mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-26 06:23:35 -04:00
(ts) fix types
This commit is contained in:
parent
1803ba7b28
commit
a869d92095
5
app/router.d.ts
vendored
5
app/router.d.ts
vendored
@ -1,5 +0,0 @@
|
||||
import type { RouteRecordRaw } from 'vue-router';
|
||||
|
||||
declare global {
|
||||
var originalRoutes: readonly RouteRecordRaw[];
|
||||
}
|
28
app/types.d.ts
vendored
Normal file
28
app/types.d.ts
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
import type { RouteMeta, RouteRecordRaw } from 'vue-router';
|
||||
|
||||
import type { Config } from '~~/locale/config.ts';
|
||||
import type { Pronoun } from '~~/shared/classes.ts';
|
||||
import type { NounConvention } from '~~/shared/nouns.ts';
|
||||
|
||||
declare global {
|
||||
var originalRoutes: readonly RouteRecordRaw[];
|
||||
}
|
||||
|
||||
interface TranslatedRoute {
|
||||
paths: string[];
|
||||
meta?: RouteMeta;
|
||||
}
|
||||
|
||||
declare module 'nuxt/app' {
|
||||
interface PageMeta {
|
||||
translatedPaths?: (config: Config) => string[] | Record<string, TranslatedRoute>;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'vue-router' {
|
||||
interface RouteMeta {
|
||||
headerCategory?: string;
|
||||
pronoun?: Pronoun;
|
||||
nounConvention?: WithKey<NounConvention>;
|
||||
}
|
||||
}
|
@ -6,7 +6,6 @@ import { resolvePath } from '@nuxt/kit';
|
||||
import yamlPlugin from '@rollup/plugin-yaml';
|
||||
import { sentryVitePlugin } from '@sentry/vite-plugin';
|
||||
import { defineNuxtConfig } from 'nuxt/config';
|
||||
import type { RouteMeta } from 'vue-router';
|
||||
|
||||
import type { Config } from './locale/config.ts';
|
||||
import localeDescriptions from './locale/locales.ts';
|
||||
@ -16,31 +15,9 @@ import sumlPlugin from './plugins/rollup/suml.ts';
|
||||
import tsvPlugin from './plugins/rollup/tsv.ts';
|
||||
import { loadSuml } from './server/loader.ts';
|
||||
|
||||
import type { Pronoun } from '~~/shared/classes.ts';
|
||||
import type { NounConvention } from '~~/shared/nouns.ts';
|
||||
|
||||
const exec = promisify(childProcess.exec);
|
||||
const version = (await exec('git log -n 1 --pretty=format:"%H"')).stdout;
|
||||
|
||||
interface TranslatedRoute {
|
||||
paths: string[];
|
||||
meta?: RouteMeta;
|
||||
}
|
||||
|
||||
declare module 'nuxt/app' {
|
||||
interface PageMeta {
|
||||
translatedPaths?: (config: Config) => string[] | Record<string, TranslatedRoute>;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'vue-router' {
|
||||
interface RouteMeta {
|
||||
headerCategory?: string;
|
||||
pronoun?: Pronoun;
|
||||
nounConvention?: WithKey<NounConvention>;
|
||||
}
|
||||
}
|
||||
|
||||
const config = await loadSuml<Config>('locale/_/config.suml');
|
||||
const translations = await loadSuml<Translations>('locale/_/translations.suml');
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { CookieOptions } from '#app/composables/cookie';
|
||||
import type { CookieOptions } from 'nuxt/app';
|
||||
|
||||
export const sessionCookieSetting: CookieOptions & { readonly?: false } = {
|
||||
sameSite: 'lax',
|
||||
|
@ -56,6 +56,8 @@ export const now = runningSnapshotTests
|
||||
? () => 1735689600 // 2025-01-01T00:00:00.000Z
|
||||
: () => Math.floor(Date.now() / 1000);
|
||||
|
||||
type GeneratorFunc<R, Args extends unknown[]> = (...args: Args) => Generator<R>;
|
||||
|
||||
export const buildDict = <K extends string | number | symbol, V, Args extends unknown[]>(
|
||||
fn: GeneratorFunc<[K, V], Args>, ...args: Args
|
||||
): Record<K, V> => {
|
||||
|
2
shared/types/express.d.ts
vendored
2
shared/types/express.d.ts
vendored
@ -4,8 +4,6 @@ import type { PermissionArea } from '~~/shared/helpers.ts';
|
||||
import type { User } from '~~/shared/user.ts';
|
||||
|
||||
declare global {
|
||||
type GeneratorFunc<R, Args extends unknown[]> = (...args: Args) => Generator<R>;
|
||||
|
||||
namespace Express {
|
||||
export interface Request {
|
||||
rawUser: User | undefined;
|
||||
|
Loading…
x
Reference in New Issue
Block a user