/**
 * PageBundleService — pure functions for the page-bundle export/import contract
 * (docs/superpowers/specs/2026-06-11-app-builder-contracts-design.md §6).
 * No DB access here: routes inject data and validators so everything is jest-testable.
 */
export declare const PAGE_BUNDLE_VERSION = 1;
/** Compute the `requires` map: every referenced collection → referenced field names. */
export declare function collectRequires(blocks: Record<string, any>[]): {
    collections: Record<string, string[]>;
};
export declare function buildPageBundle(pages: Record<string, any>[], blocks: Record<string, any>[], meta: {
    baasixVersion: string;
    exportedAt: string;
    roleNames: Record<string, string>;
}): {
    bundleVersion: number;
    baasixVersion: string;
    exportedAt: string;
    pages: Record<string, any>[];
    blocks: Record<string, any>[];
    roleNames: Record<string, string>;
    requires: {
        collections: Record<string, string[]>;
    };
};
/** Structural validation of an uploaded bundle. Returns [] when OK. */
export declare function validateBundleShape(raw: any): string[];
/** "tasks" + taken {"tasks"} → "tasks-2", then "tasks-3", … */
export declare function suggestSlug(base: string, taken: Set<string>): string;
/**
 * Remap a filter block's config.targets (old block ids → new). Returns the new
 * config when something changed, null when no update is needed.
 */
export declare function remapTargets(config: any, blockIdMap: Map<string, string>): any | null;
export interface ImportContext {
    existingPagesBySlug: Map<string, {
        id: string;
        name: string;
    }>;
    getFields: (collection: string) => Record<string, any> | null | undefined;
    roleIdExists: (id: string) => boolean;
    roleIdByName: (name: string) => string | undefined;
    /** Inject validateBlockData bound to the target instance's getFields. */
    validateBlock: (data: Record<string, any>) => void;
}
/** Resolve bundle role ids against the target instance (id match, then name via roleNames). */
export declare function resolveRoleIds(ids: string[], roleNames: Record<string, string>, ctx: Pick<ImportContext, "roleIdExists" | "roleIdByName">): {
    resolved: string[];
    unknown: string[];
};
export declare function analyzeImport(bundle: any, ctx: ImportContext): {
    pages: any;
    collections: Record<string, {
        exists: boolean;
        missingFields: string[];
    }>;
    blockIssues: {
        blockId: string;
        pageSlug: string;
        type: string;
        collection: string | null;
        error: string;
    }[];
};
//# sourceMappingURL=PageBundleService.d.ts.map