Skip to content

Commit 44a72ce

Browse files
using same api generation technique from router
1 parent f2f8a30 commit 44a72ce

56 files changed

Lines changed: 1763 additions & 9 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/.vitepress/config.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { defineConfig } from 'vitepress'
2+
import typedocSidebar from '../api/typedoc-sidebar.json'
23

34
// https://vitepress.dev/reference/site-config
45
export default defineConfig({
@@ -24,14 +25,7 @@ export default defineConfig({
2425
},
2526

2627
sidebar: {
27-
'/api/': [
28-
{
29-
text: 'API Reference',
30-
items: [
31-
{ text: 'Overview', link: '/api/index' },
32-
]
33-
}
34-
],
28+
'/api/': typedocSidebar,
3529
'/': [
3630
{
3731
text: 'Getting Started',
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Functions: createQueryClient()
2+
3+
```ts
4+
function createQueryClient(options?): QueryClient;
5+
```
6+
7+
## Parameters
8+
9+
| Parameter | Type |
10+
| ------ | ------ |
11+
| `options?` | [`ClientOptions`](../types/ClientOptions.md) |
12+
13+
## Returns
14+
15+
[`QueryClient`](../types/QueryClient.md)

docs/api/functions/query.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Functions: query
2+
3+
```ts
4+
const query: QueryFunction;
5+
```

docs/api/functions/tag.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Functions: tag()
2+
3+
## Call Signature
4+
5+
```ts
6+
function tag<TData>(): QueryTag<TData>;
7+
```
8+
9+
### Type Parameters
10+
11+
| Type Parameter | Default type |
12+
| ------ | ------ |
13+
| `TData` | *typeof* `unset` |
14+
15+
### Returns
16+
17+
[`QueryTag`](../types/QueryTag.md)\<`TData`\>
18+
19+
## Call Signature
20+
21+
```ts
22+
function tag<TData, TInput>(callback): QueryTagFactory<TData, TInput>;
23+
```
24+
25+
### Type Parameters
26+
27+
| Type Parameter | Default type |
28+
| ------ | ------ |
29+
| `TData` | *typeof* `unset` |
30+
| `TInput` | `unknown` |
31+
32+
### Parameters
33+
34+
| Parameter | Type |
35+
| ------ | ------ |
36+
| `callback` | [`QueryTagCallback`](../types/QueryTagCallback.md)\<`TInput`\> |
37+
38+
### Returns
39+
40+
[`QueryTagFactory`](../types/QueryTagFactory.md)\<`TData`, `TInput`\>

docs/api/functions/useQuery.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Functions: useQuery
2+
3+
```ts
4+
const useQuery: QueryComposition;
5+
```

docs/api/index.md

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,58 @@
1-
# API
1+
# @kitbag/query
2+
3+
## Functions
4+
5+
- [createQueryClient](functions/createQueryClient.md)
6+
- [tag](functions/tag.md)
7+
8+
## Types
9+
10+
- [AwaitedMutation](types/AwaitedMutation.md)
11+
- [AwaitedQuery](types/AwaitedQuery.md)
12+
- [ClientOptions](types/ClientOptions.md)
13+
- [DefinedMutation](types/DefinedMutation.md)
14+
- [DefinedMutationComposition](types/DefinedMutationComposition.md)
15+
- [DefinedMutationFunction](types/DefinedMutationFunction.md)
16+
- [DefinedQuery](types/DefinedQuery.md)
17+
- [DefinedQueryComposition](types/DefinedQueryComposition.md)
18+
- [DefinedQueryFunction](types/DefinedQueryFunction.md)
19+
- [DefineMutation](types/DefineMutation.md)
20+
- [DefineQuery](types/DefineQuery.md)
21+
- [Mutation](types/Mutation.md)
22+
- [MutationAction](types/MutationAction.md)
23+
- [MutationComposition](types/MutationComposition.md)
24+
- [MutationData](types/MutationData.md)
25+
- [MutationFunction](types/MutationFunction.md)
26+
- [MutationOptions](types/MutationOptions.md)
27+
- [MutationTags](types/MutationTags.md)
28+
- [MutationTagsAfterContext](types/MutationTagsAfterContext.md)
29+
- [MutationTagsBeforeContext](types/MutationTagsBeforeContext.md)
30+
- [MutationTagsContext](types/MutationTagsContext.md)
31+
- [MutationTagsType](types/MutationTagsType.md)
32+
- [OnErrorContext](types/OnErrorContext.md)
33+
- [OnExecuteContext](types/OnExecuteContext.md)
34+
- [OnSuccessContext](types/OnSuccessContext.md)
35+
- [Query](types/Query.md)
36+
- [QueryAction](types/QueryAction.md)
37+
- [QueryActionArgs](types/QueryActionArgs.md)
38+
- [QueryClient](types/QueryClient.md)
39+
- [QueryComposition](types/QueryComposition.md)
40+
- [QueryData](types/QueryData.md)
41+
- [QueryDataSetter](types/QueryDataSetter.md)
42+
- [QueryFunction](types/QueryFunction.md)
43+
- [QueryOptions](types/QueryOptions.md)
44+
- [QueryTag](types/QueryTag.md)
45+
- [QueryTagCallback](types/QueryTagCallback.md)
46+
- [QueryTagFactory](types/QueryTagFactory.md)
47+
- [QueryTags](types/QueryTags.md)
48+
- [QueryTagType](types/QueryTagType.md)
49+
- [RefreshQueryData](types/RefreshQueryData.md)
50+
- [SetQueryData](types/SetQueryData.md)
51+
- [SetQueryDataAfterContext](types/SetQueryDataAfterContext.md)
52+
- [SetQueryDataBeforeContext](types/SetQueryDataBeforeContext.md)
53+
- [UseQueryOptions](types/UseQueryOptions.md)
54+
55+
## Variables
56+
57+
- [query](functions/query.md)
58+
- [useQuery](functions/useQuery.md)

docs/api/typedoc-sidebar.json

Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
[
2+
{
3+
"text": "Functions",
4+
"collapsed": true,
5+
"items": [
6+
{
7+
"text": "createQueryClient",
8+
"link": "/api/functions/createQueryClient.md"
9+
},
10+
{
11+
"text": "tag",
12+
"link": "/api/functions/tag.md"
13+
}
14+
]
15+
},
16+
{
17+
"text": "Types",
18+
"collapsed": true,
19+
"items": [
20+
{
21+
"text": "AwaitedMutation",
22+
"link": "/api/types/AwaitedMutation.md"
23+
},
24+
{
25+
"text": "AwaitedQuery",
26+
"link": "/api/types/AwaitedQuery.md"
27+
},
28+
{
29+
"text": "ClientOptions",
30+
"link": "/api/types/ClientOptions.md"
31+
},
32+
{
33+
"text": "DefinedMutation",
34+
"link": "/api/types/DefinedMutation.md"
35+
},
36+
{
37+
"text": "DefinedMutationComposition",
38+
"link": "/api/types/DefinedMutationComposition.md"
39+
},
40+
{
41+
"text": "DefinedMutationFunction",
42+
"link": "/api/types/DefinedMutationFunction.md"
43+
},
44+
{
45+
"text": "DefinedQuery",
46+
"link": "/api/types/DefinedQuery.md"
47+
},
48+
{
49+
"text": "DefinedQueryComposition",
50+
"link": "/api/types/DefinedQueryComposition.md"
51+
},
52+
{
53+
"text": "DefinedQueryFunction",
54+
"link": "/api/types/DefinedQueryFunction.md"
55+
},
56+
{
57+
"text": "DefineMutation",
58+
"link": "/api/types/DefineMutation.md"
59+
},
60+
{
61+
"text": "DefineQuery",
62+
"link": "/api/types/DefineQuery.md"
63+
},
64+
{
65+
"text": "Mutation",
66+
"link": "/api/types/Mutation.md"
67+
},
68+
{
69+
"text": "MutationAction",
70+
"link": "/api/types/MutationAction.md"
71+
},
72+
{
73+
"text": "MutationComposition",
74+
"link": "/api/types/MutationComposition.md"
75+
},
76+
{
77+
"text": "MutationData",
78+
"link": "/api/types/MutationData.md"
79+
},
80+
{
81+
"text": "MutationFunction",
82+
"link": "/api/types/MutationFunction.md"
83+
},
84+
{
85+
"text": "MutationOptions",
86+
"link": "/api/types/MutationOptions.md"
87+
},
88+
{
89+
"text": "MutationTags",
90+
"link": "/api/types/MutationTags.md"
91+
},
92+
{
93+
"text": "MutationTagsAfterContext",
94+
"link": "/api/types/MutationTagsAfterContext.md"
95+
},
96+
{
97+
"text": "MutationTagsBeforeContext",
98+
"link": "/api/types/MutationTagsBeforeContext.md"
99+
},
100+
{
101+
"text": "MutationTagsContext",
102+
"link": "/api/types/MutationTagsContext.md"
103+
},
104+
{
105+
"text": "MutationTagsType",
106+
"link": "/api/types/MutationTagsType.md"
107+
},
108+
{
109+
"text": "OnErrorContext",
110+
"link": "/api/types/OnErrorContext.md"
111+
},
112+
{
113+
"text": "OnExecuteContext",
114+
"link": "/api/types/OnExecuteContext.md"
115+
},
116+
{
117+
"text": "OnSuccessContext",
118+
"link": "/api/types/OnSuccessContext.md"
119+
},
120+
{
121+
"text": "Query",
122+
"link": "/api/types/Query.md"
123+
},
124+
{
125+
"text": "QueryAction",
126+
"link": "/api/types/QueryAction.md"
127+
},
128+
{
129+
"text": "QueryActionArgs",
130+
"link": "/api/types/QueryActionArgs.md"
131+
},
132+
{
133+
"text": "QueryClient",
134+
"link": "/api/types/QueryClient.md"
135+
},
136+
{
137+
"text": "QueryComposition",
138+
"link": "/api/types/QueryComposition.md"
139+
},
140+
{
141+
"text": "QueryData",
142+
"link": "/api/types/QueryData.md"
143+
},
144+
{
145+
"text": "QueryDataSetter",
146+
"link": "/api/types/QueryDataSetter.md"
147+
},
148+
{
149+
"text": "QueryFunction",
150+
"link": "/api/types/QueryFunction.md"
151+
},
152+
{
153+
"text": "QueryOptions",
154+
"link": "/api/types/QueryOptions.md"
155+
},
156+
{
157+
"text": "QueryTag",
158+
"link": "/api/types/QueryTag.md"
159+
},
160+
{
161+
"text": "QueryTagCallback",
162+
"link": "/api/types/QueryTagCallback.md"
163+
},
164+
{
165+
"text": "QueryTagFactory",
166+
"link": "/api/types/QueryTagFactory.md"
167+
},
168+
{
169+
"text": "QueryTags",
170+
"link": "/api/types/QueryTags.md"
171+
},
172+
{
173+
"text": "QueryTagType",
174+
"link": "/api/types/QueryTagType.md"
175+
},
176+
{
177+
"text": "RefreshQueryData",
178+
"link": "/api/types/RefreshQueryData.md"
179+
},
180+
{
181+
"text": "SetQueryData",
182+
"link": "/api/types/SetQueryData.md"
183+
},
184+
{
185+
"text": "SetQueryDataAfterContext",
186+
"link": "/api/types/SetQueryDataAfterContext.md"
187+
},
188+
{
189+
"text": "SetQueryDataBeforeContext",
190+
"link": "/api/types/SetQueryDataBeforeContext.md"
191+
},
192+
{
193+
"text": "UseQueryOptions",
194+
"link": "/api/types/UseQueryOptions.md"
195+
}
196+
]
197+
},
198+
{
199+
"text": "Variables",
200+
"collapsed": true,
201+
"items": [
202+
{
203+
"text": "query",
204+
"link": "/api/functions/query.md"
205+
},
206+
{
207+
"text": "useQuery",
208+
"link": "/api/functions/useQuery.md"
209+
}
210+
]
211+
}
212+
]

docs/api/types/AwaitedMutation.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Types: AwaitedMutation\<TAction\>
2+
3+
```ts
4+
type AwaitedMutation<TAction> = object;
5+
```
6+
7+
## Type Parameters
8+
9+
| Type Parameter |
10+
| ------ |
11+
| `TAction` *extends* [`MutationAction`](MutationAction.md) |
12+
13+
## Properties
14+
15+
| Property | Type |
16+
| ------ | ------ |
17+
| <a id="data"></a> `data` | [`MutationData`](MutationData.md)\<`TAction`\> |
18+
| <a id="error"></a> `error` | `unknown` |
19+
| <a id="errored"></a> `errored` | `boolean` |
20+
| <a id="executed"></a> `executed` | `boolean` |
21+
| <a id="executing"></a> `executing` | `boolean` |

0 commit comments

Comments
 (0)