import { InjectionKey, Ref } from '@vue/composition-api'; import { StateTree, StoreWithState, StateDescriptor, PiniaCustomProperties, GettersTree, Store, DefineStoreOptions, ActionsTree, PiniaCustomStateProperties } from './types'; import type Vue from 'vue'; /** * The api needs more work we must be able to use the store easily in any * function by calling `useStore` to get the store Instance and we also need to * be able to reset the store instance between requests on the server */ export declare const storesMap: WeakMap, ActionsTree>, StateDescriptor, InjectionKey, ActionsTree>>]>>; export declare const piniaSymbol: InjectionKey; /** * Context argument passed to Pinia plugins. */ export interface PiniaPluginContext = GettersTree, A = ActionsTree> { /** * pinia instance. */ pinia: Pinia; /** * Current store being extended. */ store: Store; /** * Current store being extended. */ options: DefineStoreOptions; } /** * Plugin to extend every store */ export interface PiniaStorePlugin { /** * Plugin to extend every store. Returns an object to extend the store or * nothing. * * @param context - Context */ (context: PiniaPluginContext): Partial | void; } /** * Every application must own its own pinia to be able to create stores */ export interface Pinia { /** * root state */ state: Ref>; /** * Adds a store plugin to extend every store * * @alpha the plugin API could change in the future * * @param plugin - store plugin to add */ use(plugin: PiniaStorePlugin): Pinia; /** * Installed store plugins * * @internal */ _p: PiniaStorePlugin[]; } declare module 'vue/types/vue' { interface Vue { /** * Currently installed pinia instance. */ $pinia: Pinia; /** * Cache of stores instantiated by the current instance. Used by map * helpers. * * @internal */ _pStores?: Record; } } declare module 'vue/types/options' { interface ComponentOptions { /** * Pinia instance to install in your application. Should be passed to the * root Vue. */ pinia?: Pinia; } } /** * Creates a Pinia instance to be used by the application */ export declare function createPinia(): Pinia; /** * setActivePinia must be called to handle SSR at the top of functions like * `fetch`, `setup`, `serverPrefetch` and others */ export declare let activePinia: Pinia | undefined; /** * Sets or unsets the active pinia. Used in SSR and internally when calling * actions and getters * * @param pinia - Pinia instance */ export declare const setActivePinia: (pinia: Pinia | undefined) => Pinia | undefined; /** * Get the currently active pinia */ export declare const getActivePinia: () => Pinia; //# sourceMappingURL=rootStore.d.ts.map