@blackglory/wait-for
TypeScript icon, indicating that this package has built-in type declarations

0.7.4 • Public • Published

wait-for

A module for waiting for things to happen.

Install

npm install --save @blackglory/wait-for
# or
yarn add @blackglory/wait-for

API

waitForDOMChanged

function waitForDOMChanged(): Promies<void>

waitForAttached

function waitForAttached(...nodes: Node[]): Promise<void>

waitForDetached

function waitForDetached(...nodes: Node[]): Promise<void>

waitForElementsMatchingSelectorAttached

function waitForElementsMatchingSelectorAttached(
  selector: string
): Promise<Element[]>

waitForElementsMatchingSelectorAttached

function waitForElementsMatchingSelectorAttached(
  selector: string
): Promise<Element[]>

waitForAllElementsMatchingSelectorDetached

function waitForAllElementsMatchingSelectorDetached(
  selector: string
): Promise<void>

waitForEventTarget

function waitForEventTarget<T extends EventTarget>(
  target: T
, event: string
, signal?: AbortSignal
): Promise<Event>

waitForEventEmitter

function waitForEventEmitter<T extends EventEmitter>(
  target: T
, event: string
, signal?: AbortSignal
): Promise<unknown[]>

waitForEmitter

function waitForEmitter<
  EventToArgs extends Record<string, unknown[]>
, Event extends keyof EventToArgs
>(
  target: Emitter<EventToArgs>
, event: Event
, signal?: AbortSignal
): Promise<EventToArgs[Event]>

waitForDOMContentLoaded

function waitForDOMContentLoaded(): Promise<void>

waitForLoad

function waitForLoad(): Promise<void>

waitForComplete

function waitForComplete(): Promise<void>

waitForInteractiveOrComplete

function waitForInteractiveOrComplete(): Promise<void>

waitForFunction

function waitForFunction<T>(
  fn: () => T | PromiseLike<T>
, interval: number = 0
): Promise<T>

waitForTimeout

function waitForTimeout(ms: number, signal?: AbortSignal): Promise<void>

waitForStateChanged

function waitForStateChanged(): Promise<void>

waitForUrlChanged

function waitForUrlChanged(): Promise<void>

waitForAllMacrotasksProcessed

function waitForAllMacrotasksProcessed(): Promise<void>

waitForAllMicrotasksProcessed

function waitForAllMicrotasksProcessed(): Promise<void>

Readme

Keywords

Package Sidebar

Install

npm i @blackglory/wait-for

Weekly Downloads

9

Version

0.7.4

License

MIT

Unpacked Size

38.1 kB

Total Files

83

Last publish

Collaborators

  • black_glory