const store = useStore(pinia)
expect(store.n).toBe(20)
+ // @ts-expect-error: n is a number
+ store.n.notExisting
})
it('can install plugins before installing pinia', () => {
createPinia,
Pinia,
PiniaStorePlugin,
- PiniaCustomProperties,
} from './rootStore'
export { defineStore } from './store'
export { PiniaPlugin } from './plugin'
StoreWithGetters,
StoreWithActions,
StoreWithState,
+ PiniaCustomProperties,
} from './types'
+
+// TODO: remove in beta
export { createStore } from './deprecated'
import { InjectionKey, ref, Ref } from '@vue/composition-api'
-import { StateTree, StoreWithState, StateDescriptor } from './types'
+import {
+ StateTree,
+ StoreWithState,
+ StateDescriptor,
+ PiniaCustomProperties,
+} from './types'
import { VueConstructor } from 'vue'
import type Vue from 'vue'
Map<string, [StoreWithState<string, StateTree>, StateDescriptor<StateTree>]>
>()
-/**
- * Properties that are added to every store by `pinia.use()`
- */
-// eslint-disable-next-line
-export interface PiniaCustomProperties {}
-
export const piniaSymbol = (__DEV__
? Symbol('pinia')
: /* istanbul ignore next */
S extends StateTree,
G,
A
-> = StoreWithState<Id, S> & S & StoreWithGetters<G> & StoreWithActions<A>
+> = StoreWithState<Id, S> &
+ S &
+ StoreWithGetters<G> &
+ StoreWithActions<A> &
+ PiniaCustomProperties
export type GenericStore = Store<
string,
}
}
}
+
+/**
+ * Properties that are added to every store by `pinia.use()`
+ */
+// eslint-disable-next-line
+export interface PiniaCustomProperties {}