import type { PageBlock } from '../blocks/types'; /** * Create a page as a validated block document. `siteId` is a REQUIRED first * argument - the route boundary resolves it once (`requireSite()` for public * surfaces, the site switcher for the dashboard); nothing in this layer * defaults it from ambient context. */ export declare function createPageDocument(siteId: number, input: SavePageDocumentInput): Promise; /** * Update a page as a document: validates blocks, snapshots the previous * state as a revision, recomputes `path` when the slug or parent moved, * rewrites descendant paths, and records 301s for every path that changed. */ export declare function updatePageDocument(siteId: number, pageId: number, input: SavePageDocumentInput): Promise; /** * Load one page for editing, scoped to its site. * * `pages.fetchById` returns the raw row, which leaves every caller to parse * `blocks` themselves and - more to the point - to remember the site check. An * editor that looks a page up by id alone will happily open another tenant's * page, so `siteId` is required and the lookup is scoped by it. * * Returns null when the page does not exist ON THAT SITE, which is the same * answer as "not found" and deliberately indistinguishable from it. */ export declare function fetchPageDocument(siteId: number, pageId: number): Promise; export declare interface SavePageDocumentInput { title: string slug?: string parentId?: number | null template?: string blocks?: unknown metaDescription?: string | null status?: 'draft' | 'published' | 'scheduled' | 'archived' scheduledAt?: string | null authorId?: number | null note?: string | null } export declare interface SavedPageDocument { id: number path: string blocks: PageBlock[] } /** A page as an editor needs it: meta, parsed blocks, and where it lives. */ export declare interface EditablePageDocument { id: number siteId: number title: string slug: string path: string parentId: number | null template: string | null metaDescription: string | null status: string scheduledAt: string | null publishedAt: string | null updatedAt: string | null blocks: PageBlock[] } declare class PageDocumentError extends Error { readonly status: number; readonly details?: unknown; constructor(message: string, details?: unknown); } export { PageDocumentError };