28 lines
655 B
TypeScript
28 lines
655 B
TypeScript
export type HeaderStart = "rail" | "sidebar" | "content"
|
|
|
|
export type FooterStart = Exclude<HeaderStart, "rail">
|
|
|
|
export interface LayoutConfig {
|
|
asideEnabled: boolean
|
|
asideOpen: boolean
|
|
footerStart: FooterStart
|
|
headerStart: HeaderStart
|
|
sidebarCollapsible: boolean
|
|
sidebarOpen: boolean
|
|
}
|
|
|
|
export const defaultLayoutConfig = Object.freeze({
|
|
asideEnabled: true,
|
|
asideOpen: false,
|
|
footerStart: "content",
|
|
headerStart: "rail",
|
|
sidebarCollapsible: true,
|
|
sidebarOpen: true,
|
|
} satisfies LayoutConfig)
|
|
|
|
export function createLayoutConfig(
|
|
layout?: Partial<LayoutConfig>
|
|
): LayoutConfig {
|
|
return { ...defaultLayoutConfig, ...layout }
|
|
}
|