@@ -2,7 +2,6 @@ import type { FC } from 'react';
22
33import type { OcticonProps } from '@primer/octicons-react' ;
44
5- import type { Reason , SubjectType , UserType } from './typesGitHub' ;
65import type {
76 AuthorFieldsFragment ,
87 DiscussionStateReason ,
@@ -261,8 +260,9 @@ export type FilterStateType = 'open' | 'closed' | 'merged' | 'draft' | 'other';
261260 * Gitify Notification Types
262261 *
263262 * These types represent the clean, UI-focused notification structure
264- * used throughout the application. Raw GitHub API responses are
265- * transformed into these types at the API boundary.
263+ * used throughout the application.
264+ *
265+ * Raw GitHub API responses are transformed into these types at the API boundary.
266266 *
267267 **/
268268
@@ -297,12 +297,12 @@ export interface GitifySubject {
297297 title : string ;
298298 /** Subject type (Issue, PullRequest, etc.) */
299299 type : SubjectType ;
300- /** API URL for the subject (used for GraphQL fetching) */
300+ /** API URL for the subject */
301301 url : Link | null ;
302302 /** API URL for the latest comment */
303303 latestCommentUrl : Link | null ;
304304
305- // Enriched fields (from GraphQL - all optional )
305+ // Enriched fields (from additional GraphQL or REST API calls )
306306 /** Issue/PR/Discussion number */
307307 number ?: number ;
308308 /** Parsed state from GraphQL */
@@ -318,7 +318,7 @@ export interface GitifySubject {
318318 /** Label names */
319319 labels ?: string [ ] ;
320320 /** Milestone state/title */
321- milestone ?: MilestoneFieldsFragment ;
321+ milestone ?: GitifyMilestone ;
322322 /** Deep link to latest comment */
323323 htmlUrl ?: Link ;
324324}
@@ -351,6 +351,8 @@ export interface GitifyOwner {
351351
352352export type GitifyNotificationUser = AuthorFieldsFragment ;
353353
354+ export type GitifyMilestone = MilestoneFieldsFragment ;
355+
354356export interface GitifyPullRequestReview {
355357 state : PullRequestReviewState ;
356358 users : string [ ] ;
@@ -382,3 +384,50 @@ export type GitifyCheckSuiteStatus =
382384 | 'SUCCESS'
383385 | 'TIMED_OUT'
384386 | 'WAITING' ;
387+
388+ /**
389+ *
390+ * Gitify Type Enhancements
391+ *
392+ * These types represent the clean, UI-focused notification structure
393+ * used throughout the application. Raw GitHub API responses are
394+ * transformed into these types at the API boundary.
395+ *
396+ **/
397+
398+ // Stronger typings for string literal attributes
399+ export type Reason =
400+ | 'approval_requested'
401+ | 'assign'
402+ | 'author'
403+ | 'ci_activity'
404+ | 'comment'
405+ | 'invitation'
406+ | 'manual'
407+ | 'member_feature_requested'
408+ | 'mention'
409+ | 'review_requested'
410+ | 'security_advisory_credit'
411+ | 'security_alert'
412+ | 'state_change'
413+ | 'subscribed'
414+ | 'team_mention' ;
415+
416+ export type SubjectType =
417+ | 'CheckSuite'
418+ | 'Commit'
419+ | 'Discussion'
420+ | 'Issue'
421+ | 'PullRequest'
422+ | 'Release'
423+ | 'RepositoryDependabotAlertsThread'
424+ | 'RepositoryInvitation'
425+ | 'RepositoryVulnerabilityAlert'
426+ | 'WorkflowRun' ;
427+
428+ export type UserType =
429+ | 'Bot'
430+ | 'EnterpriseUserAccount'
431+ | 'Mannequin'
432+ | 'Organization'
433+ | 'User' ;
0 commit comments