Skip to content

Commit da3a92f

Browse files
setchyadufr
authored andcommitted
refactor: split issue state types and document pullrequest state type (gitify-app#826)
1 parent 4f8c81e commit da3a92f

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/typesGithub.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,20 @@ export type SubjectType =
3535
| 'RepositoryVulnerabilityAlert'
3636
| 'WorkflowRun';
3737

38-
export type IssueStateType =
39-
| 'closed'
40-
| 'completed'
41-
| 'not_planned'
42-
| 'open'
43-
| 'reopened';
38+
export type IssueStateType = 'closed' | 'open';
39+
40+
export type IssueStateReasonType = 'completed' | 'not_planned' | 'reopened';
4441

42+
/**
43+
* Note: draft and merged are not official states in the GitHub API.
44+
* These are derived from the pull request's `merged` and `draft` properties.
45+
*/
4546
export type PullRequestStateType = 'closed' | 'draft' | 'merged' | 'open';
4647

4748
export type StateType =
4849
| DiscussionStateType
4950
| IssueStateType
51+
| IssueStateReasonType
5052
| PullRequestStateType;
5153

5254
export type ViewerSubscription = 'IGNORED' | 'SUBSCRIBED' | 'UNSUBSCRIBED';

0 commit comments

Comments
 (0)