Bluesky app fork with some witchin' additions 馃挮
1import {type NavigationState, type PartialState} from '@react-navigation/native'
2import {type NativeStackNavigationProp} from '@react-navigation/native-stack'
3
4import {type VideoFeedSourceContext} from '#/screens/VideoFeed/types'
5
6export type {NativeStackScreenProps} from '@react-navigation/native-stack'
7
8export type CommonNavigatorParams = {
9 NotFound: undefined
10 AuthCallback: undefined
11 Lists: undefined
12 Moderation: undefined
13 ModerationModlists: undefined
14 ModerationMutedAccounts: undefined
15 ModerationBlockedAccounts: undefined
16 ModerationInteractionSettings: undefined
17 ModerationVerificationSettings: undefined
18 Settings: undefined
19 Profile: {name: string; hideBackButton?: boolean}
20 ProfileFollowers: {name: string}
21 ProfileFollows: {name: string}
22 ProfileKnownFollowers: {name: string}
23 ProfileSearch: {name: string; q?: string}
24 ProfileList: {name: string; rkey: string}
25 PostThread: {name: string; rkey: string}
26 PostLikedBy: {name: string; rkey: string}
27 PostRepostedBy: {name: string; rkey: string}
28 PostQuotes: {name: string; rkey: string}
29 ProfileFeed: {
30 name: string
31 rkey: string
32 feedCacheKey?: 'discover' | 'explore' | undefined
33 }
34 ProfileFeedLikedBy: {name: string; rkey: string}
35 ProfileLabelerLikedBy: {name: string}
36 Debug: undefined
37 DebugMod: undefined
38 SharedPreferencesTester: undefined
39 Log: undefined
40 Support: undefined
41 PrivacyPolicy: undefined
42 TermsOfService: undefined
43 CommunityGuidelines: undefined
44 CopyrightPolicy: undefined
45 LanguageSettings: undefined
46 AppPasswords: undefined
47 SavedFeeds: undefined
48 PreferencesFollowingFeed: undefined
49 PreferencesThreads: undefined
50 PreferencesExternalEmbeds: undefined
51 AccessibilitySettings: undefined
52 AppearanceSettings: undefined
53 AppearanceColorThemeSettings: undefined
54 RunesSettings: undefined
55 RunesMenusSettings: undefined
56 RunesBadgesSettings: undefined
57 RunesImpressionsSettings: undefined
58 RunesUsabilitySettings: undefined
59 RunesUsabilityFeedSettings: undefined
60 RunesDisplaySettings: undefined
61 RunesDisplayAlsoLikedSettings: undefined
62 RunesInfrastructureSettings: undefined
63 RunesExtraSettings: undefined
64 RunesSettingsSyncSettings: undefined
65 AccountSettings: undefined
66 AutomationLabelSettings: undefined
67 PetLabelSettings: undefined
68 PrivacyAndSecuritySettings: undefined
69 ActivityPrivacySettings: undefined
70 ContentAndMediaSettings: undefined
71 NotificationSettings: undefined
72 ReplyNotificationSettings: undefined
73 MentionNotificationSettings: undefined
74 QuoteNotificationSettings: undefined
75 LikeNotificationSettings: undefined
76 RepostNotificationSettings: undefined
77 NewFollowerNotificationSettings: undefined
78 LikesOnRepostsNotificationSettings: undefined
79 RepostsOnRepostsNotificationSettings: undefined
80 ActivityNotificationSettings: undefined
81 MiscellaneousNotificationSettings: undefined
82 InterestsSettings: undefined
83 AboutSettings: undefined
84 AppIconSettings: undefined
85 FindContactsSettings: undefined
86 Search: {q?: string; tab?: 'user' | 'profile' | 'feed'}
87 Hashtag: {tag: string; author?: string}
88 Topic: {topic: string}
89 MessagesConversation: {conversation: string; embed?: string; accept?: true}
90 MessagesConversationSettings: {conversation: string}
91 MessagesSettings: undefined
92 MessagesInbox: undefined
93 NotificationsActivityList: {posts: string}
94 LegacyNotificationSettings: undefined
95 Feeds: undefined
96 Start: {name: string; rkey: string}
97 StarterPack: {name: string; rkey: string; new?: boolean}
98 StarterPackShort: {code: string}
99 StarterPackWizard: {
100 fromDialog?: boolean
101 targetDid?: string
102 onSuccess?: () => void
103 }
104 StarterPackEdit: {rkey?: string}
105 VideoFeed: VideoFeedSourceContext
106 Bookmarks: undefined
107 FindContactsFlow: undefined
108}
109
110export type BottomTabNavigatorParams = CommonNavigatorParams & {
111 HomeTab: undefined
112 SearchTab: undefined
113 NotificationsTab: undefined
114 MyProfileTab: undefined
115 MessagesTab: undefined
116}
117
118export type HomeTabNavigatorParams = CommonNavigatorParams & {
119 Home: undefined
120}
121
122export type SearchTabNavigatorParams = CommonNavigatorParams & {
123 Search: {q?: string; tab?: 'user' | 'profile' | 'feed'}
124}
125
126export type NotificationsTabNavigatorParams = CommonNavigatorParams & {
127 Notifications: undefined
128}
129
130export type MyProfileTabNavigatorParams = CommonNavigatorParams & {
131 MyProfile: {name: 'me'; hideBackButton: true}
132}
133
134export type MessagesTabNavigatorParams = CommonNavigatorParams & {
135 Messages: {pushToConversation?: string; animation?: 'push' | 'pop'}
136}
137
138export type FlatNavigatorParams = CommonNavigatorParams & {
139 Home: undefined
140 Search: {q?: string; tab?: 'user' | 'profile' | 'feed'}
141 Feeds: undefined
142 Notifications: undefined
143 Messages: {pushToConversation?: string; animation?: 'push' | 'pop'}
144}
145
146export type AllNavigatorParams = CommonNavigatorParams & {
147 HomeTab: undefined
148 Home: undefined
149 SearchTab: undefined
150 Search: {q?: string; tab?: 'user' | 'profile' | 'feed'}
151 Feeds: undefined
152 NotificationsTab: undefined
153 Notifications: undefined
154 MyProfileTab: undefined
155 MessagesTab: undefined
156 Messages: {animation?: 'push' | 'pop'}
157}
158
159// NOTE
160// this isn't strictly correct but it should be close enough
161// a TS wizard might be able to get this 100%
162// -prf
163export type NavigationProp = NativeStackNavigationProp<AllNavigatorParams>
164
165export type State =
166 | NavigationState
167 | Omit<PartialState<NavigationState>, 'stale'>
168
169export type RouteParams = Record<string, string>
170export type MatchResult = {params: RouteParams}
171export type Route = {
172 match: (path: string) => MatchResult | undefined
173 build: (params?: Record<string, any>) => string
174}