Skip to content

@pinia/root / pinia / SetupStoreDefinition

SetupStoreDefinition()<Id, SS> ​

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

See ​

StoreDefinition

Extends ​

Type Parameters ​

• Id extends string

• SS

ts
interface SetupStoreDefinition(pinia?, hot?): Store<Id, _ExtractStateFromSetupStore<SS>, _ExtractGettersFromSetupStore<SS>, _ExtractActionsFromSetupStore<SS>>

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 ​

• pinia?: null | Pinia

Pinia instance to retrieve the store

• hot?: StoreGeneric

dev only hot module replacement

Returns ​

Store<Id, _ExtractStateFromSetupStore<SS>, _ExtractGettersFromSetupStore<SS>, _ExtractActionsFromSetupStore<SS>>

See ​

StoreDefinition

Properties ​

$id ​

ts
$id: Id;

Id of the store. Used by map helpers.

Inherited from ​

StoreDefinition.$id

Released under the MIT License.