import { z } from 'zod';
import { type AppearancePresetId, type BoundaryOptionId, type DesignBlockId, type DesignBoundaryId, type PageFlowPresetId, type SiteStyleId } from './types';
import { type SchemaVersionedJsonParseIssue } from './schemaVersionedJson';
export declare const pageDesignIntentSchemaVersion = 1;
export type PageDesignAutoChoice = Readonly<{
    kind: 'auto';
}>;
export type PageDesignUserPinnedChoice<TValue> = Readonly<{
    kind: 'user-pinned';
    value: TValue;
}>;
export type PageDesignChoice<TValue> = PageDesignAutoChoice | PageDesignUserPinnedChoice<TValue>;
export type PageDesignBlockLookPin<TBlockId extends DesignBlockId = DesignBlockId> = Readonly<{
    blockId: TBlockId;
    blockKind: string;
    choice: PageDesignUserPinnedChoice<AppearancePresetId>;
}>;
export type PageDesignBoundaryPin<TBlockId extends DesignBlockId = DesignBlockId> = Readonly<{
    boundaryId: DesignBoundaryId;
    previousBlockId: TBlockId;
    nextBlockId: TBlockId;
    choice: PageDesignUserPinnedChoice<BoundaryOptionId>;
}>;
export type PageDesignIntent<TBlockId extends DesignBlockId = DesignBlockId> = Readonly<{
    schemaVersion: typeof pageDesignIntentSchemaVersion;
    siteStyleId: SiteStyleId;
    pageFlowPresetId: PageFlowPresetId;
    blockLookPins: readonly PageDesignBlockLookPin<TBlockId>[];
    boundaryPins: readonly PageDesignBoundaryPin<TBlockId>[];
}>;
export type PageDesignBlockDescriptor<TBlockId extends DesignBlockId = DesignBlockId> = Readonly<{
    blockId: TBlockId;
    blockKind: string;
}>;
export type PageDesignStructureEvent<TBlockId extends DesignBlockId = DesignBlockId> = Readonly<{
    kind: 'block-added';
    block: PageDesignBlockDescriptor<TBlockId>;
}> | Readonly<{
    kind: 'block-removed';
    blockId: TBlockId;
}> | Readonly<{
    kind: 'blocks-reordered';
    orderedBlockIds: readonly TBlockId[];
}> | Readonly<{
    kind: 'block-kind-changed';
    blockId: TBlockId;
    nextBlockKind: string;
    compatiblePinnedLookPresetIds: readonly AppearancePresetId[];
}> | Readonly<{
    kind: 'block-duplicated';
    sourceBlockId: TBlockId;
    block: PageDesignBlockDescriptor<TBlockId>;
    copyPinnedLook?: boolean;
}>;
export type PageDesignUserAction<TBlockId extends DesignBlockId = DesignBlockId> = Readonly<{
    kind: 'set-page-flow';
    pageFlowPresetId: PageFlowPresetId;
}> | Readonly<{
    kind: 'set-block-look';
    block: PageDesignBlockDescriptor<TBlockId>;
    choice: PageDesignChoice<AppearancePresetId>;
}> | Readonly<{
    kind: 'set-boundary';
    previousBlockId: TBlockId;
    nextBlockId: TBlockId;
    choice: PageDesignChoice<BoundaryOptionId>;
}>;
export type PageDesignIntentIssueFeedback = 'debug' | 'user-facing';
export type PageDesignIntentIssue<TBlockId extends DesignBlockId = DesignBlockId> = Readonly<{
    kind: 'removed-look-pin-for-deleted-block';
    blockId: TBlockId;
    presetId: AppearancePresetId;
    feedback: 'debug';
}> | Readonly<{
    kind: 'removed-boundary-pin-for-broken-adjacency';
    boundaryId: DesignBoundaryId;
    previousBlockId: TBlockId;
    nextBlockId: TBlockId;
    presetId: BoundaryOptionId;
    feedback: 'debug';
}> | Readonly<{
    kind: 'pinned-look-incompatible-with-block-kind';
    blockId: TBlockId;
    presetId: AppearancePresetId;
    previousBlockKind: string;
    nextBlockKind: string;
    feedback: 'user-facing';
}> | Readonly<{
    kind: 'missing-look-pin-to-copy-on-duplicate';
    sourceBlockId: TBlockId;
    duplicatedBlockId: TBlockId;
    feedback: 'debug';
}>;
export type PageDesignIntentUpdate<TBlockId extends DesignBlockId = DesignBlockId> = Readonly<{
    intent: PageDesignIntent<TBlockId>;
    issues: readonly PageDesignIntentIssue<TBlockId>[];
}>;
export type PageDesignDuplicateBlockMapping<TBlockId extends DesignBlockId = DesignBlockId> = Readonly<{
    sourceBlockId: TBlockId;
    targetBlockId: TBlockId;
    targetBlockKind: string;
}>;
export type PageDesignIntentParseIssue = SchemaVersionedJsonParseIssue;
export type PageDesignIntentParseResult<TBlockId extends DesignBlockId = DesignBlockId> = Readonly<{
    kind: 'absent';
}> | Readonly<{
    kind: 'parsed';
    intent: PageDesignIntent<TBlockId>;
}> | Readonly<{
    kind: 'invalid';
    issue: PageDesignIntentParseIssue;
}>;
type ParsePageDesignIntentOptions = Readonly<{
    unsupportedSchemaVersionMessage?: string;
    invalidShapeMessage?: string;
}>;
export declare const pageDesignUserPinnedAppearanceChoiceSchema: z.ZodObject<{
    kind: z.ZodLiteral<"user-pinned">;
    value: z.ZodPipe<z.ZodString, z.ZodTransform<AppearancePresetId, string>>;
}, z.core.$strict>;
export declare const pageDesignUserPinnedBoundaryChoiceSchema: z.ZodObject<{
    kind: z.ZodLiteral<"user-pinned">;
    value: z.ZodPipe<z.ZodString, z.ZodTransform<BoundaryOptionId, string>>;
}, z.core.$strict>;
export declare const pageDesignBlockLookPinSchema: z.ZodObject<{
    blockId: z.ZodPipe<z.ZodString, z.ZodTransform<DesignBlockId, string>>;
    blockKind: z.ZodString;
    choice: z.ZodObject<{
        kind: z.ZodLiteral<"user-pinned">;
        value: z.ZodPipe<z.ZodString, z.ZodTransform<AppearancePresetId, string>>;
    }, z.core.$strict>;
}, z.core.$strict>;
export declare const pageDesignBoundaryPinSchema: z.ZodObject<{
    boundaryId: z.ZodPipe<z.ZodString, z.ZodTransform<DesignBoundaryId, string>>;
    previousBlockId: z.ZodPipe<z.ZodString, z.ZodTransform<DesignBlockId, string>>;
    nextBlockId: z.ZodPipe<z.ZodString, z.ZodTransform<DesignBlockId, string>>;
    choice: z.ZodObject<{
        kind: z.ZodLiteral<"user-pinned">;
        value: z.ZodPipe<z.ZodString, z.ZodTransform<BoundaryOptionId, string>>;
    }, z.core.$strict>;
}, z.core.$strict>;
/**
 * Persisted editor intent stores only user-pinned block Looks and boundary choices.
 * Missing pins mean `auto`; block-kind/preset compatibility is enforced by resolution,
 * not by this JSON parse boundary.
 */
export declare const pageDesignIntentV1Schema: z.ZodObject<{
    schemaVersion: z.ZodLiteral<1>;
    siteStyleId: z.ZodPipe<z.ZodString, z.ZodTransform<SiteStyleId, string>>;
    pageFlowPresetId: z.ZodPipe<z.ZodString, z.ZodTransform<PageFlowPresetId, string>>;
    blockLookPins: z.ZodArray<z.ZodObject<{
        blockId: z.ZodPipe<z.ZodString, z.ZodTransform<DesignBlockId, string>>;
        blockKind: z.ZodString;
        choice: z.ZodObject<{
            kind: z.ZodLiteral<"user-pinned">;
            value: z.ZodPipe<z.ZodString, z.ZodTransform<AppearancePresetId, string>>;
        }, z.core.$strict>;
    }, z.core.$strict>>;
    boundaryPins: z.ZodArray<z.ZodObject<{
        boundaryId: z.ZodPipe<z.ZodString, z.ZodTransform<DesignBoundaryId, string>>;
        previousBlockId: z.ZodPipe<z.ZodString, z.ZodTransform<DesignBlockId, string>>;
        nextBlockId: z.ZodPipe<z.ZodString, z.ZodTransform<DesignBlockId, string>>;
        choice: z.ZodObject<{
            kind: z.ZodLiteral<"user-pinned">;
            value: z.ZodPipe<z.ZodString, z.ZodTransform<BoundaryOptionId, string>>;
        }, z.core.$strict>;
    }, z.core.$strict>>;
}, z.core.$strict>;
export declare function parsePageDesignIntent(value: unknown, options?: ParsePageDesignIntentOptions): PageDesignIntentParseResult;
export declare function autoDesignChoice(): PageDesignAutoChoice;
export declare function userPinnedDesignChoice<TValue>(value: TValue): PageDesignUserPinnedChoice<TValue>;
export declare function resolvePageDesignBlockLookChoice<TBlockId extends DesignBlockId>(intent: PageDesignIntent<TBlockId>, blockId: TBlockId): PageDesignChoice<AppearancePresetId>;
export declare function resolvePageDesignBoundaryChoice<TBlockId extends DesignBlockId>(intent: PageDesignIntent<TBlockId>, previousBlockId: TBlockId, nextBlockId: TBlockId): PageDesignChoice<BoundaryOptionId>;
export declare function buildBoundaryPin<TBlockId extends DesignBlockId>(previousBlockId: TBlockId, nextBlockId: TBlockId, choice: PageDesignUserPinnedChoice<BoundaryOptionId>): PageDesignBoundaryPin<TBlockId>;
export declare function reducePageDesignIntentForStructureEvent<TBlockId extends DesignBlockId>(intent: PageDesignIntent<TBlockId>, event: PageDesignStructureEvent<TBlockId>): PageDesignIntentUpdate<TBlockId>;
export declare function reducePageDesignIntentForUserAction<TBlockId extends DesignBlockId>(intent: PageDesignIntent<TBlockId>, action: PageDesignUserAction<TBlockId>): PageDesignIntent<TBlockId>;
export declare function remapPageDesignIntentForDuplicate<TBlockId extends DesignBlockId>(intent: PageDesignIntent<TBlockId>, input: Readonly<{
    blockMappings: readonly PageDesignDuplicateBlockMapping<TBlockId>[];
}>): PageDesignIntentUpdate<TBlockId>;
export {};
