From c74965a0e56662bd77176add46ec2bdbec79bc52 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Tue, 16 Apr 2024 17:31:23 +0200 Subject: [PATCH] docs: api --- .../docs/api/interfaces/pinia.DefineStoreOptions.md | 3 --- .../interfaces/pinia.DefineStoreOptionsInPlugin.md | 3 --- .../pinia._StoreOnActionListenerContext.md | 12 +++--------- .../api/interfaces/pinia_testing.TestingOptions.md | 4 ---- packages/docs/api/modules/pinia.md | 13 +++++++------ packages/docs/public/vue-cert-logo.svg | 5 +++++ 6 files changed, 15 insertions(+), 25 deletions(-) create mode 100644 packages/docs/public/vue-cert-logo.svg diff --git a/packages/docs/api/interfaces/pinia.DefineStoreOptions.md b/packages/docs/api/interfaces/pinia.DefineStoreOptions.md index 8c769ec1..6d43bc67 100644 --- a/packages/docs/api/interfaces/pinia.DefineStoreOptions.md +++ b/packages/docs/api/interfaces/pinia.DefineStoreOptions.md @@ -67,9 +67,6 @@ correct typings! ▸ (): `S` -Function to create a fresh state. **Must be an arrow function** to ensure -correct typings! - ##### Returns `S` diff --git a/packages/docs/api/interfaces/pinia.DefineStoreOptionsInPlugin.md b/packages/docs/api/interfaces/pinia.DefineStoreOptionsInPlugin.md index c5634ecd..d7fafe9f 100644 --- a/packages/docs/api/interfaces/pinia.DefineStoreOptionsInPlugin.md +++ b/packages/docs/api/interfaces/pinia.DefineStoreOptionsInPlugin.md @@ -60,9 +60,6 @@ correct typings! ▸ (): `S` -Function to create a fresh state. **Must be an arrow function** to ensure -correct typings! - ##### Returns `S` diff --git a/packages/docs/api/interfaces/pinia._StoreOnActionListenerContext.md b/packages/docs/api/interfaces/pinia._StoreOnActionListenerContext.md index abd1608e..4fd238ec 100644 --- a/packages/docs/api/interfaces/pinia._StoreOnActionListenerContext.md +++ b/packages/docs/api/interfaces/pinia._StoreOnActionListenerContext.md @@ -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. @@ -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 @@ -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 @@ -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 | diff --git a/packages/docs/api/interfaces/pinia_testing.TestingOptions.md b/packages/docs/api/interfaces/pinia_testing.TestingOptions.md index 6b18f139..3d3db832 100644 --- a/packages/docs/api/interfaces/pinia_testing.TestingOptions.md +++ b/packages/docs/api/interfaces/pinia_testing.TestingOptions.md @@ -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 | diff --git a/packages/docs/api/modules/pinia.md b/packages/docs/api/modules/pinia.md index 0cb48eda..ec780193 100644 --- a/packages/docs/api/modules/pinia.md +++ b/packages/docs/api/modules/pinia.md @@ -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`\> = {} | @@ -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` | ___ @@ -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 @@ -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`\> | @@ -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` | @@ -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`\> | @@ -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` | diff --git a/packages/docs/public/vue-cert-logo.svg b/packages/docs/public/vue-cert-logo.svg new file mode 100644 index 00000000..e01247d1 --- /dev/null +++ b/packages/docs/public/vue-cert-logo.svg @@ -0,0 +1,5 @@ + -- 2.47.3