]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
refactor(types): use isolatedModules
authorEduardo San Martin Morote <posva13@gmail.com>
Fri, 7 May 2021 13:41:39 +0000 (15:41 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Thu, 13 May 2021 10:00:00 +0000 (12:00 +0200)
this allows using the lib directly with vite

src/index.ts
tsconfig.json

index c06f2da3fea265bb722ddb746a400e6a164b8522..a4fb795eb4a016c45eb13b6164febfb232f8de05 100644 (file)
@@ -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,
index 00cb97abd81f1d7b8faf4e97c832adc95ec9a203..7367d68c49d006959780da7247fc015487a74453 100644 (file)
@@ -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'"]
+  }
 }