From: Eduardo San Martin Morote Date: Wed, 28 Apr 2021 17:41:11 +0000 (+0200) Subject: test: Store suffix customization X-Git-Tag: v2.0.0-alpha.14~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3333ef83a101a36eb0e6735ae512eba8d81c0b67;p=thirdparty%2Fvuejs%2Fpinia.git test: Store suffix customization --- diff --git a/test-dts/customizations.test-d.ts b/test-dts/customizations.test-d.ts index 56e18056..c4aaf6d4 100644 --- a/test-dts/customizations.test-d.ts +++ b/test-dts/customizations.test-d.ts @@ -1,7 +1,12 @@ +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 { $actions: Array } @@ -26,8 +31,8 @@ pinia.use((context) => { } }) -defineStore({ - id: 'a', +const useStore = defineStore({ + id: 'main', actions: { one() {}, two() { @@ -51,6 +56,10 @@ function debounce(fn: F, time: number = 200) { return fn } +expectType<{ + mainStore: () => ReturnType +}>(mapStores(useStore)) + pinia.use(({ options, store }) => { if (options.debounce) { return Object.keys(options.debounce).reduce((debouncedActions, action) => {