import type { z } from "zod";
import type { ThemeTokens } from "../../theme";
type BivariantCallback<TArgs extends unknown[], TResult> = {
    bivarianceHack(...args: TArgs): TResult;
}["bivarianceHack"];
export type RouteMapEntry = string | {
    path?: string | null;
    href?: string | null;
    url?: string | null;
    draftPath?: string | null;
    [key: string]: unknown;
};
export type RouteMap = Record<string, RouteMapEntry>;
/** Maps page identifier to routeId for page link resolution */
export type PageIdentifierMap = Record<string, string>;
/** Maps contentType -> identifier -> routeId for entry link resolution */
export type EntryIdentifierMap = Record<string, Record<string, string>>;
export type TransformContext = {
    theme: ThemeTokens;
    locale?: string;
    stage?: "preview" | "published";
    /**
     * Optional binding-local data object (typically block content) that
     * transforms can use to resolve sibling fields.
     */
    data?: Record<string, unknown>;
    routes?: RouteMap;
    /** Page identifier -> routeId lookup for { kind: 'page' } links */
    pagesByIdentifier?: PageIdentifierMap;
    /** ContentType -> identifier -> routeId lookup for { kind: 'entry' } links */
    entriesByIdentifier?: EntryIdentifierMap;
    /** Read-only runtime view model for content-aware transforms */
    viewModel?: Record<string, unknown>;
};
export type TransformHandler<TOptions = unknown> = BivariantCallback<[
    value: unknown,
    options: TOptions,
    context: TransformContext
], unknown>;
export type TransformDefinition<TOptions = unknown> = {
    id: string;
    summary?: string;
    kind: "formatter" | "collection" | "string" | "html";
    schema?: z.ZodType<TOptions>;
    run: TransformHandler<TOptions>;
};
export type TransformRegistry = Map<string, TransformDefinition<unknown>>;
/**
 * Safely narrows unknown values to partial object shapes used by transforms.
 * Arrays are intentionally excluded.
 */
export declare function asPartialObject<T>(value: unknown): Partial<T> | undefined;
export declare function runTransforms(value: unknown, transforms: Array<{
    id: string;
    options?: unknown;
}> | undefined, context: TransformContext, registry: TransformRegistry): unknown;
export declare function createTransformRegistry(definitions: Iterable<TransformDefinition<unknown>>): TransformRegistry;
export declare function mergeTransformRegistries(...registries: TransformRegistry[]): TransformRegistry;
export {};
