Skip to content
Merged
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
16 changes: 14 additions & 2 deletions typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -520,11 +520,17 @@ declare namespace CodeceptJS {
}
}

type TryTo = <T>(fn: () => Promise<T> | T) => Promise<T | false>;
type HopeThat = <T>(fn: () => Promise<T> | T) => Promise<T | false>;
type RetryTo = <T>(fn: () => Promise<T> | T, retries?: number) => Promise<T>;


// Globals
declare const codecept_dir: string
declare const output_dir: string
declare function tryTo(...fn): Promise<boolean>
declare function retryTo(...fn): Promise<null>
declare const tryTo: TryTo;
declare const retryTo: RetryTo;
declare const hopeThat: HopeThat;

declare const actor: CodeceptJS.actor
declare const codecept_actor: CodeceptJS.actor
Expand Down Expand Up @@ -635,3 +641,9 @@ declare module 'codeceptjs' {
declare module '@codeceptjs/helper' {
export = CodeceptJS.Helper
}

declare module 'codeceptjs/effects' {
export const tryTo: TryTo;
export const retryTo: RetryTo;
export const hopeThat: HopeThat;
}