@histoire/vendors 0.17.17 → 1.0.0-alpha.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.js +2175 -2150
- package/dist/client/b-iconify.js +663 -850
- package/dist/client/b-pinia.js +130 -68
- package/dist/client/b-scroll.js +3 -52
- package/dist/client/b-vue-router.js +385 -237
- package/dist/client/b-vue-use.js +4578 -3115
- package/dist/client/b-vue.js +1 -1
- package/dist/client/index.js +162 -20
- package/dist/client/node_modules/@babel/helper-string-parser/package.json +31 -0
- package/dist/client/node_modules/@babel/helper-validator-identifier/package.json +31 -0
- package/dist/client/node_modules/@babel/parser/package.json +10 -6
- package/dist/client/node_modules/@babel/parser/typings/babel-parser.d.ts +167 -188
- package/dist/client/node_modules/@babel/types/lib/index-legacy.d.ts +2786 -0
- package/dist/client/node_modules/@babel/types/lib/index.d.ts +3286 -0
- package/dist/client/node_modules/@babel/types/package.json +39 -0
- package/dist/client/node_modules/@floating-ui/core/dist/floating-ui.core.d.ts +525 -0
- package/dist/client/node_modules/@floating-ui/core/package.json +32 -39
- package/dist/client/node_modules/@floating-ui/dom/package.json +23 -24
- package/dist/client/node_modules/@floating-ui/dom/src/autoUpdate.d.ts +31 -0
- package/dist/client/node_modules/@floating-ui/dom/src/index.d.ts +11 -7
- package/dist/client/node_modules/@floating-ui/dom/src/platform.d.ts +1 -1
- package/dist/client/node_modules/@floating-ui/dom/src/types.d.ts +121 -20
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getBoundingClientRect.d.ts +1 -1
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getClippingRect.d.ts +12 -0
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getCssDimensions.d.ts +4 -0
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getDimensions.d.ts +1 -1
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getNearestOverflowAncestor.d.ts +1 -0
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getOverflowAncestors.d.ts +3 -0
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getScale.d.ts +7 -0
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getViewportRect.d.ts +2 -2
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getWindowScrollBarX.d.ts +1 -1
- package/dist/client/node_modules/@floating-ui/dom/src/utils/is.d.ts +3 -1
- package/dist/client/node_modules/@floating-ui/dom/src/utils/unwrapElement.d.ts +2 -0
- package/dist/client/node_modules/@floating-ui/dom/src/utils/userAgent.d.ts +1 -0
- package/dist/client/node_modules/@floating-ui/dom/src/utils/window.d.ts +1 -2
- package/dist/client/node_modules/@floating-ui/utils/dist/floating-ui.utils.d.ts +103 -0
- package/dist/client/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.d.ts +47 -0
- package/dist/client/node_modules/@floating-ui/utils/dom/floating-ui.utils.dom.d.ts +47 -0
- package/dist/client/node_modules/@floating-ui/utils/dom/package.json +6 -0
- package/dist/client/node_modules/@floating-ui/utils/package.json +70 -0
- package/dist/client/node_modules/@iconify/types/package.json +23 -0
- package/dist/client/node_modules/@iconify/types/provider.d.ts +44 -0
- package/dist/client/node_modules/@iconify/types/types.d.ts +272 -0
- package/dist/client/node_modules/@iconify/vue/dist/iconify.d.ts +122 -327
- package/dist/client/node_modules/@iconify/vue/dist/offline.d.ts +36 -269
- package/dist/client/node_modules/@iconify/vue/package.json +64 -60
- package/dist/client/node_modules/@jridgewell/sourcemap-codec/dist/types/scopes.d.ts +49 -0
- package/dist/client/node_modules/@jridgewell/sourcemap-codec/dist/types/sourcemap-codec.d.ts +2 -0
- package/dist/client/node_modules/@jridgewell/sourcemap-codec/dist/types/strings.d.ts +15 -0
- package/dist/client/node_modules/@jridgewell/sourcemap-codec/dist/types/vlq.d.ts +6 -0
- package/dist/client/node_modules/@jridgewell/sourcemap-codec/package.json +3 -2
- package/dist/client/node_modules/@types/web-bluetooth/index.d.ts +33 -14
- package/dist/client/node_modules/@types/web-bluetooth/package.json +12 -12
- package/dist/client/node_modules/@vue/compiler-core/dist/compiler-core.d.ts +218 -125
- package/dist/client/node_modules/@vue/compiler-core/package.json +20 -5
- package/dist/client/node_modules/@vue/compiler-dom/dist/compiler-dom.d.ts +6 -3
- package/dist/client/node_modules/@vue/compiler-dom/package.json +17 -3
- package/dist/client/node_modules/@vue/compiler-sfc/dist/compiler-sfc.d.ts +35 -25
- package/dist/client/node_modules/@vue/compiler-sfc/package.json +27 -18
- package/dist/client/node_modules/@vue/compiler-ssr/dist/compiler-ssr.d.ts +2 -2
- package/dist/client/node_modules/@vue/compiler-ssr/package.json +3 -3
- package/dist/client/node_modules/@vue/devtools-api/package.json +1 -1
- package/dist/client/node_modules/@vue/reactivity/dist/reactivity.d.ts +268 -166
- package/dist/client/node_modules/@vue/reactivity/package.json +16 -2
- package/dist/client/node_modules/@vue/runtime-core/dist/runtime-core.d.ts +728 -529
- package/dist/client/node_modules/@vue/runtime-core/package.json +17 -3
- package/dist/client/node_modules/@vue/runtime-dom/dist/runtime-dom.d.ts +195 -86
- package/dist/client/node_modules/@vue/runtime-dom/package.json +22 -4
- package/dist/client/node_modules/@vue/server-renderer/dist/server-renderer.d.ts +4 -8
- package/dist/client/node_modules/@vue/server-renderer/package.json +18 -4
- package/dist/client/node_modules/@vue/shared/dist/shared.d.ts +45 -30
- package/dist/client/node_modules/@vue/shared/package.json +15 -1
- package/dist/client/node_modules/@vueuse/core/index.d.ts +2323 -666
- package/dist/client/node_modules/@vueuse/core/package.json +22 -12
- package/dist/client/node_modules/@vueuse/metadata/index.d.ts +7 -5
- package/dist/client/node_modules/@vueuse/metadata/package.json +14 -7
- package/dist/client/node_modules/@vueuse/shared/index.d.ts +451 -280
- package/dist/client/node_modules/@vueuse/shared/package.json +17 -6
- package/dist/client/node_modules/compute-scroll-into-view/dist/index.d.ts +75 -0
- package/dist/client/node_modules/compute-scroll-into-view/package.json +35 -45
- package/dist/client/node_modules/entities/lib/decode.d.ts +211 -0
- package/dist/client/node_modules/entities/lib/decode_codepoint.d.ts +19 -0
- package/dist/client/node_modules/entities/lib/encode.d.ts +22 -0
- package/dist/client/node_modules/entities/lib/escape.d.ts +43 -0
- package/dist/client/node_modules/entities/lib/esm/decode.d.ts +211 -0
- package/dist/client/node_modules/entities/lib/esm/decode_codepoint.d.ts +19 -0
- package/dist/client/node_modules/entities/lib/esm/encode.d.ts +22 -0
- package/dist/client/node_modules/entities/lib/esm/escape.d.ts +43 -0
- package/dist/client/node_modules/entities/lib/esm/generated/decode-data-html.d.ts +3 -0
- package/dist/client/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts +3 -0
- package/dist/client/node_modules/entities/lib/esm/generated/encode-html.d.ts +8 -0
- package/dist/client/node_modules/entities/lib/esm/index.d.ts +96 -0
- package/dist/client/node_modules/entities/lib/esm/package.json +1 -0
- package/dist/client/node_modules/entities/lib/generated/decode-data-html.d.ts +3 -0
- package/dist/client/node_modules/entities/lib/generated/decode-data-xml.d.ts +3 -0
- package/dist/client/node_modules/entities/lib/generated/encode-html.d.ts +8 -0
- package/dist/client/node_modules/entities/lib/index.d.ts +96 -0
- package/dist/client/node_modules/entities/package.json +90 -0
- package/dist/client/node_modules/floating-vue/dist/components/Dropdown.d.ts +398 -0
- package/dist/client/node_modules/floating-vue/dist/components/Menu.d.ts +398 -0
- package/dist/client/node_modules/floating-vue/dist/components/Popper.d.ts +225 -105
- package/dist/client/node_modules/floating-vue/dist/components/Popper.vue.d.ts +471 -364
- package/dist/client/node_modules/floating-vue/dist/components/PopperContent.vue.d.ts +14 -25
- package/dist/client/node_modules/floating-vue/dist/components/PopperWrapper.vue.d.ts +392 -6
- package/dist/client/node_modules/floating-vue/dist/components/Tooltip.d.ts +398 -0
- package/dist/client/node_modules/floating-vue/dist/components/TooltipDirective.vue.d.ts +49 -10
- package/dist/client/node_modules/floating-vue/dist/config.d.ts +1 -1
- package/dist/client/node_modules/floating-vue/dist/index.d.ts +2071 -247
- package/dist/client/node_modules/floating-vue/dist/util/events.d.ts +2 -0
- package/dist/client/node_modules/floating-vue/dist/util/popper.d.ts +1 -1
- package/dist/client/node_modules/floating-vue/package.json +42 -33
- package/dist/client/node_modules/magic-string/dist/magic-string.cjs.d.ts +250 -229
- package/dist/client/node_modules/magic-string/package.json +24 -26
- package/dist/client/node_modules/nanoid/package.json +1 -1
- package/dist/client/node_modules/picocolors/package.json +2 -2
- package/dist/client/node_modules/picocolors/types.d.ts +51 -0
- package/dist/client/node_modules/pinia/dist/pinia.d.ts +116 -37
- package/dist/client/node_modules/pinia/package.json +7 -11
- package/dist/client/node_modules/postcss/lib/at-rule.d.ts +22 -19
- package/dist/client/node_modules/postcss/lib/comment.d.ts +6 -5
- package/dist/client/node_modules/postcss/lib/container.d.ts +72 -82
- package/dist/client/node_modules/postcss/lib/css-syntax-error.d.ts +1 -1
- package/dist/client/node_modules/postcss/lib/declaration.d.ts +16 -13
- package/dist/client/node_modules/postcss/lib/document.d.ts +4 -4
- package/dist/client/node_modules/postcss/lib/input.d.ts +28 -16
- package/dist/client/node_modules/postcss/lib/lazy-result.d.ts +40 -40
- package/dist/client/node_modules/postcss/lib/list.d.ts +5 -2
- package/dist/client/node_modules/postcss/lib/no-work-result.d.ts +5 -5
- package/dist/client/node_modules/postcss/lib/node.d.ts +19 -14
- package/dist/client/node_modules/postcss/lib/postcss.d.ts +25 -8
- package/dist/client/node_modules/postcss/lib/processor.d.ts +1 -1
- package/dist/client/node_modules/postcss/lib/result.d.ts +10 -11
- package/dist/client/node_modules/postcss/lib/root.d.ts +4 -4
- package/dist/client/node_modules/postcss/lib/rule.d.ts +22 -13
- package/dist/client/node_modules/postcss/package.json +4 -4
- package/dist/client/node_modules/scroll-into-view-if-needed/dist/index.d.ts +79 -0
- package/dist/client/node_modules/scroll-into-view-if-needed/package.json +28 -67
- package/dist/client/node_modules/source-map-js/lib/source-map-consumer.d.ts +1 -0
- package/dist/client/node_modules/source-map-js/lib/source-map-generator.d.ts +1 -0
- package/dist/client/node_modules/source-map-js/lib/source-node.d.ts +1 -0
- package/dist/client/node_modules/source-map-js/package.json +1 -1
- package/dist/client/node_modules/source-map-js/source-map.d.ts +88 -99
- package/dist/client/node_modules/vue/dist/vue.d.ts +0 -4
- package/dist/client/node_modules/vue/jsx-runtime/index.d.ts +2 -1
- package/dist/client/node_modules/vue/jsx.d.ts +2 -1
- package/dist/client/node_modules/vue/package.json +13 -14
- package/dist/client/node_modules/{pinia/node_modules/vue-demi → vue-demi}/package.json +1 -1
- package/dist/client/node_modules/vue-router/dist/vue-router.d.ts +410 -81
- package/dist/client/node_modules/vue-router/package.json +66 -37
- package/dist/client/node_modules/vue-router/vue-router-auto-routes.d.ts +4 -0
- package/dist/client/node_modules/vue-router/vue-router-auto.d.ts +4 -0
- package/dist/client/vue.runtime.esm-bundler.js +6458 -4714
- package/package.json +17 -17
- package/rollup.config.mjs +6 -6
- package/dist/client/index2.js +0 -168
- package/dist/client/node_modules/@floating-ui/core/index.d.ts +0 -1
- package/dist/client/node_modules/@floating-ui/core/src/_babel.d.ts +0 -1
- package/dist/client/node_modules/@floating-ui/core/src/computeCoordsFromPlacement.d.ts +0 -4
- package/dist/client/node_modules/@floating-ui/core/src/computePosition.d.ts +0 -2
- package/dist/client/node_modules/@floating-ui/core/src/detectOverflow.d.ts +0 -9
- package/dist/client/node_modules/@floating-ui/core/src/enums.d.ts +0 -4
- package/dist/client/node_modules/@floating-ui/core/src/index.d.ts +0 -11
- package/dist/client/node_modules/@floating-ui/core/src/middleware/arrow.d.ts +0 -6
- package/dist/client/node_modules/@floating-ui/core/src/middleware/autoPlacement.d.ts +0 -9
- package/dist/client/node_modules/@floating-ui/core/src/middleware/flip.d.ts +0 -10
- package/dist/client/node_modules/@floating-ui/core/src/middleware/hide.d.ts +0 -2
- package/dist/client/node_modules/@floating-ui/core/src/middleware/inline.d.ts +0 -5
- package/dist/client/node_modules/@floating-ui/core/src/middleware/offset.d.ts +0 -21
- package/dist/client/node_modules/@floating-ui/core/src/middleware/shift.d.ts +0 -32
- package/dist/client/node_modules/@floating-ui/core/src/middleware/size.d.ts +0 -6
- package/dist/client/node_modules/@floating-ui/core/src/types.d.ts +0 -148
- package/dist/client/node_modules/@floating-ui/core/src/utils/expandPaddingObject.d.ts +0 -2
- package/dist/client/node_modules/@floating-ui/core/src/utils/getAlignment.d.ts +0 -2
- package/dist/client/node_modules/@floating-ui/core/src/utils/getAlignmentSides.d.ts +0 -5
- package/dist/client/node_modules/@floating-ui/core/src/utils/getBasePlacement.d.ts +0 -2
- package/dist/client/node_modules/@floating-ui/core/src/utils/getCrossAxis.d.ts +0 -2
- package/dist/client/node_modules/@floating-ui/core/src/utils/getExpandedPlacements.d.ts +0 -2
- package/dist/client/node_modules/@floating-ui/core/src/utils/getLengthFromAxis.d.ts +0 -2
- package/dist/client/node_modules/@floating-ui/core/src/utils/getMainAxisFromPlacement.d.ts +0 -2
- package/dist/client/node_modules/@floating-ui/core/src/utils/getOppositeAlignmentPlacement.d.ts +0 -2
- package/dist/client/node_modules/@floating-ui/core/src/utils/getOppositePlacement.d.ts +0 -1
- package/dist/client/node_modules/@floating-ui/core/src/utils/getPaddingObject.d.ts +0 -2
- package/dist/client/node_modules/@floating-ui/core/src/utils/math.d.ts +0 -2
- package/dist/client/node_modules/@floating-ui/core/src/utils/rectToClientRect.d.ts +0 -2
- package/dist/client/node_modules/@floating-ui/core/src/utils/within.d.ts +0 -1
- package/dist/client/node_modules/@floating-ui/dom/src/utils/contains.d.ts +0 -1
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getClippingClientRect.d.ts +0 -6
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getScrollParent.d.ts +0 -1
- package/dist/client/node_modules/@floating-ui/dom/src/utils/getScrollParents.d.ts +0 -1
- package/dist/client/node_modules/@vue/reactivity-transform/dist/reactivity-transform.d.ts +0 -43
- package/dist/client/node_modules/@vue/reactivity-transform/package.json +0 -41
- package/dist/client/node_modules/@vueuse/core/node_modules/vue-demi/package.json +0 -47
- package/dist/client/node_modules/@vueuse/shared/node_modules/vue-demi/lib/index.d.ts +0 -22
- package/dist/client/node_modules/@vueuse/shared/node_modules/vue-demi/lib/v2/index.d.ts +0 -33
- package/dist/client/node_modules/@vueuse/shared/node_modules/vue-demi/lib/v2.7/index.d.ts +0 -38
- package/dist/client/node_modules/@vueuse/shared/node_modules/vue-demi/lib/v3/index.d.ts +0 -22
- package/dist/client/node_modules/@vueuse/shared/node_modules/vue-demi/package.json +0 -47
- package/dist/client/node_modules/compute-scroll-into-view/typings/index.d.ts +0 -19
- package/dist/client/node_modules/floating-vue/dist/components/Dropdown.vue.d.ts +0 -25
- package/dist/client/node_modules/floating-vue/dist/components/Menu.vue.d.ts +0 -25
- package/dist/client/node_modules/floating-vue/dist/components/Tooltip.vue.d.ts +0 -25
- package/dist/client/node_modules/floating-vue/src/global-shim.d.ts +0 -1
- package/dist/client/node_modules/floating-vue/src/vue-shim.d.ts +0 -5
- package/dist/client/node_modules/pinia/node_modules/vue-demi/lib/index.d.ts +0 -22
- package/dist/client/node_modules/pinia/node_modules/vue-demi/lib/v2/index.d.ts +0 -33
- package/dist/client/node_modules/pinia/node_modules/vue-demi/lib/v2.7/index.d.ts +0 -38
- package/dist/client/node_modules/pinia/node_modules/vue-demi/lib/v3/index.d.ts +0 -22
- package/dist/client/node_modules/scroll-into-view-if-needed/typings/index.d.ts +0 -13
- package/dist/client/node_modules/scroll-into-view-if-needed/typings/types.d.ts +0 -19
- package/dist/client/node_modules/vue/macros-global.d.ts +0 -19
- package/dist/client/node_modules/vue/macros.d.ts +0 -112
- package/dist/client/node_modules/vue/ref-macros.d.ts +0 -2
- /package/dist/client/node_modules/{@vueuse/core/node_modules/vue-demi → vue-demi}/lib/index.d.ts +0 -0
- /package/dist/client/node_modules/{@vueuse/core/node_modules/vue-demi → vue-demi}/lib/v2/index.d.ts +0 -0
- /package/dist/client/node_modules/{@vueuse/core/node_modules/vue-demi → vue-demi}/lib/v2.7/index.d.ts +0 -0
- /package/dist/client/node_modules/{@vueuse/core/node_modules/vue-demi → vue-demi}/lib/v3/index.d.ts +0 -0
|
@@ -1,29 +1,60 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { RawSourceMap, SourceMapGenerator } from 'source-map-js';
|
|
3
|
-
import { Node as Node$1, Identifier, Function, BlockStatement as BlockStatement$1, Program, ObjectProperty } from '@babel/types';
|
|
1
|
+
import { PatchFlags } from '@vue/shared';
|
|
4
2
|
export { generateCodeFrame } from '@vue/shared';
|
|
3
|
+
import { Node as Node$1, Identifier, Function, BlockStatement as BlockStatement$1, Program, ObjectProperty } from '@babel/types';
|
|
4
|
+
import { ParserPlugin } from '@babel/parser';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
export declare const FRAGMENT: unique symbol;
|
|
7
|
+
export declare const TELEPORT: unique symbol;
|
|
8
|
+
export declare const SUSPENSE: unique symbol;
|
|
9
|
+
export declare const KEEP_ALIVE: unique symbol;
|
|
10
|
+
export declare const BASE_TRANSITION: unique symbol;
|
|
11
|
+
export declare const OPEN_BLOCK: unique symbol;
|
|
12
|
+
export declare const CREATE_BLOCK: unique symbol;
|
|
13
|
+
export declare const CREATE_ELEMENT_BLOCK: unique symbol;
|
|
14
|
+
export declare const CREATE_VNODE: unique symbol;
|
|
15
|
+
export declare const CREATE_ELEMENT_VNODE: unique symbol;
|
|
16
|
+
export declare const CREATE_COMMENT: unique symbol;
|
|
17
|
+
export declare const CREATE_TEXT: unique symbol;
|
|
18
|
+
export declare const CREATE_STATIC: unique symbol;
|
|
19
|
+
export declare const RESOLVE_COMPONENT: unique symbol;
|
|
20
|
+
export declare const RESOLVE_DYNAMIC_COMPONENT: unique symbol;
|
|
21
|
+
export declare const RESOLVE_DIRECTIVE: unique symbol;
|
|
22
|
+
export declare const RESOLVE_FILTER: unique symbol;
|
|
23
|
+
export declare const WITH_DIRECTIVES: unique symbol;
|
|
24
|
+
export declare const RENDER_LIST: unique symbol;
|
|
25
|
+
export declare const RENDER_SLOT: unique symbol;
|
|
26
|
+
export declare const CREATE_SLOTS: unique symbol;
|
|
27
|
+
export declare const TO_DISPLAY_STRING: unique symbol;
|
|
28
|
+
export declare const MERGE_PROPS: unique symbol;
|
|
29
|
+
export declare const NORMALIZE_CLASS: unique symbol;
|
|
30
|
+
export declare const NORMALIZE_STYLE: unique symbol;
|
|
31
|
+
export declare const NORMALIZE_PROPS: unique symbol;
|
|
32
|
+
export declare const GUARD_REACTIVE_PROPS: unique symbol;
|
|
33
|
+
export declare const TO_HANDLERS: unique symbol;
|
|
34
|
+
export declare const CAMELIZE: unique symbol;
|
|
35
|
+
export declare const CAPITALIZE: unique symbol;
|
|
36
|
+
export declare const TO_HANDLER_KEY: unique symbol;
|
|
37
|
+
export declare const SET_BLOCK_TRACKING: unique symbol;
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated no longer needed in 3.5+ because we no longer hoist element nodes
|
|
40
|
+
* but kept for backwards compat
|
|
41
|
+
*/
|
|
42
|
+
export declare const PUSH_SCOPE_ID: unique symbol;
|
|
43
|
+
/**
|
|
44
|
+
* @deprecated kept for backwards compat
|
|
45
|
+
*/
|
|
46
|
+
export declare const POP_SCOPE_ID: unique symbol;
|
|
47
|
+
export declare const WITH_CTX: unique symbol;
|
|
48
|
+
export declare const UNREF: unique symbol;
|
|
49
|
+
export declare const IS_REF: unique symbol;
|
|
50
|
+
export declare const WITH_MEMO: unique symbol;
|
|
51
|
+
export declare const IS_MEMO_SAME: unique symbol;
|
|
52
|
+
export declare const helperNameMap: Record<symbol, string>;
|
|
53
|
+
export declare function registerRuntimeHelpers(helpers: Record<symbol, string>): void;
|
|
54
|
+
|
|
55
|
+
type OptionalOptions = 'decodeEntities' | 'whitespace' | 'isNativeTag' | 'isBuiltInComponent' | 'expressionPlugins' | keyof CompilerCompatOptions;
|
|
7
56
|
type MergedParserOptions = Omit<Required<ParserOptions>, OptionalOptions> & Pick<ParserOptions, OptionalOptions>;
|
|
8
|
-
export declare
|
|
9
|
-
DATA = 0,
|
|
10
|
-
RCDATA = 1,
|
|
11
|
-
RAWTEXT = 2,
|
|
12
|
-
CDATA = 3,
|
|
13
|
-
ATTRIBUTE_VALUE = 4
|
|
14
|
-
}
|
|
15
|
-
interface ParserContext {
|
|
16
|
-
options: MergedParserOptions;
|
|
17
|
-
readonly originalSource: string;
|
|
18
|
-
source: string;
|
|
19
|
-
offset: number;
|
|
20
|
-
line: number;
|
|
21
|
-
column: number;
|
|
22
|
-
inPre: boolean;
|
|
23
|
-
inVPre: boolean;
|
|
24
|
-
onWarn: NonNullable<ErrorHandlingOptions['onWarn']>;
|
|
25
|
-
}
|
|
26
|
-
export declare function baseParse(content: string, options?: ParserOptions): RootNode;
|
|
57
|
+
export declare function baseParse(input: string, options?: ParserOptions): RootNode;
|
|
27
58
|
|
|
28
59
|
type CompilerCompatConfig = Partial<Record<CompilerDeprecationTypes, boolean | 'suppress-warning'>> & {
|
|
29
60
|
MODE?: 2 | 3;
|
|
@@ -31,19 +62,18 @@ type CompilerCompatConfig = Partial<Record<CompilerDeprecationTypes, boolean | '
|
|
|
31
62
|
interface CompilerCompatOptions {
|
|
32
63
|
compatConfig?: CompilerCompatConfig;
|
|
33
64
|
}
|
|
34
|
-
export declare
|
|
65
|
+
export declare enum CompilerDeprecationTypes {
|
|
35
66
|
COMPILER_IS_ON_ELEMENT = "COMPILER_IS_ON_ELEMENT",
|
|
36
67
|
COMPILER_V_BIND_SYNC = "COMPILER_V_BIND_SYNC",
|
|
37
|
-
COMPILER_V_BIND_PROP = "COMPILER_V_BIND_PROP",
|
|
38
68
|
COMPILER_V_BIND_OBJECT_ORDER = "COMPILER_V_BIND_OBJECT_ORDER",
|
|
39
69
|
COMPILER_V_ON_NATIVE = "COMPILER_V_ON_NATIVE",
|
|
40
70
|
COMPILER_V_IF_V_FOR_PRECEDENCE = "COMPILER_V_IF_V_FOR_PRECEDENCE",
|
|
41
71
|
COMPILER_NATIVE_TEMPLATE = "COMPILER_NATIVE_TEMPLATE",
|
|
42
72
|
COMPILER_INLINE_TEMPLATE = "COMPILER_INLINE_TEMPLATE",
|
|
43
|
-
COMPILER_FILTERS = "
|
|
73
|
+
COMPILER_FILTERS = "COMPILER_FILTERS"
|
|
44
74
|
}
|
|
45
|
-
export declare function checkCompatEnabled(key: CompilerDeprecationTypes, context:
|
|
46
|
-
export declare function warnDeprecation(key: CompilerDeprecationTypes, context:
|
|
75
|
+
export declare function checkCompatEnabled(key: CompilerDeprecationTypes, context: MergedParserOptions | TransformContext, loc: SourceLocation | null, ...args: any[]): boolean;
|
|
76
|
+
export declare function warnDeprecation(key: CompilerDeprecationTypes, context: MergedParserOptions | TransformContext, loc: SourceLocation | null, ...args: any[]): void;
|
|
47
77
|
|
|
48
78
|
export type NodeTransform = (node: RootNode | TemplateChildNode, context: TransformContext) => void | (() => void) | (() => void)[];
|
|
49
79
|
export type DirectiveTransform = (dir: DirectiveNode, node: ElementNode, context: TransformContext, augmentor?: (ret: DirectiveTransformResult) => DirectiveTransformResult) => DirectiveTransformResult;
|
|
@@ -57,7 +87,7 @@ interface ImportItem {
|
|
|
57
87
|
exp: string | ExpressionNode;
|
|
58
88
|
path: string;
|
|
59
89
|
}
|
|
60
|
-
export interface TransformContext extends Required<Omit<TransformOptions,
|
|
90
|
+
export interface TransformContext extends Required<Omit<TransformOptions, keyof CompilerCompatOptions>>, CompilerCompatOptions {
|
|
61
91
|
selfName: string | null;
|
|
62
92
|
root: RootNode;
|
|
63
93
|
helpers: Map<symbol, number>;
|
|
@@ -66,7 +96,7 @@ export interface TransformContext extends Required<Omit<TransformOptions, 'filen
|
|
|
66
96
|
hoists: (JSChildNode | null)[];
|
|
67
97
|
imports: ImportItem[];
|
|
68
98
|
temps: number;
|
|
69
|
-
cached:
|
|
99
|
+
cached: (CacheExpression | null)[];
|
|
70
100
|
identifiers: {
|
|
71
101
|
[name: string]: number | undefined;
|
|
72
102
|
};
|
|
@@ -77,6 +107,7 @@ export interface TransformContext extends Required<Omit<TransformOptions, 'filen
|
|
|
77
107
|
vOnce: number;
|
|
78
108
|
};
|
|
79
109
|
parent: ParentNode | null;
|
|
110
|
+
grandParent: ParentNode | null;
|
|
80
111
|
childIndex: number;
|
|
81
112
|
currentNode: RootNode | TemplateChildNode | null;
|
|
82
113
|
inVOnce: boolean;
|
|
@@ -89,70 +120,19 @@ export interface TransformContext extends Required<Omit<TransformOptions, 'filen
|
|
|
89
120
|
addIdentifiers(exp: ExpressionNode | string): void;
|
|
90
121
|
removeIdentifiers(exp: ExpressionNode | string): void;
|
|
91
122
|
hoist(exp: string | JSChildNode | ArrayExpression): SimpleExpressionNode;
|
|
92
|
-
cache
|
|
123
|
+
cache(exp: JSChildNode, isVNode?: boolean, inVOnce?: boolean): CacheExpression;
|
|
93
124
|
constantCache: WeakMap<TemplateChildNode, ConstantTypes>;
|
|
94
125
|
filters?: Set<string>;
|
|
95
126
|
}
|
|
96
|
-
export declare function createTransformContext(root: RootNode, { filename, prefixIdentifiers, hoistStatic, hmr, cacheHandlers, nodeTransforms, directiveTransforms, transformHoist, isBuiltInComponent, isCustomElement, expressionPlugins, scopeId, slotted, ssr, inSSR, ssrCssVars, bindingMetadata, inline, isTS, onError, onWarn, compatConfig }: TransformOptions): TransformContext;
|
|
127
|
+
export declare function createTransformContext(root: RootNode, { filename, prefixIdentifiers, hoistStatic, hmr, cacheHandlers, nodeTransforms, directiveTransforms, transformHoist, isBuiltInComponent, isCustomElement, expressionPlugins, scopeId, slotted, ssr, inSSR, ssrCssVars, bindingMetadata, inline, isTS, onError, onWarn, compatConfig, }: TransformOptions): TransformContext;
|
|
97
128
|
export declare function transform(root: RootNode, options: TransformOptions): void;
|
|
98
129
|
export declare function traverseNode(node: RootNode | TemplateChildNode, context: TransformContext): void;
|
|
99
130
|
export declare function createStructuralDirectiveTransform(name: string | RegExp, fn: StructuralDirectiveTransform): NodeTransform;
|
|
100
131
|
|
|
101
|
-
export declare function processFor(node: ElementNode, dir: DirectiveNode, context: TransformContext, processCodegen?: (forNode: ForNode) => (() => void) | undefined): (() => void) | undefined;
|
|
102
|
-
interface ForParseResult {
|
|
103
|
-
source: ExpressionNode;
|
|
104
|
-
value: ExpressionNode | undefined;
|
|
105
|
-
key: ExpressionNode | undefined;
|
|
106
|
-
index: ExpressionNode | undefined;
|
|
107
|
-
}
|
|
108
|
-
export declare function createForLoopParams({ value, key, index }: ForParseResult, memoArgs?: ExpressionNode[]): ExpressionNode[];
|
|
109
|
-
|
|
110
|
-
export declare const FRAGMENT: unique symbol;
|
|
111
|
-
export declare const TELEPORT: unique symbol;
|
|
112
|
-
export declare const SUSPENSE: unique symbol;
|
|
113
|
-
export declare const KEEP_ALIVE: unique symbol;
|
|
114
|
-
export declare const BASE_TRANSITION: unique symbol;
|
|
115
|
-
export declare const OPEN_BLOCK: unique symbol;
|
|
116
|
-
export declare const CREATE_BLOCK: unique symbol;
|
|
117
|
-
export declare const CREATE_ELEMENT_BLOCK: unique symbol;
|
|
118
|
-
export declare const CREATE_VNODE: unique symbol;
|
|
119
|
-
export declare const CREATE_ELEMENT_VNODE: unique symbol;
|
|
120
|
-
export declare const CREATE_COMMENT: unique symbol;
|
|
121
|
-
export declare const CREATE_TEXT: unique symbol;
|
|
122
|
-
export declare const CREATE_STATIC: unique symbol;
|
|
123
|
-
export declare const RESOLVE_COMPONENT: unique symbol;
|
|
124
|
-
export declare const RESOLVE_DYNAMIC_COMPONENT: unique symbol;
|
|
125
|
-
export declare const RESOLVE_DIRECTIVE: unique symbol;
|
|
126
|
-
export declare const RESOLVE_FILTER: unique symbol;
|
|
127
|
-
export declare const WITH_DIRECTIVES: unique symbol;
|
|
128
|
-
export declare const RENDER_LIST: unique symbol;
|
|
129
|
-
export declare const RENDER_SLOT: unique symbol;
|
|
130
|
-
export declare const CREATE_SLOTS: unique symbol;
|
|
131
|
-
export declare const TO_DISPLAY_STRING: unique symbol;
|
|
132
|
-
export declare const MERGE_PROPS: unique symbol;
|
|
133
|
-
export declare const NORMALIZE_CLASS: unique symbol;
|
|
134
|
-
export declare const NORMALIZE_STYLE: unique symbol;
|
|
135
|
-
export declare const NORMALIZE_PROPS: unique symbol;
|
|
136
|
-
export declare const GUARD_REACTIVE_PROPS: unique symbol;
|
|
137
|
-
export declare const TO_HANDLERS: unique symbol;
|
|
138
|
-
export declare const CAMELIZE: unique symbol;
|
|
139
|
-
export declare const CAPITALIZE: unique symbol;
|
|
140
|
-
export declare const TO_HANDLER_KEY: unique symbol;
|
|
141
|
-
export declare const SET_BLOCK_TRACKING: unique symbol;
|
|
142
|
-
export declare const PUSH_SCOPE_ID: unique symbol;
|
|
143
|
-
export declare const POP_SCOPE_ID: unique symbol;
|
|
144
|
-
export declare const WITH_CTX: unique symbol;
|
|
145
|
-
export declare const UNREF: unique symbol;
|
|
146
|
-
export declare const IS_REF: unique symbol;
|
|
147
|
-
export declare const WITH_MEMO: unique symbol;
|
|
148
|
-
export declare const IS_MEMO_SAME: unique symbol;
|
|
149
|
-
export declare const helperNameMap: Record<symbol, string>;
|
|
150
|
-
export declare function registerRuntimeHelpers(helpers: Record<symbol, string>): void;
|
|
151
|
-
|
|
152
132
|
export declare const transformElement: NodeTransform;
|
|
153
133
|
export declare function resolveComponentType(node: ComponentNode, context: TransformContext, ssr?: boolean): string | symbol | CallExpression;
|
|
154
134
|
export type PropsExpression = ObjectExpression | CallExpression | ExpressionNode;
|
|
155
|
-
export declare function buildProps(node: ElementNode, context: TransformContext, props:
|
|
135
|
+
export declare function buildProps(node: ElementNode, context: TransformContext, props: ElementNode['props'] | undefined, isComponent: boolean, isDynamicComponent: boolean, ssr?: boolean): {
|
|
156
136
|
props: PropsExpression | undefined;
|
|
157
137
|
directives: DirectiveNode[];
|
|
158
138
|
patchFlag: number;
|
|
@@ -162,10 +142,12 @@ export declare function buildProps(node: ElementNode, context: TransformContext,
|
|
|
162
142
|
export declare function buildDirectiveArgs(dir: DirectiveNode, context: TransformContext): ArrayExpression;
|
|
163
143
|
|
|
164
144
|
export type Namespace = number;
|
|
165
|
-
export declare
|
|
166
|
-
HTML = 0
|
|
145
|
+
export declare enum Namespaces {
|
|
146
|
+
HTML = 0,
|
|
147
|
+
SVG = 1,
|
|
148
|
+
MATH_ML = 2
|
|
167
149
|
}
|
|
168
|
-
export declare
|
|
150
|
+
export declare enum NodeTypes {
|
|
169
151
|
ROOT = 0,
|
|
170
152
|
ELEMENT = 1,
|
|
171
153
|
TEXT = 2,
|
|
@@ -194,7 +176,7 @@ export declare const enum NodeTypes {
|
|
|
194
176
|
JS_SEQUENCE_EXPRESSION = 25,
|
|
195
177
|
JS_RETURN_STATEMENT = 26
|
|
196
178
|
}
|
|
197
|
-
export declare
|
|
179
|
+
export declare enum ElementTypes {
|
|
198
180
|
ELEMENT = 0,
|
|
199
181
|
COMPONENT = 1,
|
|
200
182
|
SLOT = 2,
|
|
@@ -219,16 +201,18 @@ export type ExpressionNode = SimpleExpressionNode | CompoundExpressionNode;
|
|
|
219
201
|
export type TemplateChildNode = ElementNode | InterpolationNode | CompoundExpressionNode | TextNode | CommentNode | IfNode | IfBranchNode | ForNode | TextCallNode;
|
|
220
202
|
export interface RootNode extends Node {
|
|
221
203
|
type: NodeTypes.ROOT;
|
|
204
|
+
source: string;
|
|
222
205
|
children: TemplateChildNode[];
|
|
223
206
|
helpers: Set<symbol>;
|
|
224
207
|
components: string[];
|
|
225
208
|
directives: string[];
|
|
226
209
|
hoists: (JSChildNode | null)[];
|
|
227
210
|
imports: ImportItem[];
|
|
228
|
-
cached:
|
|
211
|
+
cached: (CacheExpression | null)[];
|
|
229
212
|
temps: number;
|
|
230
213
|
ssrHelpers?: symbol[];
|
|
231
214
|
codegenNode?: TemplateChildNode | JSChildNode | BlockStatement;
|
|
215
|
+
transformed?: boolean;
|
|
232
216
|
filters?: string[];
|
|
233
217
|
}
|
|
234
218
|
export type ElementNode = PlainElementNode | ComponentNode | SlotOutletNode | TemplateNode;
|
|
@@ -237,9 +221,10 @@ export interface BaseElementNode extends Node {
|
|
|
237
221
|
ns: Namespace;
|
|
238
222
|
tag: string;
|
|
239
223
|
tagType: ElementTypes;
|
|
240
|
-
isSelfClosing: boolean;
|
|
241
224
|
props: Array<AttributeNode | DirectiveNode>;
|
|
242
225
|
children: TemplateChildNode[];
|
|
226
|
+
isSelfClosing?: boolean;
|
|
227
|
+
innerLoc?: SourceLocation;
|
|
243
228
|
}
|
|
244
229
|
export interface PlainElementNode extends BaseElementNode {
|
|
245
230
|
tagType: ElementTypes.ELEMENT;
|
|
@@ -271,28 +256,37 @@ export interface CommentNode extends Node {
|
|
|
271
256
|
export interface AttributeNode extends Node {
|
|
272
257
|
type: NodeTypes.ATTRIBUTE;
|
|
273
258
|
name: string;
|
|
259
|
+
nameLoc: SourceLocation;
|
|
274
260
|
value: TextNode | undefined;
|
|
275
261
|
}
|
|
276
262
|
export interface DirectiveNode extends Node {
|
|
277
263
|
type: NodeTypes.DIRECTIVE;
|
|
264
|
+
/**
|
|
265
|
+
* the normalized name without prefix or shorthands, e.g. "bind", "on"
|
|
266
|
+
*/
|
|
278
267
|
name: string;
|
|
268
|
+
/**
|
|
269
|
+
* the raw attribute name, preserving shorthand, and including arg & modifiers
|
|
270
|
+
* this is only used during parse.
|
|
271
|
+
*/
|
|
272
|
+
rawName?: string;
|
|
279
273
|
exp: ExpressionNode | undefined;
|
|
280
274
|
arg: ExpressionNode | undefined;
|
|
281
|
-
modifiers:
|
|
275
|
+
modifiers: SimpleExpressionNode[];
|
|
282
276
|
/**
|
|
283
277
|
* optional property to cache the expression parse result for v-for
|
|
284
278
|
*/
|
|
285
|
-
|
|
279
|
+
forParseResult?: ForParseResult;
|
|
286
280
|
}
|
|
287
281
|
/**
|
|
288
282
|
* Static types have several levels.
|
|
289
283
|
* Higher levels implies lower levels. e.g. a node that can be stringified
|
|
290
284
|
* can always be hoisted and skipped for patch.
|
|
291
285
|
*/
|
|
292
|
-
export declare
|
|
286
|
+
export declare enum ConstantTypes {
|
|
293
287
|
NOT_CONSTANT = 0,
|
|
294
288
|
CAN_SKIP_PATCH = 1,
|
|
295
|
-
|
|
289
|
+
CAN_CACHE = 2,
|
|
296
290
|
CAN_STRINGIFY = 3
|
|
297
291
|
}
|
|
298
292
|
export interface SimpleExpressionNode extends Node {
|
|
@@ -300,6 +294,12 @@ export interface SimpleExpressionNode extends Node {
|
|
|
300
294
|
content: string;
|
|
301
295
|
isStatic: boolean;
|
|
302
296
|
constType: ConstantTypes;
|
|
297
|
+
/**
|
|
298
|
+
* - `null` means the expression is a simple identifier that doesn't need
|
|
299
|
+
* parsing
|
|
300
|
+
* - `false` means there was a parsing error
|
|
301
|
+
*/
|
|
302
|
+
ast?: Node$1 | null | false;
|
|
303
303
|
/**
|
|
304
304
|
* Indicates this is an identifier for a hoist vnode call and points to the
|
|
305
305
|
* hoisted node.
|
|
@@ -318,6 +318,12 @@ export interface InterpolationNode extends Node {
|
|
|
318
318
|
}
|
|
319
319
|
export interface CompoundExpressionNode extends Node {
|
|
320
320
|
type: NodeTypes.COMPOUND_EXPRESSION;
|
|
321
|
+
/**
|
|
322
|
+
* - `null` means the expression is a simple identifier that doesn't need
|
|
323
|
+
* parsing
|
|
324
|
+
* - `false` means there was a parsing error
|
|
325
|
+
*/
|
|
326
|
+
ast?: Node$1 | null | false;
|
|
321
327
|
children: (SimpleExpressionNode | CompoundExpressionNode | InterpolationNode | TextNode | string | symbol)[];
|
|
322
328
|
/**
|
|
323
329
|
* an expression parsed as the params of a function will track
|
|
@@ -348,6 +354,13 @@ export interface ForNode extends Node {
|
|
|
348
354
|
children: TemplateChildNode[];
|
|
349
355
|
codegenNode?: ForCodegenNode;
|
|
350
356
|
}
|
|
357
|
+
export interface ForParseResult {
|
|
358
|
+
source: ExpressionNode;
|
|
359
|
+
value: ExpressionNode | undefined;
|
|
360
|
+
key: ExpressionNode | undefined;
|
|
361
|
+
index: ExpressionNode | undefined;
|
|
362
|
+
finalized: boolean;
|
|
363
|
+
}
|
|
351
364
|
export interface TextCallNode extends Node {
|
|
352
365
|
type: NodeTypes.TEXT_CALL;
|
|
353
366
|
content: TextNode | InterpolationNode | CompoundExpressionNode;
|
|
@@ -358,8 +371,8 @@ export interface VNodeCall extends Node {
|
|
|
358
371
|
type: NodeTypes.VNODE_CALL;
|
|
359
372
|
tag: string | symbol | CallExpression;
|
|
360
373
|
props: PropsExpression | undefined;
|
|
361
|
-
children: TemplateChildNode[] | TemplateTextChildNode | SlotsExpression | ForRenderListExpression | SimpleExpressionNode | undefined;
|
|
362
|
-
patchFlag:
|
|
374
|
+
children: TemplateChildNode[] | TemplateTextChildNode | SlotsExpression | ForRenderListExpression | SimpleExpressionNode | CacheExpression | undefined;
|
|
375
|
+
patchFlag: PatchFlags | undefined;
|
|
363
376
|
dynamicProps: string | SimpleExpressionNode | undefined;
|
|
364
377
|
directives: DirectiveArguments | undefined;
|
|
365
378
|
isBlock: boolean;
|
|
@@ -413,7 +426,9 @@ export interface CacheExpression extends Node {
|
|
|
413
426
|
type: NodeTypes.JS_CACHE_EXPRESSION;
|
|
414
427
|
index: number;
|
|
415
428
|
value: JSChildNode;
|
|
416
|
-
|
|
429
|
+
needPauseTracking: boolean;
|
|
430
|
+
inVOnce: boolean;
|
|
431
|
+
needArraySpread: boolean;
|
|
417
432
|
}
|
|
418
433
|
export interface MemoExpression extends CallExpression {
|
|
419
434
|
callee: typeof WITH_MEMO;
|
|
@@ -473,7 +488,7 @@ export interface SlotsObjectProperty extends Property {
|
|
|
473
488
|
value: SlotFunctionExpression;
|
|
474
489
|
}
|
|
475
490
|
export interface SlotFunctionExpression extends FunctionExpression {
|
|
476
|
-
returns: TemplateChildNode[];
|
|
491
|
+
returns: TemplateChildNode[] | CacheExpression;
|
|
477
492
|
}
|
|
478
493
|
export interface DynamicSlotsExpression extends CallExpression {
|
|
479
494
|
callee: typeof CREATE_SLOTS;
|
|
@@ -509,7 +524,7 @@ export interface ForCodegenNode extends VNodeCall {
|
|
|
509
524
|
tag: typeof FRAGMENT;
|
|
510
525
|
props: undefined;
|
|
511
526
|
children: ForRenderListExpression;
|
|
512
|
-
patchFlag:
|
|
527
|
+
patchFlag: PatchFlags;
|
|
513
528
|
disableTracking: boolean;
|
|
514
529
|
}
|
|
515
530
|
export interface ForRenderListExpression extends CallExpression {
|
|
@@ -517,10 +532,10 @@ export interface ForRenderListExpression extends CallExpression {
|
|
|
517
532
|
arguments: [ExpressionNode, ForIteratorExpression];
|
|
518
533
|
}
|
|
519
534
|
export interface ForIteratorExpression extends FunctionExpression {
|
|
520
|
-
returns
|
|
535
|
+
returns?: BlockCodegenNode;
|
|
521
536
|
}
|
|
522
537
|
export declare const locStub: SourceLocation;
|
|
523
|
-
export declare function createRoot(children: TemplateChildNode[],
|
|
538
|
+
export declare function createRoot(children: TemplateChildNode[], source?: string): RootNode;
|
|
524
539
|
export declare function createVNodeCall(context: TransformContext | null, tag: VNodeCall['tag'], props?: VNodeCall['props'], children?: VNodeCall['children'], patchFlag?: VNodeCall['patchFlag'], dynamicProps?: VNodeCall['dynamicProps'], directives?: VNodeCall['directives'], isBlock?: VNodeCall['isBlock'], disableTracking?: VNodeCall['disableTracking'], isComponent?: VNodeCall['isComponent'], loc?: SourceLocation): VNodeCall;
|
|
525
540
|
export declare function createArrayExpression(elements: ArrayExpression['elements'], loc?: SourceLocation): ArrayExpression;
|
|
526
541
|
export declare function createObjectExpression(properties: ObjectExpression['properties'], loc?: SourceLocation): ObjectExpression;
|
|
@@ -532,7 +547,7 @@ type InferCodegenNodeType<T> = T extends typeof RENDER_SLOT ? RenderSlotCall : C
|
|
|
532
547
|
export declare function createCallExpression<T extends CallExpression['callee']>(callee: T, args?: CallExpression['arguments'], loc?: SourceLocation): InferCodegenNodeType<T>;
|
|
533
548
|
export declare function createFunctionExpression(params: FunctionExpression['params'], returns?: FunctionExpression['returns'], newline?: boolean, isSlot?: boolean, loc?: SourceLocation): FunctionExpression;
|
|
534
549
|
export declare function createConditionalExpression(test: ConditionalExpression['test'], consequent: ConditionalExpression['consequent'], alternate: ConditionalExpression['alternate'], newline?: boolean): ConditionalExpression;
|
|
535
|
-
export declare function createCacheExpression(index: number, value: JSChildNode,
|
|
550
|
+
export declare function createCacheExpression(index: number, value: JSChildNode, needPauseTracking?: boolean, inVOnce?: boolean): CacheExpression;
|
|
536
551
|
export declare function createBlockStatement(body: BlockStatement['body']): BlockStatement;
|
|
537
552
|
export declare function createTemplateLiteral(elements: TemplateLiteral['elements']): TemplateLiteral;
|
|
538
553
|
export declare function createIfStatement(test: IfStatement['test'], consequent: IfStatement['consequent'], alternate?: IfStatement['alternate']): IfStatement;
|
|
@@ -554,7 +569,7 @@ type InferCompilerError<T> = T extends ErrorCodes ? CoreCompilerError : Compiler
|
|
|
554
569
|
export declare function createCompilerError<T extends number>(code: T, loc?: SourceLocation, messages?: {
|
|
555
570
|
[code: number]: string;
|
|
556
571
|
}, additionalMessage?: string): InferCompilerError<T>;
|
|
557
|
-
export declare
|
|
572
|
+
export declare enum ErrorCodes {
|
|
558
573
|
ABRUPT_CLOSING_OF_EMPTY_COMMENT = 0,
|
|
559
574
|
CDATA_IN_HTML_CONTENT = 1,
|
|
560
575
|
DUPLICATE_ATTRIBUTE = 2,
|
|
@@ -606,16 +621,35 @@ export declare const enum ErrorCodes {
|
|
|
606
621
|
X_MODULE_MODE_NOT_SUPPORTED = 48,
|
|
607
622
|
X_CACHE_HANDLER_NOT_SUPPORTED = 49,
|
|
608
623
|
X_SCOPE_ID_NOT_SUPPORTED = 50,
|
|
609
|
-
|
|
610
|
-
|
|
624
|
+
X_VNODE_HOOKS = 51,
|
|
625
|
+
X_V_BIND_INVALID_SAME_NAME_ARGUMENT = 52,
|
|
611
626
|
__EXTEND_POINT__ = 53
|
|
612
627
|
}
|
|
628
|
+
export declare const errorMessages: Record<ErrorCodes, string>;
|
|
613
629
|
|
|
614
630
|
interface ErrorHandlingOptions {
|
|
615
631
|
onWarn?: (warning: CompilerError) => void;
|
|
616
632
|
onError?: (error: CompilerError) => void;
|
|
617
633
|
}
|
|
618
634
|
export interface ParserOptions extends ErrorHandlingOptions, CompilerCompatOptions {
|
|
635
|
+
/**
|
|
636
|
+
* Base mode is platform agnostic and only parses HTML-like template syntax,
|
|
637
|
+
* treating all tags the same way. Specific tag parsing behavior can be
|
|
638
|
+
* configured by higher-level compilers.
|
|
639
|
+
*
|
|
640
|
+
* HTML mode adds additional logic for handling special parsing behavior in
|
|
641
|
+
* `<script>`, `<style>`,`<title>` and `<textarea>`.
|
|
642
|
+
* The logic is handled inside compiler-core for efficiency.
|
|
643
|
+
*
|
|
644
|
+
* SFC mode treats content of all root-level tags except `<template>` as plain
|
|
645
|
+
* text.
|
|
646
|
+
*/
|
|
647
|
+
parseMode?: 'base' | 'html' | 'sfc';
|
|
648
|
+
/**
|
|
649
|
+
* Specify the root namespace to use when parsing a template.
|
|
650
|
+
* Defaults to `Namespaces.HTML` (0).
|
|
651
|
+
*/
|
|
652
|
+
ns?: Namespaces;
|
|
619
653
|
/**
|
|
620
654
|
* e.g. platform native elements, e.g. `<div>` for browsers
|
|
621
655
|
*/
|
|
@@ -628,6 +662,11 @@ export interface ParserOptions extends ErrorHandlingOptions, CompilerCompatOptio
|
|
|
628
662
|
* e.g. elements that should preserve whitespace inside, e.g. `<pre>`
|
|
629
663
|
*/
|
|
630
664
|
isPreTag?: (tag: string) => boolean;
|
|
665
|
+
/**
|
|
666
|
+
* Elements that should ignore the first newline token per parinsg spec
|
|
667
|
+
* e.g. `<textarea>` and `<pre>`
|
|
668
|
+
*/
|
|
669
|
+
isIgnoreNewlineTag?: (tag: string) => boolean;
|
|
631
670
|
/**
|
|
632
671
|
* Platform-specific built-in components e.g. `<Transition>`
|
|
633
672
|
*/
|
|
@@ -639,21 +678,19 @@ export interface ParserOptions extends ErrorHandlingOptions, CompilerCompatOptio
|
|
|
639
678
|
/**
|
|
640
679
|
* Get tag namespace
|
|
641
680
|
*/
|
|
642
|
-
getNamespace?: (tag: string, parent: ElementNode | undefined) => Namespace;
|
|
643
|
-
/**
|
|
644
|
-
* Get text parsing mode for this element
|
|
645
|
-
*/
|
|
646
|
-
getTextMode?: (node: ElementNode, parent: ElementNode | undefined) => TextModes;
|
|
681
|
+
getNamespace?: (tag: string, parent: ElementNode | undefined, rootNamespace: Namespace) => Namespace;
|
|
647
682
|
/**
|
|
648
683
|
* @default ['{{', '}}']
|
|
649
684
|
*/
|
|
650
685
|
delimiters?: [string, string];
|
|
651
686
|
/**
|
|
652
687
|
* Whitespace handling strategy
|
|
688
|
+
* @default 'condense'
|
|
653
689
|
*/
|
|
654
690
|
whitespace?: 'preserve' | 'condense';
|
|
655
691
|
/**
|
|
656
|
-
* Only
|
|
692
|
+
* Only used for DOM compilers that runs in the browser.
|
|
693
|
+
* In non-browser builds, this option is ignored.
|
|
657
694
|
*/
|
|
658
695
|
decodeEntities?: (rawText: string, asAttr: boolean) => string;
|
|
659
696
|
/**
|
|
@@ -661,9 +698,20 @@ export interface ParserOptions extends ErrorHandlingOptions, CompilerCompatOptio
|
|
|
661
698
|
* This defaults to `true` in development and `false` in production builds.
|
|
662
699
|
*/
|
|
663
700
|
comments?: boolean;
|
|
701
|
+
/**
|
|
702
|
+
* Parse JavaScript expressions with Babel.
|
|
703
|
+
* @default false
|
|
704
|
+
*/
|
|
705
|
+
prefixIdentifiers?: boolean;
|
|
706
|
+
/**
|
|
707
|
+
* A list of parser plugins to enable for `@babel/parser`, which is used to
|
|
708
|
+
* parse expressions in bindings and interpolations.
|
|
709
|
+
* https://babeljs.io/docs/en/next/babel-parser#plugins
|
|
710
|
+
*/
|
|
711
|
+
expressionPlugins?: ParserPlugin[];
|
|
664
712
|
}
|
|
665
713
|
export type HoistTransform = (children: TemplateChildNode[], context: TransformContext, parent: ParentNode) => void;
|
|
666
|
-
export declare
|
|
714
|
+
export declare enum BindingTypes {
|
|
667
715
|
/**
|
|
668
716
|
* returned from data()
|
|
669
717
|
*/
|
|
@@ -801,7 +849,7 @@ export interface TransformOptions extends SharedTransformCodegenOptions, ErrorHa
|
|
|
801
849
|
*/
|
|
802
850
|
prefixIdentifiers?: boolean;
|
|
803
851
|
/**
|
|
804
|
-
*
|
|
852
|
+
* Cache static VNodes and props objects to `_hoisted_x` constants
|
|
805
853
|
* @default false
|
|
806
854
|
*/
|
|
807
855
|
hoistStatic?: boolean;
|
|
@@ -892,6 +940,41 @@ export interface CodegenOptions extends SharedTransformCodegenOptions {
|
|
|
892
940
|
}
|
|
893
941
|
export type CompilerOptions = ParserOptions & TransformOptions & CodegenOptions;
|
|
894
942
|
|
|
943
|
+
/**
|
|
944
|
+
* The `SourceMapGenerator` type from `source-map-js` is a bit incomplete as it
|
|
945
|
+
* misses `toJSON()`. We also need to add types for internal properties which we
|
|
946
|
+
* need to access for better performance.
|
|
947
|
+
*
|
|
948
|
+
* Since TS 5.3, dts generation starts to strangely include broken triple slash
|
|
949
|
+
* references for source-map-js, so we are inlining all source map related types
|
|
950
|
+
* here to to workaround that.
|
|
951
|
+
*/
|
|
952
|
+
export interface CodegenSourceMapGenerator {
|
|
953
|
+
setSourceContent(sourceFile: string, sourceContent: string): void;
|
|
954
|
+
toJSON(): RawSourceMap;
|
|
955
|
+
_sources: Set<string>;
|
|
956
|
+
_names: Set<string>;
|
|
957
|
+
_mappings: {
|
|
958
|
+
add(mapping: MappingItem): void;
|
|
959
|
+
};
|
|
960
|
+
}
|
|
961
|
+
export interface RawSourceMap {
|
|
962
|
+
file?: string;
|
|
963
|
+
sourceRoot?: string;
|
|
964
|
+
version: string;
|
|
965
|
+
sources: string[];
|
|
966
|
+
names: string[];
|
|
967
|
+
sourcesContent?: string[];
|
|
968
|
+
mappings: string;
|
|
969
|
+
}
|
|
970
|
+
interface MappingItem {
|
|
971
|
+
source: string;
|
|
972
|
+
generatedLine: number;
|
|
973
|
+
generatedColumn: number;
|
|
974
|
+
originalLine: number;
|
|
975
|
+
originalColumn: number;
|
|
976
|
+
name: string | null;
|
|
977
|
+
}
|
|
895
978
|
type CodegenNode = TemplateChildNode | JSChildNode | SSRCodegenNode;
|
|
896
979
|
export interface CodegenResult {
|
|
897
980
|
code: string;
|
|
@@ -907,9 +990,9 @@ export interface CodegenContext extends Omit<Required<CodegenOptions>, 'bindingM
|
|
|
907
990
|
offset: number;
|
|
908
991
|
indentLevel: number;
|
|
909
992
|
pure: boolean;
|
|
910
|
-
map?:
|
|
993
|
+
map?: CodegenSourceMapGenerator;
|
|
911
994
|
helper(key: symbol): string;
|
|
912
|
-
push(code: string, node?: CodegenNode): void;
|
|
995
|
+
push(code: string, newlineIndex?: number, node?: CodegenNode): void;
|
|
913
996
|
indent(): void;
|
|
914
997
|
deindent(withoutNewLine?: boolean): void;
|
|
915
998
|
newline(): void;
|
|
@@ -923,10 +1006,9 @@ export type TransformPreset = [
|
|
|
923
1006
|
Record<string, DirectiveTransform>
|
|
924
1007
|
];
|
|
925
1008
|
export declare function getBaseTransformPreset(prefixIdentifiers?: boolean): TransformPreset;
|
|
926
|
-
export declare function baseCompile(
|
|
1009
|
+
export declare function baseCompile(source: string | RootNode, options?: CompilerOptions): CodegenResult;
|
|
927
1010
|
|
|
928
1011
|
export declare const isStaticExp: (p: JSChildNode) => p is SimpleExpressionNode;
|
|
929
|
-
export declare const isBuiltInType: (tag: string, expected: string) => boolean;
|
|
930
1012
|
export declare function isCoreComponent(tag: string): symbol | void;
|
|
931
1013
|
export declare const isSimpleIdentifier: (name: string) => boolean;
|
|
932
1014
|
/**
|
|
@@ -935,10 +1017,12 @@ export declare const isSimpleIdentifier: (name: string) => boolean;
|
|
|
935
1017
|
* inside square brackets), but it's ok since these are only used on template
|
|
936
1018
|
* expressions and false positives are invalid expressions in the first place.
|
|
937
1019
|
*/
|
|
938
|
-
export declare const isMemberExpressionBrowser: (
|
|
939
|
-
export declare const isMemberExpressionNode: (
|
|
940
|
-
export declare const isMemberExpression: (
|
|
941
|
-
export declare
|
|
1020
|
+
export declare const isMemberExpressionBrowser: (exp: ExpressionNode) => boolean;
|
|
1021
|
+
export declare const isMemberExpressionNode: (exp: ExpressionNode, context: TransformContext) => boolean;
|
|
1022
|
+
export declare const isMemberExpression: (exp: ExpressionNode, context: TransformContext) => boolean;
|
|
1023
|
+
export declare const isFnExpressionBrowser: (exp: ExpressionNode) => boolean;
|
|
1024
|
+
export declare const isFnExpressionNode: (exp: ExpressionNode, context: TransformContext) => boolean;
|
|
1025
|
+
export declare const isFnExpression: (exp: ExpressionNode, context: TransformContext) => boolean;
|
|
942
1026
|
export declare function advancePositionWithClone(pos: Position, source: string, numberOfCharacters?: number): Position;
|
|
943
1027
|
export declare function advancePositionWithMutation(pos: Position, source: string, numberOfCharacters?: number): Position;
|
|
944
1028
|
export declare function assert(condition: boolean, msg?: string): void;
|
|
@@ -952,12 +1036,17 @@ export declare function isTemplateNode(node: RootNode | TemplateChildNode): node
|
|
|
952
1036
|
export declare function isSlotOutlet(node: RootNode | TemplateChildNode): node is SlotOutletNode;
|
|
953
1037
|
export declare function injectProp(node: VNodeCall | RenderSlotCall, prop: Property, context: TransformContext): void;
|
|
954
1038
|
export declare function toValidAssetId(name: string, type: 'component' | 'directive' | 'filter'): string;
|
|
955
|
-
export declare function hasScopeRef(node: TemplateChildNode | IfBranchNode | ExpressionNode | undefined, ids: TransformContext['identifiers']): boolean;
|
|
1039
|
+
export declare function hasScopeRef(node: TemplateChildNode | IfBranchNode | ExpressionNode | CacheExpression | undefined, ids: TransformContext['identifiers']): boolean;
|
|
956
1040
|
export declare function getMemoedVNodeCall(node: BlockCodegenNode | MemoExpression): VNodeCall | RenderSlotCall;
|
|
1041
|
+
export declare const forAliasRE: RegExp;
|
|
957
1042
|
|
|
958
|
-
|
|
1043
|
+
/**
|
|
1044
|
+
* Return value indicates whether the AST walked can be a constant
|
|
1045
|
+
*/
|
|
1046
|
+
export declare function walkIdentifiers(root: Node$1, onIdentifier: (node: Identifier, parent: Node$1 | null, parentStack: Node$1[], isReference: boolean, isLocal: boolean) => void, includeAll?: boolean, parentStack?: Node$1[], knownIds?: Record<string, number>): void;
|
|
959
1047
|
export declare function isReferencedIdentifier(id: Identifier, parent: Node$1 | null, parentStack: Node$1[]): boolean;
|
|
960
1048
|
export declare function isInDestructureAssignment(parent: Node$1, parentStack: Node$1[]): boolean;
|
|
1049
|
+
export declare function isInNewExpression(parentStack: Node$1[]): boolean;
|
|
961
1050
|
export declare function walkFunctionParams(node: Function, onIdent: (id: Identifier) => void): void;
|
|
962
1051
|
export declare function walkBlockDeclarations(block: BlockStatement$1 | Program, onIdent: (node: Identifier) => void): void;
|
|
963
1052
|
export declare function extractIdentifiers(param: Node$1, nodes?: Identifier[]): Identifier[];
|
|
@@ -965,6 +1054,7 @@ export declare const isFunctionType: (node: Node$1) => node is Function;
|
|
|
965
1054
|
export declare const isStaticProperty: (node: Node$1) => node is ObjectProperty;
|
|
966
1055
|
export declare const isStaticPropertyKey: (node: Node$1, parent: Node$1) => boolean;
|
|
967
1056
|
export declare const TS_NODE_TYPES: string[];
|
|
1057
|
+
export declare function unwrapTSNode(node: Node$1): Node$1;
|
|
968
1058
|
|
|
969
1059
|
export declare const transformModel: DirectiveTransform;
|
|
970
1060
|
|
|
@@ -976,13 +1066,16 @@ export declare const noopDirectiveTransform: DirectiveTransform;
|
|
|
976
1066
|
|
|
977
1067
|
export declare function processIf(node: ElementNode, dir: DirectiveNode, context: TransformContext, processCodegen?: (node: IfNode, branch: IfBranchNode, isRoot: boolean) => (() => void) | undefined): (() => void) | undefined;
|
|
978
1068
|
|
|
1069
|
+
export declare function processFor(node: ElementNode, dir: DirectiveNode, context: TransformContext, processCodegen?: (forNode: ForNode) => (() => void) | undefined): (() => void) | undefined;
|
|
1070
|
+
export declare function createForLoopParams({ value, key, index }: ForParseResult, memoArgs?: ExpressionNode[]): ExpressionNode[];
|
|
1071
|
+
|
|
979
1072
|
export declare const transformExpression: NodeTransform;
|
|
980
1073
|
export declare function processExpression(node: SimpleExpressionNode, context: TransformContext, asParams?: boolean, asRawStatements?: boolean, localVars?: Record<string, number>): ExpressionNode;
|
|
981
1074
|
export declare function stringifyExpression(exp: ExpressionNode | string): string;
|
|
982
1075
|
|
|
983
1076
|
export declare const trackSlotScopes: NodeTransform;
|
|
984
1077
|
export declare const trackVForSlotScopes: NodeTransform;
|
|
985
|
-
export type SlotFnBuilder = (slotProps: ExpressionNode | undefined,
|
|
1078
|
+
export type SlotFnBuilder = (slotProps: ExpressionNode | undefined, vFor: DirectiveNode | undefined, slotChildren: TemplateChildNode[], loc: SourceLocation) => FunctionExpression;
|
|
986
1079
|
export declare function buildSlots(node: ElementNode, context: TransformContext, buildSlotFn?: SlotFnBuilder): {
|
|
987
1080
|
slots: SlotsExpression;
|
|
988
1081
|
hasDynamicSlots: boolean;
|
|
@@ -994,5 +1087,5 @@ interface SlotOutletProcessResult {
|
|
|
994
1087
|
}
|
|
995
1088
|
export declare function processSlotOutlet(node: SlotOutletNode, context: TransformContext): SlotOutletProcessResult;
|
|
996
1089
|
|
|
997
|
-
export declare function getConstantType(node: TemplateChildNode | SimpleExpressionNode, context: TransformContext): ConstantTypes;
|
|
1090
|
+
export declare function getConstantType(node: TemplateChildNode | SimpleExpressionNode | CacheExpression, context: TransformContext): ConstantTypes;
|
|
998
1091
|
|