import type { Ref } from 'vue';
export type CELVar = {
    type: string;
    label: string;
    description?: string;
    value: unknown;
};
export type CELContext = Record<string, CELVar>;
export declare const SCOPE_ADDRESS_VAR = "__scopes__";
export declare const SELECTIONS_VAR = "selections";
export declare const STEPS_VAR = "steps";
export type ScopeAccessor = Record<string, () => unknown>;
export declare function provideCELContext(context: CELContext): void;
export declare function injectCELContext(): CELContext;
export declare function provideScopeAddress(uuid: string, accessor: ScopeAccessor): void;
/** One addressable member of an ancestor scope, e.g. `row` / `index`. */
export type ScopeAncestorMember = Readonly<{
    /** Member name appended after the address — `__scopes__["id"].<key>`. */
    key: string;
    label: string;
    /** CEL type shown as the picker badge. */
    type: string;
    description?: string;
    /**
     * The relative shortcut this member mirrors — used by the picker to decide if
     * the member is worth offering cross-layer (it is, only when a nearer frame
     * shadows that shortcut; otherwise the relative name already reaches it).
     * Defaults to `key`. Set explicitly when the addressed key isn't the bare
     * shortcut — a form's selection member has `key = selections["<uuid>"]` but
     * `shortcut = "selections"`, since it's the relative `selections` map that an
     * inner row/subform shadows.
     */
    shortcut?: string;
}>;
/** A scope-exposing ancestor instance, as seen by an expression-editor picker. */
export type ScopeAncestor = Readonly<{
    /** Instance id keyed into `__scopes__["<id>"]`. */
    id: string;
    /** Instance display name (a table's 内部名称); blank → show the type name alone. */
    name?: string;
    /** Component type display name (from type metadata). */
    typeName: string;
    /** Component type icon (from type metadata). */
    typeIcon?: string;
    members: ReadonlyArray<ScopeAncestorMember>;
    /**
     * The relative shortcut names this host *rebinds* at runtime — i.e. the
     * shortcuts it shadows for everything below it. The picker uses this (not the
     * host type) to decide which of a farther frame's members are genuinely
     * shadowed and thus worth offering cross-layer. It is broader than `members`:
     * a table offers only `row`/`index` cross-layer but its row-provider also
     * rebinds `selections`, so a table must list `selections` here to (correctly)
     * shadow an enclosing form's selection options. Defaults to the members'
     * `shortcut`s when omitted.
     */
    shadows?: ReadonlyArray<string>;
}>;
/**
 * Contribute one scope-exposing ancestor frame. Descendant editors see it
 * prepended (nearest first) to the inherited chain. A `null` value contributes
 * nothing — for an editor whose current target may or may not own an `id`.
 */
export declare function provideScopeAncestor(ancestor: Ref<ScopeAncestor | null>): void;
/**
 * The scope-exposing ancestors enclosing the current editing position, nearest
 * first. Empty when nothing up the config tree exposes an addressable scope.
 */
export declare function useScopeAncestry(): Ref<ReadonlyArray<ScopeAncestor>>;
/** One selection-like field in the editing form, as the picker/chip surfaces it. */
export type SelectionFieldRef = Readonly<{
    /** Field uuid keyed into `selections["<id>"]` — the registry/publish key. */
    id: string;
    /** The field's designer-facing name, shown instead of the raw uuid. */
    name: string;
}>;
/**
 * Advertise the form's selection-like fields to every descendant
 * ExpressionEditor, so it can render `selections["<id>"]` as the field's name
 * and list those fields in the variable picker. Design-time only — the runtime
 * counterpart is `provideSelectionsRegistry` (utils/selections-registry). A form
 * host provides the whole roster; a nested form overrides with its own (a field
 * references its own form's siblings, not an outer form's).
 */
export declare function provideSelectionRoster(roster: Ref<ReadonlyArray<SelectionFieldRef>>): void;
/**
 * The selection-like fields of the enclosing form, or empty when the editor
 * sits outside any form (a table column expression, a standalone editor).
 */
export declare function useSelectionRoster(): Ref<ReadonlyArray<SelectionFieldRef>>;
/**
 * One referenceable step of the trigger chain being edited, as the picker/chip
 * surfaces it. Unlike a selection field a trigger row has no designer-given
 * name, so `label` is its position —「第 N 步」— computed live from the row's
 * current index and thus following drag-and-drop reorders for free (the
 * persisted reference is `steps["<id>"]`; the label is never stored).
 */
export type StepRef = Readonly<{
    /** Trigger-row uuid keyed into `steps["<id>"]` — the publish address. */
    id: string;
    /** Position label,「第 N 步」, derived from the row's current index. */
    label: string;
    /**
     * Whether the step is referenceable from the editing row — i.e. it runs
     * BEFORE it. A step dragged after its referrer stays in the roster (so its
     * chip keeps the friendly label) but flips invalid, which the chip renders
     * as a warning instead of the dangling-uuid fallback.
     */
    valid: boolean;
    /** What the step publishes (the op's `metadata.output`), for picker hover. */
    description?: string;
}>;
/**
 * Advertise the referenceable chain steps to the ExpressionEditors of ONE
 * trigger row's param editor. Per-row (each row sees a different roster —
 * earlier rows valid, later ones not), so it is provided by a per-row wrapper
 * in the trigger editor, not once by a host like the selection roster.
 */
export declare function provideStepRoster(roster: Ref<ReadonlyArray<StepRef>>): void;
/**
 * The chain steps referenceable from the current editing position, or empty
 * when the editor sits outside a trigger row's param editor.
 */
export declare function useStepRoster(): Ref<ReadonlyArray<StepRef>>;
export declare function celBindings(context: CELContext): Record<string, unknown>;
