major: import Fresh 2.0 code (#2449)

🎉
This commit is contained in:
Marvin Hagemeister
2024-05-24 09:40:08 +02:00
committed by GitHub
parent 990357629e
commit 287929e4d2
958 changed files with 15794 additions and 28287 deletions
+46 -15
View File
@@ -1,21 +1,52 @@
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 SignalLike<T> {
value: T;
peek(): T;
subscribe(fn: (value: T) => void): () => void;
}
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>;
}
}
}
// 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>;
// }
// }
// }