PronounsPage/shared/types/express.d.ts

29 lines
814 B
TypeScript

import type { LocaleCode, PermissionAreas } from '#shared/helpers.ts';
import type { User } from '#shared/user.ts';
import type { LocaleDescription } from '~~/locale/locales.ts';
import type { Database } from '~~/server/db.ts';
declare global {
namespace Express {
export interface Request {
rawUser: User | undefined;
user: User | null;
isGranted: (area?: PermissionAreas, locale?: LocaleCode) => boolean;
locales: Record<string, LocaleDescription>;
db: Database;
}
}
}
declare module 'express-session' {
interface SessionData {
socialRedirect: string;
grant: {
instance: string;
client_id?: string;
client_secret?: string;
response?: any;
};
}
}