Skip to content

Commit

Permalink
docs: api
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Apr 16, 2024
1 parent a318a5e commit c74965a
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 25 deletions.
3 changes: 0 additions & 3 deletions packages/docs/api/interfaces/pinia.DefineStoreOptions.md
Expand Up @@ -67,9 +67,6 @@ correct typings!

▸ (): `S`

Function to create a fresh state. **Must be an arrow function** to ensure
correct typings!

##### Returns

`S`
Expand Down
Expand Up @@ -60,9 +60,6 @@ correct typings!

▸ (): `S`

Function to create a fresh state. **Must be an arrow function** to ensure
correct typings!

##### Returns

`S`
Expand Down
Expand Up @@ -24,7 +24,7 @@ For internal use **only**

### after

**after**: (`callback`: `A` extends `Record`\<`ActionName`, [`_Method`](../modules/pinia.md#_Method)\> ? (`resolvedReturn`: [`_Awaited`](../modules/pinia.md#_Awaited)\<`ReturnType`\<`A`[`ActionName`]\>\>) => `void` : () => `void`) => `void`
**after**: (`callback`: `A` extends `Record`\<`ActionName`, [`_Method`](../modules/pinia.md#_Method)\> ? (`resolvedReturn`: [`_Awaited`](../modules/pinia.md#_Awaited)\<`ReturnType`\<`A`\<`A`\>[`ActionName`]\>\>) => `void` : () => `void`) => `void`

Sets up a hook once the action is finished. It receives the return value
of the action, if it's a Promise, it will be unwrapped.
Expand All @@ -33,14 +33,11 @@ of the action, if it's a Promise, it will be unwrapped.

▸ (`callback`): `void`

Sets up a hook once the action is finished. It receives the return value
of the action, if it's a Promise, it will be unwrapped.

##### Parameters

| Name | Type |
| :------ | :------ |
| `callback` | `A` extends `Record`\<`ActionName`, [`_Method`](../modules/pinia.md#_Method)\> ? (`resolvedReturn`: [`_Awaited`](../modules/pinia.md#_Awaited)\<`ReturnType`\<`A`[`ActionName`]\>\>) => `void` : () => `void` |
| `callback` | `A` extends `Record`\<`ActionName`, [`_Method`](../modules/pinia.md#_Method)\> ? (`resolvedReturn`: [`_Awaited`](../modules/pinia.md#_Awaited)\<`ReturnType`\<`A`\<`A`\>[`ActionName`]\>\>) => `void` : () => `void` |

##### Returns

Expand All @@ -50,7 +47,7 @@ ___

### args

**args**: `A` extends `Record`\<`ActionName`, [`_Method`](../modules/pinia.md#_Method)\> ? `Parameters`\<`A`[`ActionName`]\> : `unknown`[]
**args**: `A` extends `Record`\<`ActionName`, [`_Method`](../modules/pinia.md#_Method)\> ? `Parameters`\<`A`\<`A`\>[`ActionName`]\> : `unknown`[]

Parameters passed to the action

Expand All @@ -75,9 +72,6 @@ stop it from propagating.

▸ (`callback`): `void`

Sets up a hook if the action fails. Return `false` to catch the error and
stop it from propagating.

##### Parameters

| Name | Type |
Expand Down
4 changes: 0 additions & 4 deletions packages/docs/api/interfaces/pinia_testing.TestingOptions.md
Expand Up @@ -22,10 +22,6 @@ with `jest.fn` in Jest projects or `vi.fn` in Vitest projects if

▸ (`fn?`): (...`args`: `any`[]) => `any`

Function used to create a spy for actions and `$patch()`. Pre-configured
with `jest.fn` in Jest projects or `vi.fn` in Vitest projects if
`globals: true` is set.

##### Parameters

| Name | Type |
Expand Down
13 changes: 7 additions & 6 deletions packages/docs/api/modules/pinia.md
Expand Up @@ -398,7 +398,7 @@ For internal use **only**
| :------ | :------ |
| `Id` | extends `string` |
| `S` | extends [`StateTree`](pinia.md#StateTree) |
| `G` | extends [`_GettersTree`](pinia.md#_GettersTree)\<`S`\> |
| `G` | extends [`_GettersTree`](pinia.md#_GettersTree)\<`S`\> \| \{ `[key: string]`: `ComputedRef`; } |
| `A` | `A` |
| `T` | extends `Record`\<`string`, keyof `S` \| keyof `G` \| (`store`: [`Store`](pinia.md#Store)\<`Id`, `S`, `G`, `A`\>) => `any`\> = {} |

Expand All @@ -415,7 +415,7 @@ For internal use **only**
| Name | Type |
| :------ | :------ |
| `S` | extends [`StateTree`](pinia.md#StateTree) |
| `G` | extends [`_GettersTree`](pinia.md#_GettersTree)\<`S`\> |
| `G` | extends [`_GettersTree`](pinia.md#_GettersTree)\<`S`\> \| \{ `[key: string]`: `ComputedRef`; } |
| `Keys` | extends keyof `S` \| keyof `G` = keyof `S` \| keyof `G` |

___
Expand Down Expand Up @@ -717,6 +717,7 @@ ___
Dispose a Pinia instance by stopping its effectScope and removing the state, plugins and stores. This is mostly
useful in tests, with both a testing pinia or a regular pinia and in applications that use multiple pinia instances.
Once disposed, the pinia instance cannot be used anymore.
#### Parameters
Expand Down Expand Up @@ -845,7 +846,7 @@ Alias for `mapState()`. You should use `mapState()` instead.
| :------ | :------ |
| `Id` | extends `string` |
| `S` | extends [`StateTree`](pinia.md#StateTree) |
| `G` | extends [`_GettersTree`](pinia.md#_GettersTree)\<`S`\> |
| `G` | extends [`_GettersTree`](pinia.md#_GettersTree)\<`S`\> \| \{ `[key: string]`: `ComputedRef`; } |
| `A` | `A` |
| `KeyMapper` | extends `Record`\<`string`, keyof `S` \| keyof `G` \| (`store`: [`Store`](pinia.md#Store)\<`Id`, `S`, `G`, `A`\>) => `any`\> |
Expand Down Expand Up @@ -874,7 +875,7 @@ Alias for `mapState()`. You should use `mapState()` instead.
| :------ | :------ |
| `Id` | extends `string` |
| `S` | extends [`StateTree`](pinia.md#StateTree) |
| `G` | extends [`_GettersTree`](pinia.md#_GettersTree)\<`S`\> |
| `G` | extends [`_GettersTree`](pinia.md#_GettersTree)\<`S`\> \| \{ `[key: string]`: `ComputedRef`; } |
| `A` | `A` |
| `Keys` | extends `string` \| `number` \| `symbol` |
Expand Down Expand Up @@ -913,7 +914,7 @@ instance via `this`, it won't be typed.
| :------ | :------ |
| `Id` | extends `string` |
| `S` | extends [`StateTree`](pinia.md#StateTree) |
| `G` | extends [`_GettersTree`](pinia.md#_GettersTree)\<`S`\> |
| `G` | extends [`_GettersTree`](pinia.md#_GettersTree)\<`S`\> \| \{ `[key: string]`: `ComputedRef`; } |
| `A` | `A` |
| `KeyMapper` | extends `Record`\<`string`, keyof `S` \| keyof `G` \| (`store`: [`Store`](pinia.md#Store)\<`Id`, `S`, `G`, `A`\>) => `any`\> |
Expand Down Expand Up @@ -965,7 +966,7 @@ of a component.
| :------ | :------ |
| `Id` | extends `string` |
| `S` | extends [`StateTree`](pinia.md#StateTree) |
| `G` | extends [`_GettersTree`](pinia.md#_GettersTree)\<`S`\> |
| `G` | extends [`_GettersTree`](pinia.md#_GettersTree)\<`S`\> \| \{ `[key: string]`: `ComputedRef`; } |
| `A` | `A` |
| `Keys` | extends `string` \| `number` \| `symbol` |
Expand Down
5 changes: 5 additions & 0 deletions packages/docs/public/vue-cert-logo.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c74965a

Please sign in to comment.