diff --git a/src/app.d.ts b/src/app.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5867e6d9d480dc787f637468cc431fe34c1be829 --- /dev/null +++ b/src/app.d.ts @@ -0,0 +1,56 @@ +/// <reference types="@sveltejs/kit" /> + +declare namespace App { + interface Locals { + user?: User + } + + // interface Platform {} + + interface Session { + advanced: boolean + apiBaseUrls: string[] + apiWebSocketBaseUrls: string[] + baseUrl: string + authenticationEnabled: boolean + childrenKey: string + familyEntityKey: string + hasGithubPersonalAccessToken: boolean + hiddenEntitiesKeyPlural?: string[] + matomo?: { + prependDomain?: boolean + siteId: number + subdomains?: string + url: string + } + openfiscaRepository: SessionOpenFiscaRepository + portalUrl: string + reformName?: string + showTutorial?: boolean + title: string + user?: User + } + + interface SessionOpenFiscaRepository { + branch: string + group: string + project: string + rawUrlTemplate: string + urlTemplate: string + } + + // interface Stuff {} + + export interface User { + email: string // "john@doe.com" + email_verified: boolean + family_name: string // "Doe" + given_name: string // "John" + last_name: string // "Doe" + locale: string // "fr" + name: string // "John Doe" + preferred_username: string // "jdoe", + roles?: string[] // [ 'offline_access', 'default-roles-leximpact', 'uma_authorization' ], + sub: string // "12345678-9abc-def0-1234-56789abcdef0" + } +}