import { CardElement } from '../definitions/elements';
import { DisplayCard } from '../definitions/cards';
import { V1CardConfig, V1FieldConfig, V1PageConfig, V1TabConfig, V2PageConfig } from './v1ToV2';
/** Per-placement snippet override values, keyed by instance id. */
type SnippetOverrides = Record<string, Record<string, unknown>>;
export declare function v2ToV1(config: V2PageConfig): V1PageConfig;
/** Convert a single v2 element into a v1 field. */
export declare function v2ElementToV1(element: CardElement): V1FieldConfig;
/** Convert a list of v2 elements into v1 fields. */
export declare function v2ElementsToV1(elements: CardElement[]): V1FieldConfig[];
/**
 * Convert one v2 card into a v1 card. Accepts either a full `DisplayCard`
 * object (mirroring `v1CardToV2`) or a card id to resolve from `cards`.
 *
 * The `cards` / `elements` maps are always required — a v2 card references
 * its children (`elementList` / `cardList` / `tabList`) by id, so nested
 * cards/elements are resolved from the maps regardless of how the top-level
 * card is supplied. (v1 cards inline their children, so `v1CardToV2` needs
 * no maps — hence the shape difference.)
 */
export declare function v2CardToV1(card: string | DisplayCard, cards: Record<string, DisplayCard>, elements: Record<string, CardElement>, snippetOverrides?: SnippetOverrides): V1CardConfig | undefined;
/**
 * Convert v2 cards into v1 cards. Accepts full `DisplayCard` objects (like
 * `v1CardsToV2`) or card ids to resolve from `cards`; the two forms may be
 * mixed. A single id/card (not wrapped in an array) is also accepted and
 * treated as a one-element list.
 */
export declare function v2CardsToV1(cardsOrIds: string | DisplayCard | Array<string | DisplayCard>, cards: Record<string, DisplayCard>, elements: Record<string, CardElement>, snippetOverrides?: SnippetOverrides): V1CardConfig[];
/**
 * A single tab accepted by the v2→v1 tab converters. It can be:
 *   - a tab **card id** (string) referenced from a tab-list's `tabList`,
 *   - a tab **card object** (`DisplayCard`) — e.g. an element-list "tab"
 *     card from the FormBuilder rootTabsContainer schema, or
 *   - a page-level **tab descriptor** `{ title, tabId, cards: DisplayCard[] }`.
 */
export type V2TabInput = string | DisplayCard | {
    title?: string;
    tabId?: string;
    cards: DisplayCard[];
};
/**
 * Convert v2 tabs into v1 tabs. Accepts an array (or single) of:
 *   - tab card ids or tab card objects (element-list / card-list),
 *   - a **tab-list card** (or its id) — expanded into one tab per child, or
 *   - page-level tab descriptors `{ title, tabId, cards }`.
 * The forms may be mixed. Tab cards reference children by id, so the
 * `cards` / `elements` maps are required to resolve them.
 */
export declare function v2TabsToV1(tabs: V2TabInput | V2TabInput[], cards: Record<string, DisplayCard>, elements: Record<string, CardElement>, snippetOverrides?: SnippetOverrides): V1TabConfig[];
/** Convert a single v2 tab (id, card object, or descriptor) into a v1 tab. */
export declare function v2TabToV1(tab: V2TabInput, cards: Record<string, DisplayCard>, elements: Record<string, CardElement>, snippetOverrides?: SnippetOverrides): V1TabConfig | undefined;
export {};
//# sourceMappingURL=v2ToV1.d.ts.map