import { CardElement } from '../definitions/elements';
import { DisplayCard } from '../definitions/cards';
import { ElementCategory, ElementType } from '../definitions/shared/base';
/**
 * State for a single FormBuilder instance. Multiple FormBuilders can
 * coexist on a page; each is keyed by `builderId`.
 *
 * The shape mirrors the v2 page config (a flat elements map, a flat
 * cards map, a root card id) so the builder's output can be passed
 * straight to ShowPage / CardRenderer.
 */
export interface BuilderSchema {
    /** Root card id — the top of the tree. */
    rootCardId: string;
    cards: Record<string, DisplayCard>;
    elements: Record<string, CardElement>;
    /**
     * Reusable, named config fragments keyed by snippet key. Each is a
     * self-contained sub-schema editable in its own builder scope. Placements
     * elsewhere reference a snippet by the `snippet#<key>` child token.
     */
    snippets?: Record<string, SnippetDefinition>;
    /**
     * Per-placement snippet override values, keyed by instance id. A placement
     * token `snippet#<key>:<instanceId>` looks its overrides up here.
     */
    snippetOverrides?: Record<string, Record<string, unknown>>;
}
/** A self-contained snippet definition — same shape as a builder schema. */
export interface SnippetDefinition {
    rootCardId: string;
    cards: Record<string, DisplayCard>;
    elements: Record<string, CardElement>;
    /** Overrides for any snippet placements nested inside this definition. */
    snippetOverrides?: Record<string, Record<string, unknown>>;
    /** Human label shown in the snippets panel (defaults to the key). */
    label?: string;
}
/** Identifies what's currently selected in the inspector. */
export interface BuilderSelection {
    kind: "element" | "card" | null;
    id: string | null;
}
/**
 * Separator used to address a single tab inside a `card.tab` element as a
 * drag/drop container: `"<elementId>::tab::<tabId>"`. Each tab owns its own
 * `elementList`, so this lets the generic container machinery (add / move /
 * reorder / remove) operate on a tab's contents with no special-casing.
 */
export declare const TAB_SEP = "::tab::";
/** Build a composite container id addressing a tab within a card.tab element. */
export declare function tabContainerId(elementId: string, tabId: string): string;
/** Test helper to make ids deterministic. */
export declare function __resetFormBuilderIdCounter(): void;
export declare const useFormBuilderStore: import('pinia').StoreDefinition<"gx-modui/formBuilder", Pick<{
    builders: import('vue').Ref<Record<string, BuilderSchema>, Record<string, BuilderSchema>>;
    selections: import('vue').Ref<Record<string, BuilderSelection>, Record<string, BuilderSelection>>;
    ensureBuilder: (builderId: string) => BuilderSchema;
    loadSchema: (builderId: string, schema: BuilderSchema) => void;
    resetBuilder: (builderId: string) => void;
    addElement: (builderId: string, containerId: string, type: ElementType | ElementCategory) => string;
    addCard: (builderId: string, parentCardId: string, cardType: DisplayCard["cardType"]) => string;
    createRootCard: (builderId: string, cardId: string, cardType: DisplayCard["cardType"], opts?: {
        title?: string;
    }) => void;
    initRootTabs: (builderId: string) => void;
    addRootTab: (builderId: string, title?: string, icon?: string, rootCardId?: string) => string;
    reorderRootTab: (builderId: string, fromIndex: number, toIndex: number, rootCardId?: string) => void;
    removeElement: (builderId: string, elementId: string) => void;
    removeCard: (builderId: string, cardId: string) => void;
    reorderElement: (builderId: string, containerId: string, fromIndex: number, toIndex: number) => void;
    moveElement: (builderId: string, fromContainerId: string, toContainerId: string, elementId: string, toIndex: number) => void;
    updateElement: (builderId: string, elementId: string, patch: Partial<CardElement>) => void;
    updateCard: (builderId: string, cardId: string, patch: Partial<DisplayCard>) => void;
    addTab: (builderId: string, elementId: string, label?: string) => string;
    updateTab: (builderId: string, elementId: string, tabId: string, patch: Partial<Omit<{
        id: string;
        label: string;
        elementList?: string[];
    }, "id">>) => void;
    removeTab: (builderId: string, elementId: string, tabId: string) => void;
    reorderTab: (builderId: string, elementId: string, fromIndex: number, toIndex: number) => void;
    select: (builderId: string, kind: "element" | "card" | null, id: string | null) => void;
    getSelection: (builderId: string) => BuilderSelection;
    getSchema: (builderId: string) => BuilderSchema;
    getWorkingSchema: (builderId: string) => BuilderSchema;
    listSnippets: (builderId: string) => string[];
    getSnippet: (builderId: string, key: string) => SnippetDefinition | null;
    addSnippet: (builderId: string, key: string, opts?: {
        kind?: "element" | "card";
        label?: string;
    }) => string;
    removeSnippet: (builderId: string, key: string) => boolean;
    isSnippetUsed: (builderId: string, key: string) => boolean;
    placeSnippet: (builderId: string, containerId: string, key: string, index?: number) => void;
    removeSnippetPlacement: (builderId: string, token: string) => void;
    getSnippetOverride: (builderId: string, token: string) => Record<string, unknown>;
    updateSnippetOverride: (builderId: string, token: string, patch: Record<string, unknown>) => void;
    convertElementToSnippet: (builderId: string, elementId: string, key: string, label?: string) => boolean;
    inlineSnippet: (builderId: string, token: string) => string[];
    setActiveSnippet: (builderId: string, key: string | null) => void;
    getActiveSnippet: (builderId: string) => string | null;
}, "builders" | "selections">, Pick<{
    builders: import('vue').Ref<Record<string, BuilderSchema>, Record<string, BuilderSchema>>;
    selections: import('vue').Ref<Record<string, BuilderSelection>, Record<string, BuilderSelection>>;
    ensureBuilder: (builderId: string) => BuilderSchema;
    loadSchema: (builderId: string, schema: BuilderSchema) => void;
    resetBuilder: (builderId: string) => void;
    addElement: (builderId: string, containerId: string, type: ElementType | ElementCategory) => string;
    addCard: (builderId: string, parentCardId: string, cardType: DisplayCard["cardType"]) => string;
    createRootCard: (builderId: string, cardId: string, cardType: DisplayCard["cardType"], opts?: {
        title?: string;
    }) => void;
    initRootTabs: (builderId: string) => void;
    addRootTab: (builderId: string, title?: string, icon?: string, rootCardId?: string) => string;
    reorderRootTab: (builderId: string, fromIndex: number, toIndex: number, rootCardId?: string) => void;
    removeElement: (builderId: string, elementId: string) => void;
    removeCard: (builderId: string, cardId: string) => void;
    reorderElement: (builderId: string, containerId: string, fromIndex: number, toIndex: number) => void;
    moveElement: (builderId: string, fromContainerId: string, toContainerId: string, elementId: string, toIndex: number) => void;
    updateElement: (builderId: string, elementId: string, patch: Partial<CardElement>) => void;
    updateCard: (builderId: string, cardId: string, patch: Partial<DisplayCard>) => void;
    addTab: (builderId: string, elementId: string, label?: string) => string;
    updateTab: (builderId: string, elementId: string, tabId: string, patch: Partial<Omit<{
        id: string;
        label: string;
        elementList?: string[];
    }, "id">>) => void;
    removeTab: (builderId: string, elementId: string, tabId: string) => void;
    reorderTab: (builderId: string, elementId: string, fromIndex: number, toIndex: number) => void;
    select: (builderId: string, kind: "element" | "card" | null, id: string | null) => void;
    getSelection: (builderId: string) => BuilderSelection;
    getSchema: (builderId: string) => BuilderSchema;
    getWorkingSchema: (builderId: string) => BuilderSchema;
    listSnippets: (builderId: string) => string[];
    getSnippet: (builderId: string, key: string) => SnippetDefinition | null;
    addSnippet: (builderId: string, key: string, opts?: {
        kind?: "element" | "card";
        label?: string;
    }) => string;
    removeSnippet: (builderId: string, key: string) => boolean;
    isSnippetUsed: (builderId: string, key: string) => boolean;
    placeSnippet: (builderId: string, containerId: string, key: string, index?: number) => void;
    removeSnippetPlacement: (builderId: string, token: string) => void;
    getSnippetOverride: (builderId: string, token: string) => Record<string, unknown>;
    updateSnippetOverride: (builderId: string, token: string, patch: Record<string, unknown>) => void;
    convertElementToSnippet: (builderId: string, elementId: string, key: string, label?: string) => boolean;
    inlineSnippet: (builderId: string, token: string) => string[];
    setActiveSnippet: (builderId: string, key: string | null) => void;
    getActiveSnippet: (builderId: string) => string | null;
}, never>, Pick<{
    builders: import('vue').Ref<Record<string, BuilderSchema>, Record<string, BuilderSchema>>;
    selections: import('vue').Ref<Record<string, BuilderSelection>, Record<string, BuilderSelection>>;
    ensureBuilder: (builderId: string) => BuilderSchema;
    loadSchema: (builderId: string, schema: BuilderSchema) => void;
    resetBuilder: (builderId: string) => void;
    addElement: (builderId: string, containerId: string, type: ElementType | ElementCategory) => string;
    addCard: (builderId: string, parentCardId: string, cardType: DisplayCard["cardType"]) => string;
    createRootCard: (builderId: string, cardId: string, cardType: DisplayCard["cardType"], opts?: {
        title?: string;
    }) => void;
    initRootTabs: (builderId: string) => void;
    addRootTab: (builderId: string, title?: string, icon?: string, rootCardId?: string) => string;
    reorderRootTab: (builderId: string, fromIndex: number, toIndex: number, rootCardId?: string) => void;
    removeElement: (builderId: string, elementId: string) => void;
    removeCard: (builderId: string, cardId: string) => void;
    reorderElement: (builderId: string, containerId: string, fromIndex: number, toIndex: number) => void;
    moveElement: (builderId: string, fromContainerId: string, toContainerId: string, elementId: string, toIndex: number) => void;
    updateElement: (builderId: string, elementId: string, patch: Partial<CardElement>) => void;
    updateCard: (builderId: string, cardId: string, patch: Partial<DisplayCard>) => void;
    addTab: (builderId: string, elementId: string, label?: string) => string;
    updateTab: (builderId: string, elementId: string, tabId: string, patch: Partial<Omit<{
        id: string;
        label: string;
        elementList?: string[];
    }, "id">>) => void;
    removeTab: (builderId: string, elementId: string, tabId: string) => void;
    reorderTab: (builderId: string, elementId: string, fromIndex: number, toIndex: number) => void;
    select: (builderId: string, kind: "element" | "card" | null, id: string | null) => void;
    getSelection: (builderId: string) => BuilderSelection;
    getSchema: (builderId: string) => BuilderSchema;
    getWorkingSchema: (builderId: string) => BuilderSchema;
    listSnippets: (builderId: string) => string[];
    getSnippet: (builderId: string, key: string) => SnippetDefinition | null;
    addSnippet: (builderId: string, key: string, opts?: {
        kind?: "element" | "card";
        label?: string;
    }) => string;
    removeSnippet: (builderId: string, key: string) => boolean;
    isSnippetUsed: (builderId: string, key: string) => boolean;
    placeSnippet: (builderId: string, containerId: string, key: string, index?: number) => void;
    removeSnippetPlacement: (builderId: string, token: string) => void;
    getSnippetOverride: (builderId: string, token: string) => Record<string, unknown>;
    updateSnippetOverride: (builderId: string, token: string, patch: Record<string, unknown>) => void;
    convertElementToSnippet: (builderId: string, elementId: string, key: string, label?: string) => boolean;
    inlineSnippet: (builderId: string, token: string) => string[];
    setActiveSnippet: (builderId: string, key: string | null) => void;
    getActiveSnippet: (builderId: string) => string | null;
}, "select" | "ensureBuilder" | "loadSchema" | "resetBuilder" | "addElement" | "addCard" | "createRootCard" | "initRootTabs" | "addRootTab" | "reorderRootTab" | "removeElement" | "removeCard" | "reorderElement" | "moveElement" | "updateElement" | "updateCard" | "addTab" | "updateTab" | "removeTab" | "reorderTab" | "getSelection" | "getSchema" | "getWorkingSchema" | "listSnippets" | "getSnippet" | "addSnippet" | "removeSnippet" | "isSnippetUsed" | "placeSnippet" | "removeSnippetPlacement" | "getSnippetOverride" | "updateSnippetOverride" | "convertElementToSnippet" | "inlineSnippet" | "setActiveSnippet" | "getActiveSnippet">>;
/** Composable wrapping store access for a single builder instance. */
export declare function useFormBuilder(builderId: string): {
    schema: import('vue').ComputedRef<BuilderSchema>;
    /** Schema for the active scope (main, or the snippet being edited). */
    workingSchema: import('vue').ComputedRef<BuilderSchema>;
    activeSnippet: import('vue').ComputedRef<string | null>;
    selection: import('vue').ComputedRef<BuilderSelection>;
    addElement: (parentId: string, type: ElementType | ElementCategory) => string;
    addCard: (parentId: string, cardType: DisplayCard["cardType"]) => string;
    createRootCard: (cardId: string, cardType: DisplayCard["cardType"], opts?: {
        title?: string;
    }) => void;
    initRootTabs: () => void;
    addRootTab: (title?: string, icon?: string, rootCardId?: string) => string;
    reorderRootTab: (from: number, to: number, rootCardId?: string) => void;
    removeElement: (id: string) => void;
    removeCard: (id: string) => void;
    reorderElement: (containerId: string, from: number, to: number) => void;
    moveElement: (fromContainerId: string, toContainerId: string, elementId: string, toIndex: number) => void;
    updateElement: (id: string, patch: Partial<CardElement>) => void;
    updateCard: (id: string, patch: Partial<DisplayCard>) => void;
    addTab: (elementId: string, label?: string) => string;
    updateTab: (elementId: string, tabId: string, patch: Partial<{
        label: string;
        elementList: string[];
    }>) => void;
    removeTab: (elementId: string, tabId: string) => void;
    reorderTab: (elementId: string, from: number, to: number) => void;
    select: (kind: "element" | "card" | null, id: string | null) => void;
    loadSchema: (schema: BuilderSchema) => void;
    reset: () => void;
    listSnippets: () => string[];
    getSnippet: (key: string) => SnippetDefinition | null;
    addSnippet: (key: string, opts?: {
        kind?: "element" | "card";
        label?: string;
    }) => string;
    removeSnippet: (key: string) => boolean;
    isSnippetUsed: (key: string) => boolean;
    placeSnippet: (containerId: string, key: string, index?: number) => void;
    removeSnippetPlacement: (token: string) => void;
    getSnippetOverride: (token: string) => Record<string, unknown>;
    updateSnippetOverride: (token: string, patch: Record<string, unknown>) => void;
    convertElementToSnippet: (elementId: string, key: string, label?: string) => boolean;
    inlineSnippet: (token: string) => string[];
    setActiveSnippet: (key: string | null) => void;
};
//# sourceMappingURL=formBuilderStore.d.ts.map