Assert that a type is PromiseLike.
PromiseLike
Type that must be Promise-like
Promise
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 Copy
type A = AssertPromiseLike< Promise< number > >; // ✓type B = AssertPromiseLike< { then(): void } >; // ✓type C = AssertPromiseLike< number >; // ✗ TS error
Assert that a type is
PromiseLike.