/** * The closed action vocabulary. * * A Page Spec can request behavior, never author it. There is no expression * language, no selector language, and no handler body: an action is a record * with a known `action` value and validated parameters. The runtime owns how * each action is performed, including focus, keyboard, and ARIA updates. */ import { type DiagnosticBag } from '../diagnostics.js'; import { type JsonValue } from '../json.js'; import { type PropSchema, type PropValues } from './prop-schema.js'; export type ActionType = 'copy' | 'open-url' | 'toggle' | 'set-value' | 'next' | 'previous' | 'select-tab' | 'expand' | 'collapse' | 'filter' | 'theme' | 'download'; export interface ActionDefinition { type: ActionType; summary: string; params: Record; } /** Events a block may bind to. Anything else is a validation error. */ export declare const ALLOWED_EVENTS: readonly ["click", "change", "input", "select", "filter", "open", "close"]; export type ActionEvent = (typeof ALLOWED_EVENTS)[number]; export declare const ACTION_DEFINITIONS: readonly ActionDefinition[]; export declare function getAction(type: string): ActionDefinition | undefined; export declare function listActionTypes(): ActionType[]; export interface ValidatedActions { /** event name -> validated action records */ bindings: Record; } /** * Validate an `on` binding map. * * Accepts either a single action object or a list of action objects per event. * `path` points at the `on` key so diagnostics land on the author's input. */ export declare function validateActionMap(value: unknown, path: string, bag: DiagnosticBag): ValidatedActions; /** Validate a single action record against the closed vocabulary. */ export declare function validateAction(value: unknown, path: string, bag: DiagnosticBag): PropValues | undefined; /** True when a string is a plain `state.` dotted key path. */ /** A `state.` path: lowercase kebab keys only, so no prototype key can be named. */ export declare const STATE_PATH_PATTERN: RegExp; export declare function isSafeStatePath(value: string): boolean; /** Collect every action record from a validated binding map. */ export declare function bindingActions(bindings: Record): PropValues[]; /** JSON-safe view of the vocabulary for `catalog()`. */ export declare function actionsCatalog(): { type: ActionType; summary: string; }[]; /** Exported for tests and docs: the raw `action` value of a binding. */ export declare function actionTypeOf(action: JsonValue): string | undefined; //# sourceMappingURL=actions.d.ts.map