Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add missing TS definition for options parameter in wait function #387

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -443,10 +443,30 @@ export function stringify(value: any, replacer?: any, space?: string | number):
*
* @param timeout - The number of milliseconds to wait before resolving the Promise.
* @param returnValue - The value that the Promise will resolve to.
* @param options - Optional settings.
*
* @return A Promise that resolves with `returnValue`.
*/
export function wait<T>(timeout?: number, returnValue?: T): Promise<T>;
export function wait<T>(timeout?: number, returnValue?: T, options?: wait.Options): Promise<T>;

export namespace wait {

interface Options {

/**
* setTimeout function to be used by wait.
*
*/
readonly setTimeout?: (
/**
*
* @param callback - A function to be executed after the timer expires.
* @param delay - The time, in milliseconds that the timer should wait before the specified function is executed.
*
*/
callback: Function, delay: number) => void;
}
}


/**
Expand Down