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