@solidnative-dev/navigation 0.0.0-stage → 0.1.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +922 -2
- package/backend/react-native-screens-4.27.0.json +24 -0
- package/dist/error-reporting.d.ts +6 -0
- package/dist/error-reporting.d.ts.map +1 -0
- package/dist/error-reporting.js +17 -0
- package/dist/error-reporting.js.map +1 -0
- package/dist/index.d.ts +592 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3427 -0
- package/dist/index.js.map +1 -0
- package/dist/tanstack-matches.d.ts +66 -0
- package/dist/tanstack-matches.d.ts.map +1 -0
- package/dist/tanstack-matches.js +255 -0
- package/dist/tanstack-matches.js.map +1 -0
- package/dist/tanstack-router.d.ts +98 -0
- package/dist/tanstack-router.d.ts.map +1 -0
- package/dist/tanstack-router.js +501 -0
- package/dist/tanstack-router.js.map +1 -0
- package/package.json +47 -3
- package/patches/react-native-screens@4.27.0.patch +169 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"packageName": "react-native-screens",
|
|
4
|
+
"packageVersion": "4.27.0",
|
|
5
|
+
"reactNativeVersion": "0.88.1",
|
|
6
|
+
"patch": {
|
|
7
|
+
"path": "patches/react-native-screens@4.27.0.patch",
|
|
8
|
+
"sha256": "83e68ebe9f914a58bed4de9291780984479d6fdf3263f4acd59d6de4459d80d7"
|
|
9
|
+
},
|
|
10
|
+
"installedFiles": [
|
|
11
|
+
{
|
|
12
|
+
"path": "android/src/main/java/com/swmansion/rnscreens/gamma/tabs/screen/TabsScreen.kt",
|
|
13
|
+
"sha256": "578b945832ba8029b29e06f1f7fa10151a757829a03851ebf02f9a8d960886b2"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"path": "android/src/main/java/com/swmansion/rnscreens/gamma/tabs/screen/TabsScreenViewManager.kt",
|
|
17
|
+
"sha256": "8ab14420fef0705a765242be5bb6ac27921674dfb55437ce65cc4e6ec5ccb0fd"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"path": "ios/tabs/RNSTabBarAppearanceCoordinator.mm",
|
|
21
|
+
"sha256": "7f5605dc479e89fce19463418a9ccf226a1c9ac31435bb16418ba5975e876b74"
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Invokes an application diagnostic hook without allowing either a thrown
|
|
3
|
+
* error or a rejected return value to replace the failure being reported.
|
|
4
|
+
*/
|
|
5
|
+
export declare function reportIsolatedError<TArguments extends readonly unknown[]>(handler: ((...arguments_: TArguments) => unknown) | undefined, ...arguments_: TArguments): boolean;
|
|
6
|
+
//# sourceMappingURL=error-reporting.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-reporting.d.ts","sourceRoot":"","sources":["../src/error-reporting.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,SAAS,SAAS,OAAO,EAAE,EACvE,OAAO,EAAE,CAAC,CAAC,GAAG,UAAU,EAAE,UAAU,KAAK,OAAO,CAAC,GAAG,SAAS,EAC7D,GAAG,UAAU,EAAE,UAAU,GACxB,OAAO,CAST"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Invokes an application diagnostic hook without allowing either a thrown
|
|
3
|
+
* error or a rejected return value to replace the failure being reported.
|
|
4
|
+
*/
|
|
5
|
+
export function reportIsolatedError(handler, ...arguments_) {
|
|
6
|
+
if (handler === undefined)
|
|
7
|
+
return false;
|
|
8
|
+
try {
|
|
9
|
+
const reported = handler(...arguments_);
|
|
10
|
+
void Promise.resolve(reported).catch(() => undefined);
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
// Diagnostic hooks are observers, not a second application failure path.
|
|
14
|
+
}
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=error-reporting.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-reporting.js","sourceRoot":"","sources":["../src/error-reporting.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CACjC,OAA6D,EAC7D,GAAG,UAAsB;IAEzB,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IACxC,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,UAAU,CAAC,CAAC;QACxC,KAAK,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IACxD,CAAC;IAAC,MAAM,CAAC;QACP,yEAAyE;IAC3E,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,592 @@
|
|
|
1
|
+
import type { HostValue } from "@solidnative-dev/host-contract";
|
|
2
|
+
import { type MemoryWarningSource, type ModalProps, type ScreenProps, type ScreenSheetDetentChangeEvent, type ScrollViewProps, type StyleProp, type TabsHostProps, type TabsScreenAppearance, type TabsScreenIcon, type TabsScreenProps, type TabsScreenScrollEdgeAppearance } from "@solidnative-dev/core";
|
|
3
|
+
import { type NativeNode, type NativeSyntheticEvent } from "@solidnative-dev/renderer";
|
|
4
|
+
import { type Accessor } from "solid-js";
|
|
5
|
+
import type { AnyRouter } from "@tanstack/router-core";
|
|
6
|
+
import { type RouterHistory } from "@tanstack/history";
|
|
7
|
+
export type { ScreenSheetDetentChangeEvent, ScreenSheetDetentChangePayload, ScreenSheetDetents, ScreenSheetInitialDetent, ScreenSheetLargestUndimmedDetent, TabsScreenAppearance, TabsScreenAppearanceAndroid, TabsScreenAppearanceIOS, TabsScreenAndroidIcon, TabsScreenBlurEffect, TabsScreenFontStyle, TabsScreenFontWeight, TabsScreenIcon, TabsScreenIOSIcon, TabsScreenItemAppearanceIOS, TabsScreenItemLabelVisibilityMode, TabsScreenItemStateAppearanceAndroid, TabsScreenItemStateAppearanceIOS, TabsScreenScrollEdgeAppearance, TabsScreenTitlePositionAdjustment, } from "@solidnative-dev/core";
|
|
8
|
+
export { createTanStackNativeRouter, getSolidNativeRouterStoreConfig, TanStackNativeLink, TanStackNativeRouterProvider, TanStackNativeRouteView, TanStackRootRoute, TanStackRoute, tanStackRedirect, useTanStackNativeNavigate, useTanStackNativeRouter, } from "./tanstack-router.js";
|
|
9
|
+
export type { AnyTanStackRoute, AnyTanStackRouter, TanStackNativeLinkPressableProps, TanStackNativeLinkPreload, TanStackNativeLinkProps, TanStackNativeLinkState, TanStackNativeRouterProviderProps, TanStackNativeRouteMatch, TanStackNativeRouteViewProps, TanStackRouterState, UseTanStackNativeNavigateOptions, } from "./tanstack-router.js";
|
|
10
|
+
export { TanStackNativeMatch, TanStackNativeMatches, TanStackNativeOutlet, useTanStackNativeLoaderData, useTanStackNativeMatch, } from "./tanstack-matches.js";
|
|
11
|
+
export type { TanStackNativeErrorComponent, TanStackNativeErrorComponentProps, TanStackNativeNotFoundComponent, TanStackNativeNotFoundComponentProps, TanStackNativePendingComponent, TanStackNativePendingComponentProps, TanStackNativeMatchesProps, TanStackNativeRouteComponent, UseTanStackNativeLoaderDataOptions, UseTanStackNativeLoaderDataResult, UseTanStackNativeMatchOptions, UseTanStackNativeMatchResult, } from "./tanstack-matches.js";
|
|
12
|
+
export type NavigationOrigin = "application" | "platform" | "system" | "restoration";
|
|
13
|
+
export type NavigationKind = "push" | "replace" | "pop" | "traverse" | "reset";
|
|
14
|
+
export declare const NATIVE_HISTORY_RESTORATION_VERSION: 0;
|
|
15
|
+
export declare const NATIVE_HISTORY_MAX_ENTRIES = 512;
|
|
16
|
+
export declare const NATIVE_HISTORY_MAX_SERIALIZED_LENGTH = 1048576;
|
|
17
|
+
export interface NativeHistoryEntry {
|
|
18
|
+
readonly id: string;
|
|
19
|
+
readonly href: string;
|
|
20
|
+
readonly state: HostValue;
|
|
21
|
+
}
|
|
22
|
+
export interface NativeHistorySnapshot {
|
|
23
|
+
readonly entries: readonly NativeHistoryEntry[];
|
|
24
|
+
readonly index: number;
|
|
25
|
+
}
|
|
26
|
+
export interface NativeNavigationTransition {
|
|
27
|
+
readonly id: string;
|
|
28
|
+
readonly kind: NavigationKind;
|
|
29
|
+
readonly origin: NavigationOrigin;
|
|
30
|
+
readonly from: NativeHistoryEntry;
|
|
31
|
+
readonly to: NativeHistoryEntry;
|
|
32
|
+
readonly delta: number;
|
|
33
|
+
}
|
|
34
|
+
export interface NativeHistoryUpdate {
|
|
35
|
+
readonly transition: NativeNavigationTransition;
|
|
36
|
+
readonly snapshot: NativeHistorySnapshot;
|
|
37
|
+
}
|
|
38
|
+
export type NativeHistoryListener = (update: NativeHistoryUpdate) => void;
|
|
39
|
+
export type NativePlatformTransitionBlocker = (transition: NativeNavigationTransition) => boolean | Promise<boolean>;
|
|
40
|
+
export type NativePlatformTransitionBlockerListener = (hasBlockers: boolean) => void;
|
|
41
|
+
export interface NativeHistoryOptions {
|
|
42
|
+
readonly initialHref?: string;
|
|
43
|
+
readonly initialState?: HostValue;
|
|
44
|
+
readonly snapshot?: NativeHistorySnapshot;
|
|
45
|
+
}
|
|
46
|
+
export type NativeHistoryLaunchSource = "initial" | "restoration" | "deep-link";
|
|
47
|
+
export interface NativeHistoryLaunchOptions {
|
|
48
|
+
readonly initialHref?: string;
|
|
49
|
+
readonly initialState?: HostValue;
|
|
50
|
+
/** Untrusted value returned by the application shell's persistence layer. */
|
|
51
|
+
readonly serializedSnapshot?: unknown;
|
|
52
|
+
/** Untrusted value returned by the platform's initial-URL API. */
|
|
53
|
+
readonly initialURL?: unknown;
|
|
54
|
+
readonly resolveDeepLink?: (url: string) => NativeDeepLinkTarget | undefined;
|
|
55
|
+
}
|
|
56
|
+
export interface NativeHistoryLaunchResult {
|
|
57
|
+
readonly history: NativeHistory;
|
|
58
|
+
readonly source: NativeHistoryLaunchSource;
|
|
59
|
+
readonly initialURL?: string;
|
|
60
|
+
/** Present when corrupt or obsolete stored state was discarded. */
|
|
61
|
+
readonly restorationError?: unknown;
|
|
62
|
+
}
|
|
63
|
+
export interface NativeHistoryPersistenceStorage {
|
|
64
|
+
getItem(key: string): Promise<unknown>;
|
|
65
|
+
setItem(key: string, value: string): Promise<unknown>;
|
|
66
|
+
removeItem(key: string): Promise<unknown>;
|
|
67
|
+
}
|
|
68
|
+
export interface StoredNativeHistoryLaunchOptions extends Omit<NativeHistoryLaunchOptions, "serializedSnapshot"> {
|
|
69
|
+
readonly storage: NativeHistoryPersistenceStorage;
|
|
70
|
+
readonly storageKey: string;
|
|
71
|
+
}
|
|
72
|
+
export interface NativeHistoryPersistenceOptions {
|
|
73
|
+
readonly storageKey: string;
|
|
74
|
+
readonly onError?: (error: unknown) => unknown;
|
|
75
|
+
}
|
|
76
|
+
export interface NativeHistoryPersistence {
|
|
77
|
+
/** Writes or retries the newest scheduled snapshot and awaits durability. */
|
|
78
|
+
flush(): Promise<void>;
|
|
79
|
+
/** Stops observing history. Already-started native writes still settle. */
|
|
80
|
+
dispose(): void;
|
|
81
|
+
}
|
|
82
|
+
export interface TanStackNativeHistoryOptions {
|
|
83
|
+
/** Converts a router href into the form exposed by links to the host shell. */
|
|
84
|
+
readonly createHref?: (href: string) => string;
|
|
85
|
+
/** Called after a TanStack navigation blocker rejects a programmatic move. */
|
|
86
|
+
readonly onBlocked?: () => unknown;
|
|
87
|
+
/** Reports a blocker failure; without a handler it reaches the global queue. */
|
|
88
|
+
readonly onNavigationError?: (error: unknown) => unknown;
|
|
89
|
+
}
|
|
90
|
+
export declare function serializeNativeHistorySnapshot(snapshot: NativeHistorySnapshot): string;
|
|
91
|
+
export declare function deserializeNativeHistorySnapshot(serialized: unknown): NativeHistorySnapshot;
|
|
92
|
+
export declare class NativeHistory {
|
|
93
|
+
#private;
|
|
94
|
+
constructor(options?: NativeHistoryOptions);
|
|
95
|
+
get location(): NativeHistoryEntry;
|
|
96
|
+
get canGoBack(): boolean;
|
|
97
|
+
get canGoForward(): boolean;
|
|
98
|
+
get pendingApplicationTransitionCount(): number;
|
|
99
|
+
get hasPendingPlatformTransition(): boolean;
|
|
100
|
+
get hasPlatformTransitionBlockers(): boolean;
|
|
101
|
+
get snapshot(): NativeHistorySnapshot;
|
|
102
|
+
subscribe(listener: NativeHistoryListener): () => void;
|
|
103
|
+
subscribePlatformTransitionBlockers(listener: NativePlatformTransitionBlockerListener): () => void;
|
|
104
|
+
blockPlatformTransitions(blocker: NativePlatformTransitionBlocker): () => void;
|
|
105
|
+
push(href: string, state?: HostValue): NativeNavigationTransition;
|
|
106
|
+
replace(href: string, state?: HostValue): NativeNavigationTransition;
|
|
107
|
+
back(count?: number): NativeNavigationTransition | undefined;
|
|
108
|
+
forward(count?: number): NativeNavigationTransition | undefined;
|
|
109
|
+
go(delta: number): NativeNavigationTransition | undefined;
|
|
110
|
+
reset(entries: readonly Omit<NativeHistoryEntry, "id">[], index?: number): NativeNavigationTransition;
|
|
111
|
+
openDeepLink(href: string, state?: HostValue): NativeNavigationTransition;
|
|
112
|
+
requestPlatformBack(count?: number): NativeNavigationTransition | undefined;
|
|
113
|
+
completePlatformTransition(id: string, completed: boolean): boolean;
|
|
114
|
+
isPlatformTransitionBlocked(id: string): Promise<boolean>;
|
|
115
|
+
acknowledgeTransition(id: string): boolean;
|
|
116
|
+
acknowledgeApplicationTransition(id: string): boolean;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Adapts the native navigation state machine to TanStack Router's current
|
|
120
|
+
* framework-neutral history contract. Adapter-originated mutations are
|
|
121
|
+
* suppressed at the native subscription boundary and then published exactly
|
|
122
|
+
* once by TanStack history; platform backs and deep links enter through the
|
|
123
|
+
* native subscription and are translated into the matching TanStack action.
|
|
124
|
+
*/
|
|
125
|
+
export declare function createTanStackNativeHistory(nativeHistory?: NativeHistory, options?: TanStackNativeHistoryOptions): RouterHistory;
|
|
126
|
+
/**
|
|
127
|
+
* Reconciles untrusted persistence and initial-URL inputs before the first
|
|
128
|
+
* native tree is mounted. An accepted deep link starts a fresh one-entry stack
|
|
129
|
+
* so restored screens cannot unexpectedly appear behind it. Invalid stored
|
|
130
|
+
* state is reported in the result and falls back to the configured initial
|
|
131
|
+
* location instead of making the application unlaunchable.
|
|
132
|
+
*/
|
|
133
|
+
export declare function createNativeHistoryFromLaunch(options?: NativeHistoryLaunchOptions): NativeHistoryLaunchResult;
|
|
134
|
+
/**
|
|
135
|
+
* Reads and validates the application shell's persisted navigation value
|
|
136
|
+
* before creating history. Corrupt or obsolete data, including a valid stack
|
|
137
|
+
* discarded by an accepted initial URL, is removed before launch returns;
|
|
138
|
+
* native storage availability errors still reject startup so the shell can
|
|
139
|
+
* choose its own recovery policy.
|
|
140
|
+
*/
|
|
141
|
+
export declare function createNativeHistoryFromStorage(options: StoredNativeHistoryLaunchOptions): Promise<NativeHistoryLaunchResult>;
|
|
142
|
+
/**
|
|
143
|
+
* Persists the initial snapshot and every subsequent navigation update. Writes
|
|
144
|
+
* are serialized so a slow native operation cannot overwrite newer state;
|
|
145
|
+
* updates that arrive while one write is pending coalesce to the newest
|
|
146
|
+
* snapshot. The current Solid owner disposes the subscription automatically.
|
|
147
|
+
*/
|
|
148
|
+
export declare function createNativeHistoryPersistence(history: NativeHistory, storage: NativeHistoryPersistenceStorage, options: NativeHistoryPersistenceOptions): NativeHistoryPersistence;
|
|
149
|
+
export interface NativeStackScreenOptions extends Pick<ScreenProps, "gestureEnabled" | "nativeBackButtonDismissalEnabled" | "presentation" | "preventNativeDismiss" | "sheetAllowedDetents" | "sheetCornerRadius" | "sheetDefaultResizeAnimationEnabled" | "sheetElevation" | "sheetExpandsWhenScrolledToEdge" | "sheetGrabberVisible" | "sheetInitialDetent" | "sheetLargestUndimmedDetent" | "sheetShouldOverflowTopInset" | "style"> {
|
|
150
|
+
}
|
|
151
|
+
export interface NativeTabDefinition {
|
|
152
|
+
readonly key: string;
|
|
153
|
+
}
|
|
154
|
+
/** Portable bound imposed by Android's native BottomNavigationView. */
|
|
155
|
+
export declare const NATIVE_TABS_MAX_ITEMS = 5;
|
|
156
|
+
export declare const NATIVE_TABS_STATE_RESTORATION_VERSION: 0;
|
|
157
|
+
export declare const NATIVE_TABS_STATE_MAX_SERIALIZED_LENGTH: number;
|
|
158
|
+
export interface NativeTabHistoryDefinition extends NativeTabDefinition {
|
|
159
|
+
readonly initialHref?: string;
|
|
160
|
+
readonly initialState?: HostValue;
|
|
161
|
+
}
|
|
162
|
+
export interface NativeTabsStateSnapshotTab {
|
|
163
|
+
readonly key: string;
|
|
164
|
+
readonly history: NativeHistorySnapshot;
|
|
165
|
+
}
|
|
166
|
+
export interface NativeTabsStateSnapshot {
|
|
167
|
+
readonly selectedKey: string;
|
|
168
|
+
readonly tabs: readonly NativeTabsStateSnapshotTab[];
|
|
169
|
+
}
|
|
170
|
+
export type NativeTabsStateUpdateKind = "selection" | "history" | "deep-link";
|
|
171
|
+
export interface NativeTabsStateUpdate {
|
|
172
|
+
readonly kind: NativeTabsStateUpdateKind;
|
|
173
|
+
readonly selectedKey: string;
|
|
174
|
+
readonly tabKey: string;
|
|
175
|
+
readonly historyUpdate?: NativeHistoryUpdate;
|
|
176
|
+
readonly snapshot: NativeTabsStateSnapshot;
|
|
177
|
+
}
|
|
178
|
+
export type NativeTabsStateListener = (update: NativeTabsStateUpdate) => void;
|
|
179
|
+
export interface NativeTabsStateOptions {
|
|
180
|
+
readonly tabs: readonly NativeTabHistoryDefinition[];
|
|
181
|
+
readonly selectedKey?: string;
|
|
182
|
+
readonly snapshot?: NativeTabsStateSnapshot;
|
|
183
|
+
}
|
|
184
|
+
export interface NativeTabDeepLinkTarget extends NativeDeepLinkTarget {
|
|
185
|
+
readonly tabKey: string;
|
|
186
|
+
}
|
|
187
|
+
export interface NativeTabsState {
|
|
188
|
+
readonly selectedKey: Accessor<string>;
|
|
189
|
+
readonly selectedHistory: Accessor<NativeHistory>;
|
|
190
|
+
readonly snapshot: NativeTabsStateSnapshot;
|
|
191
|
+
history(tabKey: string): NativeHistory;
|
|
192
|
+
select(tabKey: string): boolean;
|
|
193
|
+
handleTabSelected(selection: NativeTabSelection): boolean;
|
|
194
|
+
openDeepLink(target: NativeTabDeepLinkTarget): NativeNavigationTransition;
|
|
195
|
+
subscribe(listener: NativeTabsStateListener): () => void;
|
|
196
|
+
dispose(): void;
|
|
197
|
+
}
|
|
198
|
+
export type NativeTabsStateLaunchSource = "initial" | "restoration" | "deep-link";
|
|
199
|
+
export interface NativeTabsStateLaunchOptions extends Omit<NativeTabsStateOptions, "snapshot"> {
|
|
200
|
+
/** Untrusted value returned by the application shell's persistence layer. */
|
|
201
|
+
readonly serializedSnapshot?: unknown;
|
|
202
|
+
/** Untrusted value returned by the platform's initial-URL API. */
|
|
203
|
+
readonly initialURL?: unknown;
|
|
204
|
+
readonly resolveDeepLink?: (url: string) => NativeTabDeepLinkTarget | undefined;
|
|
205
|
+
}
|
|
206
|
+
export interface NativeTabsStateLaunchResult {
|
|
207
|
+
readonly state: NativeTabsState;
|
|
208
|
+
readonly source: NativeTabsStateLaunchSource;
|
|
209
|
+
readonly initialURL?: string;
|
|
210
|
+
/** Present when corrupt, obsolete, or incompatible stored state was discarded. */
|
|
211
|
+
readonly restorationError?: unknown;
|
|
212
|
+
}
|
|
213
|
+
export interface StoredNativeTabsStateLaunchOptions extends Omit<NativeTabsStateLaunchOptions, "serializedSnapshot"> {
|
|
214
|
+
readonly storage: NativeHistoryPersistenceStorage;
|
|
215
|
+
readonly storageKey: string;
|
|
216
|
+
}
|
|
217
|
+
export interface NativeTabsStatePersistenceOptions {
|
|
218
|
+
readonly storageKey: string;
|
|
219
|
+
readonly onError?: (error: unknown) => unknown;
|
|
220
|
+
}
|
|
221
|
+
export interface NativeTabsStatePersistence {
|
|
222
|
+
/** Writes or retries the newest scheduled tabs snapshot and awaits durability. */
|
|
223
|
+
flush(): Promise<void>;
|
|
224
|
+
/** Stops observing tab selection and child histories. */
|
|
225
|
+
dispose(): void;
|
|
226
|
+
}
|
|
227
|
+
export interface NativeTabsScreenOptions {
|
|
228
|
+
readonly style?: StyleProp;
|
|
229
|
+
readonly title?: string;
|
|
230
|
+
readonly badgeValue?: string;
|
|
231
|
+
readonly icon?: TabsScreenIcon;
|
|
232
|
+
readonly selectedIcon?: TabsScreenIcon;
|
|
233
|
+
readonly standardAppearance?: TabsScreenAppearance;
|
|
234
|
+
readonly scrollEdgeAppearance?: TabsScreenScrollEdgeAppearance;
|
|
235
|
+
readonly preventNativeSelection?: boolean;
|
|
236
|
+
readonly tabBarItemTestID?: string;
|
|
237
|
+
readonly tabBarItemAccessibilityLabel?: string;
|
|
238
|
+
readonly specialEffects?: TabsScreenProps["specialEffects"];
|
|
239
|
+
readonly orientation?: TabsScreenProps["orientation"];
|
|
240
|
+
}
|
|
241
|
+
export type NativeTabActionOrigin = "user" | "programmatic-js" | "programmatic-native" | "implicit";
|
|
242
|
+
export interface NativeTabSelection {
|
|
243
|
+
readonly selectedKey: string;
|
|
244
|
+
readonly provenance: number;
|
|
245
|
+
readonly repeated: boolean;
|
|
246
|
+
readonly triggeredSpecialEffect: boolean;
|
|
247
|
+
readonly actionOrigin: NativeTabActionOrigin;
|
|
248
|
+
}
|
|
249
|
+
export interface NativeTabSelectionRejection {
|
|
250
|
+
readonly selectedKey: string;
|
|
251
|
+
readonly provenance: number;
|
|
252
|
+
readonly rejectedKey: string;
|
|
253
|
+
readonly rejectedBaseProvenance: number;
|
|
254
|
+
readonly reason: "stale" | "repeated";
|
|
255
|
+
}
|
|
256
|
+
export interface NativeTabSelectionPrevention {
|
|
257
|
+
readonly selectedKey: string;
|
|
258
|
+
readonly provenance: number;
|
|
259
|
+
readonly preventedKey: string;
|
|
260
|
+
}
|
|
261
|
+
export interface NativeTabsProps<Tab extends NativeTabDefinition = NativeTabDefinition> extends Pick<TabsHostProps, "colorScheme" | "direction" | "nativeContainerBackgroundColor" | "tabBarControllerMode" | "tabBarHidden" | "tabBarMinimizeBehavior" | "tabBarRespectsIMEInsets" | "tabBarTintColor"> {
|
|
262
|
+
readonly tabs: readonly Tab[];
|
|
263
|
+
readonly selectedKey?: string;
|
|
264
|
+
readonly defaultSelectedKey?: string;
|
|
265
|
+
readonly children: (tab: Accessor<Tab>, index: Accessor<number>, isSelected: Accessor<boolean>) => unknown;
|
|
266
|
+
/** Reactive navigator-wide defaults; per-tab options override matching keys. */
|
|
267
|
+
readonly defaultScreenOptions?: Readonly<NativeTabsScreenOptions> | undefined;
|
|
268
|
+
readonly screenOptions?: (tab: Tab, index: number) => Readonly<NativeTabsScreenOptions>;
|
|
269
|
+
readonly onTabSelected?: (selection: NativeTabSelection, event: NativeSyntheticEvent) => unknown;
|
|
270
|
+
readonly onTabSelectionRejected?: (rejection: NativeTabSelectionRejection, event: NativeSyntheticEvent) => unknown;
|
|
271
|
+
readonly onTabSelectionPrevented?: (prevention: NativeTabSelectionPrevention, event: NativeSyntheticEvent) => unknown;
|
|
272
|
+
readonly onTabWillAppear?: (tab: Tab, event: NativeSyntheticEvent) => unknown;
|
|
273
|
+
readonly onTabDidAppear?: (tab: Tab, event: NativeSyntheticEvent) => unknown;
|
|
274
|
+
readonly onTabWillDisappear?: (tab: Tab, event: NativeSyntheticEvent) => unknown;
|
|
275
|
+
readonly onTabDidDisappear?: (tab: Tab, event: NativeSyntheticEvent) => unknown;
|
|
276
|
+
readonly onError?: (error: unknown) => unknown;
|
|
277
|
+
}
|
|
278
|
+
export interface NativeStackProps {
|
|
279
|
+
readonly history: NativeHistory;
|
|
280
|
+
readonly children: (entry: Accessor<NativeHistoryEntry>, index: Accessor<number>, isFocused: Accessor<boolean>) => unknown;
|
|
281
|
+
readonly style?: StyleProp;
|
|
282
|
+
/** Reactive navigator-wide defaults; per-entry options override matching keys. */
|
|
283
|
+
readonly defaultScreenOptions?: Readonly<NativeStackScreenOptions> | undefined;
|
|
284
|
+
readonly screenOptions?: (entry: NativeHistoryEntry, index: number) => Readonly<NativeStackScreenOptions>;
|
|
285
|
+
/** Mounts one native header configuration inside each keyed Screen owner. */
|
|
286
|
+
readonly renderHeader?: (entry: Accessor<NativeHistoryEntry>, index: Accessor<number>, isFocused: Accessor<boolean>) => unknown;
|
|
287
|
+
readonly onTransitionEnd?: (event: NativeSyntheticEvent) => unknown;
|
|
288
|
+
readonly onScreenFocus?: (entry: NativeHistoryEntry, event: NativeSyntheticEvent) => unknown;
|
|
289
|
+
readonly onScreenBlur?: (entry: NativeHistoryEntry, event: NativeSyntheticEvent) => unknown;
|
|
290
|
+
readonly onScreenSheetDetentChange?: (entry: NativeHistoryEntry, event: ScreenSheetDetentChangeEvent) => unknown;
|
|
291
|
+
readonly onPlatformBack?: (transition: NativeNavigationTransition) => unknown;
|
|
292
|
+
readonly onPlatformBackCancel?: (entry: NativeHistoryEntry, event: NativeSyntheticEvent) => unknown;
|
|
293
|
+
readonly onPlatformBackBlocked?: (entry: NativeHistoryEntry, event: NativeSyntheticEvent) => unknown;
|
|
294
|
+
readonly onPlatformBackError?: (error: unknown) => unknown;
|
|
295
|
+
readonly onUpdate?: NativeHistoryListener;
|
|
296
|
+
}
|
|
297
|
+
export interface NativeModalScreenOptions extends Pick<ModalProps, "accessible" | "accessibilityHint" | "accessibilityLabel" | "accessibilityRole" | "accessibilityState" | "allowSwipeDismissal" | "animationType" | "backdropColor" | "hardwareAccelerated" | "hidden" | "nativeID" | "navigationBarTranslucent" | "presentationStyle" | "statusBarTranslucent" | "style" | "supportedOrientations" | "testID" | "transparent"> {
|
|
298
|
+
}
|
|
299
|
+
export interface NativeModalStackProps {
|
|
300
|
+
readonly history: NativeHistory;
|
|
301
|
+
readonly children: (entry: Accessor<NativeHistoryEntry>, index: Accessor<number>, isFocused: Accessor<boolean>) => unknown;
|
|
302
|
+
/** Styles the retained application content beneath modal portals. */
|
|
303
|
+
readonly style?: StyleProp;
|
|
304
|
+
readonly defaultModalOptions?: Readonly<NativeModalScreenOptions> | undefined;
|
|
305
|
+
readonly modalOptions?: (entry: NativeHistoryEntry, index: number) => Readonly<NativeModalScreenOptions>;
|
|
306
|
+
readonly onModalShow?: (entry: NativeHistoryEntry, event: NativeSyntheticEvent) => unknown;
|
|
307
|
+
readonly onModalRequestClose?: (entry: NativeHistoryEntry, event: NativeSyntheticEvent) => unknown;
|
|
308
|
+
readonly onModalDismiss?: (entry: NativeHistoryEntry, event: NativeSyntheticEvent) => unknown;
|
|
309
|
+
readonly onModalHidden?: (entry: NativeHistoryEntry) => unknown;
|
|
310
|
+
readonly onModalOrientationChange?: (entry: NativeHistoryEntry, event: NativeSyntheticEvent) => unknown;
|
|
311
|
+
readonly onPlatformBack?: (transition: NativeNavigationTransition) => unknown;
|
|
312
|
+
readonly onPlatformBackBlocked?: (entry: NativeHistoryEntry, event: NativeSyntheticEvent) => unknown;
|
|
313
|
+
readonly onPlatformBackError?: (error: unknown) => unknown;
|
|
314
|
+
readonly onUpdate?: NativeHistoryListener;
|
|
315
|
+
}
|
|
316
|
+
export interface HardwareBackHandlerOptions {
|
|
317
|
+
readonly onTransition?: (transition: NativeNavigationTransition) => unknown;
|
|
318
|
+
readonly onBlocked?: (transition: NativeNavigationTransition) => unknown;
|
|
319
|
+
readonly onError?: (error: unknown) => unknown;
|
|
320
|
+
}
|
|
321
|
+
export interface NativeDeepLinkTarget {
|
|
322
|
+
readonly href: string;
|
|
323
|
+
readonly state?: HostValue;
|
|
324
|
+
}
|
|
325
|
+
export interface DeepLinkHandlerOptions {
|
|
326
|
+
readonly resolve?: (url: string) => NativeDeepLinkTarget | undefined;
|
|
327
|
+
readonly onTransition?: (transition: NativeNavigationTransition) => unknown;
|
|
328
|
+
readonly onError?: (error: unknown) => unknown;
|
|
329
|
+
}
|
|
330
|
+
export interface NativeNavigationSubscription {
|
|
331
|
+
remove(): void;
|
|
332
|
+
}
|
|
333
|
+
export interface NativeNavigationEventSource {
|
|
334
|
+
subscribeHardwareBack(listener: () => boolean): NativeNavigationSubscription;
|
|
335
|
+
subscribeURL(listener: (event: unknown) => unknown): NativeNavigationSubscription;
|
|
336
|
+
}
|
|
337
|
+
export interface NativeNavigationBindingsOptions {
|
|
338
|
+
readonly hardwareBack?: HardwareBackHandlerOptions;
|
|
339
|
+
readonly deepLinks?: DeepLinkHandlerOptions;
|
|
340
|
+
}
|
|
341
|
+
export interface NativeNavigationBindings {
|
|
342
|
+
dispose(): void;
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Creates the synchronous callback expected by React Native's Android
|
|
346
|
+
* BackHandler without importing React Native into this package. An accessor
|
|
347
|
+
* selects a retained tab's history at event time; an asynchronous blocker
|
|
348
|
+
* remains attached to that exact history even if selection changes meanwhile.
|
|
349
|
+
*/
|
|
350
|
+
export declare function createHardwareBackHandler(history: NativeHistory | Accessor<NativeHistory | undefined>, options?: HardwareBackHandlerOptions): () => boolean;
|
|
351
|
+
/**
|
|
352
|
+
* Converts a React Native-compatible `{ url }` event into a system-originated
|
|
353
|
+
* history transition without importing its Linking singleton.
|
|
354
|
+
*/
|
|
355
|
+
export declare function createDeepLinkHandler(history: NativeHistory, options?: DeepLinkHandlerOptions): (event: unknown) => NativeNavigationTransition | undefined;
|
|
356
|
+
/**
|
|
357
|
+
* Owns platform Back and live-link subscriptions for the current Solid owner.
|
|
358
|
+
* The returned disposer is idempotent for callers that need an earlier stop.
|
|
359
|
+
*/
|
|
360
|
+
export declare function createNativeNavigationBindings(history: NativeHistory, source: NativeNavigationEventSource, options?: NativeNavigationBindingsOptions): NativeNavigationBindings;
|
|
361
|
+
export declare function serializeNativeTabsStateSnapshot(snapshot: NativeTabsStateSnapshot): string;
|
|
362
|
+
export declare function deserializeNativeTabsStateSnapshot(serialized: unknown): NativeTabsStateSnapshot;
|
|
363
|
+
/**
|
|
364
|
+
* Owns one history per stable native-tab key and exposes selection as a Solid
|
|
365
|
+
* accessor. A cross-tab deep link publishes one coherent state update after
|
|
366
|
+
* both the target history and selected key have changed.
|
|
367
|
+
*/
|
|
368
|
+
export declare function createNativeTabsState(options: NativeTabsStateOptions): NativeTabsState;
|
|
369
|
+
/**
|
|
370
|
+
* Resolves cold-launch precedence for native tabs. An accepted initial URL
|
|
371
|
+
* starts the target tab directly at that route and discards restoration, so no
|
|
372
|
+
* stale screen is exposed behind Back. Unhandled URLs still allow restoration.
|
|
373
|
+
*/
|
|
374
|
+
export declare function createNativeTabsStateFromLaunch(options: NativeTabsStateLaunchOptions): NativeTabsStateLaunchResult;
|
|
375
|
+
/**
|
|
376
|
+
* Loads a validated multi-history envelope. Corrupt state and valid state
|
|
377
|
+
* discarded by an accepted initial URL are removed before launch returns, so
|
|
378
|
+
* a crash before persistence setup cannot resurrect obsolete tab histories.
|
|
379
|
+
*/
|
|
380
|
+
export declare function createNativeTabsStateFromStorage(options: StoredNativeTabsStateLaunchOptions): Promise<NativeTabsStateLaunchResult>;
|
|
381
|
+
/** Serializes and coalesces selection and child-history persistence writes. */
|
|
382
|
+
export declare function createNativeTabsStatePersistence(state: NativeTabsState, storage: NativeHistoryPersistenceStorage, options: NativeTabsStatePersistenceOptions): NativeTabsStatePersistence;
|
|
383
|
+
/**
|
|
384
|
+
* Retains one keyed Solid owner per native tab and reconciles the pinned
|
|
385
|
+
* native host's provenance protocol with optional controlled Solid state.
|
|
386
|
+
* Upstream tabs are stable; this projection remains locally experimental until
|
|
387
|
+
* each pinned release completes Solid Native's physical promotion matrix.
|
|
388
|
+
*/
|
|
389
|
+
export declare function NativeTabs<Tab extends NativeTabDefinition>(props: NativeTabsProps<Tab>): NativeNode;
|
|
390
|
+
export declare function NativeStack(props: NativeStackProps): NativeNode;
|
|
391
|
+
/**
|
|
392
|
+
* Projects the root NativeHistory entry as retained application content and
|
|
393
|
+
* every active later entry as a keyed cross-platform Modal route.
|
|
394
|
+
*/
|
|
395
|
+
export declare function NativeModalStack(props: NativeModalStackProps): NativeNode;
|
|
396
|
+
export interface TanStackNativeScreenContextValue {
|
|
397
|
+
readonly entry: Accessor<NativeHistoryEntry>;
|
|
398
|
+
readonly index: Accessor<number>;
|
|
399
|
+
readonly isFocused: Accessor<boolean>;
|
|
400
|
+
}
|
|
401
|
+
export declare const NATIVE_SCROLL_RESTORATION_VERSION: 0;
|
|
402
|
+
export declare const NATIVE_SCROLL_RESTORATION_MAX_SERIALIZED_LENGTH = 1048576;
|
|
403
|
+
export declare const NATIVE_SCROLL_RESTORATION_MAX_CONTAINERS_PER_ENTRY = 32;
|
|
404
|
+
export interface NativeScrollOffset {
|
|
405
|
+
readonly x: number;
|
|
406
|
+
readonly y: number;
|
|
407
|
+
}
|
|
408
|
+
export interface NativeScrollRestorationContainerSnapshot extends NativeScrollOffset {
|
|
409
|
+
readonly restorationKey: string;
|
|
410
|
+
}
|
|
411
|
+
export interface NativeScrollRestorationEntrySnapshot {
|
|
412
|
+
readonly entryId: string;
|
|
413
|
+
readonly containers: readonly NativeScrollRestorationContainerSnapshot[];
|
|
414
|
+
}
|
|
415
|
+
export interface NativeScrollRestorationSnapshot {
|
|
416
|
+
readonly entries: readonly NativeScrollRestorationEntrySnapshot[];
|
|
417
|
+
}
|
|
418
|
+
export type NativeScrollRestorationListener = () => void;
|
|
419
|
+
export interface NativeScrollRestorationOptions {
|
|
420
|
+
readonly snapshot?: NativeScrollRestorationSnapshot;
|
|
421
|
+
}
|
|
422
|
+
export interface StoredNativeScrollRestorationOptions {
|
|
423
|
+
readonly storage: NativeHistoryPersistenceStorage;
|
|
424
|
+
readonly storageKey: string;
|
|
425
|
+
/** Offsets are accepted only with the history snapshot that owns their IDs. */
|
|
426
|
+
readonly historySource: NativeHistoryLaunchSource;
|
|
427
|
+
}
|
|
428
|
+
export interface NativeScrollRestorationLaunchResult {
|
|
429
|
+
readonly restoration: NativeScrollRestoration;
|
|
430
|
+
/** Present when malformed stored scroll state was discarded. */
|
|
431
|
+
readonly restorationError?: unknown;
|
|
432
|
+
}
|
|
433
|
+
export interface NativeScrollRestorationPersistenceOptions {
|
|
434
|
+
readonly storageKey: string;
|
|
435
|
+
/** Idle time before serializing a changed snapshot. Defaults to 250 ms. */
|
|
436
|
+
readonly writeDelayMs?: number;
|
|
437
|
+
readonly onError?: (error: unknown) => unknown;
|
|
438
|
+
}
|
|
439
|
+
export interface NativeScrollRestorationPersistence {
|
|
440
|
+
/** Writes or retries the newest scheduled offset snapshot and awaits durability. */
|
|
441
|
+
flush(): Promise<void>;
|
|
442
|
+
/** Stops observing offsets. Already-started native writes still settle. */
|
|
443
|
+
dispose(): void;
|
|
444
|
+
}
|
|
445
|
+
export declare function serializeNativeScrollRestorationSnapshot(snapshot: NativeScrollRestorationSnapshot): string;
|
|
446
|
+
export declare function deserializeNativeScrollRestorationSnapshot(serialized: unknown): NativeScrollRestorationSnapshot;
|
|
447
|
+
/**
|
|
448
|
+
* Owns bounded offsets for the live entries of one NativeHistory. A supplied
|
|
449
|
+
* snapshot is pruned against that history before any route can read it.
|
|
450
|
+
*/
|
|
451
|
+
export declare class NativeScrollRestoration {
|
|
452
|
+
#private;
|
|
453
|
+
constructor(history: NativeHistory, options?: NativeScrollRestorationOptions);
|
|
454
|
+
get history(): NativeHistory;
|
|
455
|
+
get snapshot(): NativeScrollRestorationSnapshot;
|
|
456
|
+
subscribe(listener: NativeScrollRestorationListener): () => void;
|
|
457
|
+
read(entryId: string, restorationKey: string): NativeScrollOffset | undefined;
|
|
458
|
+
capture(entryId: string, restorationKey: string, offset: NativeScrollOffset): void;
|
|
459
|
+
dispose(): void;
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* Loads a scroll snapshot only when navigation itself restored stable entry
|
|
463
|
+
* IDs. Fresh and deep-link launches remove old offsets before returning.
|
|
464
|
+
*/
|
|
465
|
+
export declare function createNativeScrollRestorationFromStorage(history: NativeHistory, options: StoredNativeScrollRestorationOptions): Promise<NativeScrollRestorationLaunchResult>;
|
|
466
|
+
/** Serializes and coalesces durable offset writes behind native storage. */
|
|
467
|
+
export declare function createNativeScrollRestorationPersistence(restoration: NativeScrollRestoration, storage: NativeHistoryPersistenceStorage, options: NativeScrollRestorationPersistenceOptions): NativeScrollRestorationPersistence;
|
|
468
|
+
export interface TanStackNativeScrollViewProps extends ScrollViewProps {
|
|
469
|
+
/** Distinguishes multiple restorable scroll containers within one route. */
|
|
470
|
+
readonly restorationKey?: string;
|
|
471
|
+
/** Observes malformed native offsets or an active restoration failure. */
|
|
472
|
+
readonly onRestorationError?: (error: unknown, entry: NativeHistoryEntry, restorationKey: string) => unknown;
|
|
473
|
+
}
|
|
474
|
+
export type NativeScreenFocusSetup = () => void | (() => void);
|
|
475
|
+
export type NativeScreenFocusTask = (signal: AbortSignal) => void | PromiseLike<void>;
|
|
476
|
+
export interface NativeScreenFocusTaskOptions {
|
|
477
|
+
/** Additional reactive gate, for example foreground AppState or connectivity. */
|
|
478
|
+
readonly enabled?: Accessor<boolean>;
|
|
479
|
+
/** Observes a task failure while its screen is still focused. */
|
|
480
|
+
readonly onError?: (error: unknown) => unknown;
|
|
481
|
+
}
|
|
482
|
+
export type NativeAccessibilityFocusTarget = NativeNode | (() => NativeNode | undefined);
|
|
483
|
+
/**
|
|
484
|
+
* Owns focus-only work beneath the current Solid owner. Setup runs after a
|
|
485
|
+
* positive native focus event; its cleanup runs on blur, screen disposal, or
|
|
486
|
+
* parent disposal before setup can run again.
|
|
487
|
+
*/
|
|
488
|
+
export declare function createNativeScreenFocusEffect(isFocused: Accessor<boolean>, setup: NativeScreenFocusSetup): void;
|
|
489
|
+
/**
|
|
490
|
+
* Runs abort-aware asynchronous work for each native screen focus interval.
|
|
491
|
+
* Blur or owner disposal aborts the interval before another task can start.
|
|
492
|
+
* Rejections caused after cancellation are stale and intentionally ignored;
|
|
493
|
+
* failures while the interval is active are reported without allowing a
|
|
494
|
+
* failing diagnostic hook to replace the task failure.
|
|
495
|
+
*/
|
|
496
|
+
export declare function createNativeScreenFocusTask(isFocused: Accessor<boolean>, task: NativeScreenFocusTask, options?: NativeScreenFocusTaskOptions): void;
|
|
497
|
+
/**
|
|
498
|
+
* Moves platform accessibility focus once each time a native screen appears.
|
|
499
|
+
* A target accessor is resolved at the positive native focus event, after the
|
|
500
|
+
* keyed screen subtree has mounted.
|
|
501
|
+
*/
|
|
502
|
+
export declare function createNativeScreenAccessibilityFocus(isFocused: Accessor<boolean>, target: NativeAccessibilityFocusTarget): void;
|
|
503
|
+
/** Reads the keyed native screen owning the current route component subtree. */
|
|
504
|
+
export declare function useTanStackNativeScreen(): TanStackNativeScreenContextValue;
|
|
505
|
+
/**
|
|
506
|
+
* A native ScrollView whose last finite offset follows its stable TanStack
|
|
507
|
+
* history entry across route-tree parking and remounting. Mounted native views
|
|
508
|
+
* retain their own position and are never commanded a second time.
|
|
509
|
+
*/
|
|
510
|
+
export declare function TanStackNativeScrollView(props: TanStackNativeScrollViewProps): NativeNode;
|
|
511
|
+
/** Focus-scopes work to the native screen owning the current route subtree. */
|
|
512
|
+
export declare function createTanStackNativeScreenFocusEffect(setup: NativeScreenFocusSetup): void;
|
|
513
|
+
/** Runs abort-aware work while the current TanStack native screen is focused. */
|
|
514
|
+
export declare function createTanStackNativeScreenFocusTask(task: NativeScreenFocusTask, options?: NativeScreenFocusTaskOptions): void;
|
|
515
|
+
/** Moves accessibility focus when the current TanStack native screen appears. */
|
|
516
|
+
export declare function createTanStackNativeScreenAccessibilityFocus(target: NativeAccessibilityFocusTarget): void;
|
|
517
|
+
export interface TanStackNativeStackProps<TRouter extends AnyRouter = AnyRouter> extends Omit<NativeStackProps, "children"> {
|
|
518
|
+
readonly router?: TRouter;
|
|
519
|
+
/**
|
|
520
|
+
* Maximum TanStack match trees mounted across the current and inactive
|
|
521
|
+
* native screens. The default keeps every active history entry mounted.
|
|
522
|
+
* Native Screen containers, history entries, and settled router snapshots
|
|
523
|
+
* remain intact when an older match tree is parked. The prop is reactive.
|
|
524
|
+
*/
|
|
525
|
+
readonly maxMountedRouteTrees?: number;
|
|
526
|
+
/**
|
|
527
|
+
* Owner-bound memory policy. A warning cancels restored-entry preloading,
|
|
528
|
+
* clears TanStack's inactive/preload cache, and drops inactive snapshots.
|
|
529
|
+
*/
|
|
530
|
+
readonly memoryPolicy?: TanStackNativeMemoryPolicy;
|
|
531
|
+
/**
|
|
532
|
+
* Optional process-durable offset owner. It must be bound to the same
|
|
533
|
+
* NativeHistory; otherwise the stack owns an in-memory controller.
|
|
534
|
+
*/
|
|
535
|
+
readonly scrollRestoration?: NativeScrollRestoration;
|
|
536
|
+
/**
|
|
537
|
+
* Preloads and mounts at most this many nearest inactive entries from the
|
|
538
|
+
* initial native stack. The default is zero so restored loaders never run
|
|
539
|
+
* without an explicit application policy.
|
|
540
|
+
*/
|
|
541
|
+
readonly preloadRestoredEntries?: number;
|
|
542
|
+
/**
|
|
543
|
+
* Selects each bounded restored-entry candidate before its loader starts.
|
|
544
|
+
* The shared signal aborts when pressure begins or the stack owner disposes.
|
|
545
|
+
*/
|
|
546
|
+
readonly shouldPreloadRestoredEntry?: (entry: NativeHistoryEntry, index: number, signal: AbortSignal) => boolean | Promise<boolean>;
|
|
547
|
+
/** Observes setup failures without replacing the unresolved fallback. */
|
|
548
|
+
readonly onPreloadError?: (error: unknown, entry: NativeHistoryEntry) => unknown;
|
|
549
|
+
/**
|
|
550
|
+
* Renders a safe placeholder for a restored or newly pushed screen until
|
|
551
|
+
* that history index has received its first router match publication.
|
|
552
|
+
*/
|
|
553
|
+
readonly renderUnresolved: (entry: Accessor<NativeHistoryEntry>, index: Accessor<number>, isFocused: Accessor<boolean>) => NativeNode;
|
|
554
|
+
/** Renders inside a native Screen whose settled match tree is parked. */
|
|
555
|
+
readonly renderParked?: (entry: Accessor<NativeHistoryEntry>, index: Accessor<number>, isFocused: Accessor<boolean>) => NativeNode;
|
|
556
|
+
}
|
|
557
|
+
export interface TanStackNativeMemoryPolicyOptions {
|
|
558
|
+
/** Route trees retained before the application enters pressure mode. */
|
|
559
|
+
readonly normalMountedRouteTrees: number;
|
|
560
|
+
/** Route trees retained after a warning and before recovery is acknowledged. */
|
|
561
|
+
readonly pressuredMountedRouteTrees: number;
|
|
562
|
+
/**
|
|
563
|
+
* Evicts application-owned caches for each observed warning generation.
|
|
564
|
+
* The return value is not awaited by native navigation reclamation.
|
|
565
|
+
*/
|
|
566
|
+
readonly onMemoryPressure?: (warningCount: number) => unknown;
|
|
567
|
+
/** Observes an isolated sync or async application cache-eviction failure. */
|
|
568
|
+
readonly onMemoryPressureError?: (error: unknown, warningCount: number) => unknown;
|
|
569
|
+
}
|
|
570
|
+
export interface TanStackNativeMemoryPolicy {
|
|
571
|
+
/** Monotonic native warning generation owned by the creating Solid owner. */
|
|
572
|
+
readonly warningCount: Accessor<number>;
|
|
573
|
+
/** True from the latest warning until application recovery is acknowledged. */
|
|
574
|
+
readonly isUnderMemoryPressure: Accessor<boolean>;
|
|
575
|
+
/** Reactive route-tree limit for `TanStackNativeStack`. */
|
|
576
|
+
readonly maxMountedRouteTrees: Accessor<number>;
|
|
577
|
+
/** Allows the application to restore its normal route-tree budget. */
|
|
578
|
+
acknowledgeRecovery(): void;
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* Couples native pressure delivery to an explicit, recoverable navigation
|
|
582
|
+
* budget. The source subscription follows the current Solid owner.
|
|
583
|
+
*/
|
|
584
|
+
export declare function createTanStackNativeMemoryPolicy(source: MemoryWarningSource, options: TanStackNativeMemoryPolicyOptions): TanStackNativeMemoryPolicy;
|
|
585
|
+
/**
|
|
586
|
+
* Couples TanStack's current match publication to keyed native screen owners.
|
|
587
|
+
* By default, each visited history entry retains its last settled match tree
|
|
588
|
+
* while hidden. An explicit mount budget can park older match trees while
|
|
589
|
+
* retaining their keyed native Screen containers and settled router state.
|
|
590
|
+
*/
|
|
591
|
+
export declare function TanStackNativeStack<TRouter extends AnyRouter = AnyRouter>(props: TanStackNativeStackProps<TRouter>): NativeNode;
|
|
592
|
+
//# sourceMappingURL=index.d.ts.map
|