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.
This commit is contained in:
Marvin Hagemeister
2025-05-21 13:44:09 +02:00
committed by GitHub
parent e595d35c44
commit 750ab35499
2 changed files with 15 additions and 1 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ export {
type RouteData,
type RouteHandler,
} from "./handlers.ts";
export type { RouteConfig } from "./types.ts";
export type { LayoutConfig, RouteConfig } from "./types.ts";
export type { Middleware, MiddlewareFn } from "./middlewares/mod.ts";
export { staticFiles } from "./middlewares/static_files.ts";
export type { FreshConfig, ResolvedFreshConfig } from "./config.ts";
+14
View File
@@ -28,6 +28,20 @@ export interface RouteConfig {
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 {