From 9ca186dad8b2633bcacb9c73730ecdbd2765a319 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Fri, 7 May 2021 15:41:39 +0200 Subject: [PATCH] refactor(types): use isolatedModules this allows using the lib directly with vite --- src/index.ts | 18 +++++++++--------- src/types.ts | 2 +- tsconfig.json | 9 +++------ 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/index.ts b/src/index.ts index c2b52d26..957c7b68 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,12 +1,9 @@ -export { - setActivePinia, - createPinia, - Pinia, - PiniaStorePlugin, - PiniaPluginContext, -} from './rootStore' +export { setActivePinia, createPinia } from './rootStore' +export type { Pinia, PiniaStorePlugin, PiniaPluginContext } from './rootStore' + export { defineStore } from './store' -export { + +export type { StateTree, Store, GenericStore, @@ -26,8 +23,11 @@ export { mapState, mapWritableState, mapGetters, - MapStoresCustomization, setMapStoreSuffix, +} from './mapHelpers' + +export type { + MapStoresCustomization, _MapActionsObjectReturn, _MapActionsReturn, _MapStateObjectReturn, diff --git a/src/types.ts b/src/types.ts index 320f2541..0e30b687 100644 --- a/src/types.ts +++ b/src/types.ts @@ -56,7 +56,7 @@ export interface StoreWithState { _p: Pinia /** - * Used by devtools plugin to retrieve getters. Removed in production + * Used by devtools plugin to retrieve getters. Removed in production. * * @internal */ diff --git a/tsconfig.json b/tsconfig.json index 84d3d695..375779fd 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,9 +1,5 @@ { - "include": [ - "src/global.d.ts", - "src/**/*.ts", - "__tests__/**/*.ts" - ], + "include": ["src/global.d.ts", "src/**/*.ts", "__tests__/**/*.ts"], "compilerOptions": { "baseUrl": ".", "rootDir": ".", @@ -15,6 +11,7 @@ "module": "esnext", "moduleResolution": "node", "allowJs": false, + "skipLibCheck": true, "noUnusedLocals": true, "strictNullChecks": true, @@ -22,7 +19,7 @@ "noImplicitThis": true, "noImplicitReturns": false, "strict": true, - "isolatedModules": false, + "isolatedModules": true, "experimentalDecorators": true, "resolveJsonModule": true, -- 2.47.3