import type { Data } from "@puckeditor/core"; import type { PageStore, RouteSummary } from "./dal/types"; import { type SemanticOp } from "./semantic-ops"; export type SemanticPatchPageEntry = { kind: "semantic"; basePath: string; ops: SemanticOp[]; }; export type OverridePageEntry = SemanticPatchPageEntry; export type { SemanticOp }; export type RouteKind = "static" | "template" | "override" | "instance-full"; export type RouteRow = { path: string; kind: RouteKind; basePath?: string; patchOperations: number; contentTypeTemplateId?: string; }; export { flattenStructureRoutes, type FlatStructureRow } from "./page-structure"; export declare function isSemanticPatchEntry(value: unknown): value is SemanticPatchPageEntry; export declare function isOverrideEntry(value: unknown): value is OverridePageEntry; export declare function summarizeEntry(entry: unknown): RouteSummary | null; /** * Create a new full-document page (not a collection override). Use createCollectionOverride for instance paths. * * @param path - Page path (e.g. "/contact-us") * @param options.initialData - Optional Puck data to initialize the page with (e.g. scaffolded from a content type template) */ export declare function createStaticPage(path: string, options?: { initialData?: Data; templateId?: string; templateVersion?: number; }): Promise<{ ok: true; path: string; } | { ok: false; error: string; }>; /** * Create a new collection template page (e.g. `/posts/:slug`). * * @param path - Route template path with at least one :param segment * @param options.initialData - Optional Puck data to initialize with (e.g. scaffolded from a content type template) */ export declare function createCollectionTemplate(path: string, options?: { initialData?: Data; templateId?: string; templateVersion?: number; }): Promise<{ ok: true; path: string; } | { ok: false; error: string; }>; /** * Remove a route. Deleting a collection template also removes overrides * and full-document instances that belong to that template. */ export declare function deletePageAtPath(path: string, overrideStore?: PageStore): Promise<{ ok: true; deletedPaths: string[]; } | { ok: false; error: string; }>; export declare function resolvePageData(path: string): Promise; export declare function resolveCanonicalForPatchBase(basePath: string): Promise; export declare function persistPublishedPage(path: string, data: Data): Promise; /** * List every route in the store with its kind (static, template, override, instance). * * @param overrideStore - Store to read instead of the default one; takes precedence over `options.branchId` * @param options.branchId - Read the routes of this branch instead of the default one. Applies only * inside an authenticated request; otherwise the default store is read. */ export declare function listRoutes(overrideStore?: PageStore, options?: { branchId?: string; }): Promise; /** * Collection template keys currently in the store (e.g. `/jedi/:id`). * * @param options.branchId - Read the template keys of this branch instead of the default one. Applies * only inside an authenticated request; otherwise the default store is read. */ export declare function listRouteTemplateKeysFromDatabase(options?: { branchId?: string; }): Promise; export declare function createCollectionOverride(instancePath: string, overrideStore?: PageStore): Promise<{ ok: true; path: string; } | { ok: false; error: string; }>; export declare function listOverridePathsForBase(basePath: string): Promise;