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