@wevu/compiler 7.6.0 → 7.7.0
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/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as StaticPageMeta, r as StaticRouteValue, t as StaticPageDeclaration } from "./public-
|
|
1
|
+
import { n as StaticPageMeta, r as StaticRouteValue, t as StaticPageDeclaration } from "./public-BL8gwg7L.mjs";
|
|
2
2
|
import { WevuBindingUpdateMode, WevuBindingUpdateMode as WevuBindingUpdateMode$1, WevuRuntimeBindingManifestV1, WevuRuntimeBindingRecordV1 } from "@weapp-core/constants";
|
|
3
3
|
import { LRUCache } from "lru-cache";
|
|
4
4
|
import MagicString from "magic-string";
|
|
@@ -8,7 +8,6 @@ import { Expression, File } from "@weapp-vite/ast/babelTypes";
|
|
|
8
8
|
import { MpPlatform } from "@weapp-core/shared";
|
|
9
9
|
import { AstEngineName, AstEngineName as AstEngineName$1 } from "@weapp-vite/ast";
|
|
10
10
|
import "@weapp-vite/ast/babelTraverse";
|
|
11
|
-
//#region src/auto-import-components/builtin.d.ts
|
|
12
11
|
/**
|
|
13
12
|
* 内置组件集合(来自自动生成的组件列表)。
|
|
14
13
|
*/
|
|
@@ -17,8 +16,6 @@ export declare const builtinComponentsSet: Set<string>;
|
|
|
17
16
|
* 判断标签是否为内置组件。
|
|
18
17
|
*/
|
|
19
18
|
export declare function isBuiltinComponent(tag: string): boolean;
|
|
20
|
-
//#endregion
|
|
21
|
-
//#region src/types/diagnostics.d.ts
|
|
22
19
|
type CompilerDiagnosticCode = 'WV1002' | 'WV1003' | 'WV2003' | 'WV2002' | 'WV2001' | 'WV1001';
|
|
23
20
|
type CompilerDiagnosticSeverity = 'error' | 'warning';
|
|
24
21
|
type CompilerDiagnosticSource = 'expression' | 'jsx' | 'script' | 'sfc' | 'style' | 'template';
|
|
@@ -62,8 +59,6 @@ export declare class CompilerDiagnosticError extends Error implements CompilerDi
|
|
|
62
59
|
cause?: unknown;
|
|
63
60
|
});
|
|
64
61
|
}
|
|
65
|
-
//#endregion
|
|
66
|
-
//#region src/types/bindingManifest.d.ts
|
|
67
62
|
/**
|
|
68
63
|
* 模板绑定的语义类型。
|
|
69
64
|
*/
|
|
@@ -125,14 +120,10 @@ interface WevuBindingManifestV1 {
|
|
|
125
120
|
* 注入运行时的 Binding Manifest 精简级别。
|
|
126
121
|
*/
|
|
127
122
|
type WevuRuntimeBindingManifestMode = 'compact' | 'diagnostic';
|
|
128
|
-
//#endregion
|
|
129
|
-
//#region src/bindingManifest.d.ts
|
|
130
123
|
/**
|
|
131
124
|
* 将编译期完整 IR 投影为运行时更新和诊断所需的最小元数据。
|
|
132
125
|
*/
|
|
133
126
|
export declare function createRuntimeBindingManifest(manifest: WevuBindingManifestV1, mode?: WevuRuntimeBindingManifestMode): WevuRuntimeBindingManifestV1;
|
|
134
|
-
//#endregion
|
|
135
|
-
//#region src/constants.d.ts
|
|
136
127
|
export declare const WE_VU_PAGE_HOOK_TO_FEATURE: {
|
|
137
128
|
readonly onPageScroll: "enableOnPageScroll";
|
|
138
129
|
readonly usePageScrollRestoration: "enableOnPageScroll";
|
|
@@ -211,8 +202,6 @@ export declare const WE_VU_INTERNAL_TEMPLATE_APIS: readonly ["normalizeClass", "
|
|
|
211
202
|
* 根据 wevu API 名称解析编译产物内部导入入口。
|
|
212
203
|
*/
|
|
213
204
|
export declare function resolveWevuInternalImportModuleId(apiName: string): "virtual:weapp-vite/runtime" | "virtual:weapp-vite/runtime/reactivity" | "virtual:weapp-vite/runtime/template";
|
|
214
|
-
//#endregion
|
|
215
|
-
//#region src/utils/sourcemap.d.ts
|
|
216
205
|
interface EncodedSourceMapLike {
|
|
217
206
|
version: number | string;
|
|
218
207
|
file?: string;
|
|
@@ -222,8 +211,6 @@ interface EncodedSourceMapLike {
|
|
|
222
211
|
sourcesContent?: Array<string | null>;
|
|
223
212
|
mappings: string;
|
|
224
213
|
}
|
|
225
|
-
//#endregion
|
|
226
|
-
//#region src/plugins/utils/vueSfcBlockSrc.d.ts
|
|
227
214
|
/**
|
|
228
215
|
* 解析 SFC block `src` 的配置。
|
|
229
216
|
*/
|
|
@@ -245,8 +232,6 @@ export declare function resolveSfcBlockSrc(descriptor: SFCDescriptor, filename:
|
|
|
245
232
|
scriptSetupResolvedId?: string;
|
|
246
233
|
templateResolvedId?: string;
|
|
247
234
|
}>;
|
|
248
|
-
//#endregion
|
|
249
|
-
//#region src/plugins/utils/vueSfc.d.ts
|
|
250
235
|
/**
|
|
251
236
|
* 读取并解析 SFC 的配置。
|
|
252
237
|
*/
|
|
@@ -302,8 +287,6 @@ export declare function readAndParseSfc(filename: string, options?: ReadAndParse
|
|
|
302
287
|
export declare function getSfcCheckMtime(config?: {
|
|
303
288
|
isDev?: boolean;
|
|
304
289
|
}): boolean;
|
|
305
|
-
//#endregion
|
|
306
|
-
//#region ../../node_modules/.pnpm/@babel+types@8.0.6/node_modules/@babel/types/lib/index.d.ts
|
|
307
290
|
interface BaseComment {
|
|
308
291
|
value: string;
|
|
309
292
|
start?: number;
|
|
@@ -1812,8 +1795,6 @@ type FlowType = AnyTypeAnnotation | ArrayTypeAnnotation | BooleanTypeAnnotation
|
|
|
1812
1795
|
type FlowPredicate = DeclaredPredicate | InferredPredicate;
|
|
1813
1796
|
type TSTypeElement = TSCallSignatureDeclaration | TSConstructSignatureDeclaration | TSPropertySignature | TSMethodSignature | TSIndexSignature;
|
|
1814
1797
|
type TSType = TSAnyKeyword | TSBooleanKeyword | TSBigIntKeyword | TSIntrinsicKeyword | TSNeverKeyword | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSStringKeyword | TSSymbolKeyword | TSUndefinedKeyword | TSUnknownKeyword | TSVoidKeyword | TSThisType | TSFunctionType | TSConstructorType | TSTypeReference | TSTypePredicate | TSTypeQuery | TSTypeLiteral | TSArrayType | TSTupleType | TSOptionalType | TSRestType | TSNamedTupleMember | TSUnionType | TSIntersectionType | TSConditionalType | TSInferType | TSParenthesizedType | TSTypeOperator | TSIndexedAccessType | TSMappedType | TSTemplateLiteralType | TSLiteralType | TSClassImplements | TSInterfaceHeritage | TSImportType;
|
|
1815
|
-
//#endregion
|
|
1816
|
-
//#region src/pageDeclaration/analyze.d.ts
|
|
1817
1798
|
/**
|
|
1818
1799
|
* 共享普通脚本与 setup 的模块绑定,收集指向全局宏或规范导入的页面元信息调用。
|
|
1819
1800
|
*/
|
|
@@ -1821,8 +1802,6 @@ export declare function collectPageMetaCallsFromPrograms(programs: {
|
|
|
1821
1802
|
script?: File;
|
|
1822
1803
|
scriptSetup?: File;
|
|
1823
1804
|
}): CallExpression[];
|
|
1824
|
-
//#endregion
|
|
1825
|
-
//#region src/pageDeclaration/index.d.ts
|
|
1826
1805
|
interface StripPageDeclarationResult {
|
|
1827
1806
|
code: string;
|
|
1828
1807
|
map?: EncodedSourceMapLike;
|
|
@@ -1846,8 +1825,6 @@ export declare function mayContainPageMeta(source: string): boolean;
|
|
|
1846
1825
|
export declare function extractPageDeclarationWithDependencies(source: string, filename: string, options?: ResolveSfcBlockSrcOptions): Promise<ExtractPageDeclarationWithDependenciesResult>;
|
|
1847
1826
|
export declare function extractPageDeclaration(source: string, filename: string): StaticPageDeclaration | undefined;
|
|
1848
1827
|
export declare function stripPageDeclaration(source: string, filename: string): StripPageDeclarationResult | undefined;
|
|
1849
|
-
//#endregion
|
|
1850
|
-
//#region src/runtimeCapabilities.d.ts
|
|
1851
1828
|
/**
|
|
1852
1829
|
* wevu 编译器内部使用的运行时能力规范顺序。
|
|
1853
1830
|
*
|
|
@@ -1869,8 +1846,6 @@ interface WevuRuntimeCapabilityMetadata {
|
|
|
1869
1846
|
required: WevuRuntimeCapabilityName[];
|
|
1870
1847
|
conservative?: WevuRuntimeCapabilityName[];
|
|
1871
1848
|
}
|
|
1872
|
-
//#endregion
|
|
1873
|
-
//#region src/types/componentStyleOptions.d.ts
|
|
1874
1849
|
/** 编译期可证明的静态原语;显式 undefined 与属性缺失分别保留。 */
|
|
1875
1850
|
type ComponentStylePrimitive = string | boolean | number | null | undefined;
|
|
1876
1851
|
/** 小程序组件样式选项的静态解析状态。 */
|
|
@@ -1887,8 +1862,6 @@ interface ComponentStyleOptions {
|
|
|
1887
1862
|
styleIsolation: StaticComponentStyleOption;
|
|
1888
1863
|
addGlobalClass: StaticComponentStyleOption;
|
|
1889
1864
|
}
|
|
1890
|
-
//#endregion
|
|
1891
|
-
//#region src/types/json.d.ts
|
|
1892
1865
|
/**
|
|
1893
1866
|
* JSON 合并阶段枚举。
|
|
1894
1867
|
*/
|
|
@@ -1934,8 +1907,6 @@ interface JsonConfig {
|
|
|
1934
1907
|
*/
|
|
1935
1908
|
mergeStrategy?: JsonMergeStrategy;
|
|
1936
1909
|
}
|
|
1937
|
-
//#endregion
|
|
1938
|
-
//#region src/types/pageLayout.d.ts
|
|
1939
1910
|
/**
|
|
1940
1911
|
* 页面布局属性可序列化值。
|
|
1941
1912
|
*/
|
|
@@ -1968,8 +1939,6 @@ interface CompilerAppShell {
|
|
|
1968
1939
|
importPath: string;
|
|
1969
1940
|
tagName: string;
|
|
1970
1941
|
}
|
|
1971
|
-
//#endregion
|
|
1972
|
-
//#region src/types/wevu.d.ts
|
|
1973
1942
|
/**
|
|
1974
1943
|
* wevu JSON 默认值配置(app/component)。
|
|
1975
1944
|
*/
|
|
@@ -1977,8 +1946,6 @@ interface WevuDefaults {
|
|
|
1977
1946
|
app?: Record<string, any>;
|
|
1978
1947
|
component?: Record<string, any>;
|
|
1979
1948
|
}
|
|
1980
|
-
//#endregion
|
|
1981
|
-
//#region src/plugins/vue/compiler/template/platform.d.ts
|
|
1982
1949
|
interface MiniProgramDirectiveAttrs {
|
|
1983
1950
|
ifAttr: string;
|
|
1984
1951
|
elifAttr: string;
|
|
@@ -2006,8 +1973,6 @@ interface MiniProgramPlatform {
|
|
|
2006
1973
|
eventBindingAlias?: (eventName: string, tagName?: string) => string | undefined;
|
|
2007
1974
|
eventBindingAttr: (eventName: string) => string;
|
|
2008
1975
|
}
|
|
2009
|
-
//#endregion
|
|
2010
|
-
//#region src/plugins/vue/compiler/template/types.d.ts
|
|
2011
1976
|
type FunctionPropNameMatcher = string | RegExp;
|
|
2012
1977
|
/**
|
|
2013
1978
|
* 作用域插槽组件资源描述。
|
|
@@ -2264,11 +2229,7 @@ interface LayoutHostBinding {
|
|
|
2264
2229
|
selector: string;
|
|
2265
2230
|
kind?: 'component';
|
|
2266
2231
|
}
|
|
2267
|
-
//#endregion
|
|
2268
|
-
//#region src/plugins/vue/compiler/template/platforms/alipay.d.ts
|
|
2269
2232
|
export declare const alipayPlatform: MiniProgramPlatform;
|
|
2270
|
-
//#endregion
|
|
2271
|
-
//#region src/plugins/vue/compiler/template/platforms/default.d.ts
|
|
2272
2233
|
/**
|
|
2273
2234
|
* 默认小程序模板平台实现。
|
|
2274
2235
|
*
|
|
@@ -2280,14 +2241,8 @@ export declare const defaultMiniProgramPlatform: MiniProgramPlatform;
|
|
|
2280
2241
|
* 默认模板平台对象的简写别名。
|
|
2281
2242
|
*/
|
|
2282
2243
|
export declare const defaultPlatform: MiniProgramPlatform;
|
|
2283
|
-
//#endregion
|
|
2284
|
-
//#region src/plugins/vue/compiler/template/platforms/swan.d.ts
|
|
2285
2244
|
export declare const swanPlatform: MiniProgramPlatform;
|
|
2286
|
-
//#endregion
|
|
2287
|
-
//#region src/plugins/vue/compiler/template/platforms/tt.d.ts
|
|
2288
2245
|
export declare const ttPlatform: MiniProgramPlatform;
|
|
2289
|
-
//#endregion
|
|
2290
|
-
//#region src/plugins/vue/compiler/template/platforms/index.d.ts
|
|
2291
2246
|
/**
|
|
2292
2247
|
* 获取默认模板适配器。
|
|
2293
2248
|
*/
|
|
@@ -2310,24 +2265,20 @@ export declare const wechatPlatform: MiniProgramPlatform;
|
|
|
2310
2265
|
* 获取指定平台的模板适配器,默认回退到默认模板平台。
|
|
2311
2266
|
*/
|
|
2312
2267
|
export declare function getMiniProgramTemplatePlatform(platform?: MpPlatform): MiniProgramPlatform;
|
|
2313
|
-
//#endregion
|
|
2314
|
-
//#region src/plugins/vue/compiler/template.d.ts
|
|
2315
2268
|
/**
|
|
2316
2269
|
* 将 Vue 模板编译为 WXML。
|
|
2317
2270
|
*/
|
|
2318
2271
|
export declare function compileVueTemplateToWxml(template: string, filename: string, options?: TemplateCompileOptions): TemplateCompileResult;
|
|
2319
|
-
//#endregion
|
|
2320
|
-
//#region src/plugins/vue/transform/compileVueFile/nativeSlotContext/source.d.ts
|
|
2321
2272
|
interface SourceFacts {
|
|
2322
2273
|
source: string;
|
|
2323
2274
|
descriptor?: SFCDescriptor;
|
|
2324
2275
|
invalid?: boolean;
|
|
2325
2276
|
ast?: File;
|
|
2326
2277
|
}
|
|
2327
|
-
/**
|
|
2328
|
-
type
|
|
2329
|
-
|
|
2330
|
-
|
|
2278
|
+
/** 只缓存单文件输入与解析事实,不保存传递闭包或递归任务。 */
|
|
2279
|
+
type SourceAnalysisCache = Map<string, Promise<SourceFacts | undefined>>;
|
|
2280
|
+
/** 原生插槽继续由宿主管理单文件缓存,递归分类只在当轮保存。 */
|
|
2281
|
+
type NativeSlotContextAnalysisCache = SourceAnalysisCache;
|
|
2331
2282
|
interface ResolvedUsingComponentInfo {
|
|
2332
2283
|
from?: string;
|
|
2333
2284
|
resolvedId?: string;
|
|
@@ -2368,6 +2319,8 @@ interface VueTransformResult {
|
|
|
2368
2319
|
sfcSrcCompilationDeps?: string[];
|
|
2369
2320
|
/** 原生插槽上下文分析读取的源码依赖,变化时必须重新编译引用方。@internal */
|
|
2370
2321
|
nativeSlotContextDeps?: string[];
|
|
2322
|
+
/** props 键集合分析读取的源码依赖,变化时必须重新编译引用方。@internal */
|
|
2323
|
+
propsAnalysisDeps?: string[];
|
|
2371
2324
|
/** 已解析样式中的 CSS 变量表达式快照。@internal */
|
|
2372
2325
|
cssVars?: string[];
|
|
2373
2326
|
styleBlocks?: SFCStyleBlock[];
|
|
@@ -2502,14 +2455,10 @@ interface CompileVueFileOptions {
|
|
|
2502
2455
|
/** 原生插槽上下文分析的单文件事实缓存,不缓存传递闭包。@internal */
|
|
2503
2456
|
nativeSlotContextCache?: NativeSlotContextAnalysisCache;
|
|
2504
2457
|
}
|
|
2505
|
-
//#endregion
|
|
2506
|
-
//#region src/plugins/jsx/compileJsxFile.d.ts
|
|
2507
2458
|
/**
|
|
2508
2459
|
* 编译 JSX/TSX 文件,输出 wevu 脚本与 WXML 模板。
|
|
2509
2460
|
*/
|
|
2510
2461
|
export declare function compileJsxFile(source: string, filename: string, options?: CompileVueFileOptions): Promise<VueTransformResult>;
|
|
2511
|
-
//#endregion
|
|
2512
|
-
//#region src/plugins/uniApp/index.d.ts
|
|
2513
2462
|
type UniAppCompatibilityTarget = 'h5' | 'mp-weixin';
|
|
2514
2463
|
interface TransformUniAppSourceOptions {
|
|
2515
2464
|
blockType?: 'script' | 'sfc' | 'style' | 'template';
|
|
@@ -2534,8 +2483,6 @@ export declare function transformUniAppSource(source: string, options: Transform
|
|
|
2534
2483
|
* 判断文件是否属于项目源码或显式允许的 npm 包。
|
|
2535
2484
|
*/
|
|
2536
2485
|
export declare function isUniAppCompatibilityFile(filename: string, srcRoot: string, include: readonly string[]): boolean;
|
|
2537
|
-
//#endregion
|
|
2538
|
-
//#region src/plugins/utils/cache.d.ts
|
|
2539
2486
|
interface FileSignature {
|
|
2540
2487
|
ctimeMs: number;
|
|
2541
2488
|
ino: number;
|
|
@@ -2564,12 +2511,8 @@ export declare function invalidateFileCache(id: string): void;
|
|
|
2564
2511
|
* 清空所有文件缓存。
|
|
2565
2512
|
*/
|
|
2566
2513
|
export declare function clearFileCaches(): void;
|
|
2567
|
-
//#endregion
|
|
2568
|
-
//#region src/plugins/vue/compiler/wxss.d.ts
|
|
2569
2514
|
/** 保留兼容入口;WXSS 支持嵌套变量回退,不得丢弃依赖级联的内层变量。 */
|
|
2570
2515
|
export declare function transformNestedWxssVars(source: string): string;
|
|
2571
|
-
//#endregion
|
|
2572
|
-
//#region src/plugins/vue/compiler/style.d.ts
|
|
2573
2516
|
/**
|
|
2574
2517
|
* 样式编译结果。
|
|
2575
2518
|
*/
|
|
@@ -2601,8 +2544,6 @@ export declare function transformVueDeepSelectors(source: string): string;
|
|
|
2601
2544
|
* 将 Vue SFC style 块编译为可交给 Vite CSS 管线的内容。
|
|
2602
2545
|
*/
|
|
2603
2546
|
export declare function compileVueStyleToWxss(styleBlock: SFCStyleBlock, options: StyleCompileOptions): Promise<StyleCompileResult>;
|
|
2604
|
-
//#endregion
|
|
2605
|
-
//#region src/plugins/vue/compiler/template/classStyleRuntime.d.ts
|
|
2606
2547
|
/**
|
|
2607
2548
|
* class/style WXS 模块名。
|
|
2608
2549
|
*/
|
|
@@ -2633,8 +2574,6 @@ export declare function resolveClassStyleWxsLocation(options: {
|
|
|
2633
2574
|
* 获取内置 class/style WXS 运行时代码。
|
|
2634
2575
|
*/
|
|
2635
2576
|
export declare function getClassStyleWxsSource(options?: ClassStyleWxsSourceOptions): string;
|
|
2636
|
-
//#endregion
|
|
2637
|
-
//#region src/plugins/vue/hmr/sfcSignature.d.ts
|
|
2638
2577
|
export declare const VUE_SFC_BLOCK_TYPES: readonly ["script", "template", "style", "config"];
|
|
2639
2578
|
type VueSfcBlockType = typeof VUE_SFC_BLOCK_TYPES[number];
|
|
2640
2579
|
type VueSfcBlockSignatures = Readonly<Record<VueSfcBlockType, string>>;
|
|
@@ -2664,30 +2603,22 @@ export declare function resolveVueSfcScriptSignature(source: string, filename: s
|
|
|
2664
2603
|
export declare function resolveVueSfcStyleIndependentSignature(source: string, filename: string): string | undefined;
|
|
2665
2604
|
export declare function resolveVueSfcTailwindContentSignature(source: string, filename: string): string | undefined;
|
|
2666
2605
|
export declare function resolveVueSfcHasTemplate(source: string, filename: string): boolean | undefined;
|
|
2667
|
-
//#endregion
|
|
2668
|
-
//#region src/plugins/vue/transform/classStyleComputed.d.ts
|
|
2669
2606
|
interface ClassStyleHelperNames {
|
|
2670
2607
|
normalizeClassName: string;
|
|
2671
2608
|
normalizeStyleName: string;
|
|
2672
2609
|
unrefName?: string;
|
|
2673
2610
|
}
|
|
2674
2611
|
export declare function buildClassStyleComputedCode(bindings: ClassStyleBinding[], helpers: ClassStyleHelperNames): string | null;
|
|
2675
|
-
//#endregion
|
|
2676
|
-
//#region src/plugins/vue/transform/compileVueFile/jsonOnly.d.ts
|
|
2677
2612
|
/**
|
|
2678
2613
|
* 只重算 Vue SFC 的 JSON 配置,并复用脚本、模板与样式编译结果。
|
|
2679
2614
|
*
|
|
2680
2615
|
* @internal
|
|
2681
2616
|
*/
|
|
2682
2617
|
export declare function refreshVueFileJsonConfig(source: string, filename: string, cachedResult: VueTransformResult, options?: CompileVueFileOptions): Promise<VueTransformResult | undefined>;
|
|
2683
|
-
//#endregion
|
|
2684
|
-
//#region src/plugins/vue/transform/compileVueFile/index.d.ts
|
|
2685
2618
|
/**
|
|
2686
2619
|
* 编译 Vue 单文件组件,输出脚本、模板、样式与配置结果。
|
|
2687
2620
|
*/
|
|
2688
2621
|
export declare function compileVueFile(source: string, filename: string, options?: CompileVueFileOptions): Promise<VueTransformResult>;
|
|
2689
|
-
//#endregion
|
|
2690
|
-
//#region src/plugins/vue/transform/config.d.ts
|
|
2691
2622
|
/**
|
|
2692
2623
|
* JS 配置块的语言类型。
|
|
2693
2624
|
*/
|
|
@@ -2714,17 +2645,11 @@ export declare function evaluateJsLikeConfig(source: string, filename: string, l
|
|
|
2714
2645
|
export declare function compileConfigBlocks(blocks: SFCBlock[], filename: string, options?: {
|
|
2715
2646
|
merge?: (target: Record<string, any>, source: Record<string, any>) => Record<string, any> | void;
|
|
2716
2647
|
}): Promise<string | undefined>;
|
|
2717
|
-
//#endregion
|
|
2718
|
-
//#region src/plugins/vue/transform/jsonMacros/parse.d.ts
|
|
2719
2648
|
export declare function mayContainJsonMacro(content: string): boolean;
|
|
2720
|
-
//#endregion
|
|
2721
|
-
//#region src/plugins/vue/transform/jsonMacros/rewrite.d.ts
|
|
2722
2649
|
/**
|
|
2723
2650
|
* 从任意代码中剥离 JSON 宏调用。
|
|
2724
2651
|
*/
|
|
2725
2652
|
export declare function stripJsonMacroCallsFromCode(code: string, filename: string): string;
|
|
2726
|
-
//#endregion
|
|
2727
|
-
//#region src/plugins/vue/transform/jsonMacros/index.d.ts
|
|
2728
2653
|
interface JsonMacroExtractionOptions {
|
|
2729
2654
|
merge?: (target: Record<string, any>, source: Record<string, any>) => Record<string, any> | void;
|
|
2730
2655
|
preambleContent?: string;
|
|
@@ -2739,8 +2664,6 @@ interface JsonMacroExtractionResult {
|
|
|
2739
2664
|
* 从 `<script setup>` 中提取 JSON 宏配置并返回剥离后的代码。
|
|
2740
2665
|
*/
|
|
2741
2666
|
export declare function extractJsonMacroFromScriptSetup(content: string, filename: string, lang?: string, options?: JsonMacroExtractionOptions): Promise<JsonMacroExtractionResult>;
|
|
2742
|
-
//#endregion
|
|
2743
|
-
//#region src/plugins/vue/transform/jsonMerge.d.ts
|
|
2744
2667
|
/**
|
|
2745
2668
|
* 按策略合并 JSON 配置对象。
|
|
2746
2669
|
*/
|
|
@@ -2749,14 +2672,10 @@ export declare function mergeJsonWithStrategy(target: Record<string, any>, sourc
|
|
|
2749
2672
|
* 创建带上下文的 JSON 合并函数。
|
|
2750
2673
|
*/
|
|
2751
2674
|
export declare function createJsonMerger(strategy: JsonMergeStrategy | undefined, baseContext: Omit<JsonMergeContext, 'stage'>): (target: Record<string, any>, source: Record<string, any>, stage: JsonMergeContext["stage"]) => Record<string, any>;
|
|
2752
|
-
//#endregion
|
|
2753
|
-
//#region src/plugins/vue/transform/scopedId.d.ts
|
|
2754
2675
|
/**
|
|
2755
2676
|
* 根据项目内相对路径生成跨机器稳定的 scoped ID。
|
|
2756
2677
|
*/
|
|
2757
2678
|
export declare function generateScopedId(filename: string): string;
|
|
2758
|
-
//#endregion
|
|
2759
|
-
//#region src/plugins/vue/transform/transformScript/utils.d.ts
|
|
2760
2679
|
/**
|
|
2761
2680
|
* 使用 Babel AST 转换脚本
|
|
2762
2681
|
* 比正则替换更健壮,能处理复杂的代码结构
|
|
@@ -2887,14 +2806,10 @@ interface TransformScriptOptions {
|
|
|
2887
2806
|
*/
|
|
2888
2807
|
stabilizeCssVarsRuntime?: boolean;
|
|
2889
2808
|
}
|
|
2890
|
-
//#endregion
|
|
2891
|
-
//#region src/plugins/vue/transform/transformScript/index.d.ts
|
|
2892
2809
|
/**
|
|
2893
2810
|
* 转换 Vue SFC 脚本:处理宏、导入、默认导出与 wevu 相关注入。
|
|
2894
2811
|
*/
|
|
2895
2812
|
export declare function transformScript(source: string, options?: TransformScriptOptions): TransformResult;
|
|
2896
|
-
//#endregion
|
|
2897
|
-
//#region src/plugins/wevu/pageFeatures/types.d.ts
|
|
2898
2813
|
/**
|
|
2899
2814
|
* wevu 页面特性标识(由钩子映射表推导)。
|
|
2900
2815
|
*/
|
|
@@ -2910,16 +2825,12 @@ interface ModuleResolver {
|
|
|
2910
2825
|
resolveId: (source: string, importer: string) => Promise<string | undefined>;
|
|
2911
2826
|
loadCode: (id: string) => Promise<string | undefined>;
|
|
2912
2827
|
}
|
|
2913
|
-
//#endregion
|
|
2914
|
-
//#region src/ast/operations/pageFeatures.d.ts
|
|
2915
2828
|
/**
|
|
2916
2829
|
* 从源码中收集 wevu 页面特性。
|
|
2917
2830
|
*/
|
|
2918
2831
|
export declare function collectWevuPageFeatureFlagsFromCode(code: string, options?: {
|
|
2919
2832
|
astEngine?: AstEngineName$1;
|
|
2920
2833
|
}): Set<WevuPageFeatureFlag>;
|
|
2921
|
-
//#endregion
|
|
2922
|
-
//#region src/plugins/wevu/pageFeatures/moduleAnalysis/types.d.ts
|
|
2923
2834
|
type FunctionLike = t.FunctionDeclaration | t.FunctionExpression | t.ArrowFunctionExpression | t.ObjectMethod | {
|
|
2924
2835
|
type: string;
|
|
2925
2836
|
[key: string]: any;
|
|
@@ -2960,8 +2871,6 @@ interface ModuleAnalysis {
|
|
|
2960
2871
|
localFunctions: Map<string, FunctionLike>;
|
|
2961
2872
|
exports: Map<string, ExportTarget>;
|
|
2962
2873
|
}
|
|
2963
|
-
//#endregion
|
|
2964
|
-
//#region src/plugins/wevu/pageFeatures/optionsObjects.d.ts
|
|
2965
2874
|
type OptionsObject = t.ObjectExpression | {
|
|
2966
2875
|
type: 'ObjectExpression';
|
|
2967
2876
|
properties: any[];
|
|
@@ -2973,15 +2882,11 @@ export declare function collectTargetOptionsObjectsFromCode(code: string, module
|
|
|
2973
2882
|
optionsObjects: OptionsObject[];
|
|
2974
2883
|
module: ModuleAnalysis;
|
|
2975
2884
|
};
|
|
2976
|
-
//#endregion
|
|
2977
|
-
//#region src/plugins/wevu/pageFeatures/reachability/index.d.ts
|
|
2978
2885
|
export declare function collectWevuFeaturesFromCodeReachableImports(code: string, options: {
|
|
2979
2886
|
id: string;
|
|
2980
2887
|
resolver: ModuleResolver;
|
|
2981
2888
|
astEngine?: AstEngineName$1;
|
|
2982
2889
|
}): Promise<Set<WevuPageFeatureFlag>>;
|
|
2983
|
-
//#endregion
|
|
2984
|
-
//#region src/plugins/wevu/pageFeatures/flags.d.ts
|
|
2985
2890
|
/**
|
|
2986
2891
|
* 扫描 AST,收集启用的 wevu 页面特性标识。
|
|
2987
2892
|
*/
|
|
@@ -2990,8 +2895,6 @@ export declare function collectWevuPageFeatureFlags(ast: t.File): Set<WevuPageFe
|
|
|
2990
2895
|
* 将启用的页面特性注入到 options 对象中。
|
|
2991
2896
|
*/
|
|
2992
2897
|
export declare function injectWevuPageFeatureFlagsIntoOptionsObject(optionsObject: t.ObjectExpression, enabled: Set<WevuPageFeatureFlag>): boolean;
|
|
2993
|
-
//#endregion
|
|
2994
|
-
//#region src/plugins/wevu/pageFeatures/inject.d.ts
|
|
2995
2898
|
/**
|
|
2996
2899
|
* 在 JS 源码中注入 wevu 页面特性(基于本文件分析)。
|
|
2997
2900
|
*/
|
|
@@ -3018,8 +2921,6 @@ export declare function injectWevuPageFeaturesInJsWithResolver(source: string, o
|
|
|
3018
2921
|
transformed: boolean;
|
|
3019
2922
|
map?: EncodedSourceMapLike | null;
|
|
3020
2923
|
}>;
|
|
3021
|
-
//#endregion
|
|
3022
|
-
//#region src/plugins/wevu/pageFeatures/matcher.d.ts
|
|
3023
2924
|
/**
|
|
3024
2925
|
* 页面入口匹配器的数据源。
|
|
3025
2926
|
*/
|
|
@@ -3042,8 +2943,6 @@ export declare function createPageEntryMatcher(source: PageEntryMatcherSource):
|
|
|
3042
2943
|
markDirty(): void;
|
|
3043
2944
|
isPageFile(filePath: string): Promise<boolean>;
|
|
3044
2945
|
};
|
|
3045
|
-
//#endregion
|
|
3046
|
-
//#region src/utils/vueTemplateTags.d.ts
|
|
3047
2946
|
export declare const RESERVED_VUE_COMPONENT_TAGS: Set<string>;
|
|
3048
2947
|
export declare const VUE_COMPONENT_TAG_RE: RegExp;
|
|
3049
2948
|
/**
|
|
@@ -3063,5 +2962,4 @@ interface CollectVueTemplateTagsOptions {
|
|
|
3063
2962
|
* 收集 Vue 模板中的自定义组件标签。
|
|
3064
2963
|
*/
|
|
3065
2964
|
export declare function collectVueTemplateTags(template: string, options: CollectVueTemplateTagsOptions): Set<string>;
|
|
3066
|
-
//#endregion
|
|
3067
2965
|
export { type AstEngineName, type AutoImportTagsOptions, type AutoUsingComponentsOptions, type BindingCondition, type ClassStyleBinding, type ClassStyleRuntime, type CollectVueTemplateTagsOptions, type CompileVueFileOptions, type CompilerAppShell, type CompilerDiagnostic, type CompilerDiagnosticCode, type CompilerDiagnosticSeverity, type CompilerDiagnosticSource, type CompilerLayoutPropValue, type CompilerPageLayout, type CompilerPageLayoutPlan, type ComponentStyleOptions, type ComponentStylePrimitive, type ExtractPageDeclarationWithDependenciesResult, type ForParseResult, type InlineExpressionAsset, type JsLikeLang, type JsonConfig, type JsonMergeContext, type JsonMergeFunction, type JsonMergeStage, type JsonMergeStrategy, type MiniProgramPlatform, type ModuleResolver, type MpPlatform, type ReadAndParseSfcOptions, type ResolveSfcBlockSrcOptions, type ResolvedUsingComponentInfo, type ResolvedUsingComponentPath, type ScopedSlotComponentAsset, type SlotFallbackWrapperComponentAsset, type SlotFallbackWrapperStrategy, type SourcePosition, type SourceSpan, type StaticComponentStyleOption, type StaticPageDeclaration, type StaticPageMeta, type StaticRouteValue, type StyleCompileOptions, type StyleCompileResult, type TemplateCompileOptions, type TemplateCompileResult, type TemplateRefBinding, type TransformResult, type TransformScriptOptions, type TransformUniAppSourceOptions, type UniAppCompatibilityTarget, type VueSfcBlockChanges, type VueSfcBlockSignatures, type VueSfcBlockType, type VueSfcHmrSignatures, type VueTransformResult, type WevuBindingDependencyV1, type WevuBindingKind, type WevuBindingManifestFeaturesV1, type WevuBindingManifestV1, type WevuBindingRecordV1, type WevuBindingScopeV1, type WevuBindingUpdateMode, type WevuDefaults, type WevuRuntimeBindingManifestMode, type WevuRuntimeBindingManifestV1, type WevuRuntimeBindingRecordV1, compileVueFile as compileSfc, compileVueStyleToWxss as compileStyle, compileVueTemplateToWxml as compileTemplate, transformScript as transformSfcScript };
|