/**
 * Snippet placement helpers, shared by the v1↔v2 adapters and the builder.
 *
 * A *snippet* is a reusable, named config fragment (a card or an element)
 * referenced by key instead of duplicated. The definitions live elsewhere
 * (in the builder schema's `snippets` map / the host's
 * `version.settings.snippets`); these helpers concern only the *placement* of
 * a snippet inside a form's child arrays.
 *
 * Wire formats:
 *   - v1: a node `{ type: "snippet", key: "<key>", ...overrides }` placed
 *     anywhere a card or element/field can go. Extra keys (anything except
 *     `type`/`key`) shallow-merge over the stored fragment per use.
 *   - v2: a bare token string in a container's `elementList` / `cardList` /
 *     `tabList` (no backing entry in the `cards` / `elements` maps — the
 *     `snippet#` prefix is the signal):
 *       • `snippet#<key>`                — placement with no per-use overrides.
 *       • `snippet#<key>:<instanceId>`   — placement WITH overrides; the
 *         override values live in `schema.snippetOverrides[instanceId]`.
 *     The instanceId is unique per placement, so the same key reused with
 *     different overrides never collides.
 */
/** Prefix marking a child-array id as a snippet placement. */
export declare const SNIPPET_PREFIX = "snippet#";
/** Separator between the snippet key and a per-placement instance id. */
export declare const SNIPPET_INSTANCE_SEP = ":";
/** A v1 snippet reference node. */
export interface V1SnippetNode {
    type: "snippet";
    key: string;
    [extra: string]: unknown;
}
/** Parsed parts of a `snippet#<key>[:<instanceId>]` token. */
export interface ParsedSnippetToken {
    key: string;
    /** Present only when the placement carries per-use overrides. */
    instanceId?: string;
}
/** True when an id string is a snippet placement token. */
export declare function isSnippetToken(id: unknown): id is string;
/**
 * Build a placement token. With `instanceId` the token is
 * `snippet#<key>:<instanceId>` (it has per-use overrides); without it the
 * token is the bare `snippet#<key>`.
 */
export declare function snippetToken(key: string, instanceId?: string): string;
/** Split a placement token into its `{ key, instanceId? }` parts. */
export declare function parseSnippetToken(id: string): ParsedSnippetToken;
/** The snippet key part of a placement token. */
export declare function snippetKeyFromToken(id: string): string;
/** The per-placement instance id of a token (undefined when none). */
export declare function snippetInstanceFromToken(id: string): string | undefined;
/** True when a v1 node is a snippet reference (`{ type: "snippet", key }`). */
export declare function isSnippetNode(node: unknown): node is V1SnippetNode;
/**
 * The override values of a v1 snippet node — everything except the structural
 * keys `type`, `key`, and `id` (the `id` is the placement instance id, carried
 * by the token, not an override value).
 */
export declare function snippetOverridesOf(node: V1SnippetNode): Record<string, unknown>;
/**
 * Build a v1 snippet reference node from a key (+ optional instance id and
 * overrides). The instance id is emitted as the node's `id`.
 */
export declare function v1SnippetNode(key: string, overrides?: Record<string, unknown>, instanceId?: string): V1SnippetNode;
//# sourceMappingURL=snippets.d.ts.map