Skip to content

Commit 28b4074

Browse files
committed
docs(api): initial auto generated version of docs
still needs to be re organized, but it is a nice base using api-docs-gen :)
1 parent 31cf069 commit 28b4074

File tree

6 files changed

+1027
-0
lines changed

6 files changed

+1027
-0
lines changed

docs/api/index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# API Reference
2+
3+
- [Components](./vue-router-variable.md)
4+
- [Enumerations](./vue-router-enum.md)
5+
- [Functions](./vue-router-function.md)
6+
- [Interfaces](./vue-router-interface.md)
7+
- [Types](./vue-router-typealias.md)

docs/api/vue-router-enum.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Enum
2+
3+
## NavigationFailureType
4+
5+
Enumeration with all possible types for navigation failures. Can be passed to to check for specific failures.
6+
7+
**Signature:**
8+
```typescript
9+
export declare enum NavigationFailureType
10+
```
11+
12+
### Members
13+
14+
| Member | Value| Description |
15+
| --- | --- | --- |
16+
| aborted | 4 | An aborted navigation is a navigation that failed because a navigation guard returned `false` or called `next(false)` |
17+
| cancelled | 8 | A cancelled navigation is a navigation that failed because a more recent navigation finished started (not necessarily finished). |
18+
| duplicated | 16 | A duplicated navigation is a navigation that failed because it was initiated while already being at the exact same ___location. |
19+

docs/api/vue-router-function.md

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
# Function
2+
3+
## createMemoryHistory
4+
5+
Creates a in-memory based history. The main purpose of this history is to handle SSR. It starts in a special ___location that is nowhere. It's up to the user to replace that ___location with the starter ___location.
6+
7+
**Signature:**
8+
```typescript
9+
export declare function createMemoryHistory(base?: string): RouterHistory;
10+
```
11+
12+
### Parameters
13+
14+
| Parameter | Type | Description |
15+
| --- | --- | --- |
16+
| base | string | Base applied to all urls, defaults to '/' |
17+
18+
### Returns
19+
20+
a history object that can be passed to the router constructor
21+
22+
## createRouter
23+
24+
Create a Router instance that can be used on a Vue app.
25+
26+
**Signature:**
27+
```typescript
28+
export declare function createRouter(options: RouterOptions): Router;
29+
```
30+
31+
### Parameters
32+
33+
| Parameter | Type | Description |
34+
| --- | --- | --- |
35+
| options | RouterOptions | [RouterOptions](./vue-router-interface#routeroptions) |
36+
37+
## createWebHashHistory
38+
39+
Creates a hash history.
40+
41+
**Signature:**
42+
```typescript
43+
export declare function createWebHashHistory(base?: string): RouterHistory;
44+
```
45+
46+
### Parameters
47+
48+
| Parameter | Type | Description |
49+
| --- | --- | --- |
50+
| base | string | optional base to provide. Defaults to `___location.pathname` or `/` if at root. If there is a `base` tag in the `head`, its value will be **ignored**. |
51+
52+
### Examples
53+
54+
55+
```js
56+
// at https://example.com/folder
57+
createWebHashHistory() // gives a url of `https://example.com/folder#`
58+
createWebHashHistory('/folder/') // gives a url of `https://example.com/folder/#`
59+
// if the `#` is provided in the base, it won't be added by `createWebHashHistory`
60+
createWebHashHistory('/folder/#/app/') // gives a url of `https://example.com/folder/#/app/`
61+
// you should avoid doing this because it changes the original url and breaks copying urls
62+
createWebHashHistory('/other-folder/') // gives a url of `https://example.com/other-folder/#`
63+
64+
// at file:///usr/etc/folder/index.html
65+
// for locations with no `host`, the base is ignored
66+
createWebHashHistory('/iAmIgnored') // gives a url of `file:///usr/etc/folder/index.html#`
67+
```
68+
69+
70+
## createWebHistory
71+
72+
## isNavigationFailure
73+
74+
## isNavigationFailure
75+
76+
## onBeforeRouteLeave
77+
78+
Add a navigation guard that triggers whenever the component for the current ___location is about to be left. Similar to but can be used in any component. The guard is removed when the component is unmounted.
79+
80+
**Signature:**
81+
```typescript
82+
export declare function onBeforeRouteLeave(leaveGuard: NavigationGuard): void;
83+
```
84+
85+
### Parameters
86+
87+
| Parameter | Type | Description |
88+
| --- | --- | --- |
89+
| leaveGuard | NavigationGuard | [NavigationGuard](./vue-router-interface#navigationguard) |
90+
91+
## onBeforeRouteUpdate
92+
93+
Add a navigation guard that triggers whenever the current ___location is about to be updated. Similar to but can be used in any component. The guard is removed when the component is unmounted.
94+
95+
**Signature:**
96+
```typescript
97+
export declare function onBeforeRouteUpdate(updateGuard: NavigationGuard): void;
98+
```
99+
100+
### Parameters
101+
102+
| Parameter | Type | Description |
103+
| --- | --- | --- |
104+
| updateGuard | NavigationGuard | [NavigationGuard](./vue-router-interface#navigationguard) |
105+
106+
## parseQuery
107+
108+
Transforms a queryString into a [LocationQuery](./vue-router-typealias#locationquery) object. Accept both, a version with the leading `?` and without Should work as URLSearchParams
109+
110+
**Signature:**
111+
```typescript
112+
export declare function parseQuery(search: string): LocationQuery;
113+
```
114+
115+
### Parameters
116+
117+
| Parameter | Type | Description |
118+
| --- | --- | --- |
119+
| search | string | search string to parse |
120+
121+
### Returns
122+
123+
a query object
124+
125+
## stringifyQuery
126+
127+
Stringifies a [LocationQueryRaw](./vue-router-typealias#locationqueryraw) object. Like `URLSearchParams`, it doesn't prepend a `?`
128+
129+
**Signature:**
130+
```typescript
131+
export declare function stringifyQuery(query: LocationQueryRaw): string;
132+
```
133+
134+
### Parameters
135+
136+
| Parameter | Type | Description |
137+
| --- | --- | --- |
138+
| query | LocationQueryRaw | query object to stringify |
139+
140+
### Returns
141+
142+
string version of the query without the leading `?`
143+
144+
## useLink
145+
146+
## useRoute
147+
148+
## useRouter
149+

0 commit comments

Comments
 (0)