https://github.com/blackglory/wait-for
🌲 A module for waiting for things to happen.
https://github.com/blackglory/wait-for
browser esm library npm-package typescript
Last synced: 11 months ago
JSON representation
🌲 A module for waiting for things to happen.
- Host: GitHub
- URL: https://github.com/blackglory/wait-for
- Owner: BlackGlory
- License: mit
- Created: 2020-05-25T16:04:48.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2025-05-22T15:54:47.000Z (about 1 year ago)
- Last Synced: 2025-07-03T07:09:54.425Z (about 1 year ago)
- Topics: browser, esm, library, npm-package, typescript
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/@blackglory/wait-for
- Size: 1.36 MB
- Stars: 0
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# wait-for
A module for waiting for things to happen.
## Install
```sh
npm install --save @blackglory/wait-for
# or
yarn add @blackglory/wait-for
```
## API
### waitForDOMChanged
```ts
function waitForDOMChanged(): Promies
```
### waitForAttached
```ts
function waitForAttached(...nodes: Node[]): Promise
```
### waitForDetached
```ts
function waitForDetached(...nodes: Node[]): Promise
```
### waitForElementsMatchingSelectorAttached
```ts
function waitForElementsMatchingSelectorAttached(
selector: string
): Promise
```
### waitForAllElementsMatchingSelectorDetached
```ts
function waitForAllElementsMatchingSelectorDetached(
selector: string
): Promise
```
### waitForEventTarget
```ts
function waitForEventTarget(
target: T
, event: string
, signal?: AbortSignal
): Promise
```
### waitForEventEmitter
```ts
function waitForEventEmitter(
target: T
, event: string
, signal?: AbortSignal
): Promise
```
### waitForEmitter
```ts
function waitForEmitter<
EventToArgs extends Record
, Event extends keyof EventToArgs
>(
target: Emitter
, event: Event
, signal?: AbortSignal
): Promise
```
### waitForDOMContentLoaded
```ts
function waitForDOMContentLoaded(): Promise
```
### waitForLoad
```ts
function waitForLoad(): Promise
```
### waitForComplete
```ts
function waitForComplete(): Promise
```
### waitForInteractiveOrComplete
```ts
function waitForInteractiveOrComplete(): Promise
```
### waitForFunction
```ts
function waitForFunction(
fn: () => T | PromiseLike
, interval: number = 0
): Promise
```
### waitForTimeout
```ts
function waitForTimeout(ms: number, signal?: AbortSignal): Promise
```
### waitForStateChanged
```ts
function waitForStateChanged(): Promise
```
### waitForUrlChanged
```ts
function waitForUrlChanged(): Promise
```
### waitForAllMacrotasksProcessed
```ts
function waitForAllMacrotasksProcessed(): Promise
```
### waitForAllMicrotasksProcessed
```ts
function waitForAllMicrotasksProcessed(): Promise
```
### waitForIdleCallback
```ts
function waitForIdleCallback(options?: IdleRequestOptions): Promise
```
### waitForAnimationFrame
```ts
function waitForAnimationFrame(): Promise
```
### waitForVideoFrameCallback
```ts
function waitForVideoFrameCallback(
video: HTMLVideoElement
): Promise>
```