devtypes - v1.1.0
    Preparing search index...

    Type Alias Promisify<F>

    Promisify: F extends (...args: infer A) => infer R
        ? (...args: A) => Promise<R>
        : never

    Promisify a function type.

    Type Parameters

    • F

      Function type to promisify

    Wraps a function's return type in a Promise, preserving argument types. Will result in never if input is not a function.

    type Fn = ( a: string, b: number ) => boolean;
    type PromisifiedFn = Promisify< Fn >;
    // ( a: string, b: number ) => Promise< boolean >