@histoire/vendors 0.8.4 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/b-floating-vue.d.ts +3 -0
- package/dist/client/{floating-vue.js → b-floating-vue.js} +13 -18
- package/dist/client/b-iconify.d.ts +1 -0
- package/dist/client/{iconify.js → b-iconify.js} +0 -0
- package/dist/client/b-pinia.d.ts +1 -0
- package/dist/client/{pinia.js → b-pinia.js} +41 -8
- package/dist/client/b-scroll.d.ts +2 -0
- package/dist/client/{scroll.js → b-scroll.js} +1 -1
- package/dist/client/b-vue-router.d.ts +1 -0
- package/dist/client/{vue-router.js → b-vue-router.js} +279 -158
- package/dist/client/b-vue-use.d.ts +1 -0
- package/dist/client/{vue-use.js → b-vue-use.js} +1070 -603
- package/dist/client/b-vue.d.ts +1 -0
- package/dist/client/{vue.js → b-vue.js} +1 -1
- package/dist/client/node_modules/@babel/parser/package.json +46 -0
- package/dist/client/node_modules/@babel/parser/typings/babel-parser.d.ts +214 -0
- package/dist/client/node_modules/@floating-ui/core/index.d.ts +1 -0
- package/dist/client/node_modules/@floating-ui/core/package.json +70 -0
- package/dist/client/node_modules/@floating-ui/core/src/_babel.d.ts +1 -0
- package/dist/client/node_modules/@floating-ui/core/src/computeCoordsFromPlacement.d.ts +4 -0
- package/dist/client/node_modules/@floating-ui/core/src/computePosition.d.ts +2 -0
- package/dist/client/node_modules/@floating-ui/core/src/detectOverflow.d.ts +9 -0
- package/dist/client/node_modules/@floating-ui/core/src/enums.d.ts +4 -0
- package/dist/client/node_modules/@floating-ui/core/src/index.d.ts +11 -0
- package/dist/client/node_modules/@floating-ui/core/src/middleware/arrow.d.ts +6 -0
- package/dist/client/node_modules/@floating-ui/core/src/middleware/autoPlacement.d.ts +9 -0
- package/dist/client/node_modules/@floating-ui/core/src/middleware/flip.d.ts +10 -0
- package/dist/client/node_modules/@floating-ui/core/src/middleware/hide.d.ts +2 -0
- package/dist/client/node_modules/@floating-ui/core/src/middleware/inline.d.ts +5 -0
- package/dist/client/node_modules/@floating-ui/core/src/middleware/offset.d.ts +21 -0
- package/dist/client/node_modules/@floating-ui/core/src/middleware/shift.d.ts +32 -0
- package/dist/client/node_modules/@floating-ui/core/src/middleware/size.d.ts +6 -0
- package/dist/client/node_modules/@floating-ui/core/src/types.d.ts +148 -0
- package/dist/client/node_modules/@floating-ui/core/src/utils/expandPaddingObject.d.ts +2 -0
- package/dist/client/node_modules/@floating-ui/core/src/utils/getAlignment.d.ts +2 -0
- package/dist/client/node_modules/@floating-ui/core/src/utils/getAlignmentSides.d.ts +5 -0
- package/dist/client/node_modules/@floating-ui/core/src/utils/getBasePlacement.d.ts +2 -0
- package/dist/client/node_modules/@floating-ui/core/src/utils/getCrossAxis.d.ts +2 -0
- package/dist/client/node_modules/@floating-ui/core/src/utils/getExpandedPlacements.d.ts +2 -0
- package/dist/client/node_modules/@floating-ui/core/src/utils/getLengthFromAxis.d.ts +2 -0
- package/dist/client/node_modules/@floating-ui/core/src/utils/getMainAxisFromPlacement.d.ts +2 -0
- package/dist/client/node_modules/@floating-ui/core/src/utils/getOppositeAlignmentPlacement.d.ts +2 -0
- package/dist/client/node_modules/@floating-ui/core/src/utils/getOppositePlacement.d.ts +1 -0
- package/dist/client/node_modules/@floating-ui/core/src/utils/getPaddingObject.d.ts +2 -0
- package/dist/client/node_modules/@floating-ui/core/src/utils/math.d.ts +2 -0
- package/dist/client/node_modules/@floating-ui/core/src/utils/rectToClientRect.d.ts +2 -0
- package/dist/client/node_modules/@floating-ui/core/src/utils/within.d.ts +1 -0
- package/dist/client/node_modules/@floating-ui/dom/index.d.ts +1 -0
- package/dist/client/node_modules/@floating-ui/dom/package.json +75 -0
- package/dist/client/node_modules/@floating-ui/dom/src/index.d.ts +7 -0
- package/dist/client/node_modules/@floating-ui/dom/src/platform.d.ts +2 -0
- package/dist/client/node_modules/@floating-ui/dom/src/types.d.ts +27 -0
- package/dist/client/node_modules/@floating-ui/dom/src/utils/contains.d.ts +1 -0
- package/dist/client/node_modules/@floating-ui/dom/src/utils/convertOffsetParentRelativeRectToViewportRelativeRect.d.ts +6 -0
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getBoundingClientRect.d.ts +2 -0
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getClippingClientRect.d.ts +6 -0
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getComputedStyle.d.ts +1 -0
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getDimensions.d.ts +2 -0
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getDocumentElement.d.ts +1 -0
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getDocumentRect.d.ts +2 -0
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getNodeName.d.ts +1 -0
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getNodeScroll.d.ts +2 -0
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getOffsetParent.d.ts +1 -0
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getParentNode.d.ts +1 -0
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getRectRelativeToOffsetParent.d.ts +2 -0
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getScrollParent.d.ts +1 -0
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getScrollParents.d.ts +1 -0
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getViewportRect.d.ts +2 -0
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getWindowScrollBarX.d.ts +1 -0
- package/dist/client/node_modules/@floating-ui/dom/src/utils/is.d.ts +15 -0
- package/dist/client/node_modules/@floating-ui/dom/src/utils/math.d.ts +3 -0
- package/dist/client/node_modules/@floating-ui/dom/src/utils/window.d.ts +2 -0
- package/dist/client/node_modules/@iconify/vue/dist/iconify.d.ts +680 -0
- package/dist/client/node_modules/@iconify/vue/dist/offline.d.ts +347 -0
- package/dist/client/node_modules/@iconify/vue/offline/package.json +14 -0
- package/dist/client/node_modules/@iconify/vue/package.json +61 -0
- package/dist/client/node_modules/@types/web-bluetooth/index.d.ts +176 -0
- package/dist/client/node_modules/@types/web-bluetooth/package.json +40 -0
- package/dist/client/node_modules/@vue/compiler-core/dist/compiler-core.d.ts +1198 -0
- package/dist/client/node_modules/@vue/compiler-core/package.json +43 -0
- package/dist/client/node_modules/@vue/compiler-dom/dist/compiler-dom.d.ts +66 -0
- package/dist/client/node_modules/@vue/compiler-dom/package.json +43 -0
- package/dist/client/node_modules/@vue/compiler-sfc/dist/compiler-sfc.d.ts +321 -0
- package/dist/client/node_modules/@vue/compiler-sfc/package.json +59 -0
- package/dist/client/node_modules/@vue/compiler-ssr/dist/compiler-ssr.d.ts +6 -0
- package/dist/client/node_modules/@vue/compiler-ssr/package.json +34 -0
- package/dist/client/node_modules/@vue/devtools-api/lib/esm/api/api.d.ts +108 -0
- package/dist/client/node_modules/@vue/devtools-api/lib/esm/api/app.d.ts +1 -0
- package/dist/client/node_modules/@vue/devtools-api/lib/esm/api/component.d.ts +77 -0
- package/dist/client/node_modules/@vue/devtools-api/lib/esm/api/context.d.ts +5 -0
- package/dist/client/node_modules/@vue/devtools-api/lib/esm/api/hooks.d.ts +179 -0
- package/dist/client/node_modules/@vue/devtools-api/lib/esm/api/index.d.ts +6 -0
- package/dist/client/node_modules/@vue/devtools-api/lib/esm/api/util.d.ts +4 -0
- package/dist/client/node_modules/@vue/devtools-api/lib/esm/const.d.ts +2 -0
- package/dist/client/node_modules/@vue/devtools-api/lib/esm/env.d.ts +15 -0
- package/dist/client/node_modules/@vue/devtools-api/lib/esm/index.d.ts +18 -0
- package/dist/client/node_modules/@vue/devtools-api/lib/esm/plugin.d.ts +47 -0
- package/dist/client/node_modules/@vue/devtools-api/lib/esm/proxy.d.ts +20 -0
- package/dist/client/node_modules/@vue/devtools-api/lib/esm/time.d.ts +2 -0
- package/dist/client/node_modules/@vue/devtools-api/package.json +37 -0
- package/dist/client/node_modules/@vue/reactivity/dist/reactivity.d.ts +347 -0
- package/dist/client/node_modules/@vue/reactivity/package.json +41 -0
- package/dist/client/node_modules/@vue/reactivity-transform/dist/reactivity-transform.d.ts +33 -0
- package/dist/client/node_modules/@vue/reactivity-transform/package.json +41 -0
- package/dist/client/node_modules/@vue/runtime-core/dist/runtime-core.d.ts +2018 -0
- package/dist/client/node_modules/@vue/runtime-core/package.json +38 -0
- package/dist/client/node_modules/@vue/runtime-dom/dist/runtime-dom.d.ts +1522 -0
- package/dist/client/node_modules/@vue/runtime-dom/package.json +42 -0
- package/dist/client/node_modules/@vue/server-renderer/dist/server-renderer.d.ts +100 -0
- package/dist/client/node_modules/@vue/server-renderer/package.json +41 -0
- package/dist/client/node_modules/@vue/shared/dist/shared.d.ts +356 -0
- package/dist/client/node_modules/@vue/shared/package.json +33 -0
- package/dist/client/node_modules/@vueuse/core/index.d.ts +4305 -0
- package/dist/client/node_modules/@vueuse/core/metadata.d.ts +1 -0
- package/dist/client/node_modules/@vueuse/core/node_modules/@vueuse/shared/index.d.ts +874 -0
- package/dist/client/node_modules/@vueuse/core/node_modules/@vueuse/shared/package.json +50 -0
- package/dist/client/node_modules/@vueuse/core/node_modules/vue-demi/lib/index.d.ts +22 -0
- package/dist/client/node_modules/@vueuse/core/node_modules/vue-demi/lib/v2/index.d.ts +31 -0
- package/dist/client/node_modules/@vueuse/core/node_modules/vue-demi/lib/v2.7/index.d.ts +52 -0
- package/dist/client/node_modules/@vueuse/core/node_modules/vue-demi/lib/v3/index.d.ts +22 -0
- package/dist/client/node_modules/@vueuse/core/node_modules/vue-demi/package.json +47 -0
- package/dist/client/node_modules/@vueuse/core/package.json +59 -0
- package/dist/client/node_modules/@vueuse/metadata/index.d.ts +75 -0
- package/dist/client/node_modules/@vueuse/metadata/package.json +39 -0
- package/dist/client/node_modules/compute-scroll-into-view/package.json +90 -0
- package/dist/client/node_modules/compute-scroll-into-view/typings/index.d.ts +19 -0
- package/dist/client/node_modules/csstype/index.d.ts +38372 -0
- package/dist/client/node_modules/csstype/package.json +57 -0
- package/dist/client/node_modules/estree-walker/dist/esm/package.json +1 -0
- package/dist/client/node_modules/estree-walker/package.json +37 -0
- package/dist/client/node_modules/estree-walker/src/package.json +1 -0
- package/dist/client/node_modules/estree-walker/types/async.d.ts +53 -0
- package/dist/client/node_modules/estree-walker/types/index.d.ts +56 -0
- package/dist/client/node_modules/estree-walker/types/sync.d.ts +53 -0
- package/dist/client/node_modules/estree-walker/types/walker.d.ts +37 -0
- package/dist/client/node_modules/floating-vue/dist/components/Dropdown.vue.d.ts +25 -0
- package/dist/client/node_modules/floating-vue/dist/components/Menu.vue.d.ts +25 -0
- package/dist/client/node_modules/floating-vue/dist/components/Popper.d.ts +375 -0
- package/dist/client/node_modules/floating-vue/dist/components/Popper.vue.d.ts +367 -0
- package/dist/client/node_modules/floating-vue/dist/components/PopperContent.vue.d.ts +48 -0
- package/dist/client/node_modules/floating-vue/dist/components/PopperMethods.d.ts +9 -0
- package/dist/client/node_modules/floating-vue/dist/components/PopperWrapper.vue.d.ts +28 -0
- package/dist/client/node_modules/floating-vue/dist/components/ThemeClass.d.ts +6 -0
- package/dist/client/node_modules/floating-vue/dist/components/Tooltip.vue.d.ts +25 -0
- package/dist/client/node_modules/floating-vue/dist/components/TooltipDirective.vue.d.ts +28 -0
- package/dist/client/node_modules/floating-vue/dist/config.d.ts +11 -0
- package/dist/client/node_modules/floating-vue/dist/directives/v-close-popper.d.ts +13 -0
- package/dist/client/node_modules/floating-vue/dist/directives/v-tooltip.d.ts +27 -0
- package/dist/client/node_modules/floating-vue/dist/directives/v-tooltip.spec.d.ts +1 -0
- package/dist/client/node_modules/floating-vue/dist/index.d.ts +415 -0
- package/dist/client/node_modules/floating-vue/dist/util/assign-deep.d.ts +1 -0
- package/dist/client/node_modules/floating-vue/dist/util/env.d.ts +2 -0
- package/dist/client/node_modules/floating-vue/dist/util/events.d.ts +12 -0
- package/dist/client/node_modules/floating-vue/dist/util/frame.d.ts +1 -0
- package/dist/client/node_modules/floating-vue/dist/util/lang.d.ts +1 -0
- package/dist/client/node_modules/floating-vue/dist/util/popper.d.ts +3 -0
- package/dist/client/node_modules/floating-vue/package.json +71 -0
- package/dist/client/node_modules/floating-vue/src/global-shim.d.ts +1 -0
- package/dist/client/node_modules/floating-vue/src/vue-shim.d.ts +5 -0
- package/dist/client/node_modules/magic-string/index.d.ts +221 -0
- package/dist/client/node_modules/magic-string/package.json +52 -0
- package/dist/client/node_modules/nanoid/async/index.d.ts +56 -0
- package/dist/client/node_modules/nanoid/async/package.json +12 -0
- package/dist/client/node_modules/nanoid/index.d.ts +91 -0
- package/dist/client/node_modules/nanoid/non-secure/index.d.ts +33 -0
- package/dist/client/node_modules/nanoid/non-secure/package.json +6 -0
- package/dist/client/node_modules/nanoid/package.json +60 -0
- package/dist/client/node_modules/nanoid/url-alphabet/package.json +6 -0
- package/dist/client/node_modules/picocolors/package.json +25 -0
- package/dist/client/node_modules/picocolors/picocolors.d.ts +5 -0
- package/dist/client/node_modules/pinia/dist/pinia.d.ts +963 -0
- package/dist/client/node_modules/pinia/node_modules/vue-demi/lib/index.d.ts +22 -0
- package/dist/client/node_modules/pinia/node_modules/vue-demi/lib/v2/index.d.ts +31 -0
- package/dist/client/node_modules/pinia/node_modules/vue-demi/lib/v2.7/index.d.ts +52 -0
- package/dist/client/node_modules/pinia/node_modules/vue-demi/lib/v3/index.d.ts +22 -0
- package/dist/client/node_modules/pinia/node_modules/vue-demi/package.json +47 -0
- package/dist/client/node_modules/pinia/package.json +101 -0
- package/dist/client/node_modules/postcss/lib/at-rule.d.ts +106 -0
- package/dist/client/node_modules/postcss/lib/comment.d.ts +56 -0
- package/dist/client/node_modules/postcss/lib/container.d.ts +442 -0
- package/dist/client/node_modules/postcss/lib/css-syntax-error.d.ts +239 -0
- package/dist/client/node_modules/postcss/lib/declaration.d.ts +124 -0
- package/dist/client/node_modules/postcss/lib/document.d.ts +57 -0
- package/dist/client/node_modules/postcss/lib/fromJSON.d.ts +5 -0
- package/dist/client/node_modules/postcss/lib/input.d.ts +150 -0
- package/dist/client/node_modules/postcss/lib/lazy-result.d.ts +176 -0
- package/dist/client/node_modules/postcss/lib/list.d.ts +51 -0
- package/dist/client/node_modules/postcss/lib/no-work-result.d.ts +37 -0
- package/dist/client/node_modules/postcss/lib/node.d.ts +478 -0
- package/dist/client/node_modules/postcss/lib/parse.d.ts +5 -0
- package/dist/client/node_modules/postcss/lib/postcss.d.ts +473 -0
- package/dist/client/node_modules/postcss/lib/previous-map.d.ts +72 -0
- package/dist/client/node_modules/postcss/lib/processor.d.ts +102 -0
- package/dist/client/node_modules/postcss/lib/result.d.ts +196 -0
- package/dist/client/node_modules/postcss/lib/root.d.ts +73 -0
- package/dist/client/node_modules/postcss/lib/rule.d.ts +104 -0
- package/dist/client/node_modules/postcss/lib/stringifier.d.ts +37 -0
- package/dist/client/node_modules/postcss/lib/stringify.d.ts +5 -0
- package/dist/client/node_modules/postcss/lib/warning.d.ts +138 -0
- package/dist/client/node_modules/postcss/package.json +85 -0
- package/dist/client/node_modules/scroll-into-view-if-needed/package.json +144 -0
- package/dist/client/node_modules/scroll-into-view-if-needed/typings/index.d.ts +13 -0
- package/dist/client/node_modules/scroll-into-view-if-needed/typings/types.d.ts +19 -0
- package/dist/client/node_modules/source-map/package.json +73 -0
- package/dist/client/node_modules/source-map/source-map.d.ts +98 -0
- package/dist/client/node_modules/source-map-js/package.json +71 -0
- package/dist/client/node_modules/source-map-js/source-map.d.ts +115 -0
- package/dist/client/node_modules/sourcemap-codec/dist/types/sourcemap-codec.d.ts +5 -0
- package/dist/client/node_modules/sourcemap-codec/package.json +53 -0
- package/dist/client/node_modules/vue/compiler-sfc/index.d.ts +1 -0
- package/dist/client/node_modules/vue/compiler-sfc/package.json +5 -0
- package/dist/client/node_modules/vue/dist/vue.d.ts +9 -0
- package/dist/client/node_modules/vue/macros-global.d.ts +19 -0
- package/dist/client/node_modules/vue/macros.d.ts +110 -0
- package/dist/client/node_modules/vue/package.json +75 -0
- package/dist/client/node_modules/vue/ref-macros.d.ts +2 -0
- package/dist/client/node_modules/vue/server-renderer/index.d.ts +1 -0
- package/dist/client/node_modules/vue/server-renderer/package.json +5 -0
- package/dist/client/node_modules/vue-resize/package.json +77 -0
- package/dist/client/node_modules/vue-router/dist/vue-router.d.ts +1491 -0
- package/dist/client/node_modules/vue-router/package.json +114 -0
- package/dist/client/vue.runtime.esm-bundler.js +24 -19
- package/entries.js +7 -7
- package/floating-vue.d.ts +3 -0
- package/iconify.d.ts +3 -0
- package/package.json +14 -5
- package/pinia.d.ts +3 -0
- package/rollup.config.mjs +117 -0
- package/scroll.d.ts +3 -0
- package/src/client/b-floating-vue.ts +3 -0
- package/src/client/b-iconify.ts +1 -0
- package/src/client/b-pinia.ts +1 -0
- package/src/client/b-scroll.ts +2 -0
- package/src/client/b-vue-router.ts +1 -0
- package/src/client/b-vue-use.ts +1 -0
- package/src/client/b-vue.ts +1 -0
- package/vue-router.d.ts +3 -0
- package/vue-use.d.ts +3 -0
- package/vue.d.ts +3 -0
- package/dist/client/floating-vue.d.ts +0 -2
- package/dist/client/iconify.d.ts +0 -1
- package/dist/client/pinia.d.ts +0 -1
- package/dist/client/scroll.d.ts +0 -1
- package/dist/client/vue-router.d.ts +0 -1
- package/dist/client/vue-use.d.ts +0 -1
- package/dist/client/vue.d.ts +0 -1
- package/rollup.config.js +0 -37
- package/src/client/floating-vue.ts +0 -2
- package/src/client/iconify.ts +0 -1
- package/src/client/pinia.ts +0 -1
- package/src/client/scroll.ts +0 -1
- package/src/client/vue-router.ts +0 -1
- package/src/client/vue-use.ts +0 -1
- package/src/client/vue.ts +0 -1
|
@@ -0,0 +1,963 @@
|
|
|
1
|
+
import { App } from 'vue-demi';
|
|
2
|
+
import { ComputedRef } from 'vue-demi';
|
|
3
|
+
import { DebuggerEvent } from 'vue-demi';
|
|
4
|
+
import { EffectScope } from 'vue-demi';
|
|
5
|
+
import type { Plugin as Plugin_2 } from 'vue-demi';
|
|
6
|
+
import { Ref } from 'vue-demi';
|
|
7
|
+
import { ToRefs } from 'vue-demi';
|
|
8
|
+
import { UnwrapRef } from 'vue-demi';
|
|
9
|
+
import { WatchOptions } from 'vue-demi';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Creates an _accept_ function to pass to `import.meta.hot` in Vite applications.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```js
|
|
16
|
+
* const useUser = defineStore(...)
|
|
17
|
+
* if (import.meta.hot) {
|
|
18
|
+
* import.meta.hot.accept(acceptHMRUpdate(useUser, import.meta.hot))
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @param initialUseStore - return of the defineStore to hot update
|
|
23
|
+
* @param hot - `import.meta.hot`
|
|
24
|
+
*/
|
|
25
|
+
export declare function acceptHMRUpdate(initialUseStore: StoreDefinition, hot: any): (newModule: any) => any;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Type of an object of Actions. For internal usage only.
|
|
29
|
+
* For internal use **only**
|
|
30
|
+
*/
|
|
31
|
+
export declare type _ActionsTree = Record<string, _Method>;
|
|
32
|
+
|
|
33
|
+
export declare type _Awaited<T> = T extends null | undefined ? T : T extends object & {
|
|
34
|
+
then(onfulfilled: infer F): any;
|
|
35
|
+
} ? F extends (value: infer V, ...args: any) => any ? _Awaited<V> : never : T;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Creates a Pinia instance to be used by the application
|
|
39
|
+
*/
|
|
40
|
+
export declare function createPinia(): Pinia;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Recursive `Partial<T>`. Used by {@link Store['$patch']}.
|
|
44
|
+
*
|
|
45
|
+
* For internal use **only**
|
|
46
|
+
*/
|
|
47
|
+
export declare type _DeepPartial<T> = {
|
|
48
|
+
[K in keyof T]?: _DeepPartial<T[K]>;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Options parameter of `defineStore()` for setup stores. Can be extended to
|
|
53
|
+
* augment stores with the plugin API. @see {@link DefineStoreOptionsBase}.
|
|
54
|
+
*/
|
|
55
|
+
export declare interface DefineSetupStoreOptions<Id extends string, S extends StateTree, G, A> extends DefineStoreOptionsBase<S, Store<Id, S, G, A>> {
|
|
56
|
+
/**
|
|
57
|
+
* Extracted actions. Added by useStore(). SHOULD NOT be added by the user when
|
|
58
|
+
* creating the store. Can be used in plugins to get the list of actions in a
|
|
59
|
+
* store defined with a setup function. Note this is always defined
|
|
60
|
+
*/
|
|
61
|
+
actions?: A;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Creates a `useStore` function that retrieves the store instance
|
|
66
|
+
*
|
|
67
|
+
* @param id - id of the store (must be unique)
|
|
68
|
+
* @param options - options to define the store
|
|
69
|
+
*/
|
|
70
|
+
export declare function defineStore<Id extends string, S extends StateTree = {}, G extends _GettersTree<S> = {}, A = {}>(id: Id, options: Omit<DefineStoreOptions<Id, S, G, A>, 'id'>): StoreDefinition<Id, S, G, A>;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Creates a `useStore` function that retrieves the store instance
|
|
74
|
+
*
|
|
75
|
+
* @param options - options to define the store
|
|
76
|
+
*/
|
|
77
|
+
export declare function defineStore<Id extends string, S extends StateTree = {}, G extends _GettersTree<S> = {}, A = {}>(options: DefineStoreOptions<Id, S, G, A>): StoreDefinition<Id, S, G, A>;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Creates a `useStore` function that retrieves the store instance
|
|
81
|
+
*
|
|
82
|
+
* @param id - id of the store (must be unique)
|
|
83
|
+
* @param storeSetup - function that defines the store
|
|
84
|
+
* @param options - extra options
|
|
85
|
+
*/
|
|
86
|
+
export declare function defineStore<Id extends string, SS>(id: Id, storeSetup: () => SS, options?: DefineSetupStoreOptions<Id, _ExtractStateFromSetupStore<SS>, _ExtractGettersFromSetupStore<SS>, _ExtractActionsFromSetupStore<SS>>): StoreDefinition<Id, _ExtractStateFromSetupStore<SS>, _ExtractGettersFromSetupStore<SS>, _ExtractActionsFromSetupStore<SS>>;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Options parameter of `defineStore()` for option stores. Can be extended to
|
|
90
|
+
* augment stores with the plugin API. @see {@link DefineStoreOptionsBase}.
|
|
91
|
+
*/
|
|
92
|
+
export declare interface DefineStoreOptions<Id extends string, S extends StateTree, G, A> extends DefineStoreOptionsBase<S, Store<Id, S, G, A>> {
|
|
93
|
+
/**
|
|
94
|
+
* Unique string key to identify the store across the application.
|
|
95
|
+
*/
|
|
96
|
+
id: Id;
|
|
97
|
+
/**
|
|
98
|
+
* Function to create a fresh state. **Must be an arrow function** to ensure
|
|
99
|
+
* correct typings!
|
|
100
|
+
*/
|
|
101
|
+
state?: () => S;
|
|
102
|
+
/**
|
|
103
|
+
* Optional object of getters.
|
|
104
|
+
*/
|
|
105
|
+
getters?: G & ThisType<UnwrapRef<S> & _StoreWithGetters<G> & PiniaCustomProperties> & _GettersTree<S>;
|
|
106
|
+
/**
|
|
107
|
+
* Optional object of actions.
|
|
108
|
+
*/
|
|
109
|
+
actions?: A & ThisType<A & UnwrapRef<S> & _StoreWithState<Id, S, G, A> & _StoreWithGetters<G> & PiniaCustomProperties>;
|
|
110
|
+
/**
|
|
111
|
+
* Allows hydrating the store during SSR when complex state (like client side only refs) are used in the store
|
|
112
|
+
* definition and copying the value from `pinia.state` isn't enough.
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* If in your `state`, you use any `customRef`s, any `computed`s, or any `ref`s that have a different value on
|
|
116
|
+
* Server and Client, you need to manually hydrate them. e.g., a custom ref that is stored in the local
|
|
117
|
+
* storage:
|
|
118
|
+
*
|
|
119
|
+
* ```ts
|
|
120
|
+
* const useStore = defineStore('main', {
|
|
121
|
+
* state: () => ({
|
|
122
|
+
* n: useLocalStorage('key', 0)
|
|
123
|
+
* }),
|
|
124
|
+
* hydrate(storeState, initialState) {
|
|
125
|
+
* // @ts-expect-error: https://github.com/microsoft/TypeScript/issues/43826
|
|
126
|
+
* storeState.n = useLocalStorage('key', 0)
|
|
127
|
+
* }
|
|
128
|
+
* })
|
|
129
|
+
* ```
|
|
130
|
+
*
|
|
131
|
+
* @param storeState - the current state in the store
|
|
132
|
+
* @param initialState - initialState
|
|
133
|
+
*/
|
|
134
|
+
hydrate?(storeState: UnwrapRef<S>, initialState: UnwrapRef<S>): void;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Options passed to `defineStore()` that are common between option and setup
|
|
139
|
+
* stores. Extend this interface if you want to add custom options to both kinds
|
|
140
|
+
* of stores.
|
|
141
|
+
*/
|
|
142
|
+
export declare interface DefineStoreOptionsBase<S extends StateTree, Store> {
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Available `options` when creating a pinia plugin.
|
|
147
|
+
*/
|
|
148
|
+
export declare interface DefineStoreOptionsInPlugin<Id extends string, S extends StateTree, G, A> extends Omit<DefineStoreOptions<Id, S, G, A>, 'id' | 'actions'> {
|
|
149
|
+
/**
|
|
150
|
+
* Extracted object of actions. Added by useStore() when the store is built
|
|
151
|
+
* using the setup API, otherwise uses the one passed to `defineStore()`.
|
|
152
|
+
* Defaults to an empty object if no actions are defined.
|
|
153
|
+
*/
|
|
154
|
+
actions: A;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* For internal use **only**
|
|
159
|
+
*/
|
|
160
|
+
export declare type _ExtractActionsFromSetupStore<SS> = SS extends undefined | void ? {} : _ExtractActionsFromSetupStore_Keys<SS> extends keyof SS ? Pick<SS, _ExtractActionsFromSetupStore_Keys<SS>> : never;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Type that enables refactoring through IDE.
|
|
164
|
+
* For internal use **only**
|
|
165
|
+
*/
|
|
166
|
+
export declare type _ExtractActionsFromSetupStore_Keys<SS> = keyof {
|
|
167
|
+
[K in keyof SS as SS[K] extends _Method ? K : never]: any;
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* For internal use **only**
|
|
172
|
+
*/
|
|
173
|
+
export declare type _ExtractGettersFromSetupStore<SS> = SS extends undefined | void ? {} : _ExtractGettersFromSetupStore_Keys<SS> extends keyof SS ? Pick<SS, _ExtractGettersFromSetupStore_Keys<SS>> : never;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Type that enables refactoring through IDE.
|
|
177
|
+
* For internal use **only**
|
|
178
|
+
*/
|
|
179
|
+
export declare type _ExtractGettersFromSetupStore_Keys<SS> = keyof {
|
|
180
|
+
[K in keyof SS as SS[K] extends ComputedRef ? K : never]: any;
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* For internal use **only**
|
|
185
|
+
*/
|
|
186
|
+
export declare type _ExtractStateFromSetupStore<SS> = SS extends undefined | void ? {} : _ExtractStateFromSetupStore_Keys<SS> extends keyof SS ? _UnwrapAll<Pick<SS, _ExtractStateFromSetupStore_Keys<SS>>> : never;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Type that enables refactoring through IDE.
|
|
190
|
+
* For internal use **only**
|
|
191
|
+
*/
|
|
192
|
+
export declare type _ExtractStateFromSetupStore_Keys<SS> = keyof {
|
|
193
|
+
[K in keyof SS as SS[K] extends _Method | ComputedRef ? never : K]: any;
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Get the currently active pinia if there is any.
|
|
198
|
+
*/
|
|
199
|
+
export declare const getActivePinia: () => Pinia | undefined;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Type of an object of Getters that infers the argument. For internal usage only.
|
|
203
|
+
* For internal use **only**
|
|
204
|
+
*/
|
|
205
|
+
export declare type _GettersTree<S extends StateTree> = Record<string, ((state: UnwrapRef<S> & UnwrapRef<PiniaCustomStateProperties<S>>) => any) | (() => any)>;
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Allows directly using actions from your store without using the composition
|
|
209
|
+
* API (`setup()`) by generating an object to be spread in the `methods` field
|
|
210
|
+
* of a component. The values of the object are the actions while the keys are
|
|
211
|
+
* the names of the resulting methods.
|
|
212
|
+
*
|
|
213
|
+
* @example
|
|
214
|
+
* ```js
|
|
215
|
+
* export default {
|
|
216
|
+
* methods: {
|
|
217
|
+
* // other methods properties
|
|
218
|
+
* // useCounterStore has two actions named `increment` and `setCount`
|
|
219
|
+
* ...mapActions(useCounterStore, { moar: 'increment', setIt: 'setCount' })
|
|
220
|
+
* },
|
|
221
|
+
*
|
|
222
|
+
* created() {
|
|
223
|
+
* this.moar()
|
|
224
|
+
* this.setIt(2)
|
|
225
|
+
* }
|
|
226
|
+
* }
|
|
227
|
+
* ```
|
|
228
|
+
*
|
|
229
|
+
* @param useStore - store to map from
|
|
230
|
+
* @param keyMapper - object to define new names for the actions
|
|
231
|
+
*/
|
|
232
|
+
export declare function mapActions<Id extends string, S extends StateTree, G extends _GettersTree<S>, A, KeyMapper extends Record<string, keyof A>>(useStore: StoreDefinition<Id, S, G, A>, keyMapper: KeyMapper): _MapActionsObjectReturn<A, KeyMapper>;
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Allows directly using actions from your store without using the composition
|
|
236
|
+
* API (`setup()`) by generating an object to be spread in the `methods` field
|
|
237
|
+
* of a component.
|
|
238
|
+
*
|
|
239
|
+
* @example
|
|
240
|
+
* ```js
|
|
241
|
+
* export default {
|
|
242
|
+
* methods: {
|
|
243
|
+
* // other methods properties
|
|
244
|
+
* ...mapActions(useCounterStore, ['increment', 'setCount'])
|
|
245
|
+
* },
|
|
246
|
+
*
|
|
247
|
+
* created() {
|
|
248
|
+
* this.increment()
|
|
249
|
+
* this.setCount(2) // pass arguments as usual
|
|
250
|
+
* }
|
|
251
|
+
* }
|
|
252
|
+
* ```
|
|
253
|
+
*
|
|
254
|
+
* @param useStore - store to map from
|
|
255
|
+
* @param keys - array of action names to map
|
|
256
|
+
*/
|
|
257
|
+
export declare function mapActions<Id extends string, S extends StateTree, G extends _GettersTree<S>, A>(useStore: StoreDefinition<Id, S, G, A>, keys: Array<keyof A>): _MapActionsReturn<A>;
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* For internal use **only**
|
|
261
|
+
*/
|
|
262
|
+
export declare type _MapActionsObjectReturn<A, T extends Record<string, keyof A>> = {
|
|
263
|
+
[key in keyof T]: A[T[key]];
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* For internal use **only**
|
|
268
|
+
*/
|
|
269
|
+
export declare type _MapActionsReturn<A> = {
|
|
270
|
+
[key in keyof A]: A[key];
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Alias for `mapState()`. You should use `mapState()` instead.
|
|
275
|
+
* @deprecated use `mapState()` instead.
|
|
276
|
+
*/
|
|
277
|
+
export declare const mapGetters: typeof mapState;
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Allows using state and getters from one store without using the composition
|
|
281
|
+
* API (`setup()`) by generating an object to be spread in the `computed` field
|
|
282
|
+
* of a component. The values of the object are the state properties/getters
|
|
283
|
+
* while the keys are the names of the resulting computed properties.
|
|
284
|
+
* Optionally, you can also pass a custom function that will receive the store
|
|
285
|
+
* as its first argument. Note that while it has access to the component
|
|
286
|
+
* instance via `this`, it won't be typed.
|
|
287
|
+
*
|
|
288
|
+
* @example
|
|
289
|
+
* ```js
|
|
290
|
+
* export default {
|
|
291
|
+
* computed: {
|
|
292
|
+
* // other computed properties
|
|
293
|
+
* // useCounterStore has a state property named `count` and a getter `double`
|
|
294
|
+
* ...mapState(useCounterStore, {
|
|
295
|
+
* n: 'count',
|
|
296
|
+
* triple: store => store.n * 3,
|
|
297
|
+
* // note we can't use an arrow function if we want to use `this`
|
|
298
|
+
* custom(store) {
|
|
299
|
+
* return this.someComponentValue + store.n
|
|
300
|
+
* },
|
|
301
|
+
* doubleN: 'double'
|
|
302
|
+
* })
|
|
303
|
+
* },
|
|
304
|
+
*
|
|
305
|
+
* created() {
|
|
306
|
+
* this.n // 2
|
|
307
|
+
* this.doubleN // 4
|
|
308
|
+
* }
|
|
309
|
+
* }
|
|
310
|
+
* ```
|
|
311
|
+
*
|
|
312
|
+
* @param useStore - store to map from
|
|
313
|
+
* @param keyMapper - object of state properties or getters
|
|
314
|
+
*/
|
|
315
|
+
export declare function mapState<Id extends string, S extends StateTree, G extends _GettersTree<S>, A, KeyMapper extends Record<string, keyof S | keyof G | ((store: Store<Id, S, G, A>) => any)>>(useStore: StoreDefinition<Id, S, G, A>, keyMapper: KeyMapper): _MapStateObjectReturn<Id, S, G, A, KeyMapper>;
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Allows using state and getters from one store without using the composition
|
|
319
|
+
* API (`setup()`) by generating an object to be spread in the `computed` field
|
|
320
|
+
* of a component.
|
|
321
|
+
*
|
|
322
|
+
* @example
|
|
323
|
+
* ```js
|
|
324
|
+
* export default {
|
|
325
|
+
* computed: {
|
|
326
|
+
* // other computed properties
|
|
327
|
+
* ...mapState(useCounterStore, ['count', 'double'])
|
|
328
|
+
* },
|
|
329
|
+
*
|
|
330
|
+
* created() {
|
|
331
|
+
* this.count // 2
|
|
332
|
+
* this.double // 4
|
|
333
|
+
* }
|
|
334
|
+
* }
|
|
335
|
+
* ```
|
|
336
|
+
*
|
|
337
|
+
* @param useStore - store to map from
|
|
338
|
+
* @param keys - array of state properties or getters
|
|
339
|
+
*/
|
|
340
|
+
export declare function mapState<Id extends string, S extends StateTree, G extends _GettersTree<S>, A, Keys extends keyof S | keyof G>(useStore: StoreDefinition<Id, S, G, A>, keys: readonly Keys[]): _MapStateReturn<S, G, Keys>;
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* For internal use **only**
|
|
344
|
+
*/
|
|
345
|
+
export declare type _MapStateObjectReturn<Id extends string, S extends StateTree, G extends _GettersTree<S>, A, T extends Record<string, keyof S | keyof G | ((store: Store<Id, S, G, A>) => any)> = {}> = {
|
|
346
|
+
[key in keyof T]: () => T[key] extends (store: any) => infer R ? R : T[key] extends keyof Store<Id, S, G, A> ? Store<Id, S, G, A>[T[key]] : never;
|
|
347
|
+
};
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* For internal use **only**
|
|
351
|
+
*/
|
|
352
|
+
export declare type _MapStateReturn<S extends StateTree, G extends _GettersTree<S>, Keys extends keyof S | keyof G = keyof S | keyof G> = {
|
|
353
|
+
[key in Keys]: () => Store<string, S, G, {}>[key];
|
|
354
|
+
};
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Allows using stores without the composition API (`setup()`) by generating an
|
|
358
|
+
* object to be spread in the `computed` field of a component. It accepts a list
|
|
359
|
+
* of store definitions.
|
|
360
|
+
*
|
|
361
|
+
* @example
|
|
362
|
+
* ```js
|
|
363
|
+
* export default {
|
|
364
|
+
* computed: {
|
|
365
|
+
* // other computed properties
|
|
366
|
+
* ...mapStores(useUserStore, useCartStore)
|
|
367
|
+
* },
|
|
368
|
+
*
|
|
369
|
+
* created() {
|
|
370
|
+
* this.userStore // store with id "user"
|
|
371
|
+
* this.cartStore // store with id "cart"
|
|
372
|
+
* }
|
|
373
|
+
* }
|
|
374
|
+
* ```
|
|
375
|
+
*
|
|
376
|
+
* @param stores - list of stores to map to an object
|
|
377
|
+
*/
|
|
378
|
+
export declare function mapStores<Stores extends any[]>(...stores: [...Stores]): _Spread<Stores>;
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* Interface to allow customizing map helpers. Extend this interface with the
|
|
382
|
+
* following properties:
|
|
383
|
+
*
|
|
384
|
+
* - `suffix`: string. Affects the suffix of `mapStores()`, defaults to `Store`.
|
|
385
|
+
*/
|
|
386
|
+
export declare interface MapStoresCustomization {
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* Same as `mapState()` but creates computed setters as well so the state can be
|
|
391
|
+
* modified. Differently from `mapState()`, only `state` properties can be
|
|
392
|
+
* added.
|
|
393
|
+
*
|
|
394
|
+
* @param useStore - store to map from
|
|
395
|
+
* @param keyMapper - object of state properties
|
|
396
|
+
*/
|
|
397
|
+
export declare function mapWritableState<Id extends string, S extends StateTree, G extends _GettersTree<S>, A, KeyMapper extends Record<string, keyof S>>(useStore: StoreDefinition<Id, S, G, A>, keyMapper: KeyMapper): _MapWritableStateObjectReturn<S, KeyMapper>;
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* Allows using state and getters from one store without using the composition
|
|
401
|
+
* API (`setup()`) by generating an object to be spread in the `computed` field
|
|
402
|
+
* of a component.
|
|
403
|
+
*
|
|
404
|
+
* @param useStore - store to map from
|
|
405
|
+
* @param keys - array of state properties
|
|
406
|
+
*/
|
|
407
|
+
export declare function mapWritableState<Id extends string, S extends StateTree, G extends _GettersTree<S>, A>(useStore: StoreDefinition<Id, S, G, A>, keys: Array<keyof S>): _MapWritableStateReturn<S>;
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* For internal use **only**
|
|
411
|
+
*/
|
|
412
|
+
export declare type _MapWritableStateObjectReturn<S extends StateTree, T extends Record<string, keyof S>> = {
|
|
413
|
+
[key in keyof T]: {
|
|
414
|
+
get: () => S[T[key]];
|
|
415
|
+
set: (value: S[T[key]]) => any;
|
|
416
|
+
};
|
|
417
|
+
};
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* For internal use **only**
|
|
421
|
+
*/
|
|
422
|
+
export declare type _MapWritableStateReturn<S extends StateTree> = {
|
|
423
|
+
[key in keyof S]: {
|
|
424
|
+
get: () => S[key];
|
|
425
|
+
set: (value: S[key]) => any;
|
|
426
|
+
};
|
|
427
|
+
};
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* Generic type for a function that can infer arguments and return type
|
|
431
|
+
*
|
|
432
|
+
* For internal use **only**
|
|
433
|
+
*/
|
|
434
|
+
export declare type _Method = (...args: any[]) => any;
|
|
435
|
+
|
|
436
|
+
/**
|
|
437
|
+
* Possible types for SubscriptionCallback
|
|
438
|
+
*/
|
|
439
|
+
export declare enum MutationType {
|
|
440
|
+
/**
|
|
441
|
+
* Direct mutation of the state:
|
|
442
|
+
*
|
|
443
|
+
* - `store.name = 'new name'`
|
|
444
|
+
* - `store.$state.name = 'new name'`
|
|
445
|
+
* - `store.list.push('new item')`
|
|
446
|
+
*/
|
|
447
|
+
direct = "direct",
|
|
448
|
+
/**
|
|
449
|
+
* Mutated the state with `$patch` and an object
|
|
450
|
+
*
|
|
451
|
+
* - `store.$patch({ name: 'newName' })`
|
|
452
|
+
*/
|
|
453
|
+
patchObject = "patch object",
|
|
454
|
+
/**
|
|
455
|
+
* Mutated the state with `$patch` and a function
|
|
456
|
+
*
|
|
457
|
+
* - `store.$patch(state => state.name = 'newName')`
|
|
458
|
+
*/
|
|
459
|
+
patchFunction = "patch function"
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* Every application must own its own pinia to be able to create stores
|
|
464
|
+
*/
|
|
465
|
+
export declare interface Pinia {
|
|
466
|
+
install: (app: App) => void;
|
|
467
|
+
/**
|
|
468
|
+
* root state
|
|
469
|
+
*/
|
|
470
|
+
state: Ref<Record<string, StateTree>>;
|
|
471
|
+
/**
|
|
472
|
+
* Adds a store plugin to extend every store
|
|
473
|
+
*
|
|
474
|
+
* @param plugin - store plugin to add
|
|
475
|
+
*/
|
|
476
|
+
use(plugin: PiniaPlugin): Pinia;
|
|
477
|
+
/* Excluded from this release type: _p */
|
|
478
|
+
/* Excluded from this release type: _a */
|
|
479
|
+
/* Excluded from this release type: _e */
|
|
480
|
+
/* Excluded from this release type: _s */
|
|
481
|
+
/* Excluded from this release type: _testing */
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* Interface to be extended by the user when they add properties through plugins.
|
|
486
|
+
*/
|
|
487
|
+
export declare interface PiniaCustomProperties<Id extends string = string, S extends StateTree = StateTree, G = _GettersTree<S>, A = _ActionsTree> {
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
/**
|
|
491
|
+
* Properties that are added to every `store.$state` by `pinia.use()`.
|
|
492
|
+
*/
|
|
493
|
+
export declare interface PiniaCustomStateProperties<S extends StateTree = StateTree> {
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
/**
|
|
497
|
+
* Plugin to extend every store.
|
|
498
|
+
*/
|
|
499
|
+
export declare interface PiniaPlugin {
|
|
500
|
+
/**
|
|
501
|
+
* Plugin to extend every store. Returns an object to extend the store or
|
|
502
|
+
* nothing.
|
|
503
|
+
*
|
|
504
|
+
* @param context - Context
|
|
505
|
+
*/
|
|
506
|
+
(context: PiniaPluginContext): Partial<PiniaCustomProperties & PiniaCustomStateProperties> | void;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* Context argument passed to Pinia plugins.
|
|
511
|
+
*/
|
|
512
|
+
export declare interface PiniaPluginContext<Id extends string = string, S extends StateTree = StateTree, G = _GettersTree<S>, A = _ActionsTree> {
|
|
513
|
+
/**
|
|
514
|
+
* pinia instance.
|
|
515
|
+
*/
|
|
516
|
+
pinia: Pinia;
|
|
517
|
+
/**
|
|
518
|
+
* Current app created with `Vue.createApp()`.
|
|
519
|
+
*/
|
|
520
|
+
app: App;
|
|
521
|
+
/**
|
|
522
|
+
* Current store being extended.
|
|
523
|
+
*/
|
|
524
|
+
store: Store<Id, S, G, A>;
|
|
525
|
+
/**
|
|
526
|
+
* Initial options defining the store when calling `defineStore()`.
|
|
527
|
+
*/
|
|
528
|
+
options: DefineStoreOptionsInPlugin<Id, S, G, A>;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
/**
|
|
532
|
+
* Plugin to extend every store.
|
|
533
|
+
* @deprecated use PiniaPlugin instead
|
|
534
|
+
*/
|
|
535
|
+
export declare type PiniaStorePlugin = PiniaPlugin;
|
|
536
|
+
|
|
537
|
+
/**
|
|
538
|
+
* Vue 2 Plugin that must be installed for pinia to work. Note **you don't need
|
|
539
|
+
* this plugin if you are using Nuxt.js**. Use the `buildModule` instead:
|
|
540
|
+
* https://pinia.vuejs.org/ssr/nuxt.html.
|
|
541
|
+
*
|
|
542
|
+
* @example
|
|
543
|
+
* ```js
|
|
544
|
+
* import Vue from 'vue'
|
|
545
|
+
* import { PiniaVuePlugin, createPinia } from 'pinia'
|
|
546
|
+
*
|
|
547
|
+
* Vue.use(PiniaVuePlugin)
|
|
548
|
+
* const pinia = createPinia()
|
|
549
|
+
*
|
|
550
|
+
* new Vue({
|
|
551
|
+
* el: '#app',
|
|
552
|
+
* // ...
|
|
553
|
+
* pinia,
|
|
554
|
+
* })
|
|
555
|
+
* ```
|
|
556
|
+
*
|
|
557
|
+
* @param _Vue - `Vue` imported from 'vue'.
|
|
558
|
+
*/
|
|
559
|
+
export declare const PiniaVuePlugin: Plugin_2;
|
|
560
|
+
|
|
561
|
+
/**
|
|
562
|
+
* Sets or unsets the active pinia. Used in SSR and internally when calling
|
|
563
|
+
* actions and getters
|
|
564
|
+
*
|
|
565
|
+
* @param pinia - Pinia instance
|
|
566
|
+
*/
|
|
567
|
+
export declare const setActivePinia: (pinia: Pinia | undefined) => Pinia | undefined;
|
|
568
|
+
|
|
569
|
+
/**
|
|
570
|
+
* Changes the suffix added by `mapStores()`. Can be set to an empty string.
|
|
571
|
+
* Defaults to `"Store"`. Make sure to extend the MapStoresCustomization
|
|
572
|
+
* interface if you are using TypeScript.
|
|
573
|
+
*
|
|
574
|
+
* @param suffix - new suffix
|
|
575
|
+
*/
|
|
576
|
+
export declare function setMapStoreSuffix(suffix: MapStoresCustomization extends Record<'suffix', string> ? MapStoresCustomization['suffix'] : string): void;
|
|
577
|
+
|
|
578
|
+
/**
|
|
579
|
+
* Tells Pinia to skip the hydration process of a given object. This is useful in setup stores (only) when you return a
|
|
580
|
+
* stateful object in the store but it isn't really state. e.g. returning a router instance in a setup store.
|
|
581
|
+
*
|
|
582
|
+
* @param obj - target object
|
|
583
|
+
* @returns obj
|
|
584
|
+
*/
|
|
585
|
+
export declare function skipHydrate<T = any>(obj: T): T;
|
|
586
|
+
|
|
587
|
+
/**
|
|
588
|
+
* For internal use **only**.
|
|
589
|
+
*/
|
|
590
|
+
export declare type _Spread<A extends readonly any[]> = A extends [infer L, ...infer R] ? _StoreObject<L> & _Spread<R> : unknown;
|
|
591
|
+
|
|
592
|
+
/**
|
|
593
|
+
* Generic state of a Store
|
|
594
|
+
*/
|
|
595
|
+
export declare type StateTree = Record<string | number | symbol, any>;
|
|
596
|
+
|
|
597
|
+
/**
|
|
598
|
+
* Store type to build a store.
|
|
599
|
+
*/
|
|
600
|
+
export declare type Store<Id extends string = string, S extends StateTree = {}, G = {}, A = {}> = _StoreWithState<Id, S, G, A> & UnwrapRef<S> & _StoreWithGetters<G> & (_ActionsTree extends A ? {} : A) & PiniaCustomProperties<Id, S, G, A> & PiniaCustomStateProperties<S>;
|
|
601
|
+
|
|
602
|
+
/**
|
|
603
|
+
* Extract the actions of a store type. Works with both a Setup Store or an
|
|
604
|
+
* Options Store.
|
|
605
|
+
*/
|
|
606
|
+
export declare type StoreActions<SS> = SS extends Store<string, StateTree, _GettersTree<StateTree>, infer A> ? A : _ExtractActionsFromSetupStore<SS>;
|
|
607
|
+
|
|
608
|
+
/**
|
|
609
|
+
* Return type of `defineStore()`. Function that allows instantiating a store.
|
|
610
|
+
*/
|
|
611
|
+
export declare interface StoreDefinition<Id extends string = string, S extends StateTree = StateTree, G = _GettersTree<S>, A = _ActionsTree> {
|
|
612
|
+
/**
|
|
613
|
+
* Returns a store, creates it if necessary.
|
|
614
|
+
*
|
|
615
|
+
* @param pinia - Pinia instance to retrieve the store
|
|
616
|
+
* @param hot - dev only hot module replacement
|
|
617
|
+
*/
|
|
618
|
+
(pinia?: Pinia | null | undefined, hot?: StoreGeneric): Store<Id, S, G, A>;
|
|
619
|
+
/**
|
|
620
|
+
* Id of the store. Used by map helpers.
|
|
621
|
+
*/
|
|
622
|
+
$id: Id;
|
|
623
|
+
/* Excluded from this release type: _pinia */
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
/**
|
|
627
|
+
* Generic and type-unsafe version of Store. Doesn't fail on access with
|
|
628
|
+
* strings, making it much easier to write generic functions that do not care
|
|
629
|
+
* about the kind of store that is passed.
|
|
630
|
+
*/
|
|
631
|
+
export declare type StoreGeneric = Store<string, StateTree, _GettersTree<StateTree>, _ActionsTree>;
|
|
632
|
+
|
|
633
|
+
/**
|
|
634
|
+
* Extract the getters of a store type. Works with both a Setup Store or an
|
|
635
|
+
* Options Store.
|
|
636
|
+
*/
|
|
637
|
+
export declare type StoreGetters<SS> = SS extends Store<string, StateTree, infer G, _ActionsTree> ? _StoreWithGetters<G> : _ExtractGettersFromSetupStore<SS>;
|
|
638
|
+
|
|
639
|
+
/**
|
|
640
|
+
* For internal use **only**.
|
|
641
|
+
*/
|
|
642
|
+
export declare type _StoreObject<S> = S extends StoreDefinition<infer Ids, infer State, infer Getters, infer Actions> ? {
|
|
643
|
+
[Id in `${Ids}${MapStoresCustomization extends Record<'suffix', string> ? MapStoresCustomization['suffix'] : 'Store'}`]: () => Store<Id extends `${infer RealId}${MapStoresCustomization extends Record<'suffix', string> ? MapStoresCustomization['suffix'] : 'Store'}` ? RealId : string, State, Getters, Actions>;
|
|
644
|
+
} : {};
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
* Argument of `store.$onAction()`
|
|
648
|
+
*/
|
|
649
|
+
export declare type StoreOnActionListener<Id extends string, S extends StateTree, G, A> = (context: StoreOnActionListenerContext<Id, S, G, {} extends A ? _ActionsTree : A>) => void;
|
|
650
|
+
|
|
651
|
+
/**
|
|
652
|
+
* Context object passed to callbacks of `store.$onAction(context => {})`
|
|
653
|
+
* TODO: should have only the Id, the Store and Actions to generate the proper object
|
|
654
|
+
*/
|
|
655
|
+
export declare type StoreOnActionListenerContext<Id extends string, S extends StateTree, G, A> = _ActionsTree extends A ? _StoreOnActionListenerContext<StoreGeneric, string, _ActionsTree> : {
|
|
656
|
+
[Name in keyof A]: Name extends string ? _StoreOnActionListenerContext<Store<Id, S, G, A>, Name, A> : never;
|
|
657
|
+
}[keyof A];
|
|
658
|
+
|
|
659
|
+
/**
|
|
660
|
+
* Actual type for {@link StoreOnActionListenerContext}. Exists for refactoring
|
|
661
|
+
* purposes. For internal use only.
|
|
662
|
+
* For internal use **only**
|
|
663
|
+
*/
|
|
664
|
+
export declare interface _StoreOnActionListenerContext<Store, ActionName extends string, A> {
|
|
665
|
+
/**
|
|
666
|
+
* Name of the action
|
|
667
|
+
*/
|
|
668
|
+
name: ActionName;
|
|
669
|
+
/**
|
|
670
|
+
* Store that is invoking the action
|
|
671
|
+
*/
|
|
672
|
+
store: Store;
|
|
673
|
+
/**
|
|
674
|
+
* Parameters passed to the action
|
|
675
|
+
*/
|
|
676
|
+
args: A extends Record<ActionName, _Method> ? Parameters<A[ActionName]> : unknown[];
|
|
677
|
+
/**
|
|
678
|
+
* Sets up a hook once the action is finished. It receives the return value
|
|
679
|
+
* of the action, if it's a Promise, it will be unwrapped.
|
|
680
|
+
*/
|
|
681
|
+
after: (callback: A extends Record<ActionName, _Method> ? (resolvedReturn: _Awaited<ReturnType<A[ActionName]>>) => void : () => void) => void;
|
|
682
|
+
/**
|
|
683
|
+
* Sets up a hook if the action fails. Return `false` to catch the error and
|
|
684
|
+
* stop it fro propagating.
|
|
685
|
+
*/
|
|
686
|
+
onError: (callback: (error: unknown) => void) => void;
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
/**
|
|
690
|
+
* Properties of a store.
|
|
691
|
+
*/
|
|
692
|
+
export declare interface StoreProperties<Id extends string> {
|
|
693
|
+
/**
|
|
694
|
+
* Unique identifier of the store
|
|
695
|
+
*/
|
|
696
|
+
$id: Id;
|
|
697
|
+
/* Excluded from this release type: _p */
|
|
698
|
+
/* Excluded from this release type: _getters */
|
|
699
|
+
/* Excluded from this release type: _isOptionsAPI */
|
|
700
|
+
/**
|
|
701
|
+
* Used by devtools plugin to retrieve properties added with plugins. Removed
|
|
702
|
+
* in production. Can be used by the user to add property keys of the store
|
|
703
|
+
* that should be displayed in devtools.
|
|
704
|
+
*/
|
|
705
|
+
_customProperties: Set<string>;
|
|
706
|
+
/* Excluded from this release type: _hotUpdate */
|
|
707
|
+
/* Excluded from this release type: _hotUpdating */
|
|
708
|
+
/* Excluded from this release type: _hmrPayload */
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
/**
|
|
712
|
+
* Extract the state of a store type. Works with both a Setup Store or an
|
|
713
|
+
* Options Store. Note this unwraps refs.
|
|
714
|
+
*/
|
|
715
|
+
export declare type StoreState<SS> = SS extends Store<string, infer S, _GettersTree<StateTree>, _ActionsTree> ? UnwrapRef<S> : _ExtractStateFromSetupStore<SS>;
|
|
716
|
+
|
|
717
|
+
/**
|
|
718
|
+
* Creates an object of references with all the state, getters, and plugin-added
|
|
719
|
+
* state properties of the store. Similar to `toRefs()` but specifically
|
|
720
|
+
* designed for Pinia stores so methods and non reactive properties are
|
|
721
|
+
* completely ignored.
|
|
722
|
+
*
|
|
723
|
+
* @param store - store to extract the refs from
|
|
724
|
+
*/
|
|
725
|
+
export declare function storeToRefs<SS extends StoreGeneric>(store: SS): ToRefs<StoreState<SS> & StoreGetters<SS> & PiniaCustomStateProperties<StoreState<SS>>>;
|
|
726
|
+
|
|
727
|
+
/**
|
|
728
|
+
* Store augmented for actions. For internal usage only.
|
|
729
|
+
* For internal use **only**
|
|
730
|
+
*/
|
|
731
|
+
export declare type _StoreWithActions<A> = {
|
|
732
|
+
[k in keyof A]: A[k] extends (...args: infer P) => infer R ? (...args: P) => R : never;
|
|
733
|
+
};
|
|
734
|
+
|
|
735
|
+
/**
|
|
736
|
+
* Store augmented with getters. For internal usage only.
|
|
737
|
+
* For internal use **only**
|
|
738
|
+
*/
|
|
739
|
+
export declare type _StoreWithGetters<G> = {
|
|
740
|
+
readonly [k in keyof G]: G[k] extends (...args: any[]) => infer R ? R : UnwrapRef<G[k]>;
|
|
741
|
+
};
|
|
742
|
+
|
|
743
|
+
/**
|
|
744
|
+
* Base store with state and functions. Should not be used directly.
|
|
745
|
+
*/
|
|
746
|
+
export declare interface _StoreWithState<Id extends string, S extends StateTree, G, A> extends StoreProperties<Id> {
|
|
747
|
+
/**
|
|
748
|
+
* State of the Store. Setting it will replace the whole state.
|
|
749
|
+
*/
|
|
750
|
+
$state: UnwrapRef<S> & PiniaCustomStateProperties<S>;
|
|
751
|
+
/**
|
|
752
|
+
* Applies a state patch to current state. Allows passing nested values
|
|
753
|
+
*
|
|
754
|
+
* @param partialState - patch to apply to the state
|
|
755
|
+
*/
|
|
756
|
+
$patch(partialState: _DeepPartial<UnwrapRef<S>>): void;
|
|
757
|
+
/**
|
|
758
|
+
* Group multiple changes into one function. Useful when mutating objects like
|
|
759
|
+
* Sets or arrays and applying an object patch isn't practical, e.g. appending
|
|
760
|
+
* to an array. The function passed to `$patch()` **must be synchronous**.
|
|
761
|
+
*
|
|
762
|
+
* @param stateMutator - function that mutates `state`, cannot be async
|
|
763
|
+
*/
|
|
764
|
+
$patch<F extends (state: UnwrapRef<S>) => any>(stateMutator: ReturnType<F> extends Promise<any> ? never : F): void;
|
|
765
|
+
/**
|
|
766
|
+
* Resets the store to its initial state by building a new state object.
|
|
767
|
+
* TODO: make this options only
|
|
768
|
+
*/
|
|
769
|
+
$reset(): void;
|
|
770
|
+
/**
|
|
771
|
+
* Setups a callback to be called whenever the state changes. It also returns a function to remove the callback. Note
|
|
772
|
+
* that when calling `store.$subscribe()` inside of a component, it will be automatically cleaned up when the
|
|
773
|
+
* component gets unmounted unless `detached` is set to true.
|
|
774
|
+
*
|
|
775
|
+
* @param callback - callback passed to the watcher
|
|
776
|
+
* @param options - `watch` options + `detached` to detach the subscription from the context (usually a component)
|
|
777
|
+
* this is called from. Note that the `flush` option does not affect calls to `store.$patch()`.
|
|
778
|
+
* @returns function that removes the watcher
|
|
779
|
+
*/
|
|
780
|
+
$subscribe(callback: SubscriptionCallback<S>, options?: {
|
|
781
|
+
detached?: boolean;
|
|
782
|
+
} & WatchOptions): () => void;
|
|
783
|
+
/**
|
|
784
|
+
* Setups a callback to be called every time an action is about to get
|
|
785
|
+
* invoked. The callback receives an object with all the relevant information
|
|
786
|
+
* of the invoked action:
|
|
787
|
+
* - `store`: the store it is invoked on
|
|
788
|
+
* - `name`: The name of the action
|
|
789
|
+
* - `args`: The parameters passed to the action
|
|
790
|
+
*
|
|
791
|
+
* On top of these, it receives two functions that allow setting up a callback
|
|
792
|
+
* once the action finishes or when it fails.
|
|
793
|
+
*
|
|
794
|
+
* It also returns a function to remove the callback. Note than when calling
|
|
795
|
+
* `store.$onAction()` inside of a component, it will be automatically cleaned
|
|
796
|
+
* up when the component gets unmounted unless `detached` is set to true.
|
|
797
|
+
*
|
|
798
|
+
* @example
|
|
799
|
+
*
|
|
800
|
+
*```js
|
|
801
|
+
*store.$onAction(({ after, onError }) => {
|
|
802
|
+
* // Here you could share variables between all of the hooks as well as
|
|
803
|
+
* // setting up watchers and clean them up
|
|
804
|
+
* after((resolvedValue) => {
|
|
805
|
+
* // can be used to cleanup side effects
|
|
806
|
+
* . // `resolvedValue` is the value returned by the action, if it's a
|
|
807
|
+
* . // Promise, it will be the resolved value instead of the Promise
|
|
808
|
+
* })
|
|
809
|
+
* onError((error) => {
|
|
810
|
+
* // can be used to pass up errors
|
|
811
|
+
* })
|
|
812
|
+
*})
|
|
813
|
+
*```
|
|
814
|
+
*
|
|
815
|
+
* @param callback - callback called before every action
|
|
816
|
+
* @param detached - detach the subscription from the context this is called from
|
|
817
|
+
* @returns function that removes the watcher
|
|
818
|
+
*/
|
|
819
|
+
$onAction(callback: StoreOnActionListener<Id, S, G, A>, detached?: boolean): () => void;
|
|
820
|
+
/**
|
|
821
|
+
* Stops the associated effect scope of the store and remove it from the store
|
|
822
|
+
* registry. Plugins can override this method to cleanup any added effects.
|
|
823
|
+
* e.g. devtools plugin stops displaying disposed stores from devtools.
|
|
824
|
+
*/
|
|
825
|
+
$dispose(): void;
|
|
826
|
+
/* Excluded from this release type: _r */
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
/**
|
|
830
|
+
* Callback of a subscription
|
|
831
|
+
*/
|
|
832
|
+
export declare type SubscriptionCallback<S> = (
|
|
833
|
+
/**
|
|
834
|
+
* Object with information relative to the store mutation that triggered the
|
|
835
|
+
* subscription.
|
|
836
|
+
*/
|
|
837
|
+
mutation: SubscriptionCallbackMutation<S>,
|
|
838
|
+
/**
|
|
839
|
+
* State of the store when the subscription is triggered. Same as
|
|
840
|
+
* `store.$state`.
|
|
841
|
+
*/
|
|
842
|
+
state: UnwrapRef<S>) => void;
|
|
843
|
+
|
|
844
|
+
/**
|
|
845
|
+
* Context object passed to a subscription callback.
|
|
846
|
+
*/
|
|
847
|
+
export declare type SubscriptionCallbackMutation<S> = SubscriptionCallbackMutationDirect | SubscriptionCallbackMutationPatchObject<S> | SubscriptionCallbackMutationPatchFunction;
|
|
848
|
+
|
|
849
|
+
/**
|
|
850
|
+
* Base type for the context passed to a subscription callback. Internal type.
|
|
851
|
+
*/
|
|
852
|
+
export declare interface _SubscriptionCallbackMutationBase {
|
|
853
|
+
/**
|
|
854
|
+
* Type of the mutation.
|
|
855
|
+
*/
|
|
856
|
+
type: MutationType;
|
|
857
|
+
/**
|
|
858
|
+
* `id` of the store doing the mutation.
|
|
859
|
+
*/
|
|
860
|
+
storeId: string;
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
/**
|
|
864
|
+
* Context passed to a subscription callback when directly mutating the state of
|
|
865
|
+
* a store with `store.someState = newValue` or `store.$state.someState =
|
|
866
|
+
* newValue`.
|
|
867
|
+
*/
|
|
868
|
+
export declare interface SubscriptionCallbackMutationDirect extends _SubscriptionCallbackMutationBase {
|
|
869
|
+
type: MutationType.direct;
|
|
870
|
+
/**
|
|
871
|
+
* DEV ONLY. Different mutation calls.
|
|
872
|
+
*/
|
|
873
|
+
events: DebuggerEvent;
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
/**
|
|
877
|
+
* Context passed to a subscription callback when `store.$patch()` is called
|
|
878
|
+
* with a function.
|
|
879
|
+
*/
|
|
880
|
+
export declare interface SubscriptionCallbackMutationPatchFunction extends _SubscriptionCallbackMutationBase {
|
|
881
|
+
type: MutationType.patchFunction;
|
|
882
|
+
/**
|
|
883
|
+
* DEV ONLY. Array of all the mutations done inside of the callback.
|
|
884
|
+
*/
|
|
885
|
+
events: DebuggerEvent[];
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
/**
|
|
889
|
+
* Context passed to a subscription callback when `store.$patch()` is called
|
|
890
|
+
* with an object.
|
|
891
|
+
*/
|
|
892
|
+
export declare interface SubscriptionCallbackMutationPatchObject<S> extends _SubscriptionCallbackMutationBase {
|
|
893
|
+
type: MutationType.patchObject;
|
|
894
|
+
/**
|
|
895
|
+
* DEV ONLY. Array for patch calls.
|
|
896
|
+
*/
|
|
897
|
+
events: DebuggerEvent[];
|
|
898
|
+
/**
|
|
899
|
+
* Object passed to `store.$patch()`.
|
|
900
|
+
*/
|
|
901
|
+
payload: _DeepPartial<S>;
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
/**
|
|
905
|
+
* Type that enables refactoring through IDE.
|
|
906
|
+
* For internal use **only**
|
|
907
|
+
*/
|
|
908
|
+
export declare type _UnwrapAll<SS> = {
|
|
909
|
+
[K in keyof SS]: UnwrapRef<SS[K]>;
|
|
910
|
+
};
|
|
911
|
+
|
|
912
|
+
export { }
|
|
913
|
+
|
|
914
|
+
// Extensions of Vue types to be appended manually
|
|
915
|
+
// https://github.com/microsoft/rushstack/issues/2090
|
|
916
|
+
// https://github.com/microsoft/rushstack/issues/1709
|
|
917
|
+
|
|
918
|
+
// @ts-ignore: works on Vue 2, fails in Vue 3
|
|
919
|
+
declare module 'vue/types/vue' {
|
|
920
|
+
interface Vue {
|
|
921
|
+
/**
|
|
922
|
+
* Currently installed pinia instance.
|
|
923
|
+
*/
|
|
924
|
+
$pinia: Pinia
|
|
925
|
+
|
|
926
|
+
/**
|
|
927
|
+
* Cache of stores instantiated by the current instance. Used by map
|
|
928
|
+
* helpers. Used internally by Pinia.
|
|
929
|
+
*
|
|
930
|
+
* @internal
|
|
931
|
+
*/
|
|
932
|
+
_pStores?: Record<string, Store>
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
// @ts-ignore: works on Vue 2, fails in Vue 3
|
|
937
|
+
declare module 'vue/types/options' {
|
|
938
|
+
interface ComponentOptions<V> {
|
|
939
|
+
/**
|
|
940
|
+
* Pinia instance to install in your application. Should be passed to the
|
|
941
|
+
* root Vue.
|
|
942
|
+
*/
|
|
943
|
+
pinia?: Pinia
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
// @ts-ignore: works on Vue 3, fails in Vue 2
|
|
948
|
+
declare module '@vue/runtime-core' {
|
|
949
|
+
export interface ComponentCustomProperties {
|
|
950
|
+
/**
|
|
951
|
+
* Access to the application's Pinia
|
|
952
|
+
*/
|
|
953
|
+
$pinia: Pinia
|
|
954
|
+
|
|
955
|
+
/**
|
|
956
|
+
* Cache of stores instantiated by the current instance. Used by devtools to
|
|
957
|
+
* list currently used stores. Used internally by Pinia.
|
|
958
|
+
*
|
|
959
|
+
* @internal
|
|
960
|
+
*/
|
|
961
|
+
_pStores?: Record<string, StoreGeneric>
|
|
962
|
+
}
|
|
963
|
+
}
|