@wevu/compiler 7.5.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,13 +211,12 @@ 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
|
*/
|
|
230
217
|
interface ResolveSfcBlockSrcOptions {
|
|
231
218
|
resolveId?: (source: string, importer?: string) => Promise<string | undefined>;
|
|
219
|
+
/** 自定义读取器的异常原样传出,保留调用方用于重试或重新同步的控制流。 */
|
|
232
220
|
readFile?: (id: string, options?: {
|
|
233
221
|
checkMtime?: boolean;
|
|
234
222
|
}) => Promise<string>;
|
|
@@ -244,8 +232,6 @@ export declare function resolveSfcBlockSrc(descriptor: SFCDescriptor, filename:
|
|
|
244
232
|
scriptSetupResolvedId?: string;
|
|
245
233
|
templateResolvedId?: string;
|
|
246
234
|
}>;
|
|
247
|
-
//#endregion
|
|
248
|
-
//#region src/plugins/utils/vueSfc.d.ts
|
|
249
235
|
/**
|
|
250
236
|
* 读取并解析 SFC 的配置。
|
|
251
237
|
*/
|
|
@@ -301,8 +287,6 @@ export declare function readAndParseSfc(filename: string, options?: ReadAndParse
|
|
|
301
287
|
export declare function getSfcCheckMtime(config?: {
|
|
302
288
|
isDev?: boolean;
|
|
303
289
|
}): boolean;
|
|
304
|
-
//#endregion
|
|
305
|
-
//#region ../../node_modules/.pnpm/@babel+types@8.0.6/node_modules/@babel/types/lib/index.d.ts
|
|
306
290
|
interface BaseComment {
|
|
307
291
|
value: string;
|
|
308
292
|
start?: number;
|
|
@@ -1811,8 +1795,6 @@ type FlowType = AnyTypeAnnotation | ArrayTypeAnnotation | BooleanTypeAnnotation
|
|
|
1811
1795
|
type FlowPredicate = DeclaredPredicate | InferredPredicate;
|
|
1812
1796
|
type TSTypeElement = TSCallSignatureDeclaration | TSConstructSignatureDeclaration | TSPropertySignature | TSMethodSignature | TSIndexSignature;
|
|
1813
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;
|
|
1814
|
-
//#endregion
|
|
1815
|
-
//#region src/pageDeclaration/analyze.d.ts
|
|
1816
1798
|
/**
|
|
1817
1799
|
* 共享普通脚本与 setup 的模块绑定,收集指向全局宏或规范导入的页面元信息调用。
|
|
1818
1800
|
*/
|
|
@@ -1820,8 +1802,6 @@ export declare function collectPageMetaCallsFromPrograms(programs: {
|
|
|
1820
1802
|
script?: File;
|
|
1821
1803
|
scriptSetup?: File;
|
|
1822
1804
|
}): CallExpression[];
|
|
1823
|
-
//#endregion
|
|
1824
|
-
//#region src/pageDeclaration/index.d.ts
|
|
1825
1805
|
interface StripPageDeclarationResult {
|
|
1826
1806
|
code: string;
|
|
1827
1807
|
map?: EncodedSourceMapLike;
|
|
@@ -1845,8 +1825,6 @@ export declare function mayContainPageMeta(source: string): boolean;
|
|
|
1845
1825
|
export declare function extractPageDeclarationWithDependencies(source: string, filename: string, options?: ResolveSfcBlockSrcOptions): Promise<ExtractPageDeclarationWithDependenciesResult>;
|
|
1846
1826
|
export declare function extractPageDeclaration(source: string, filename: string): StaticPageDeclaration | undefined;
|
|
1847
1827
|
export declare function stripPageDeclaration(source: string, filename: string): StripPageDeclarationResult | undefined;
|
|
1848
|
-
//#endregion
|
|
1849
|
-
//#region src/runtimeCapabilities.d.ts
|
|
1850
1828
|
/**
|
|
1851
1829
|
* wevu 编译器内部使用的运行时能力规范顺序。
|
|
1852
1830
|
*
|
|
@@ -1868,8 +1846,6 @@ interface WevuRuntimeCapabilityMetadata {
|
|
|
1868
1846
|
required: WevuRuntimeCapabilityName[];
|
|
1869
1847
|
conservative?: WevuRuntimeCapabilityName[];
|
|
1870
1848
|
}
|
|
1871
|
-
//#endregion
|
|
1872
|
-
//#region src/types/componentStyleOptions.d.ts
|
|
1873
1849
|
/** 编译期可证明的静态原语;显式 undefined 与属性缺失分别保留。 */
|
|
1874
1850
|
type ComponentStylePrimitive = string | boolean | number | null | undefined;
|
|
1875
1851
|
/** 小程序组件样式选项的静态解析状态。 */
|
|
@@ -1886,8 +1862,6 @@ interface ComponentStyleOptions {
|
|
|
1886
1862
|
styleIsolation: StaticComponentStyleOption;
|
|
1887
1863
|
addGlobalClass: StaticComponentStyleOption;
|
|
1888
1864
|
}
|
|
1889
|
-
//#endregion
|
|
1890
|
-
//#region src/types/json.d.ts
|
|
1891
1865
|
/**
|
|
1892
1866
|
* JSON 合并阶段枚举。
|
|
1893
1867
|
*/
|
|
@@ -1933,8 +1907,6 @@ interface JsonConfig {
|
|
|
1933
1907
|
*/
|
|
1934
1908
|
mergeStrategy?: JsonMergeStrategy;
|
|
1935
1909
|
}
|
|
1936
|
-
//#endregion
|
|
1937
|
-
//#region src/types/pageLayout.d.ts
|
|
1938
1910
|
/**
|
|
1939
1911
|
* 页面布局属性可序列化值。
|
|
1940
1912
|
*/
|
|
@@ -1967,8 +1939,6 @@ interface CompilerAppShell {
|
|
|
1967
1939
|
importPath: string;
|
|
1968
1940
|
tagName: string;
|
|
1969
1941
|
}
|
|
1970
|
-
//#endregion
|
|
1971
|
-
//#region src/types/wevu.d.ts
|
|
1972
1942
|
/**
|
|
1973
1943
|
* wevu JSON 默认值配置(app/component)。
|
|
1974
1944
|
*/
|
|
@@ -1976,8 +1946,6 @@ interface WevuDefaults {
|
|
|
1976
1946
|
app?: Record<string, any>;
|
|
1977
1947
|
component?: Record<string, any>;
|
|
1978
1948
|
}
|
|
1979
|
-
//#endregion
|
|
1980
|
-
//#region src/plugins/vue/compiler/template/platform.d.ts
|
|
1981
1949
|
interface MiniProgramDirectiveAttrs {
|
|
1982
1950
|
ifAttr: string;
|
|
1983
1951
|
elifAttr: string;
|
|
@@ -2005,8 +1973,6 @@ interface MiniProgramPlatform {
|
|
|
2005
1973
|
eventBindingAlias?: (eventName: string, tagName?: string) => string | undefined;
|
|
2006
1974
|
eventBindingAttr: (eventName: string) => string;
|
|
2007
1975
|
}
|
|
2008
|
-
//#endregion
|
|
2009
|
-
//#region src/plugins/vue/compiler/template/types.d.ts
|
|
2010
1976
|
type FunctionPropNameMatcher = string | RegExp;
|
|
2011
1977
|
/**
|
|
2012
1978
|
* 作用域插槽组件资源描述。
|
|
@@ -2137,6 +2103,10 @@ interface TemplateCompileOptions {
|
|
|
2137
2103
|
htmlTagToWxmlTagClass?: boolean;
|
|
2138
2104
|
scopedSlotsCompiler?: ScopedSlotsCompilerMode;
|
|
2139
2105
|
scopedSlotsRequireProps?: boolean;
|
|
2106
|
+
/** 显式启用微信原生普通插槽的声明上下文协议;默认关闭。 */
|
|
2107
|
+
nativeSlotContext?: boolean;
|
|
2108
|
+
/** 上下文分析后需要声明协议的组件标签;未提供时保守保留全部 wevu 组件。@internal */
|
|
2109
|
+
nativeSlotContextTags?: ReadonlySet<string>;
|
|
2140
2110
|
slotSingleRootNoWrapper?: boolean;
|
|
2141
2111
|
slotFallbackWrapper?: SlotFallbackWrapperConfig;
|
|
2142
2112
|
slotFallbackWrapperStrategy?: SlotFallbackWrapperStrategy;
|
|
@@ -2259,11 +2229,7 @@ interface LayoutHostBinding {
|
|
|
2259
2229
|
selector: string;
|
|
2260
2230
|
kind?: 'component';
|
|
2261
2231
|
}
|
|
2262
|
-
//#endregion
|
|
2263
|
-
//#region src/plugins/vue/compiler/template/platforms/alipay.d.ts
|
|
2264
2232
|
export declare const alipayPlatform: MiniProgramPlatform;
|
|
2265
|
-
//#endregion
|
|
2266
|
-
//#region src/plugins/vue/compiler/template/platforms/default.d.ts
|
|
2267
2233
|
/**
|
|
2268
2234
|
* 默认小程序模板平台实现。
|
|
2269
2235
|
*
|
|
@@ -2275,14 +2241,8 @@ export declare const defaultMiniProgramPlatform: MiniProgramPlatform;
|
|
|
2275
2241
|
* 默认模板平台对象的简写别名。
|
|
2276
2242
|
*/
|
|
2277
2243
|
export declare const defaultPlatform: MiniProgramPlatform;
|
|
2278
|
-
//#endregion
|
|
2279
|
-
//#region src/plugins/vue/compiler/template/platforms/swan.d.ts
|
|
2280
2244
|
export declare const swanPlatform: MiniProgramPlatform;
|
|
2281
|
-
//#endregion
|
|
2282
|
-
//#region src/plugins/vue/compiler/template/platforms/tt.d.ts
|
|
2283
2245
|
export declare const ttPlatform: MiniProgramPlatform;
|
|
2284
|
-
//#endregion
|
|
2285
|
-
//#region src/plugins/vue/compiler/template/platforms/index.d.ts
|
|
2286
2246
|
/**
|
|
2287
2247
|
* 获取默认模板适配器。
|
|
2288
2248
|
*/
|
|
@@ -2305,14 +2265,20 @@ export declare const wechatPlatform: MiniProgramPlatform;
|
|
|
2305
2265
|
* 获取指定平台的模板适配器,默认回退到默认模板平台。
|
|
2306
2266
|
*/
|
|
2307
2267
|
export declare function getMiniProgramTemplatePlatform(platform?: MpPlatform): MiniProgramPlatform;
|
|
2308
|
-
//#endregion
|
|
2309
|
-
//#region src/plugins/vue/compiler/template.d.ts
|
|
2310
2268
|
/**
|
|
2311
2269
|
* 将 Vue 模板编译为 WXML。
|
|
2312
2270
|
*/
|
|
2313
2271
|
export declare function compileVueTemplateToWxml(template: string, filename: string, options?: TemplateCompileOptions): TemplateCompileResult;
|
|
2314
|
-
|
|
2315
|
-
|
|
2272
|
+
interface SourceFacts {
|
|
2273
|
+
source: string;
|
|
2274
|
+
descriptor?: SFCDescriptor;
|
|
2275
|
+
invalid?: boolean;
|
|
2276
|
+
ast?: File;
|
|
2277
|
+
}
|
|
2278
|
+
/** 只缓存单文件输入与解析事实,不保存传递闭包或递归任务。 */
|
|
2279
|
+
type SourceAnalysisCache = Map<string, Promise<SourceFacts | undefined>>;
|
|
2280
|
+
/** 原生插槽继续由宿主管理单文件缓存,递归分类只在当轮保存。 */
|
|
2281
|
+
type NativeSlotContextAnalysisCache = SourceAnalysisCache;
|
|
2316
2282
|
interface ResolvedUsingComponentInfo {
|
|
2317
2283
|
from?: string;
|
|
2318
2284
|
resolvedId?: string;
|
|
@@ -2340,6 +2306,8 @@ interface VueTransformResult {
|
|
|
2340
2306
|
pageMeta?: JsonMergeContext['pageMeta'];
|
|
2341
2307
|
/** @internal */
|
|
2342
2308
|
componentStyleOptions?: ComponentStyleOptions;
|
|
2309
|
+
/** 已解析模板和计算绑定的注册签名;包含外部模板与静态 JSX 展开。@internal */
|
|
2310
|
+
templateRegistrationSignature?: string;
|
|
2343
2311
|
/** @internal */
|
|
2344
2312
|
runtimeCapabilities?: WevuRuntimeCapabilityMetadata;
|
|
2345
2313
|
hasScriptSetup?: boolean;
|
|
@@ -2349,6 +2317,10 @@ interface VueTransformResult {
|
|
|
2349
2317
|
sfcSrcDeps?: string[];
|
|
2350
2318
|
/** 模板和脚本外部块的编译输入,变化时必须失效完整编译结果。@internal */
|
|
2351
2319
|
sfcSrcCompilationDeps?: string[];
|
|
2320
|
+
/** 原生插槽上下文分析读取的源码依赖,变化时必须重新编译引用方。@internal */
|
|
2321
|
+
nativeSlotContextDeps?: string[];
|
|
2322
|
+
/** props 键集合分析读取的源码依赖,变化时必须重新编译引用方。@internal */
|
|
2323
|
+
propsAnalysisDeps?: string[];
|
|
2352
2324
|
/** 已解析样式中的 CSS 变量表达式快照。@internal */
|
|
2353
2325
|
cssVars?: string[];
|
|
2354
2326
|
styleBlocks?: SFCStyleBlock[];
|
|
@@ -2471,20 +2443,22 @@ interface CompileVueFileOptions {
|
|
|
2471
2443
|
mergeStrategy?: JsonMergeStrategy;
|
|
2472
2444
|
};
|
|
2473
2445
|
sfcSrc?: ResolveSfcBlockSrcOptions;
|
|
2446
|
+
/** JSX/TSX 跨文件静态展开的同步源码读取;未提供时读取磁盘。 */
|
|
2447
|
+
jsx?: {
|
|
2448
|
+
readFile: (filename: string) => string;
|
|
2449
|
+
};
|
|
2474
2450
|
wevuDefaults?: WevuDefaults;
|
|
2475
2451
|
/**
|
|
2476
2452
|
* 缓存被当前 SFC 引用的 Vue 组件静态元信息,避免重复读取和解析同一组件。
|
|
2477
2453
|
*/
|
|
2478
2454
|
componentMetaCache?: Map<string, Promise<VueSfcStaticComponentMeta>>;
|
|
2455
|
+
/** 原生插槽上下文分析的单文件事实缓存,不缓存传递闭包。@internal */
|
|
2456
|
+
nativeSlotContextCache?: NativeSlotContextAnalysisCache;
|
|
2479
2457
|
}
|
|
2480
|
-
//#endregion
|
|
2481
|
-
//#region src/plugins/jsx/compileJsxFile.d.ts
|
|
2482
2458
|
/**
|
|
2483
2459
|
* 编译 JSX/TSX 文件,输出 wevu 脚本与 WXML 模板。
|
|
2484
2460
|
*/
|
|
2485
2461
|
export declare function compileJsxFile(source: string, filename: string, options?: CompileVueFileOptions): Promise<VueTransformResult>;
|
|
2486
|
-
//#endregion
|
|
2487
|
-
//#region src/plugins/uniApp/index.d.ts
|
|
2488
2462
|
type UniAppCompatibilityTarget = 'h5' | 'mp-weixin';
|
|
2489
2463
|
interface TransformUniAppSourceOptions {
|
|
2490
2464
|
blockType?: 'script' | 'sfc' | 'style' | 'template';
|
|
@@ -2509,8 +2483,6 @@ export declare function transformUniAppSource(source: string, options: Transform
|
|
|
2509
2483
|
* 判断文件是否属于项目源码或显式允许的 npm 包。
|
|
2510
2484
|
*/
|
|
2511
2485
|
export declare function isUniAppCompatibilityFile(filename: string, srcRoot: string, include: readonly string[]): boolean;
|
|
2512
|
-
//#endregion
|
|
2513
|
-
//#region src/plugins/utils/cache.d.ts
|
|
2514
2486
|
interface FileSignature {
|
|
2515
2487
|
ctimeMs: number;
|
|
2516
2488
|
ino: number;
|
|
@@ -2539,12 +2511,8 @@ export declare function invalidateFileCache(id: string): void;
|
|
|
2539
2511
|
* 清空所有文件缓存。
|
|
2540
2512
|
*/
|
|
2541
2513
|
export declare function clearFileCaches(): void;
|
|
2542
|
-
//#endregion
|
|
2543
|
-
//#region src/plugins/vue/compiler/wxss.d.ts
|
|
2544
2514
|
/** 保留兼容入口;WXSS 支持嵌套变量回退,不得丢弃依赖级联的内层变量。 */
|
|
2545
2515
|
export declare function transformNestedWxssVars(source: string): string;
|
|
2546
|
-
//#endregion
|
|
2547
|
-
//#region src/plugins/vue/compiler/style.d.ts
|
|
2548
2516
|
/**
|
|
2549
2517
|
* 样式编译结果。
|
|
2550
2518
|
*/
|
|
@@ -2576,8 +2544,6 @@ export declare function transformVueDeepSelectors(source: string): string;
|
|
|
2576
2544
|
* 将 Vue SFC style 块编译为可交给 Vite CSS 管线的内容。
|
|
2577
2545
|
*/
|
|
2578
2546
|
export declare function compileVueStyleToWxss(styleBlock: SFCStyleBlock, options: StyleCompileOptions): Promise<StyleCompileResult>;
|
|
2579
|
-
//#endregion
|
|
2580
|
-
//#region src/plugins/vue/compiler/template/classStyleRuntime.d.ts
|
|
2581
2547
|
/**
|
|
2582
2548
|
* class/style WXS 模块名。
|
|
2583
2549
|
*/
|
|
@@ -2608,8 +2574,6 @@ export declare function resolveClassStyleWxsLocation(options: {
|
|
|
2608
2574
|
* 获取内置 class/style WXS 运行时代码。
|
|
2609
2575
|
*/
|
|
2610
2576
|
export declare function getClassStyleWxsSource(options?: ClassStyleWxsSourceOptions): string;
|
|
2611
|
-
//#endregion
|
|
2612
|
-
//#region src/plugins/vue/hmr/sfcSignature.d.ts
|
|
2613
2577
|
export declare const VUE_SFC_BLOCK_TYPES: readonly ["script", "template", "style", "config"];
|
|
2614
2578
|
type VueSfcBlockType = typeof VUE_SFC_BLOCK_TYPES[number];
|
|
2615
2579
|
type VueSfcBlockSignatures = Readonly<Record<VueSfcBlockType, string>>;
|
|
@@ -2639,30 +2603,22 @@ export declare function resolveVueSfcScriptSignature(source: string, filename: s
|
|
|
2639
2603
|
export declare function resolveVueSfcStyleIndependentSignature(source: string, filename: string): string | undefined;
|
|
2640
2604
|
export declare function resolveVueSfcTailwindContentSignature(source: string, filename: string): string | undefined;
|
|
2641
2605
|
export declare function resolveVueSfcHasTemplate(source: string, filename: string): boolean | undefined;
|
|
2642
|
-
//#endregion
|
|
2643
|
-
//#region src/plugins/vue/transform/classStyleComputed.d.ts
|
|
2644
2606
|
interface ClassStyleHelperNames {
|
|
2645
2607
|
normalizeClassName: string;
|
|
2646
2608
|
normalizeStyleName: string;
|
|
2647
2609
|
unrefName?: string;
|
|
2648
2610
|
}
|
|
2649
2611
|
export declare function buildClassStyleComputedCode(bindings: ClassStyleBinding[], helpers: ClassStyleHelperNames): string | null;
|
|
2650
|
-
//#endregion
|
|
2651
|
-
//#region src/plugins/vue/transform/compileVueFile/jsonOnly.d.ts
|
|
2652
2612
|
/**
|
|
2653
2613
|
* 只重算 Vue SFC 的 JSON 配置,并复用脚本、模板与样式编译结果。
|
|
2654
2614
|
*
|
|
2655
2615
|
* @internal
|
|
2656
2616
|
*/
|
|
2657
2617
|
export declare function refreshVueFileJsonConfig(source: string, filename: string, cachedResult: VueTransformResult, options?: CompileVueFileOptions): Promise<VueTransformResult | undefined>;
|
|
2658
|
-
//#endregion
|
|
2659
|
-
//#region src/plugins/vue/transform/compileVueFile/index.d.ts
|
|
2660
2618
|
/**
|
|
2661
2619
|
* 编译 Vue 单文件组件,输出脚本、模板、样式与配置结果。
|
|
2662
2620
|
*/
|
|
2663
2621
|
export declare function compileVueFile(source: string, filename: string, options?: CompileVueFileOptions): Promise<VueTransformResult>;
|
|
2664
|
-
//#endregion
|
|
2665
|
-
//#region src/plugins/vue/transform/config.d.ts
|
|
2666
2622
|
/**
|
|
2667
2623
|
* JS 配置块的语言类型。
|
|
2668
2624
|
*/
|
|
@@ -2689,17 +2645,11 @@ export declare function evaluateJsLikeConfig(source: string, filename: string, l
|
|
|
2689
2645
|
export declare function compileConfigBlocks(blocks: SFCBlock[], filename: string, options?: {
|
|
2690
2646
|
merge?: (target: Record<string, any>, source: Record<string, any>) => Record<string, any> | void;
|
|
2691
2647
|
}): Promise<string | undefined>;
|
|
2692
|
-
//#endregion
|
|
2693
|
-
//#region src/plugins/vue/transform/jsonMacros/parse.d.ts
|
|
2694
2648
|
export declare function mayContainJsonMacro(content: string): boolean;
|
|
2695
|
-
//#endregion
|
|
2696
|
-
//#region src/plugins/vue/transform/jsonMacros/rewrite.d.ts
|
|
2697
2649
|
/**
|
|
2698
2650
|
* 从任意代码中剥离 JSON 宏调用。
|
|
2699
2651
|
*/
|
|
2700
2652
|
export declare function stripJsonMacroCallsFromCode(code: string, filename: string): string;
|
|
2701
|
-
//#endregion
|
|
2702
|
-
//#region src/plugins/vue/transform/jsonMacros/index.d.ts
|
|
2703
2653
|
interface JsonMacroExtractionOptions {
|
|
2704
2654
|
merge?: (target: Record<string, any>, source: Record<string, any>) => Record<string, any> | void;
|
|
2705
2655
|
preambleContent?: string;
|
|
@@ -2714,8 +2664,6 @@ interface JsonMacroExtractionResult {
|
|
|
2714
2664
|
* 从 `<script setup>` 中提取 JSON 宏配置并返回剥离后的代码。
|
|
2715
2665
|
*/
|
|
2716
2666
|
export declare function extractJsonMacroFromScriptSetup(content: string, filename: string, lang?: string, options?: JsonMacroExtractionOptions): Promise<JsonMacroExtractionResult>;
|
|
2717
|
-
//#endregion
|
|
2718
|
-
//#region src/plugins/vue/transform/jsonMerge.d.ts
|
|
2719
2667
|
/**
|
|
2720
2668
|
* 按策略合并 JSON 配置对象。
|
|
2721
2669
|
*/
|
|
@@ -2724,14 +2672,10 @@ export declare function mergeJsonWithStrategy(target: Record<string, any>, sourc
|
|
|
2724
2672
|
* 创建带上下文的 JSON 合并函数。
|
|
2725
2673
|
*/
|
|
2726
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>;
|
|
2727
|
-
//#endregion
|
|
2728
|
-
//#region src/plugins/vue/transform/scopedId.d.ts
|
|
2729
2675
|
/**
|
|
2730
2676
|
* 根据项目内相对路径生成跨机器稳定的 scoped ID。
|
|
2731
2677
|
*/
|
|
2732
2678
|
export declare function generateScopedId(filename: string): string;
|
|
2733
|
-
//#endregion
|
|
2734
|
-
//#region src/plugins/vue/transform/transformScript/utils.d.ts
|
|
2735
2679
|
/**
|
|
2736
2680
|
* 使用 Babel AST 转换脚本
|
|
2737
2681
|
* 比正则替换更健壮,能处理复杂的代码结构
|
|
@@ -2862,14 +2806,10 @@ interface TransformScriptOptions {
|
|
|
2862
2806
|
*/
|
|
2863
2807
|
stabilizeCssVarsRuntime?: boolean;
|
|
2864
2808
|
}
|
|
2865
|
-
//#endregion
|
|
2866
|
-
//#region src/plugins/vue/transform/transformScript/index.d.ts
|
|
2867
2809
|
/**
|
|
2868
2810
|
* 转换 Vue SFC 脚本:处理宏、导入、默认导出与 wevu 相关注入。
|
|
2869
2811
|
*/
|
|
2870
2812
|
export declare function transformScript(source: string, options?: TransformScriptOptions): TransformResult;
|
|
2871
|
-
//#endregion
|
|
2872
|
-
//#region src/plugins/wevu/pageFeatures/types.d.ts
|
|
2873
2813
|
/**
|
|
2874
2814
|
* wevu 页面特性标识(由钩子映射表推导)。
|
|
2875
2815
|
*/
|
|
@@ -2885,16 +2825,12 @@ interface ModuleResolver {
|
|
|
2885
2825
|
resolveId: (source: string, importer: string) => Promise<string | undefined>;
|
|
2886
2826
|
loadCode: (id: string) => Promise<string | undefined>;
|
|
2887
2827
|
}
|
|
2888
|
-
//#endregion
|
|
2889
|
-
//#region src/ast/operations/pageFeatures.d.ts
|
|
2890
2828
|
/**
|
|
2891
2829
|
* 从源码中收集 wevu 页面特性。
|
|
2892
2830
|
*/
|
|
2893
2831
|
export declare function collectWevuPageFeatureFlagsFromCode(code: string, options?: {
|
|
2894
2832
|
astEngine?: AstEngineName$1;
|
|
2895
2833
|
}): Set<WevuPageFeatureFlag>;
|
|
2896
|
-
//#endregion
|
|
2897
|
-
//#region src/plugins/wevu/pageFeatures/moduleAnalysis/types.d.ts
|
|
2898
2834
|
type FunctionLike = t.FunctionDeclaration | t.FunctionExpression | t.ArrowFunctionExpression | t.ObjectMethod | {
|
|
2899
2835
|
type: string;
|
|
2900
2836
|
[key: string]: any;
|
|
@@ -2935,8 +2871,6 @@ interface ModuleAnalysis {
|
|
|
2935
2871
|
localFunctions: Map<string, FunctionLike>;
|
|
2936
2872
|
exports: Map<string, ExportTarget>;
|
|
2937
2873
|
}
|
|
2938
|
-
//#endregion
|
|
2939
|
-
//#region src/plugins/wevu/pageFeatures/optionsObjects.d.ts
|
|
2940
2874
|
type OptionsObject = t.ObjectExpression | {
|
|
2941
2875
|
type: 'ObjectExpression';
|
|
2942
2876
|
properties: any[];
|
|
@@ -2948,15 +2882,11 @@ export declare function collectTargetOptionsObjectsFromCode(code: string, module
|
|
|
2948
2882
|
optionsObjects: OptionsObject[];
|
|
2949
2883
|
module: ModuleAnalysis;
|
|
2950
2884
|
};
|
|
2951
|
-
//#endregion
|
|
2952
|
-
//#region src/plugins/wevu/pageFeatures/reachability/index.d.ts
|
|
2953
2885
|
export declare function collectWevuFeaturesFromCodeReachableImports(code: string, options: {
|
|
2954
2886
|
id: string;
|
|
2955
2887
|
resolver: ModuleResolver;
|
|
2956
2888
|
astEngine?: AstEngineName$1;
|
|
2957
2889
|
}): Promise<Set<WevuPageFeatureFlag>>;
|
|
2958
|
-
//#endregion
|
|
2959
|
-
//#region src/plugins/wevu/pageFeatures/flags.d.ts
|
|
2960
2890
|
/**
|
|
2961
2891
|
* 扫描 AST,收集启用的 wevu 页面特性标识。
|
|
2962
2892
|
*/
|
|
@@ -2965,8 +2895,6 @@ export declare function collectWevuPageFeatureFlags(ast: t.File): Set<WevuPageFe
|
|
|
2965
2895
|
* 将启用的页面特性注入到 options 对象中。
|
|
2966
2896
|
*/
|
|
2967
2897
|
export declare function injectWevuPageFeatureFlagsIntoOptionsObject(optionsObject: t.ObjectExpression, enabled: Set<WevuPageFeatureFlag>): boolean;
|
|
2968
|
-
//#endregion
|
|
2969
|
-
//#region src/plugins/wevu/pageFeatures/inject.d.ts
|
|
2970
2898
|
/**
|
|
2971
2899
|
* 在 JS 源码中注入 wevu 页面特性(基于本文件分析)。
|
|
2972
2900
|
*/
|
|
@@ -2993,8 +2921,6 @@ export declare function injectWevuPageFeaturesInJsWithResolver(source: string, o
|
|
|
2993
2921
|
transformed: boolean;
|
|
2994
2922
|
map?: EncodedSourceMapLike | null;
|
|
2995
2923
|
}>;
|
|
2996
|
-
//#endregion
|
|
2997
|
-
//#region src/plugins/wevu/pageFeatures/matcher.d.ts
|
|
2998
2924
|
/**
|
|
2999
2925
|
* 页面入口匹配器的数据源。
|
|
3000
2926
|
*/
|
|
@@ -3017,8 +2943,6 @@ export declare function createPageEntryMatcher(source: PageEntryMatcherSource):
|
|
|
3017
2943
|
markDirty(): void;
|
|
3018
2944
|
isPageFile(filePath: string): Promise<boolean>;
|
|
3019
2945
|
};
|
|
3020
|
-
//#endregion
|
|
3021
|
-
//#region src/utils/vueTemplateTags.d.ts
|
|
3022
2946
|
export declare const RESERVED_VUE_COMPONENT_TAGS: Set<string>;
|
|
3023
2947
|
export declare const VUE_COMPONENT_TAG_RE: RegExp;
|
|
3024
2948
|
/**
|
|
@@ -3038,5 +2962,4 @@ interface CollectVueTemplateTagsOptions {
|
|
|
3038
2962
|
* 收集 Vue 模板中的自定义组件标签。
|
|
3039
2963
|
*/
|
|
3040
2964
|
export declare function collectVueTemplateTags(template: string, options: CollectVueTemplateTagsOptions): Set<string>;
|
|
3041
|
-
//#endregion
|
|
3042
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 };
|