import { Persist } from '@ficusjs/state' export type StoreGetter = (context: StoreClass) => any export type StoreAction = (context: StoreActionContext, payload?: any) => void export type StoreDispatch = (actionKey: keyof StoreActionTree, payload: any) => void export type StoreCommit = (mutationKey: keyof StoreMutationTree, payload: any) => void export type StoreActionContext = StoreClass export type StoreMutation = (state: S, payload: any) => S export interface StoreGetterTree { [key: string]: StoreGetter } export interface StoreActionTree { [key: string]: StoreAction } export interface StoreMutationTree { [key: string]: StoreMutation } export interface StoreOfStores { [key: string]: StoreClass } export interface StoreOptions { initialState?: S getters?: StoreGetterTree actions?: StoreActionTree mutations?: StoreMutationTree persist?: string | Persist ttl?: number } export type Store = StoreOfStores | StoreClass declare class StoreClass { constructor(options: StoreOptions) dispatch (actionKey: keyof StoreActionTree, payload: any): StoreDispatch commit (mutationKey: keyof StoreMutationTree, payload: any): StoreCommit subscribe (callback: () => any): void begin (): void end (): void rollback (): void clear (notifySubscribers?: boolean): void } export declare function createStore (key: string, options: StoreOptions): StoreClass export declare function getStore (key: string): StoreClass