//#region src/client-script/messages.d.ts /** * Structural slice of the hub's `DevframeMessageAction` the page script emits: a * labeled control that, when clicked in the messages panel, activates a dock * (deep-linking via `params`). Kept as a discriminated union so future action * kinds can be added without reshaping the field. */ interface HubMessageAction { id: string; label: string; kind: 'activate'; activate: { dockId: string; params?: Record; }; } /** Structural slice of the hub's `DevframeMessageEntryInput` the page script emits. */ interface HubMessageInput { id?: string; message: string; description?: string; level: 'info' | 'warn' | 'error' | 'success' | 'debug'; /** * Grouping category shown in the messages panel. Set explicitly to a short * `'a11y'` label, because the hub client host otherwise defaults it to the dock id * (e.g. `devframes_plugin_a11y`), and input fields win over that default. */ category?: string; labels?: string[]; elementPosition?: { selector?: string; boundingBox?: { x: number; y: number; width: number; height: number; }; description?: string; }; actions?: HubMessageAction[]; status?: 'loading' | 'idle'; } /** Structural slice of the hub's `DevframeMessagesClient` the page script calls. */ interface HubMessagesClient { add: (input: HubMessageInput) => Promise; remove: (id: string) => Promise; } /** * Structural slice of the hub's `DockClientScriptContext` the page script accepts. * Every field is optional, so any argument (or none) boots the page script. */ interface A11yPageScriptContext { messages?: HubMessagesClient; } //#endregion //#region src/client-script/index.d.ts /** * Client-script entry the hub runtime calls after importing this module, * passing its `DockClientScriptContext`. The live scan/highlight loop rides * the in-page channel either way; when the context carries a `messages` * client (duck-typed, see {@link A11yPageScriptContext}), the page script * additionally mirrors each scan into the hub's messages feed. `start()` is * idempotent. */ export default function runA11yPageScript(context?: A11yPageScriptContext): void; //#endregion