import type { Operation } from "@effection/core"; import type { KeyboardLayout } from "./keyboard-layout.js"; export type InteractionType = "action" | "assertion"; type Interaction = Operation & { type: InteractionType; description: string; options: InteractionOptions; interactor: unknown; code: () => string; halt: () => Promise; }; interface Globals { readonly document: Document; /** * @deprecated Use `wrapInteraction` instead */ readonly wrapAction: (description: string, perform: () => Promise, type: InteractionType) => Operation; readonly wrapInteraction: InteractionWrapper; readonly interactionWrappers: Set; readonly interactorTimeout: number; readonly reset: () => void; readonly keyboardLayout: KeyboardLayout; } export type InteractorOptions = { interactor: string; code: () => string; locator?: string; filter?: Record; }; export type InteractionOptions = InteractorOptions & { name: string; type: InteractionType; code: () => string; args: unknown[]; ancestors?: InteractorOptions[]; }; export type InteractionWrapper = (perform: () => Promise, interaction: Interaction) => Operation; declare global { namespace globalThis { var __interactors: Globals; } } export declare const globals: Globals; export declare function setDocumentResolver(resolver: () => Document): void; export declare function setInteractorTimeout(ms: number): void; /** * @deprecated Use `addInteractionWrapper` instead */ export declare function addActionWrapper(wrapper: (description: string, perform: () => Promise, type: InteractionType) => Operation): () => boolean; export declare function addInteractionWrapper(wrapper: InteractionWrapper): () => boolean; export declare function setKeyboardLayout(layout: KeyboardLayout): void; export {}; //# sourceMappingURL=globals.d.ts.map