/** * A host's own stand-in for Pipeup's text fields (the browser extension's frame, `mount({ field })`): what the reviewer * types there is typed in another document, so the page never hears it. Pipeup's field stays in the DOM, hidden, as * the model the rest of Pipeup reads and writes; the host keeps the two in step and passes the reviewer's keys in with * `pass`, as events that stay inside Pipeup's shadow root. */ export type Field = HTMLTextAreaElement | HTMLInputElement; /** Given one of Pipeup's fields and a way to pass events into it, the element to show in its place (or null: keep it). */ export type FieldHost = (field: Field, pass: (event: Event) => void) => HTMLElement | null; /** Set as Pipeup starts (null: the fields are Pipeup's own); `shadow` is where passed keys are heard. */ export declare function setFieldHost(h: FieldHost | null, shadow: ShadowRoot | null): void; /** Offers a field Pipeup just made, already in its place, to the host, which may show its own in its place. */ export declare function offerField(field: Field): void; /** The field behind what has focus: a field of Pipeup's, or the field a host's stand-in shows. */ export declare function fieldOf(a: Element | null | undefined): Field | null; /** As `fieldOf`, a comment or reply box only. */ export declare function boxOf(a: Element | null | undefined): HTMLTextAreaElement | null; /** * Listens for keys on the window, as the page's own keys are heard, and also for the keys a host passes into a field * (they never reach the window, so the page doesn't hear them). Returns how to stop. */ export declare function onWindowKey(type: "keydown" | "keyup", fn: (e: KeyboardEvent) => void, capture: boolean): () => void;