Skip to content

Commit

Permalink
Merge pull request #244 from Kiikurage/improve-type
Browse files Browse the repository at this point in the history
TypeScript: Improve type definition to use optional chaining
  • Loading branch information
ryanbrainard committed Jan 20, 2020
2 parents b60163c + 959a03a commit 313cadd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,23 @@ export interface PendingPromiseState<T = {}> extends PromiseStateBase {
readonly pending: true;
readonly fulfilled: false;
readonly rejected: false;
readonly value: undefined;
readonly reason: undefined;
}

export interface FulfilledPromiseState<T = {}> extends PromiseStateBase {
readonly pending: false;
readonly fulfilled: true;
readonly rejected: false;
readonly value: T;
readonly reason: undefined;
}

export interface RejectedPromiseState<T = {}> extends PromiseStateBase {
readonly pending: false;
readonly fulfilled: false;
readonly rejected: true;
readonly value: undefined;
readonly reason: any;
}

Expand Down

0 comments on commit 313cadd

Please sign in to comment.