devtypes - v2.0.0
    Preparing search index...

    Type Alias AssertPromiseLike<T>

    AssertPromiseLike: T

    Assert that a type is PromiseLike.

    Type Parameters

    • T extends PromiseLike<any>

      Type that must be Promise-like

    Accepts any thenable object compatible with PromiseLike. Does not require an actual Promise instance.

    type A = AssertPromiseLike< Promise< number > >;  // ✓
    type B = AssertPromiseLike< { then(): void } >; // ✓
    type C = AssertPromiseLike< number >; // ✗ TS error