UNPKG

wcz-layout

Version:

69 lines • 2.67 kB
import { n as User, t as ProviderId } from "./User-aJksXItw.mjs"; import { t as QueryClientParam } from "./QueryClientParam-CTV1vj76.mjs"; import { i as WISTRON_SECONDARY_COLOR, r as WISTRON_PRIMARY_COLOR, s as rootRouteHead } from "./utils-giYfiv39.mjs"; import { Theme } from "@mui/material"; import { FC, ReactNode } from "react"; import { LinkOptions } from "@tanstack/react-router"; interface LayoutOptions { showShell?: boolean; appBarActions?: ReactNode; } type NavigationBase = { hidden?: boolean; }; type NavigationBaseItem = NavigationBase & { title: string; icon: React.ReactNode; }; type NavigationPageItem = NavigationBaseItem & Pick<LinkOptions, "to" | "href" | "params" | "search"> & { kind: "item"; }; type NavigationPageGroup = NavigationBaseItem & { kind: "group"; children: Array<NavigationItem>; }; type NavigationDivider = NavigationBase & { kind: "divider"; }; type NavigationHeader = NavigationBase & { kind: "header"; title: string; }; type NavigationItem = NavigationPageItem | NavigationPageGroup | NavigationDivider | NavigationHeader; type Navigation = Array<NavigationItem>; interface ProvidersProps { options?: LayoutOptions; navigation?: Navigation; theme: Theme; children: ReactNode; } export declare const LayoutProvider: FC<ProvidersProps>; /** * Feeds `LoginForm`. Server config, not per-user, so it is safe to prime on the * server — the `/login` route's loader does that to avoid a flash of empty card. */ export declare const loginProvidersQueryOptions: import("@tanstack/query-core").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{ id: ProviderId; label: string; }[], Error, { id: ProviderId; label: string; }[], string[]>, "queryFn"> & { queryFn?: import("@tanstack/query-core").QueryFunction<{ id: ProviderId; label: string; }[], string[], never> | undefined; } & import("@tanstack/query-core").QueryKeyWithDataTag<string[], { id: ProviderId; label: string; }[], Error>; export declare const getUser: ({ queryClient }: QueryClientParam) => Promise<User | null>; /** * Server-renders the request's language — the `i18next` cookie the browser writes on every * switch, then `Accept-Language` — so `LayoutProvider`'s language-keyed page hydrates instead * of being rebuilt when the browser detects a language other than English. No-op in the browser, * where i18next detects the language itself. */ export declare const setLanguageFromRequest: import("@tanstack/start-fn-stubs").IsomorphicFn<[], Promise<void>, Promise<void>>; export { type Navigation, WISTRON_PRIMARY_COLOR, WISTRON_SECONDARY_COLOR, rootRouteHead }; //# sourceMappingURL=index.d.mts.map