]> 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>
Tue, 11 May 2021 20:58:17 +0000 (22:58 +0200)
this allows using the lib directly with vite

src/index.ts
src/types.ts
tsconfig.json

index c2b52d26656467c02216b97f0a53d14a8b52d087..957c7b687377191dc25ed81daed2dde6d002abe0 100644 (file)
@@ -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,
index 320f2541293882900a886baae6f00109e703af06..0e30b687e06684713bc0e3c91115920442ac3406 100644 (file)
@@ -56,7 +56,7 @@ export interface StoreWithState<Id extends string, S extends StateTree> {
   _p: Pinia
 
   /**
-   * Used by devtools plugin to retrieve getters. Removed in production
+   * Used by devtools plugin to retrieve getters. Removed in production.
    *
    * @internal
    */
index 84d3d695dc6bc3f1378a56968dfff419b7303cf7..375779fd41fbad039def6ebe5fbc1087d7480d00 100644 (file)
@@ -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,