Skip to content

Commit 74addd8

Browse files
committed
chore: format comments
1 parent 6006e09 commit 74addd8

File tree

1 file changed

+63
-49
lines changed

1 file changed

+63
-49
lines changed

Diff for: types/router.d.ts

+63-49
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,8 @@ export declare class VueRouter {
5252
*/
5353
beforeEach(guard: NavigationGuard): () => void
5454
/**
55-
* Add a navigation guard that executes before navigation is about to be
56-
* resolved. At this state all component have been fetched and other
57-
* navigation guards have been successful.
55+
* Add a navigation guard that executes before navigation is about to be resolved. At this state all component have
56+
* been fetched and other navigation guards have been successful.
5857
*
5958
* @param guard - navigation guard to add
6059
* @returns a function that removes the registered guard
@@ -68,8 +67,7 @@ export declare class VueRouter {
6867
*/
6968
beforeResolve(guard: NavigationGuard): () => void
7069
/**
71-
* Add a navigation hook that is executed after every navigation. Returns a
72-
* function that removes the registered hook.
70+
* Add a navigation hook that is executed after every navigation. Returns a function that removes the registered hook.
7371
*
7472
* @param hook - navigation hook to add
7573
* @returns a function that removes the registered guard
@@ -101,15 +99,13 @@ export declare class VueRouter {
10199
onAbort?: ErrorHandler
102100
): void
103101
/**
104-
* Programmatically navigate to a new URL by replacing the current entry in
105-
* the history stack.
102+
* Programmatically navigate to a new URL by replacing the current entry in the history stack.
106103
*
107104
* @param to Route location to navigate to
108105
*/
109106
replace(to: RawLocation): Promise<Route>
110107
/**
111-
* Programmatically navigate to a new URL by replacing the current entry in
112-
* the history stack.
108+
* Programmatically navigate to a new URL by replacing the current entry in the history stack.
113109
*
114110
* @param to Route location to navigate to
115111
* @param onComplete Navigation success callback
@@ -121,39 +117,35 @@ export declare class VueRouter {
121117
onAbort?: ErrorHandler
122118
): void
123119
/**
124-
* Allows you to move forward or backward through the history. Calls
125-
* `history.go()`.
120+
* Allows you to move forward or backward through the history. Calls `history.go()`.
126121
*
127-
* @param delta The position in the history to which you want to move,
128-
* relative to the current page
122+
* @param delta The position in the history to which you want to move, relative to the current page
129123
*/
130124
go(n: number): void
131125
/**
132-
* Go back in history if possible by calling `history.back()`. Equivalent to
133-
* `router.go(-1)`.
126+
* Go back in history if possible by calling `history.back()`. Equivalent to `router.go(-1)`.
134127
*/
135128
back(): void
136129
/**
137-
* Go forward in history if possible by calling `history.forward()`.
138-
* Equivalent to `router.go(1)`.
130+
* Go forward in history if possible by calling `history.forward()`. Equivalent to `router.go(1)`.
139131
*/
140132
forward(): void
141133
match (raw: RawLocation, current?: Route, redirectedFrom?: Location): Route
142134
getMatchedComponents(to?: RawLocation | Route): Component[]
143135
/**
144-
* This method queues a callback to be called when the router has completed the initial navigation, which means it has resolved all async enter hooks and async components that are associated with the initial route.
136+
* This method queues a callback to be called when the router has completed the initial navigation, which means it has
137+
* resolved all async enter hooks and async components that are associated with the initial route.
145138
*
146139
* This is useful in server-side rendering to ensure consistent output on both the server and the client.
147140
* @param cb onReady callback.
148-
* @param errorCb errorCb will be called when the initial route resolution runs into an error (e.g. failed to resolve an async component).
141+
* @param errorCb errorCb will be called when the initial route resolution runs into an error (e.g. failed to resolve
142+
* an async component).
149143
*/
150144
onReady(cb: () => void, errorCb?: ErrorHandler): void
151145
/**
152-
* Adds an error handler that is called every time a non caught error happens
153-
* during navigation. This includes errors thrown synchronously and
154-
* asynchronously, errors returned or passed to `next` in any navigation
155-
* guard, and errors occurred when trying to resolve an async component that
156-
* is required to render a route.
146+
* Adds an error handler that is called every time a non caught error happens during navigation. This includes errors
147+
* thrown synchronously and asynchronously, errors returned or passed to `next` in any navigation guard, and errors
148+
* occurred when trying to resolve an async component that is required to render a route.
157149
*
158150
* @param handler - error handler to register
159151
*/
@@ -163,14 +155,16 @@ export declare class VueRouter {
163155
*/
164156
addRoutes(routes: RouteConfig[]): void
165157
/**
166-
* Add a new {@link RouteConfig | route record} as the child of an existing route. If the route has a `name` and there is already an existing one with the same one, it overwrites it.
158+
* Add a new {@link RouteConfig | route record} as the child of an existing route. If the route has a `name` and there
159+
* is already an existing one with the same one, it overwrites it.
167160
*
168161
* @param parentName - Parent Route Record where `route` should be appended at
169162
* @param route - Route Record to add
170163
*/
171164
addRoute(parentName: string, route: RouteConfig): void
172165
/**
173-
* Add a new {@link RouteConfig | route} to the router. If the route has a `name` and there is already an existing one with the same one, it overwrites it.
166+
* Add a new {@link RouteConfig | route} to the router. If the route has a `name` and there is already an existing one
167+
* with the same one, it overwrites it.
174168
* @param route - Route Record to add
175169
*/
176170
addRoute(route: RouteConfig): void
@@ -227,18 +221,18 @@ export enum NavigationFailureType {
227221
*/
228222
redirected = 2,
229223
/**
230-
* An aborted navigation is a navigation that failed because a navigation
231-
* guard returned `false` or called `next(false)`
224+
* An aborted navigation is a navigation that failed because a navigation guard returned `false` or called
225+
* `next(false)`
232226
*/
233227
aborted = 4,
234228
/**
235-
* A cancelled navigation is a navigation that failed because a more recent
236-
* navigation finished started (not necessarily finished).
229+
* A cancelled navigation is a navigation that failed because a more recent navigation finished started (not
230+
* necessarily finished).
237231
*/
238232
cancelled = 8,
239233
/**
240-
* A duplicated navigation is a navigation that failed because it was
241-
* initiated while already being at the exact same location.
234+
* A duplicated navigation is a navigation that failed because it was initiated while already being at the exact same
235+
* location.
242236
*/
243237
duplicated = 16
244238
}
@@ -281,9 +275,11 @@ export interface RouterOptions {
281275
* default: `"hash"` (in browser) | `"abstract"` (in Node.js)
282276
*
283277
* available values: `"hash" | "history" | "abstract"`
284-
* - `"hash"`: uses the URL hash for routing. Works in all Vue-supported browsers, including those that do not support HTML5 History API.
278+
* - `"hash"`: uses the URL hash for routing. Works in all Vue-supported browsers, including those that do not support
279+
* HTML5 History API.
285280
* - `"history"`: requires HTML5 History API and server config. See HTML5 History Mode.
286-
* - `"abstract"`: works in all JavaScript environments, e.g. server-side with Node.js. **The router will automatically be forced into this mode if no browser API is present.**
281+
* - `"abstract"`: works in all JavaScript environments, e.g. server-side with Node.js. **The router will
282+
* automatically be forced into this mode if no browser API is present.**
287283
*/
288284
mode?: RouterMode
289285
fallback?: boolean
@@ -293,15 +289,17 @@ export interface RouterOptions {
293289
*/
294290
linkActiveClass?: string
295291
/**
296-
* Default class applied to active {@link RouterLink}. If none is provided, `router-link-exact-active` will be applied.
292+
* Default class applied to active {@link RouterLink}. If none is provided, `router-link-exact-active` will be
293+
* applied.
297294
*/
298295
linkExactActiveClass?: string
299296
/**
300297
* Custom implementation to parse a query. See its counterpart, {@link stringifyQuery}.
301298
*/
302299
parseQuery?: (query: string) => Object
303300
/**
304-
* Custom implementation to stringify a query object. Should not prepend a leading `?`. {@link parseQuery} counterpart to handle query parsing.
301+
* Custom implementation to stringify a query object. Should not prepend a leading `?`. {@link parseQuery} counterpart
302+
* to handle query parsing.
305303
*/
306304
stringifyQuery?: (query: Object) => string
307305
/**
@@ -416,35 +414,42 @@ export interface RouteMeta extends Record<string | number | symbol, any> {}
416414

417415
export interface RouterLinkProps {
418416
/**
419-
* Denotes the target route of the link. When clicked, the value of the `to` prop will be passed to `router.push()` internally, so the value can be either a string or a location descriptor object.
417+
* Denotes the target route of the link. When clicked, the value of the `to` prop will be passed to `router.push()`
418+
* internally, so the value can be either a string or a location descriptor object.
420419
*/
421420
to: string | Location
422421
/**
423-
* Setting `replace` prop will call `router.replace()` instead of `router.push()` when clicked, so the navigation will not leave a history record.
422+
* Setting `replace` prop will call `router.replace()` instead of `router.push()` when clicked, so the navigation will
423+
* not leave a history record.
424424
*
425425
* @default false
426426
*/
427427
replace?: boolean
428428
/**
429-
* Setting `append` prop always appends the relative path to the current path. For example, assuming we are navigating from `/a` to a relative link `b`, without `append` we will end up at `/b`, but with append we will end up at `/a/b`.
429+
* Setting `append` prop always appends the relative path to the current path. For example, assuming we are navigating
430+
* from `/a` to a relative link `b`, without `append` we will end up at `/b`, but with append we will end up at
431+
* `/a/b`.
430432
*
431433
* @default false
432434
*/
433435
append?: boolean
434436
/**
435-
* Sometimes we want <RouterLink> to render as another tag, e.g <li>. Then we can use tag prop to specify which tag to render to, and it will still listen to click events for navigation.
437+
* Sometimes we want <RouterLink> to render as another tag, e.g <li>. Then we can use tag prop to specify which tag to
438+
* render to, and it will still listen to click events for navigation.
436439
*
437440
* @default "a"
438441
*/
439442
tag?: string
440443
/**
441-
* Configure the active CSS class applied when the link is active. Note the default value can also be configured globally via the `linkActiveClass` router constructor option.
444+
* Configure the active CSS class applied when the link is active. Note the default value can also be configured
445+
* globally via the `linkActiveClass` router constructor option.
442446
*
443447
* @default "router-link-active"
444448
*/
445449
activeClass?: string
446450
/**
447-
* The default active class matching behavior is **inclusive match**. For example, `<RouterLink to="/a">` will get this class applied as long as the current path starts with `/a/` or is `/a`.
451+
* The default active class matching behavior is **inclusive match**. For example, `<RouterLink to="/a">` will get
452+
* this class applied as long as the current path starts with `/a/` or is `/a`.
448453
*
449454
* @default false
450455
*/
@@ -456,7 +461,8 @@ export interface RouterLinkProps {
456461
*/
457462
exactPath?: boolean
458463
/**
459-
* Configure the active CSS class applied when the link is active with exact path match. Note the default value can also be configured globally via the `linkExactPathActiveClass` router constructor option.
464+
* Configure the active CSS class applied when the link is active with exact path match. Note the default value can
465+
* also be configured globally via the `linkExactPathActiveClass` router constructor option.
460466
*
461467
* @default "router-link-exact-path-active"
462468
*/
@@ -469,13 +475,16 @@ export interface RouterLinkProps {
469475
*/
470476
event?: string | ReadonlyArray<string>
471477
/**
472-
* Configure the active CSS class applied when the link is active with exact match. Note the default value can also be configured globally via the `linkExactActiveClass` router constructor option.
478+
* Configure the active CSS class applied when the link is active with exact match. Note the default value can also be
479+
* configured globally via the `linkExactActiveClass` router constructor option.
473480
*
474481
* @default "router-link-exact-active"
475482
*/
476483
exactActiveClass?: string
477484
/**
478-
* Configure the value of `aria-current` when the link is active with exact match. It must be one of the allowed values for [aria-current](https://www.w3.org/TR/wai-aria-1.2/#aria-current) in the ARIA spec. In most cases, the default of page should be the best fit.
485+
* Configure the value of `aria-current` when the link is active with exact match. It must be one of the allowed
486+
* values for [aria-current](https://www.w3.org/TR/wai-aria-1.2/#aria-current) in the ARIA spec. In most cases, the
487+
* default of page should be the best fit.
479488
*
480489
* @default "page"
481490
*/
@@ -499,15 +508,18 @@ export interface RouterLinkSlotArgument {
499508
*/
500509
route: Route
501510
/**
502-
* function to trigger the navigation. It will automatically prevent events when necessary, the same way `RouterLink` does
511+
* function to trigger the navigation. It will automatically prevent events when necessary, the same way `RouterLink`
512+
* does
503513
*/
504514
navigate: (e?: MouseEvent) => Promise<undefined | NavigationFailure>
505515
/**
506-
* `true` if the [active class](https://v3.router.vuejs.org/api/#active-class) should be applied. Allows to apply an arbitrary class
516+
* `true` if the [active class](https://v3.router.vuejs.org/api/#active-class) should be applied. Allows to apply an
517+
* arbitrary class
507518
*/
508519
isActive: boolean
509520
/**
510-
* `true` if the [exact active class](https://v3.router.vuejs.org/api/#exact-active-class) should be applied. Allows to apply an arbitrary class
521+
* `true` if the [exact active class](https://v3.router.vuejs.org/api/#exact-active-class) should be applied. Allows
522+
* to apply an arbitrary class
511523
*/
512524
isExactActive: boolean
513525
}
@@ -530,7 +542,9 @@ export declare const RouterLink: new () => {
530542

531543
export interface RouterViewProps {
532544
/**
533-
* When a {@link RouterView | `<RouterView />`} has a name, it will render the component with the corresponding name in the matched route record's components option. See [Named Views](https://v3.router.vuejs.org/guide/essentials/named-views.html) for an example.
545+
* When a {@link RouterView | `<RouterView />`} has a name, it will render the component with the corresponding name
546+
* in the matched route record's components option. See [Named
547+
* Views](https://v3.router.vuejs.org/guide/essentials/named-views.html) for an example.
534548
*
535549
* @default "default"
536550
*/

0 commit comments

Comments
 (0)