@svatah/yam-adapter-bidi
WebDriver BiDi adapter (independence proof)
- Source:
packages/adapter-bidi· README:packages/adapter-bidi/README.md - Install:
npm install @svatah/yam-adapter-bidi - Version 0.1.0 · Apache-2.0
Exports
| Export | Kind | Signature | |
|---|---|---|---|
Actionability | interface | export interface Actionability | |
actionabilityOf | function | export function actionabilityOf(options: { handles: string; registry: string; index: number; from: "handle" | "registry" }): Actionability | null | The actionability facts for one element (LLD §7.3). |
BIDI_ADAPTER_NAME | variable | BIDI_ADAPTER_NAME = "bidi" | The name this adapter is selected by in yam.config.yaml (LLD §2.4). |
BIDI_BROWSER_ENV | variable | BIDI_BROWSER_ENV = "YAM_BIDI_BROWSER" | YAM_BIDI_BROWSER: the Gecko binary to launch. |
BIDI_CAPABILITIES | variable | BIDI_CAPABILITIES: Capabilities | What this adapter can do (LLD §2.4, §7.3). |
BIDI_URL_ENV | variable | BIDI_URL_ENV = "YAM_BIDI_URL" | YAM_BIDI_URL: attach to a BiDi endpoint someone else is hosting. |
BidiAdapterOptions | interface | export interface BidiAdapterOptions extends LaunchOptions | |
bidiAvailable | function | export function bidiAvailable( | Whether this machine can run the BiDi adapter at all. |
BidiClient | class | export class BidiClient | |
BidiClientOptions | interface | export interface BidiClientOptions | |
BidiEndpoint | interface | export interface BidiEndpoint | Where a session is talking, and to what. |
BidiError | class | export class BidiError extends Error | A protocol-level refusal, before it becomes one of the surface's errors. |
BidiEvent | interface | export interface BidiEvent | One unsolicited message: { method, params } with no id. |
BidiEventHandler | typealias | export type BidiEventHandler = (event: BidiEvent) => void; | |
BidiSession | class | export class BidiSession | |
BidiSurface | class | export class BidiSurface implements AgentSurface | |
ContextId | typealias | export type ContextId = string; | A BiDi browsing context id: a top-level tab, or a frame inside one. |
createBidiSurface | function | export function createBidiSurface( | Build a surface from a project config (LLD §2.4). |
describeElement | function | export function describeElement( | |
evaluateBidiPredicate | function | export async function evaluateBidiPredicate( | |
findGecko | function | export function findGecko( | The first Gecko binary that exists, or nothing. |
fromRemoteValue | function | export function fromRemoteValue(remote: unknown): unknown | Turn BiDi's tagged RemoteValue back into a plain JSON value. |
HANDLES | variable | HANDLES = "__yamHandles__" | The in-page array locate() fills, for refs minted from a stored candidate. |
keyActions | function | export async function keyActions( | press, keyDown and keyUp, including chords like "Control+a". |
keyValue | function | export function keyValue(name: string): string | The codepoint a key name means, or the name itself when it is one character. |
LaunchOptions | interface | export interface LaunchOptions | |
literalValue | function | export function literalValue(ref: ValueRef): string | The literal a ValueRef names. |
locateInPage | function | export function locateInPage(options: | Candidate → indices into the handle registry (LLD §6.3, REQ-RUN-5). |
openEndpoint | function | export async function openEndpoint(options: LaunchOptions = {}): Promise<BidiEndpoint> | Open a BiDi endpoint: attach to one, or launch a browser that serves one. |
pointerClick | function | export async function pointerClick( | One pointer action against an element. |
pointerDrag | function | export async function pointerDrag( | Press, hold, move and release: dragTo (LLD §7.1's action table). |
RawCandidate | interface | export interface RawCandidate | The subset of Candidate a web adapter can honour, flattened for the wire. |
RawDescription | interface | export interface RawDescription | The shape describeElement returns. Mirrors ElementDescription minus ref. |
RawNode | interface | export interface RawNode | The shape walkDocument returns for one node. Mirrors SnapshotNode. |
RefSpace | class | export class RefSpace | Everything snapshot, locate, describe and act need to turn a Ref |
registerBidiAdapter | function | export function registerBidiAdapter(): void | Register the adapter. Idempotent, because the registry refuses a silent |
REGISTRY | variable | REGISTRY = "__yamRefs__" | The in-page array walkDocument fills. Reset by every walk and lost on |
toLocalValue | function | export function toLocalValue(value: unknown): LocalValue | Turn a plain JSON value into BiDi's tagged LocalValue form. |
typeText | function | export async function typeText(session: BidiSession, text: string): Promise<void> | Type text into whatever has focus, one key at a time. |
walkDocument | function | export function walkDocument(options: |