From f4712ae9f01a06c4c237f353abc2637c7f43ba72 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Fri, 26 Jul 2024 14:44:18 +0200 Subject: [PATCH] docs: api --- packages/docs/api/pinia/functions/mapActions.md | 16 ++++++++++++++++ packages/docs/api/pinia/functions/mapGetters.md | 8 ++++++++ packages/docs/api/pinia/functions/mapState.md | 16 ++++++++++++++++ .../docs/api/pinia/functions/mapWritableState.md | 16 ++++++++++++++++ .../docs/api/pinia/functions/setActivePinia.md | 12 ++++++++++++ .../interfaces/DefineStoreOptionsInPlugin.md | 8 ++++---- .../docs/api/pinia/interfaces/PiniaPlugin.md | 3 +-- .../api/pinia/interfaces/SetupStoreDefinition.md | 8 +++++++- .../docs/api/pinia/interfaces/StoreDefinition.md | 2 +- 9 files changed, 81 insertions(+), 8 deletions(-) diff --git a/packages/docs/api/pinia/functions/mapActions.md b/packages/docs/api/pinia/functions/mapActions.md index 409c503bd7..927e272bff 100644 --- a/packages/docs/api/pinia/functions/mapActions.md +++ b/packages/docs/api/pinia/functions/mapActions.md @@ -57,6 +57,14 @@ object to define new names for the actions [`_MapActionsObjectReturn`](../type-aliases/MapActionsObjectReturn.md)\<`A`, `KeyMapper`\> +### Param + +store to map from + +### Param + +array or object + ### Example ```js @@ -106,6 +114,14 @@ array of action names to map [`_MapActionsReturn`](../type-aliases/MapActionsReturn.md)\<`A`\> +### Param + +store to map from + +### Param + +array or object + ### Example ```js diff --git a/packages/docs/api/pinia/functions/mapGetters.md b/packages/docs/api/pinia/functions/mapGetters.md index 28c8e52480..75fe09bd1d 100644 --- a/packages/docs/api/pinia/functions/mapGetters.md +++ b/packages/docs/api/pinia/functions/mapGetters.md @@ -54,6 +54,10 @@ object of state properties or getters [`_MapStateObjectReturn`](../type-aliases/MapStateObjectReturn.md)\<`Id`, `S`, `G`, `A`, `KeyMapper`\> +### Deprecated + +use `mapState()` instead. + ### Example ```js @@ -113,6 +117,10 @@ array of state properties or getters [`_MapStateReturn`](../type-aliases/MapStateReturn.md)\<`S`, `G`, `Keys`\> +### Deprecated + +use `mapState()` instead. + ### Example ```js diff --git a/packages/docs/api/pinia/functions/mapState.md b/packages/docs/api/pinia/functions/mapState.md index 0670d08ce2..17983169a3 100644 --- a/packages/docs/api/pinia/functions/mapState.md +++ b/packages/docs/api/pinia/functions/mapState.md @@ -60,6 +60,14 @@ object of state properties or getters [`_MapStateObjectReturn`](../type-aliases/MapStateObjectReturn.md)\<`Id`, `S`, `G`, `A`, `KeyMapper`\> +### Param + +store to map from + +### Param + +array or object + ### Example ```js @@ -119,6 +127,14 @@ array of state properties or getters [`_MapStateReturn`](../type-aliases/MapStateReturn.md)\<`S`, `G`, `Keys`\> +### Param + +store to map from + +### Param + +array or object + ### Example ```js diff --git a/packages/docs/api/pinia/functions/mapWritableState.md b/packages/docs/api/pinia/functions/mapWritableState.md index caf59c3be3..c8b572d022 100644 --- a/packages/docs/api/pinia/functions/mapWritableState.md +++ b/packages/docs/api/pinia/functions/mapWritableState.md @@ -56,6 +56,14 @@ object of state properties [`_MapWritableStateObjectReturn`](../type-aliases/MapWritableStateObjectReturn.md)\<`S`, `KeyMapper`\> +### Param + +store to map from + +### Param + +array or object + ## mapWritableState(useStore, keys) > **mapWritableState**\<`Id`, `S`, `G`, `A`, `Keys`\>(`useStore`, `keys`): `{ [K in Keys]: Object }` @@ -89,3 +97,11 @@ array of state properties ### Returns `{ [K in Keys]: Object }` + +### Param + +store to map from + +### Param + +array or object diff --git a/packages/docs/api/pinia/functions/setActivePinia.md b/packages/docs/api/pinia/functions/setActivePinia.md index 110d134ec8..1d97b0302e 100644 --- a/packages/docs/api/pinia/functions/setActivePinia.md +++ b/packages/docs/api/pinia/functions/setActivePinia.md @@ -32,6 +32,10 @@ actions and getters [`Pinia`](../interfaces/Pinia.md) +### Param + +Pinia instance + ## setActivePinia(pinia) > **setActivePinia**(`pinia`): `undefined` @@ -47,6 +51,10 @@ actions and getters `undefined` +### Param + +Pinia instance + ## setActivePinia(pinia) > **setActivePinia**(`pinia`): `undefined` \| [`Pinia`](../interfaces/Pinia.md) @@ -61,3 +69,7 @@ actions and getters ### Returns `undefined` \| [`Pinia`](../interfaces/Pinia.md) + +### Param + +Pinia instance diff --git a/packages/docs/api/pinia/interfaces/DefineStoreOptionsInPlugin.md b/packages/docs/api/pinia/interfaces/DefineStoreOptionsInPlugin.md index 65cc86a3d2..543a0f0b9a 100644 --- a/packages/docs/api/pinia/interfaces/DefineStoreOptionsInPlugin.md +++ b/packages/docs/api/pinia/interfaces/DefineStoreOptionsInPlugin.md @@ -88,10 +88,6 @@ initialState `void` -#### Inherited from - -`Omit.hydrate` - #### Example If in your `state`, you use any `customRef`s, any `computed`s, or any `ref`s that have a different value on @@ -109,3 +105,7 @@ const useStore = defineStore('main', { } }) ``` + +#### Inherited from + +`Omit.hydrate` diff --git a/packages/docs/api/pinia/interfaces/PiniaPlugin.md b/packages/docs/api/pinia/interfaces/PiniaPlugin.md index 2f1c9b38a8..598048351d 100644 --- a/packages/docs/api/pinia/interfaces/PiniaPlugin.md +++ b/packages/docs/api/pinia/interfaces/PiniaPlugin.md @@ -14,8 +14,7 @@ Plugin to extend every store. > **PiniaPlugin**(`context`): `void` \| `Partial`\<[`PiniaCustomProperties`](PiniaCustomProperties.md)\<`string`, [`StateTree`](../type-aliases/StateTree.md), [`_GettersTree`](../type-aliases/GettersTree.md)\<[`StateTree`](../type-aliases/StateTree.md)\>, [`_ActionsTree`](../type-aliases/ActionsTree.md)\> & [`PiniaCustomStateProperties`](PiniaCustomStateProperties.md)\<[`StateTree`](../type-aliases/StateTree.md)\>\> -Plugin to extend every store. Returns an object to extend the store or -nothing. +Plugin to extend every store. ## Parameters diff --git a/packages/docs/api/pinia/interfaces/SetupStoreDefinition.md b/packages/docs/api/pinia/interfaces/SetupStoreDefinition.md index 1288a751e0..494af3fbd3 100644 --- a/packages/docs/api/pinia/interfaces/SetupStoreDefinition.md +++ b/packages/docs/api/pinia/interfaces/SetupStoreDefinition.md @@ -30,7 +30,9 @@ Return type of `defineStore()` with a setup function. > **SetupStoreDefinition**(`pinia`?, `hot`?): [`Store`](../type-aliases/Store.md)\<`Id`, [`_ExtractStateFromSetupStore`](../type-aliases/ExtractStateFromSetupStore.md)\<`SS`\>, [`_ExtractGettersFromSetupStore`](../type-aliases/ExtractGettersFromSetupStore.md)\<`SS`\>, [`_ExtractActionsFromSetupStore`](../type-aliases/ExtractActionsFromSetupStore.md)\<`SS`\>\> -Returns a store, creates it if necessary. +Return type of `defineStore()` with a setup function. +- `Id` is a string literal of the store's name +- `SS` is the return type of the setup function ## Parameters @@ -46,6 +48,10 @@ dev only hot module replacement [`Store`](../type-aliases/Store.md)\<`Id`, [`_ExtractStateFromSetupStore`](../type-aliases/ExtractStateFromSetupStore.md)\<`SS`\>, [`_ExtractGettersFromSetupStore`](../type-aliases/ExtractGettersFromSetupStore.md)\<`SS`\>, [`_ExtractActionsFromSetupStore`](../type-aliases/ExtractActionsFromSetupStore.md)\<`SS`\>\> +## See + +[StoreDefinition](StoreDefinition.md) + ## Properties ### $id diff --git a/packages/docs/api/pinia/interfaces/StoreDefinition.md b/packages/docs/api/pinia/interfaces/StoreDefinition.md index f046eef8fd..d58231ac87 100644 --- a/packages/docs/api/pinia/interfaces/StoreDefinition.md +++ b/packages/docs/api/pinia/interfaces/StoreDefinition.md @@ -28,7 +28,7 @@ Return type of `defineStore()`. Function that allows instantiating a store. > **StoreDefinition**(`pinia`?, `hot`?): [`Store`](../type-aliases/Store.md)\<`Id`, `S`, `G`, `A`\> -Returns a store, creates it if necessary. +Return type of `defineStore()`. Function that allows instantiating a store. ## Parameters