+import { mapStores } from 'dist/pinia'
import { App } from 'vue'
import { expectType, createPinia, defineStore } from '.'
declare module '../dist/pinia' {
+ export interface MapStoresCustomization {
+ suffix: 'Store'
+ }
+
export interface PiniaCustomProperties<Id, S, G, A> {
$actions: Array<keyof A>
}
}
})
-defineStore({
- id: 'a',
+const useStore = defineStore({
+ id: 'main',
actions: {
one() {},
two() {
return fn
}
+expectType<{
+ mainStore: () => ReturnType<typeof useStore>
+}>(mapStores(useStore))
+
pinia.use(({ options, store }) => {
if (options.debounce) {
return Object.keys(options.debounce).reduce((debouncedActions, action) => {