Skip to content

Commit

Permalink
docs(svelte-query): Auto-generate reference docs (#7751)
Browse files Browse the repository at this point in the history
* docs(svelte-query): Auto-generate reference docs

* Fix knip, update exclude
  • Loading branch information
lachlancollins authored Jul 18, 2024
1 parent 81ca333 commit 13817e9
Show file tree
Hide file tree
Showing 43 changed files with 1,556 additions and 127 deletions.
17 changes: 17 additions & 0 deletions docs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,23 @@
"to": "framework/solid/reference/createQuery"
}
]
},
{
"label": "svelte",
"children": [
{
"label": "Svelte Reference",
"to": "framework/svelte/reference/index"
},
{
"label": "Functions / createQuery",
"to": "framework/svelte/reference/createquery"
},
{
"label": "Functions / createMutation",
"to": "framework/svelte/reference/createmutation"
}
]
}
]
},
Expand Down
27 changes: 27 additions & 0 deletions docs/framework/svelte/reference/createbasemutationresult.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Type Alias: CreateBaseMutationResult\<TData, TError, TVariables, TContext\>

```ts
type CreateBaseMutationResult<TData, TError, TVariables, TContext>: Override<MutationObserverResult<TData, TError, TVariables, TContext>, object> & object;
```

## Type declaration

### mutateAsync

```ts
mutateAsync: CreateMutateAsyncFunction<TData, TError, TVariables, TContext>
```

## Type Parameters

**TData** = `unknown`

**TError** = `DefaultError`

**TVariables** = `unknown`

**TContext** = `unknown`

## Defined in

[packages/svelte-query/src/types.ts:113](https://github.com/TanStack/query/blob/81ca3332486f7b98502d4f5ea50588d88a80f59b/packages/svelte-query/src/types.ts#L113)
23 changes: 23 additions & 0 deletions docs/framework/svelte/reference/createbasequeryoptions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Type Alias: CreateBaseQueryOptions\<TQueryFnData, TError, TData, TQueryData, TQueryKey\>

```ts
type CreateBaseQueryOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>: QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>;
```

Options for createBaseQuery

## Type Parameters

**TQueryFnData** = `unknown`

**TError** = `DefaultError`

**TData** = `TQueryFnData`

**TQueryData** = `TQueryFnData`

**TQueryKey** _extends_ `QueryKey` = `QueryKey`

## Defined in

[packages/svelte-query/src/types.ts:23](https://github.com/TanStack/query/blob/81ca3332486f7b98502d4f5ea50588d88a80f59b/packages/svelte-query/src/types.ts#L23)
17 changes: 17 additions & 0 deletions docs/framework/svelte/reference/createbasequeryresult.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Type Alias: CreateBaseQueryResult\<TData, TError\>

```ts
type CreateBaseQueryResult<TData, TError>: Readable<QueryObserverResult<TData, TError>>;
```

Result from createBaseQuery

## Type Parameters

**TData** = `unknown`

**TError** = `DefaultError`

## Defined in

[packages/svelte-query/src/types.ts:32](https://github.com/TanStack/query/blob/81ca3332486f7b98502d4f5ea50588d88a80f59b/packages/svelte-query/src/types.ts#L32)
37 changes: 37 additions & 0 deletions docs/framework/svelte/reference/createinfinitequery.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Function: createInfiniteQuery()

```ts
function createInfiniteQuery<
TQueryFnData,
TError,
TData,
TQueryKey,
TPageParam,
>(options, queryClient?): CreateInfiniteQueryResult<TData, TError>
```

## Type Parameters

**TQueryFnData**

**TError** = `Error`

**TData** = `InfiniteData`\<`TQueryFnData`, `unknown`\>

**TQueryKey** _extends_ `QueryKey` = `QueryKey`

**TPageParam** = `unknown`

## Parameters

**options**: [`StoreOrVal`](storeorval.md)\<[`CreateInfiniteQueryOptions`](createinfinitequeryoptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryFnData`, `TQueryKey`, `TPageParam`\>\>

**queryClient?**: `QueryClient`

## Returns

[`CreateInfiniteQueryResult`](createinfinitequeryresult.md)\<`TData`, `TError`\>

## Defined in

[packages/svelte-query/src/createInfiniteQuery.ts:16](https://github.com/TanStack/query/blob/81ca3332486f7b98502d4f5ea50588d88a80f59b/packages/svelte-query/src/createInfiniteQuery.ts#L16)
25 changes: 25 additions & 0 deletions docs/framework/svelte/reference/createinfinitequeryoptions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Type Alias: CreateInfiniteQueryOptions\<TQueryFnData, TError, TData, TQueryData, TQueryKey, TPageParam\>

```ts
type CreateInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey, TPageParam>: InfiniteQueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey, TPageParam>;
```

Options for createInfiniteQuery

## Type Parameters

**TQueryFnData** = `unknown`

**TError** = `DefaultError`

**TData** = `TQueryFnData`

**TQueryData** = `TQueryFnData`

**TQueryKey** _extends_ `QueryKey` = `QueryKey`

**TPageParam** = `unknown`

## Defined in

[packages/svelte-query/src/types.ts:52](https://github.com/TanStack/query/blob/81ca3332486f7b98502d4f5ea50588d88a80f59b/packages/svelte-query/src/types.ts#L52)
17 changes: 17 additions & 0 deletions docs/framework/svelte/reference/createinfinitequeryresult.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Type Alias: CreateInfiniteQueryResult\<TData, TError\>

```ts
type CreateInfiniteQueryResult<TData, TError>: Readable<InfiniteQueryObserverResult<TData, TError>>;
```

Result from createInfiniteQuery

## Type Parameters

**TData** = `unknown`

**TError** = `DefaultError`

## Defined in

[packages/svelte-query/src/types.ts:69](https://github.com/TanStack/query/blob/81ca3332486f7b98502d4f5ea50588d88a80f59b/packages/svelte-query/src/types.ts#L69)
19 changes: 19 additions & 0 deletions docs/framework/svelte/reference/createmutateasyncfunction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Type Alias: CreateMutateAsyncFunction\<TData, TError, TVariables, TContext\>

```ts
type CreateMutateAsyncFunction<TData, TError, TVariables, TContext>: MutateFunction<TData, TError, TVariables, TContext>;
```

## Type Parameters

**TData** = `unknown`

**TError** = `DefaultError`

**TVariables** = `void`

**TContext** = `unknown`

## Defined in

[packages/svelte-query/src/types.ts:106](https://github.com/TanStack/query/blob/81ca3332486f7b98502d4f5ea50588d88a80f59b/packages/svelte-query/src/types.ts#L106)
27 changes: 27 additions & 0 deletions docs/framework/svelte/reference/createmutatefunction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Type Alias: CreateMutateFunction()\<TData, TError, TVariables, TContext\>

```ts
type CreateMutateFunction<TData, TError, TVariables, TContext>: (...args) => void;
```

## Type Parameters

**TData** = `unknown`

**TError** = `DefaultError`

**TVariables** = `void`

**TContext** = `unknown`

## Parameters

• ...**args**: `Parameters`\<`MutateFunction`\<`TData`, `TError`, `TVariables`, `TContext`\>\>

## Returns

`void`

## Defined in

[packages/svelte-query/src/types.ts:97](https://github.com/TanStack/query/blob/81ca3332486f7b98502d4f5ea50588d88a80f59b/packages/svelte-query/src/types.ts#L97)
32 changes: 32 additions & 0 deletions docs/framework/svelte/reference/createmutation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Function: createMutation()

```ts
function createMutation<TData, TError, TVariables, TContext>(
options,
queryClient?,
): CreateMutationResult<TData, TError, TVariables, TContext>
```

## Type Parameters

**TData** = `unknown`

**TError** = `Error`

**TVariables** = `void`

**TContext** = `unknown`

## Parameters

**options**: [`StoreOrVal`](storeorval.md)\<[`CreateMutationOptions`](createmutationoptions.md)\<`TData`, `TError`, `TVariables`, `TContext`\>\>

**queryClient?**: `QueryClient`

## Returns

[`CreateMutationResult`](createmutationresult.md)\<`TData`, `TError`, `TVariables`, `TContext`\>

## Defined in

[packages/svelte-query/src/createMutation.ts:13](https://github.com/TanStack/query/blob/81ca3332486f7b98502d4f5ea50588d88a80f59b/packages/svelte-query/src/createMutation.ts#L13)
21 changes: 21 additions & 0 deletions docs/framework/svelte/reference/createmutationoptions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Type Alias: CreateMutationOptions\<TData, TError, TVariables, TContext\>

```ts
type CreateMutationOptions<TData, TError, TVariables, TContext>: OmitKeyof<MutationObserverOptions<TData, TError, TVariables, TContext>, "_defaulted">;
```

Options for createMutation

## Type Parameters

**TData** = `unknown`

**TError** = `DefaultError`

**TVariables** = `void`

**TContext** = `unknown`

## Defined in

[packages/svelte-query/src/types.ts:87](https://github.com/TanStack/query/blob/81ca3332486f7b98502d4f5ea50588d88a80f59b/packages/svelte-query/src/types.ts#L87)
21 changes: 21 additions & 0 deletions docs/framework/svelte/reference/createmutationresult.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Type Alias: CreateMutationResult\<TData, TError, TVariables, TContext\>

```ts
type CreateMutationResult<TData, TError, TVariables, TContext>: Readable<CreateBaseMutationResult<TData, TError, TVariables, TContext>>;
```

Result from createMutation

## Type Parameters

**TData** = `unknown`

**TError** = `DefaultError`

**TVariables** = `unknown`

**TContext** = `unknown`

## Defined in

[packages/svelte-query/src/types.ts:126](https://github.com/TanStack/query/blob/81ca3332486f7b98502d4f5ea50588d88a80f59b/packages/svelte-query/src/types.ts#L126)
32 changes: 32 additions & 0 deletions docs/framework/svelte/reference/createqueries.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Function: createQueries()

```ts
function createQueries<T, TCombinedResult>(
__namedParameters,
queryClient?,
): Readable<TCombinedResult>
```

## Type Parameters

**T** _extends_ `any`[]

• **TCombinedResult** = `T` _extends_ [] ? [] : `T` _extends_ [`Head`] ? [`GetResults`\<`Head`\>] : `T` _extends_ [`Head`, `...Tail[]`] ? [`...Tail[]`] _extends_ [] ? [] : [`...Tail[]`] _extends_ [`Head`] ? [`GetResults`\<`Head`\>, `GetResults`\<`Head`\>] : [`...Tail[]`] _extends_ [`Head`, `...Tail[]`] ? [`...Tail[]`] _extends_ [] ? [] : [`...Tail[]`] _extends_ [`Head`] ? [`GetResults`\<`Head`\>, `GetResults`\<`Head`\>, `GetResults`\<`Head`\>] : [`...Tail[]`] _extends_ [`Head`, `...Tail[]`] ? [`...(...)[]`] _extends_ [] ? [] : ... _extends_ ... ? ... : ... : [`...(...)[]`] _extends_ ...[] ? ...[] : ...[] : [`...Tail[]`] _extends_ `QueryObserverOptionsForCreateQueries`\<`TQueryFnData`, `TError`, `TData`, `any`\>[] ? `QueryObserverResult`\<`unknown` _extends_ `TData` ? `TQueryFnData` : `TData`, `unknown` _extends_ `TError` ? `Error` : `TError`\>[] : `QueryObserverResult`[] : `T` _extends_ `QueryObserverOptionsForCreateQueries`\<`TQueryFnData`, `TError`, `TData`, `any`\>[] ? `QueryObserverResult`\<`unknown` _extends_ `TData` ? `TQueryFnData` : `TData`, `unknown` _extends_ `TError` ? `Error` : `TError`\>[] : `QueryObserverResult`[]

## Parameters

**\_\_namedParameters**

**\_\_namedParameters.combine?**

**\_\_namedParameters.queries?**: [`StoreOrVal`](storeorval.md)\<[`...(T extends [] ? [] : T extends [Head] ? [GetOptions<Head>] : T extends [Head, ...Tail[]] ? [...Tail[]] extends [] ? [] : [...Tail[]] extends [Head] ? [GetOptions<Head>, GetOptions<Head>] : [...Tail[]] extends [Head, ...Tail[]] ? [...(...)[]] extends [] ? [] : (...) extends (...) ? (...) : (...) : readonly (...)[] extends [...(...)[]] ? [...(...)[]] : (...) extends (...) ? (...) : (...) : readonly unknown[] extends T ? T : T extends QueryObserverOptionsForCreateQueries<TQueryFnData, TError, TData, TQueryKey>[] ? QueryObserverOptionsForCreateQueries<TQueryFnData, TError, TData, TQueryKey>[] : QueryObserverOptionsForCreateQueries<unknown, Error, unknown, QueryKey>[])[]`]\>

**queryClient?**: `QueryClient`

## Returns

`Readable`\<`TCombinedResult`\>

## Defined in

[packages/svelte-query/src/createQueries.ts:186](https://github.com/TanStack/query/blob/81ca3332486f7b98502d4f5ea50588d88a80f59b/packages/svelte-query/src/createQueries.ts#L186)
Loading

0 comments on commit 13817e9

Please sign in to comment.