/** * Theme layout overrides — `themes//layouts.json`. * * A page component's position lives in its own `export const layout = * { areaId, sortOrder }`. The active theme may move any storefront page * component without forking its file by listing it here, keyed the way the * component trees are merged: `/` (`all/Logo`, * `productView/ProductView`, `productEdit+productNew/Title`). Values are * partial — `areaId`, `sortOrder`, or both — and win over the file's own * literal, whichever tree (core, extension, theme) supplied the file. * * The map is read at build time (production emitter, dev loader) and is * deliberately loose: a missing or malformed file, an entry that matches no * component, or a value of the wrong shape is ignored without a word. * Themes never affect admin routes, so callers skip admin routes. */ export interface LayoutOverride { areaId?: string; sortOrder?: number; } export interface ComponentLayout { areaId: string; sortOrder: number; } export type ThemeLayouts = Record; export declare const THEME_LAYOUTS_FILE = "layouts.json"; /** `/` for a page component file path, or null. */ export declare function layoutKeyOf(componentPath: string): string | null; /** Parse the file content loosely: anything that is not a map of objects becomes {} / is dropped. */ export declare function parseThemeLayouts(text: string): ThemeLayouts; /** * The active theme's layout overrides, or {} when there is no theme, no * file, or nothing usable in it. Pass `file` to read a specific file (the * lab generator does); by default the file is `themes//layouts.json`. * Cached by the file's modification time, so the dev loader (which re-runs on * every recompile) sees an edit as soon as `ThemeWatcherPlugin` triggers the * recompile — no restart. Production reads it once per build. */ export declare function loadThemeLayouts(file?: string): ThemeLayouts; /** The layout the emitters should use for `componentPath`: the theme's override over the file's literal. */ export declare function applyThemeLayout(componentPath: string, layout: ComponentLayout, overrides: ThemeLayouts): ComponentLayout;