import { CardElement } from '../definitions/elements';
import { DisplayCard } from '../definitions/cards';
import { V1CardConfig, V1FieldConfig, V1TabConfig } from './v1ToV2';
/** Per-placement snippet override values, keyed by instance id. */
type SnippetOverrides = Record<string, Record<string, unknown>>;
/**
 * A self-contained v2 builder schema: a flat `cards` / `elements` id-map plus
 * the id of the root card. This is what `convertV1ToV2` always returns and
 * what ShowPage / FormBuilder consume.
 */
export interface V2BuilderSchema {
    /** Id (within `cards`) of the root card. */
    rootCardId: string;
    cards: Record<string, DisplayCard>;
    elements: Record<string, CardElement>;
    /** Per-placement snippet override values, keyed by instance id. */
    snippetOverrides?: Record<string, Record<string, unknown>>;
}
/** Anything `convertV2ToV1` accepts as the thing-to-convert. */
export type V2ConvertInput = string | DisplayCard | V2BuilderSchema | {
    rootCardId?: string;
    root?: string | DisplayCard;
    cards?: Record<string, DisplayCard>;
    elements?: Record<string, CardElement>;
} | {
    title?: string;
    tabId?: string;
    cards: DisplayCard[];
} | Array<string | DisplayCard | {
    title?: string;
    tabId?: string;
    cards: DisplayCard[];
}>;
/** What `convertV2ToV1` returns — a single converted node, or a list. */
export type V1ConvertResult = V1CardConfig | V1TabConfig | Array<V1CardConfig | V1TabConfig>;
/**
 * Convert v2 → v1, detecting the input shape automatically.
 *
 * Accepts any of:
 *   - a single card object (or card id, with `cards`/`elements` supplied),
 *   - a tab descriptor `{ title, tabId, cards }`,
 *   - a builder schema `{ rootCardId | root, cards, elements }`,
 *   - an array of any of the above.
 *
 * Returns a single converted node when the input is a single thing, or an
 * array when the input is an array (or a container root resolving to several
 * children). See the cardinality rule in the module doc-comment.
 */
export declare function convertV2ToV1(input: V2ConvertInput, cards?: Record<string, DisplayCard>, elements?: Record<string, CardElement>, snippetOverrides?: SnippetOverrides): V1ConvertResult;
/** Test-only: reset the root-id counter so generated ids are deterministic. */
export declare function __resetAutoRootCounter(): void;
/**
 * Convert v1 → v2, detecting the input shape automatically. Always returns a
 * self-contained builder schema `{ rootCardId, cards, elements }`:
 *
 *   - a `tabs_list` card / tab descriptors / array of tabs → a `tab-list` root,
 *   - a single card → that converted card as the root,
 *   - several cards → a `card-list` root referencing them,
 *   - fields (no card structure) → an `element-list` root holding them.
 */
export declare function convertV1ToV2(input: V1CardConfig | V1TabConfig | V1FieldConfig | Array<V1CardConfig | V1TabConfig | V1FieldConfig> | null | undefined, options?: {
    rootKey?: string;
}): V2BuilderSchema;
export {};
//# sourceMappingURL=auto.d.ts.map