forked from
jollywhoppers.com/witchsky.app
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 RunesDisplaySettings: undefined
60 RunesInfrastructureSettings: undefined
61 RunesExtraSettings: undefined
62 AccountSettings: undefined
63 AutomationLabelSettings: undefined
64 PetLabelSettings: undefined
65 PrivacyAndSecuritySettings: undefined
66 ActivityPrivacySettings: undefined
67 ContentAndMediaSettings: undefined
68 NotificationSettings: undefined
69 ReplyNotificationSettings: undefined
70 MentionNotificationSettings: undefined
71 QuoteNotificationSettings: undefined
72 LikeNotificationSettings: undefined
73 RepostNotificationSettings: undefined
74 NewFollowerNotificationSettings: undefined
75 LikesOnRepostsNotificationSettings: undefined
76 RepostsOnRepostsNotificationSettings: undefined
77 ActivityNotificationSettings: undefined
78 MiscellaneousNotificationSettings: undefined
79 InterestsSettings: undefined
80 AboutSettings: undefined
81 AppIconSettings: undefined
82 FindContactsSettings: undefined
83 Search: {q?: string; tab?: 'user' | 'profile' | 'feed'}
84 Hashtag: {tag: string; author?: string}
85 Topic: {topic: string}
86 MessagesConversation: {conversation: string; embed?: string; accept?: true}
87 MessagesConversationSettings: {conversation: string}
88 MessagesSettings: undefined
89 MessagesInbox: undefined
90 NotificationsActivityList: {posts: string}
91 LegacyNotificationSettings: undefined
92 Feeds: undefined
93 Start: {name: string; rkey: string}
94 StarterPack: {name: string; rkey: string; new?: boolean}
95 StarterPackShort: {code: string}
96 StarterPackWizard: {
97 fromDialog?: boolean
98 targetDid?: string
99 onSuccess?: () => void
100 }
101 StarterPackEdit: {rkey?: string}
102 VideoFeed: VideoFeedSourceContext
103 Bookmarks: undefined
104 FindContactsFlow: undefined
105}
106
107export type BottomTabNavigatorParams = CommonNavigatorParams & {
108 HomeTab: undefined
109 SearchTab: undefined
110 NotificationsTab: undefined
111 MyProfileTab: undefined
112 MessagesTab: undefined
113}
114
115export type HomeTabNavigatorParams = CommonNavigatorParams & {
116 Home: undefined
117}
118
119export type SearchTabNavigatorParams = CommonNavigatorParams & {
120 Search: {q?: string; tab?: 'user' | 'profile' | 'feed'}
121}
122
123export type NotificationsTabNavigatorParams = CommonNavigatorParams & {
124 Notifications: undefined
125}
126
127export type MyProfileTabNavigatorParams = CommonNavigatorParams & {
128 MyProfile: {name: 'me'; hideBackButton: true}
129}
130
131export type MessagesTabNavigatorParams = CommonNavigatorParams & {
132 Messages: {pushToConversation?: string; animation?: 'push' | 'pop'}
133}
134
135export type FlatNavigatorParams = CommonNavigatorParams & {
136 Home: undefined
137 Search: {q?: string; tab?: 'user' | 'profile' | 'feed'}
138 Feeds: undefined
139 Notifications: undefined
140 Messages: {pushToConversation?: string; animation?: 'push' | 'pop'}
141}
142
143export type AllNavigatorParams = CommonNavigatorParams & {
144 HomeTab: undefined
145 Home: undefined
146 SearchTab: undefined
147 Search: {q?: string; tab?: 'user' | 'profile' | 'feed'}
148 Feeds: undefined
149 NotificationsTab: undefined
150 Notifications: undefined
151 MyProfileTab: undefined
152 MessagesTab: undefined
153 Messages: {animation?: 'push' | 'pop'}
154}
155
156// NOTE
157// this isn't strictly correct but it should be close enough
158// a TS wizard might be able to get this 100%
159// -prf
160export type NavigationProp = NativeStackNavigationProp<AllNavigatorParams>
161
162export type State =
163 | NavigationState
164 | Omit<PartialState<NavigationState>, 'stale'>
165
166export type RouteParams = Record<string, string>
167export type MatchResult = {params: RouteParams}
168export type Route = {
169 match: (path: string) => MatchResult | undefined
170 build: (params?: Record<string, any>) => string
171}