From 42e81e3b386a63aa96e585fdc3c663b8e944d73c 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 | 17 ++++++++--------- tsconfig.json | 16 +++++++++++++--- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/src/index.ts b/src/index.ts index c06f2da3..a4fb795e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,13 +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 { PiniaPlugin } from './plugin' -export { +export type { StateTree, Store, StoreDefinition, @@ -27,8 +23,11 @@ export { mapState, mapWritableState, mapGetters, - MapStoresCustomization, setMapStoreSuffix, +} from './mapHelpers' + +export type { + MapStoresCustomization, _MapActionsObjectReturn, _MapActionsReturn, _MapStateObjectReturn, diff --git a/tsconfig.json b/tsconfig.json index 00cb97ab..7367d68c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,4 +1,5 @@ { + "include": ["src/**/*.ts", "nuxt/*.js", "__tests__/**/*.ts", "nuxt/*.d.ts'"], "compilerOptions": { "allowJs": true, "target": "esnext", @@ -7,11 +8,20 @@ "strict": true, "noImplicitThis": true, "composite": true, - "esModuleInterop": true, "moduleResolution": "node", + "skipLibCheck": true, + + "noUnusedLocals": true, + "strictNullChecks": true, + "noImplicitAny": true, + "noImplicitReturns": false, + "isolatedModules": true, + + "experimentalDecorators": true, + "resolveJsonModule": true, + "esModuleInterop": true, "rootDir": ".", "baseUrl": "." - }, - "include": ["src/**/*.ts", "nuxt/*.js", "__tests__/**/*.ts", "nuxt/*.d.ts'"] + } } -- 2.47.3