Full template context produced by routes/helpers/render.ts when rendering views. Extends AppLocals with request-scoped data like the current user, CSRF token, and asset lists.

interface TemplateContext {
    configScript?: string;
    csrfToken?: string;
    currentLanguage?: { langKey: LocaleCode; name: string };
    dal?: DataAccessLayer | DalContext;
    languageNames?: TemplateLanguageName[];
    locale?: LocaleCode;
    localeChange?: {
        new: LocaleCodeWithUndetermined;
        old: LocaleCodeWithUndetermined;
    };
    permissions?: Record<string, boolean>;
    qualifiedURL?: string;
    returnTo?: string;
    scripts?: string[];
    siteErrors?: string[];
    siteMessages?: string[];
    styles?: string[];
    titleKey?: string;
    urlPath?: string;
    user?: RequestUser;
    vite?: ViteDevServer;
    webHooks?: default;
    [key: string]: unknown;
}

Hierarchy (View Summary)

Indexable

  • [key: string]: unknown

Properties

configScript?: string
csrfToken?: string
currentLanguage?: { langKey: LocaleCode; name: string }
languageNames?: TemplateLanguageName[]
locale?: LocaleCode
localeChange?: {
    new: LocaleCodeWithUndetermined;
    old: LocaleCodeWithUndetermined;
}
permissions?: Record<string, boolean>
qualifiedURL?: string
returnTo?: string
scripts?: string[]
siteErrors?: string[]
siteMessages?: string[]
styles?: string[]
titleKey?: string
urlPath?: string
vite?: ViteDevServer
webHooks?: default