From 137f189c523be64cccf2c35f38d4bb845a23c3c7 Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Mon, 26 Feb 2024 09:27:44 -0500 Subject: [PATCH] refactor: split issue state types and document pullrequest state type --- src/typesGithub.ts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/typesGithub.ts b/src/typesGithub.ts index 61bda5b30..03a25e8d3 100644 --- a/src/typesGithub.ts +++ b/src/typesGithub.ts @@ -26,16 +26,20 @@ export type SubjectType = | 'RepositoryVulnerabilityAlert' | 'WorkflowRun'; -export type IssueStateType = - | 'closed' - | 'completed' - | 'not_planned' - | 'open' - | 'reopened'; +export type IssueStateType = 'closed' | 'open'; + +export type IssueStateReasonType = 'completed' | 'not_planned' | 'reopened'; +/** + * Note: draft and merged are not official states in the GitHub API. + * These are derived from the pull request's `merged` and `draft` properties. + */ export type PullRequestStateType = 'closed' | 'draft' | 'merged' | 'open'; -export type StateType = IssueStateType | PullRequestStateType; +export type StateType = + | IssueStateType + | IssueStateReasonType + | PullRequestStateType; export type ViewerSubscription = 'IGNORED' | 'SUBSCRIBED' | 'UNSUBSCRIBED';