Skip to content

Commit

Permalink
docs: api
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Jul 26, 2024
1 parent ee7b4f2 commit f4712ae
Show file tree
Hide file tree
Showing 9 changed files with 81 additions and 8 deletions.
16 changes: 16 additions & 0 deletions packages/docs/api/pinia/functions/mapActions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions packages/docs/api/pinia/functions/mapGetters.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -113,6 +117,10 @@ array of state properties or getters

[`_MapStateReturn`](../type-aliases/MapStateReturn.md)\<`S`, `G`, `Keys`\>

### Deprecated

use `mapState()` instead.

### Example

```js
Expand Down
16 changes: 16 additions & 0 deletions packages/docs/api/pinia/functions/mapState.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions packages/docs/api/pinia/functions/mapWritableState.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 }`
Expand Down Expand Up @@ -89,3 +97,11 @@ array of state properties
### Returns

`{ [K in Keys]: Object }`

### Param

store to map from

### Param

array or object
12 changes: 12 additions & 0 deletions packages/docs/api/pinia/functions/setActivePinia.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ actions and getters

[`Pinia`](../interfaces/Pinia.md)

### Param

Pinia instance

## setActivePinia(pinia)

> **setActivePinia**(`pinia`): `undefined`
Expand All @@ -47,6 +51,10 @@ actions and getters

`undefined`

### Param

Pinia instance

## setActivePinia(pinia)

> **setActivePinia**(`pinia`): `undefined` \| [`Pinia`](../interfaces/Pinia.md)
Expand All @@ -61,3 +69,7 @@ actions and getters
### Returns

`undefined` \| [`Pinia`](../interfaces/Pinia.md)

### Param

Pinia instance
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -109,3 +105,7 @@ const useStore = defineStore('main', {
}
})
```

#### Inherited from

`Omit.hydrate`
3 changes: 1 addition & 2 deletions packages/docs/api/pinia/interfaces/PiniaPlugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 7 additions & 1 deletion packages/docs/api/pinia/interfaces/SetupStoreDefinition.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/api/pinia/interfaces/StoreDefinition.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit f4712ae

Please sign in to comment.