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:
+1
-1
@@ -9,7 +9,7 @@ export {
|
|||||||
type RouteData,
|
type RouteData,
|
||||||
type RouteHandler,
|
type RouteHandler,
|
||||||
} from "./handlers.ts";
|
} 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 type { Middleware, MiddlewareFn } from "./middlewares/mod.ts";
|
||||||
export { staticFiles } from "./middlewares/static_files.ts";
|
export { staticFiles } from "./middlewares/static_files.ts";
|
||||||
export type { FreshConfig, ResolvedFreshConfig } from "./config.ts";
|
export type { FreshConfig, ResolvedFreshConfig } from "./config.ts";
|
||||||
|
|||||||
@@ -28,6 +28,20 @@ export interface RouteConfig {
|
|||||||
skipAppWrapper?: boolean;
|
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
|
// TODO: Uncomment once JSR supports global types
|
||||||
// declare global {
|
// declare global {
|
||||||
// namespace preact.createElement.JSX {
|
// namespace preact.createElement.JSX {
|
||||||
|
|||||||
Reference in New Issue
Block a user