Skip to content

Commit 9a5ec31

Browse files
authored
chore: mark router APIs as @internal (#9231)
1 parent bad595b commit 9a5ec31

File tree

1 file changed

+45
-2
lines changed

1 file changed

+45
-2
lines changed

packages/router/router.ts

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,35 +39,53 @@ import {
3939
*/
4040
export interface Router {
4141
/**
42+
* @internal
43+
* PRIVATE - DO NOT USE
44+
*
4245
* Return the basename for the router
4346
*/
4447
get basename(): RouterInit["basename"];
4548

4649
/**
50+
* @internal
51+
* PRIVATE - DO NOT USE
52+
*
4753
* Return the current state of the router
4854
*/
4955
get state(): RouterState;
5056

5157
/**
58+
* @internal
59+
* PRIVATE - DO NOT USE
60+
*
5261
* Return the routes for this router instance
5362
*/
5463
get routes(): AgnosticDataRouteObject[];
5564

5665
/**
66+
* @internal
67+
* PRIVATE - DO NOT USE
68+
*
5769
* Initialize the router, including adding history listeners and kicking off
5870
* initial data fetches. Returns a function to cleanup listeners and abort
5971
* any in-progress loads
6072
*/
6173
initialize(): Router;
6274

6375
/**
76+
* @internal
77+
* PRIVATE - DO NOT USE
78+
*
6479
* Subscribe to router.state updates
6580
*
6681
* @param fn function to call with the new state
6782
*/
6883
subscribe(fn: RouterSubscriber): () => void;
6984

7085
/**
86+
* @internal
87+
* PRIVATE - DO NOT USE
88+
*
7189
* Enable scroll restoration behavior in the router
7290
*
7391
* @param savedScrollPositions Object that will manage positions, in case
@@ -82,6 +100,9 @@ export interface Router {
82100
): () => void;
83101

84102
/**
103+
* @internal
104+
* PRIVATE - DO NOT USE
105+
*
85106
* Navigate forward/backward in the history stack
86107
* @param to Delta to move in the history stack
87108
*/
@@ -95,6 +116,9 @@ export interface Router {
95116
navigate(to: To, opts?: RouterNavigateOptions): void;
96117

97118
/**
119+
* @internal
120+
* PRIVATE - DO NOT USE
121+
*
98122
* Trigger a fetcher load/submission
99123
*
100124
* @param key Fetcher key
@@ -110,42 +134,61 @@ export interface Router {
110134
): void;
111135

112136
/**
137+
* @internal
138+
* PRIVATE - DO NOT USE
139+
*
113140
* Trigger a revalidation of all current route loaders and fetcher loads
114141
*/
115142
revalidate(): void;
116143

117144
/**
145+
* @internal
146+
* PRIVATE - DO NOT USE
147+
*
118148
* Utility function to create an href for the given location
119149
* @param location
120150
*/
121151
createHref(location: Location | URL): string;
122152

123153
/**
154+
* @internal
155+
* PRIVATE - DO NOT USE
156+
*
124157
* Get/create a fetcher for the given key
125158
* @param key
126159
*/
127160
getFetcher<TData = any>(key?: string): Fetcher<TData>;
128161

129162
/**
163+
* @internal
164+
* PRIVATE - DO NOT USE
165+
*
130166
* Delete the fetcher for a given key
131167
* @param key
132168
*/
133169
deleteFetcher(key?: string): void;
134170

135171
/**
172+
* @internal
173+
* PRIVATE - DO NOT USE
174+
*
136175
* Cleanup listeners and abort any in-progress loads
137176
*/
138177
dispose(): void;
139178

140179
/**
180+
* @internal
181+
* PRIVATE - DO NOT USE
182+
*
141183
* Internal fetch AbortControllers accessed by unit tests
142-
* @private
143184
*/
144185
_internalFetchControllers: Map<string, AbortController>;
145186

146187
/**
188+
* @internal
189+
* PRIVATE - DO NOT USE
190+
*
147191
* Internal pending DeferredData instances accessed by unit tests
148-
* @private
149192
*/
150193
_internalActiveDeferreds: Map<string, DeferredData>;
151194
}

0 commit comments

Comments
 (0)