npm.io
0.5.33 • Published 2 years ago

@types/mpromise

Licence
MIT
Version
0.5.33
Deps
0
Size
4 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/mpromise

Summary

This package contains type definitions for mpromise (https://github.com/aheckmann/mpromise).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mpromise.

index.d.ts

interface IResolveFunction<F, R> {
    (err: R, ...args: F[]): void;
    (err: R, arg: F): void;
}

declare class Promise<F, R> {
    constructor(fn?: IResolveFunction<F, R>);

    static FAILURE: string;
    static SUCCESS: string;

    fulfill(...args: F[]): Promise<F, R>;
    reject(reason: R): Promise<F, R>;
    resolve(reason: R, ...args: F[]): Promise<F, R>;
    resolve(reason: R, arg: F): Promise<F, R>;

    onFulfill(callback: (...args: F[]) => void): Promise<F, R>;
    onReject(callback: (err: R) => void): Promise<F, R>;
    onResolve(callback: IResolveFunction<F, R>): Promise<F, R>;

    then<TRes>(
        onFulfilled: (...values: F[]) => TRes | PromiseLike<TRes>,
        onRejected?: (err: R) => TRes | PromiseLike<TRes>,
    ): Promise<TRes, R>;
    end(): void;

    chain(promise: Promise<F, R>): Promise<F, R>;
}

export = Promise;

Additional Details

  • Last updated: Tue, 07 Nov 2023 0939 GMT
  • Dependencies: none

Credits

These definitions were written by Seulgi Kim.