From 3333ef83a101a36eb0e6735ae512eba8d81c0b67 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Wed, 28 Apr 2021 19:41:11 +0200 Subject: [PATCH] test: Store suffix customization --- test-dts/customizations.test-d.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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) => { -- 2.47.3