@vue/compiler-sfc 3.2.2 → 3.2.6
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/compiler-sfc.cjs.js +107 -501
- package/dist/compiler-sfc.d.ts +24 -34
- package/dist/compiler-sfc.esm-browser.js +14704 -1545
- package/package.json +9 -8
package/dist/compiler-sfc.d.ts
CHANGED
|
@@ -4,19 +4,24 @@ import { CodegenResult } from '@vue/compiler-core';
|
|
|
4
4
|
import { CompilerError } from '@vue/compiler-core';
|
|
5
5
|
import { CompilerOptions } from '@vue/compiler-core';
|
|
6
6
|
import { ElementNode } from '@vue/compiler-core';
|
|
7
|
+
import { extractIdentifiers } from '@vue/compiler-core';
|
|
7
8
|
import { generateCodeFrame } from '@vue/compiler-core';
|
|
8
|
-
import {
|
|
9
|
+
import { isInDestructureAssignment } from '@vue/compiler-core';
|
|
10
|
+
import { isStaticProperty } from '@vue/compiler-core';
|
|
9
11
|
import { LazyResult } from 'postcss';
|
|
10
12
|
import MagicString from 'magic-string';
|
|
11
|
-
import { Node as Node_2 } from '@babel/types';
|
|
12
13
|
import { ParserOptions } from '@vue/compiler-core';
|
|
13
14
|
import { ParserPlugin } from '@babel/parser';
|
|
14
15
|
import { RawSourceMap } from 'source-map';
|
|
15
16
|
import { Result } from 'postcss';
|
|
16
17
|
import { RootNode } from '@vue/compiler-core';
|
|
18
|
+
import { shouldTransform as shouldTransformRef } from '@vue/ref-transform';
|
|
17
19
|
import { SourceLocation } from '@vue/compiler-core';
|
|
18
20
|
import { Statement } from '@babel/types';
|
|
21
|
+
import { transform as transformRef } from '@vue/ref-transform';
|
|
22
|
+
import { transformAST as transformRefAST } from '@vue/ref-transform';
|
|
19
23
|
import { walk } from 'estree-walker';
|
|
24
|
+
import { walkIdentifiers } from '@vue/compiler-core';
|
|
20
25
|
|
|
21
26
|
declare interface AssetURLOptions {
|
|
22
27
|
/**
|
|
@@ -69,8 +74,14 @@ declare interface CSSModulesOptions {
|
|
|
69
74
|
globalModulePaths?: string[];
|
|
70
75
|
}
|
|
71
76
|
|
|
77
|
+
export { extractIdentifiers }
|
|
78
|
+
|
|
72
79
|
export { generateCodeFrame }
|
|
73
80
|
|
|
81
|
+
export { isInDestructureAssignment }
|
|
82
|
+
|
|
83
|
+
export { isStaticProperty }
|
|
84
|
+
|
|
74
85
|
export { MagicString }
|
|
75
86
|
|
|
76
87
|
export declare function parse(source: string, { sourceMap, filename, sourceRoot, pad, ignoreEmpty, compiler }?: SFCParseOptions): SFCParseResult;
|
|
@@ -83,19 +94,6 @@ declare type PreprocessLang = 'less' | 'sass' | 'scss' | 'styl' | 'stylus';
|
|
|
83
94
|
*/
|
|
84
95
|
export declare function rewriteDefault(input: string, as: string, parserPlugins?: ParserPlugin[]): string;
|
|
85
96
|
|
|
86
|
-
/**
|
|
87
|
-
* Text range data for IDE support
|
|
88
|
-
*/
|
|
89
|
-
declare interface ScriptSetupTextRanges {
|
|
90
|
-
scriptBindings: TextRange[];
|
|
91
|
-
scriptSetupBindings: TextRange[];
|
|
92
|
-
propsTypeArg?: TextRange;
|
|
93
|
-
propsRuntimeArg?: TextRange;
|
|
94
|
-
emitsTypeArg?: TextRange;
|
|
95
|
-
emitsRuntimeArg?: TextRange;
|
|
96
|
-
withDefaultsArg?: TextRange;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
97
|
export declare interface SFCAsyncStyleCompileOptions extends SFCStyleCompileOptions {
|
|
100
98
|
isAsync?: boolean;
|
|
101
99
|
modules?: boolean;
|
|
@@ -144,7 +142,6 @@ export declare interface SFCScriptBlock extends SFCBlock {
|
|
|
144
142
|
bindings?: BindingMetadata;
|
|
145
143
|
scriptAst?: Statement[];
|
|
146
144
|
scriptSetupAst?: Statement[];
|
|
147
|
-
ranges?: ScriptSetupTextRanges;
|
|
148
145
|
}
|
|
149
146
|
|
|
150
147
|
export declare interface SFCScriptCompileOptions {
|
|
@@ -162,10 +159,14 @@ export declare interface SFCScriptCompileOptions {
|
|
|
162
159
|
*/
|
|
163
160
|
babelParserPlugins?: ParserPlugin[];
|
|
164
161
|
/**
|
|
165
|
-
*
|
|
162
|
+
* (Experimental) Enable syntax transform for using refs without `.value`
|
|
166
163
|
* https://github.com/vuejs/rfcs/discussions/369
|
|
167
164
|
* @default true
|
|
168
165
|
*/
|
|
166
|
+
refTransform?: boolean;
|
|
167
|
+
/**
|
|
168
|
+
* @deprecated use `refTransform` instead.
|
|
169
|
+
*/
|
|
169
170
|
refSugar?: boolean;
|
|
170
171
|
/**
|
|
171
172
|
* Compile the template and inline the resulting render function
|
|
@@ -181,12 +182,6 @@ export declare interface SFCScriptCompileOptions {
|
|
|
181
182
|
* options passed to `compiler-dom`.
|
|
182
183
|
*/
|
|
183
184
|
templateOptions?: Partial<SFCTemplateCompileOptions>;
|
|
184
|
-
/**
|
|
185
|
-
* Skip codegen and only return AST / binding / text range information.
|
|
186
|
-
* Also makes the call error-tolerant.
|
|
187
|
-
* Used for IDE support.
|
|
188
|
-
*/
|
|
189
|
-
parseOnly?: boolean;
|
|
190
185
|
}
|
|
191
186
|
|
|
192
187
|
export declare interface SFCStyleBlock extends SFCBlock {
|
|
@@ -265,24 +260,19 @@ export declare interface SFCTemplateCompileResults {
|
|
|
265
260
|
map?: RawSourceMap;
|
|
266
261
|
}
|
|
267
262
|
|
|
263
|
+
export { shouldTransformRef }
|
|
264
|
+
|
|
268
265
|
export declare interface TemplateCompiler {
|
|
269
266
|
compile(template: string, options: CompilerOptions): CodegenResult;
|
|
270
267
|
parse(template: string, options: ParserOptions): RootNode;
|
|
271
268
|
}
|
|
272
269
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
}
|
|
270
|
+
export { transformRef }
|
|
271
|
+
|
|
272
|
+
export { transformRefAST }
|
|
277
273
|
|
|
278
274
|
export { walk }
|
|
279
275
|
|
|
280
|
-
|
|
281
|
-
* Walk an AST and find identifiers that are variable references.
|
|
282
|
-
* This is largely the same logic with `transformExpressions` in compiler-core
|
|
283
|
-
* but with some subtle differences as this needs to handle a wider range of
|
|
284
|
-
* possible syntax.
|
|
285
|
-
*/
|
|
286
|
-
export declare function walkIdentifiers(root: Node_2, onIdentifier: (node: Identifier, parent: Node_2, parentStack: Node_2[]) => void, onNode?: (node: Node_2, parent: Node_2, parentStack: Node_2[]) => void | boolean): void;
|
|
276
|
+
export { walkIdentifiers }
|
|
287
277
|
|
|
288
278
|
export { }
|