Files
sweet/src/types.ts
T
Marvin Hagemeister 750ab35499 fix: add back LayoutConfig (#2982)
~~Makes it easier to upgrade from 1.x .~~

Initially, I assumed it would be just an alias to `RouteConfig`, but
upon closer inspection that has some additional properties that make no
sense for a layout.
2025-05-21 13:44:09 +02:00

61 lines
1.5 KiB
TypeScript

export interface RouteConfig {
/**
* A route override for the page. This is useful for pages where the route
* can not be expressed through the filesystem routing capabilities.
*
* The route override must be a path-to-regexp compatible route matcher.
*/
routeOverride?: string;
/**
* If Content-Security-Policy should be enabled for this page. If 'true', a
* locked down policy will be used that allows only the scripts and styles
* that are generated by Fresh. Additional scripts and styles can be added
* using the `useCSP` hook.
*/
csp?: boolean;
/**
* Skip already inherited layouts
* Default: `false`
*/
skipInheritedLayouts?: boolean;
/**
* Skip rendering the `routes/_app` template
* Default: `false`
*/
skipAppWrapper?: boolean;
}
export interface LayoutConfig {
/**
* Skip already inherited layouts
* Default: `false`
*/
skipInheritedLayouts?: boolean;
/**
* Skip rendering the `routes/_app` template
* Default: `false`
*/
skipAppWrapper?: boolean;
}
// TODO: Uncomment once JSR supports global types
// declare global {
// namespace preact.createElement.JSX {
// interface HTMLAttributes {
// /**
// * Alternative url to fetch partials from on `<a>` or `<form>` tags
// */
// "f-partial"?: string | SignalLike<string>;
// /**
// * Enable or disable client side navigation and partials for this
// * particular node and its children.
// */
// "f-client-nav"?: boolean | SignalLike<boolean>;
// }
// }
// }