12 lines
364 B
TypeScript
12 lines
364 B
TypeScript
|
type PromiseResolve<T> = (value: T | PromiseLike<T>) => void;
|
||
|
type PromiseReject = (reason?: unknown) => void;
|
||
|
type Result<T> = {
|
||
|
promise: Promise<T>;
|
||
|
resolve: PromiseResolve<T>;
|
||
|
reject: PromiseReject;
|
||
|
isPending: () => boolean;
|
||
|
isResolved: () => boolean;
|
||
|
isRejected: () => boolean;
|
||
|
};
|
||
|
export type { PromiseResolve, PromiseReject, Result };
|