wcz-layout
Version:
75 lines • 2.52 kB
text/typescript
import { n as User } from "./User-D4__w1I1.mjs";
import { t as QueryClientParam } from "./QueryClientParam-JcH0mJWl.mjs";
import { permissions } from "virtual:wcz-layout";
import { ParsedLocation } from "@tanstack/react-router";
import "@tanstack/react-form";
//#region src/lib/utils.d.ts
declare const WISTRON_PRIMARY_COLOR = "#00506E";
declare const WISTRON_SECONDARY_COLOR = "#64DC00";
declare class Platform {
static get isAndroid(): boolean;
static get isIOS(): boolean;
static get isWindows(): boolean;
static get isMacOS(): boolean;
private static get userAgent();
}
interface RootRouteHeadOptions {
manifest?: string;
}
declare const rootRouteHead: (options?: RootRouteHeadOptions) => {
meta: ({
charSet: string;
name?: undefined;
content?: undefined;
title?: undefined;
} | {
charSet?: undefined;
name: string;
content: string;
title?: undefined;
} | {
charSet?: undefined;
name?: undefined;
content?: undefined;
title: string;
})[];
links: ({
rel: string;
sizes: string;
href: string;
type?: undefined;
} | {
rel: string;
type: string;
sizes: string;
href: string;
} | {
type?: undefined;
sizes?: undefined;
rel: string;
href: string;
})[];
};
type GuardArgs = {
location: ParsedLocation;
context: QueryClientParam;
};
/**
* Route guard for `beforeLoad`. Routes are public by default; add this to close one.
*
* - `requireAuth()` — signed in with any provider. The only gate a population
* without permission groups (e.g. AWS users) can pass.
* - `requireAuth("admin")` — signed in *and* in a group listed under that key.
*
* `reloadDocument` is required: `/auth/login` is a component-less server route and
* must be reached with a full-document navigation. It starts the login directly when
* only one provider is registered, otherwise it forwards to the `/login` chooser.
*/
declare const requireAuth: (permissionKey?: keyof typeof permissions) => ({ location, context }: GuardArgs) => Promise<{
user: User;
}>;
type FormOmittedProps = "name" | "value" | "onChange" | "onBlur" | "error" | "helperText" | "renderInput" | "type" | "aria-label";
declare const hasPermission: (user: User | null, key: keyof typeof permissions) => boolean;
//#endregion
export { hasPermission as a, WISTRON_SECONDARY_COLOR as i, Platform as n, requireAuth as o, WISTRON_PRIMARY_COLOR as r, rootRouteHead as s, FormOmittedProps as t };
//# sourceMappingURL=utils-Bhi0KiBx.d.mts.map