-
-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
59 changed files
with
272 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,26 @@ | ||
import { type DocumentTitleOptions, type LinkingOptions, type LocaleDirection, type NavigationContainerProps, type NavigationContainerRef, type Theme } from '@react-navigation/native'; | ||
/** | ||
* This file is copied from the react-navigation repo: | ||
* https://github.com/react-navigation/react-navigation/blob/%40react-navigation/core%407.1.2/packages/core/src/getPathFromState.tsx | ||
* | ||
* Please refrain from making changes to this file, as it will make merging updates from the upstream harder. | ||
* All modifications except formatting should be marked with `// @modified` comment. | ||
*/ | ||
import { type NavigationContainerProps, type NavigationContainerRef } from '@react-navigation/core'; | ||
import * as React from 'react'; | ||
type Props<ParamList extends object> = NavigationContainerProps & { | ||
import { type DocumentTitleOptions, type LinkingOptions, type LocaleDirection } from '@react-navigation/native'; | ||
declare global { | ||
var REACT_NAVIGATION_DEVTOOLS: WeakMap<NavigationContainerRef<any>, { | ||
readonly linking: LinkingOptions<any>; | ||
}>; | ||
} | ||
type Props<ParamList extends {}> = NavigationContainerProps & { | ||
direction?: LocaleDirection; | ||
documentTitle?: DocumentTitleOptions; | ||
fallback?: React.ReactNode; | ||
linking?: LinkingOptions<ParamList>; | ||
onReady?: () => void; | ||
theme?: Theme; | ||
fallback?: React.ReactNode; | ||
documentTitle?: DocumentTitleOptions; | ||
}; | ||
declare const NavigationContainer: <RootParamList extends object = ReactNavigation.RootParamList>(props: Props<RootParamList> & { | ||
export declare const NavigationContainer: <RootParamList extends {} = ReactNavigation.RootParamList>(props: Props<RootParamList> & { | ||
ref?: React.Ref<NavigationContainerRef<RootParamList>>; | ||
}) => React.ReactElement; | ||
export default NavigationContainer; | ||
export {}; | ||
//# sourceMappingURL=NavigationContainer.d.ts.map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
export declare function extractExpoPathFromURL(url?: string): string; | ||
export declare function parsePathAndParamsFromExpoGoLink(url: string): { | ||
pathname: string; | ||
queryString: string; | ||
}; | ||
export declare function parsePathFromExpoGoLink(url: string): string; | ||
export declare function extractExpoPathFromURL(_prefixes: string[], url?: string): string; | ||
export declare function adjustPathname(url: { | ||
hostname?: string | null; | ||
pathname: string; | ||
}): string; | ||
export declare const extractPathFromURL: typeof extractExpoPathFromURL; | ||
//# sourceMappingURL=extractPathFromURL.d.ts.map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** | ||
* This file exports things that will be used to modify the forked code in `getPathFromState.ts`. | ||
* | ||
* The purpose of keeping things in this separated file is to keep changes to the copied code as little as possible, making merging upstream updates easier. | ||
*/ | ||
import type { Route } from '@react-navigation/core'; | ||
export type AdditionalOptions = { | ||
preserveDynamicRoutes?: boolean; | ||
preserveGroups?: boolean; | ||
shouldEncodeURISegment?: boolean; | ||
}; | ||
export type ConfigItemMods = { | ||
initialRouteName?: string; | ||
}; | ||
export declare function getPathWithConventionsCollapsed({ pattern, route, params, preserveGroups, preserveDynamicRoutes, shouldEncodeURISegment, initialRouteName, }: AdditionalOptions & { | ||
pattern: string; | ||
route: Route<any>; | ||
params: Record<string, any>; | ||
initialRouteName?: string; | ||
}): string; | ||
export declare const getParamName: (pattern: string) => string; | ||
export declare function appendBaseUrl(path: string, baseUrl?: string | undefined): string; | ||
//# sourceMappingURL=getPathFromState-mods.d.ts.map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/** | ||
* This file exports things that will be used to modify the forked code in `getStateFromPath.ts`. | ||
* | ||
* The purpose of keeping things in this separated file is to keep changes to the copied code as little as possible, making merging upstream updates easier. | ||
*/ | ||
import type { RouteConfig, ParsedRoute, InitialRouteConfig } from './getStateFromPath'; | ||
export type AdditionalRouteConfig = { | ||
type: 'static' | 'dynamic' | 'layout'; | ||
userReadableName: string; | ||
isIndex: boolean; | ||
isInitial?: boolean; | ||
hasChildren: boolean; | ||
expandedRouteNames: string[]; | ||
parts: string[]; | ||
}; | ||
export declare function getUrlWithReactNavigationConcessions(path: string, baseUrl?: string | undefined): { | ||
path: string; | ||
cleanUrl: string; | ||
nonstandardPathname: string; | ||
url: URL; | ||
pathWithoutGroups?: undefined; | ||
} | { | ||
path: string; | ||
nonstandardPathname: string; | ||
url: URL; | ||
pathWithoutGroups: string; | ||
cleanUrl?: undefined; | ||
}; | ||
export declare function matchForEmptyPath(configs: RouteConfig[]): { | ||
path: string; | ||
screen: string; | ||
regex?: RegExp; | ||
pattern: string; | ||
routeNames: string[]; | ||
parse?: { | ||
[x: string]: (value: string) => any; | ||
}; | ||
type: "static" | "dynamic" | "layout"; | ||
userReadableName: string; | ||
isIndex: boolean; | ||
isInitial?: boolean; | ||
hasChildren: boolean; | ||
expandedRouteNames: string[]; | ||
parts: string[]; | ||
} | undefined; | ||
export declare function appendIsInitial(initialRoutes: InitialRouteConfig[]): (config: RouteConfig) => RouteConfig; | ||
export declare function getRouteConfigSorter(previousSegments?: string[]): (a: RouteConfig, b: RouteConfig) => number; | ||
export declare function formatRegexPattern(it: string): string; | ||
export declare function decodeURIComponentSafe(str: string): string; | ||
export declare function getParamValue(p: string, value: string): string | string[] | undefined; | ||
/** | ||
* In One, the params are available at all levels of the routing config | ||
*/ | ||
export declare function populateParams(routes?: ParsedRoute[], params?: Record<string, any>): ParsedRoute[] | undefined; | ||
export declare function createConfigItemAdditionalProperties(screen: string, pattern: string, routeNames: string[], config?: Record<string, any>): Omit<AdditionalRouteConfig, 'isInitial'>; | ||
export declare function parseQueryParamsExtended(path: string, route: ParsedRoute, parseConfig?: Record<string, (value: string) => any>, hash?: string): Record<string, string | string[]> | undefined; | ||
export declare function stripBaseUrl(path: string, baseUrl?: string | undefined): string; | ||
//# sourceMappingURL=getStateFromPath-mods.d.ts.map |
Oops, something went wrong.