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