@open-wxa/wxa-runner-core 0.8.2 → 0.10.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,8 +1,34 @@
1
+ import { IncomingMessage, ServerResponse } from 'http';
1
2
  import { ResolvedBaseLib } from '@open-wxa/wxa-runner-extractor';
2
3
  import { D as DeviceProfile, F as ForwardConsole } from './setup-Bac8XdhR.mjs';
3
4
  export { A as ApiContext, a as ApiHandler, b as ApiResult, c as AppInfo, M as MockConfig, d as MockRequest, e as MockResponse, f as MockValue, N as NetworkConfig, R as RouteHandler, S as SetupApi, g as SetupConfig, h as SetupContext, i as SetupDefinition } from './setup-Bac8XdhR.mjs';
4
5
  export { F as FrameError, P as PageSnapshot, R as RecordedRequest, W as WxaTestApi } from './testApi-DHuEW5Cl.mjs';
5
6
 
7
+ /**
8
+ * 样式预处理:project.config.json 的 setting.useCompilerPlugins 开启 less / sass 时,
9
+ * 按开发者工具(summer 编译器的 summer-less、summer-sass 插件)的规则把 .less / .scss / .sass 编译成同名的 .wxss
10
+ *
11
+ * - 同一路径有多种源文件时,预处理文件覆盖 .wxss;less 和 sass 都开启时,在 useCompilerPlugins 里排在后面的优先,.scss 优先于 .sass
12
+ * - 除公共文件本身外,每个 .less 先引用小程序根目录的 app.less(lessSetting.commonUseFilePath),
13
+ * 每个 .scss / .sass 先 @use global.scss 或 global.sass(sassSetting);公共文件不存在时跳过
14
+ * - @import "x.wxss"; 原样保留,由 wcsc 处理
15
+ * - 编译器优先用项目里安装的 less / sass,没装时用 wxa-runner 自带的(开发者工具也自带编译器)
16
+ *
17
+ * wcsc 只接收文件路径、自己从磁盘读文件:和 WxmlMirror 一样,把编译结果和原有的 .wxss 写进临时目录,让 wcsc 在这里编译。
18
+ */
19
+
20
+ type StylePluginName = 'less' | 'sass';
21
+ interface StyleSetting {
22
+ /** 开启的样式插件,按 useCompilerPlugins 里的顺序 */
23
+ plugins: StylePluginName[];
24
+ /** ["less", { globalVars }] 写法给出的 less 全局变量 */
25
+ lessGlobalVars: Record<string, string>;
26
+ /** 相对小程序根目录 */
27
+ lessCommonFile: string;
28
+ sassCommonFile: string;
29
+ scssCommonFile: string;
30
+ }
31
+
6
32
  /**
7
33
  * 小程序项目结构解析
8
34
  *
@@ -10,6 +36,7 @@ export { F as FrameError, P as PageSnapshot, R as RecordedRequest, W as WxaTestA
10
36
  * - app.json 的全局 usingComponents 展开到每个页面和组件(miniprogram_npm 内除外)
11
37
  * - 每个页面/组件 json 都保证有 usingComponents 字段
12
38
  */
39
+
13
40
  interface AppJson {
14
41
  pages: string[];
15
42
  entryPagePath?: string;
@@ -53,6 +80,8 @@ declare class MiniProgram {
53
80
  readonly root: string;
54
81
  readonly appid: string;
55
82
  constructor(projectPath: string);
83
+ /** project.config.json 里与 less / sass 编译插件有关的设置;每次重新读取,开发中修改了也能生效 */
84
+ get styleSetting(): StyleSetting;
56
85
  readAppJson(): AppJson;
57
86
  subPackages(app: AppJson): {
58
87
  [key: string]: any;
@@ -98,7 +127,8 @@ declare class MiniProgram {
98
127
  *
99
128
  * 渲染层(page-frame):
100
129
  * 1. 完整版 $gwx(wcc -cc)与每个页面/组件的 __wxAppCode__ json / wxml(pageTemplates)
101
- * 2. wcsc 的公共样式运行时 + app.wxss,与每个页面/组件的 __wxAppCode__ wxss(pageStyles)
130
+ * 2. wcsc 的公共样式运行时 + app.wxss,与每个页面/组件的 __wxAppCode__ wxss(pageStyles)。
131
+ * 开启 less / sass 编译插件时,先把 .less / .scss / .sass 编译成 .wxss(见 StyleMirror)
102
132
  * 两部分在热更新时分别下发
103
133
  * 样式和模板里的 env(safe-area-inset-*) 改写成 CSS 变量,见 rewriteSafeAreaInsets
104
134
  *
@@ -124,6 +154,10 @@ interface BuildResult {
124
154
  components: string[];
125
155
  durationMs: number;
126
156
  }
157
+ interface AppBuilderOptions {
158
+ /** wxml 交给 wcc 前的转换,见 DevServerOptions.wxmlTransform */
159
+ wxmlTransform?: (code: string, file: string) => string;
160
+ }
127
161
  declare class AppBuilder {
128
162
  readonly project: MiniProgram;
129
163
  private version;
@@ -134,7 +168,15 @@ declare class AppBuilder {
134
168
  private dirty;
135
169
  private wxmlCache;
136
170
  private wxssCache;
137
- constructor(project: MiniProgram);
171
+ /** 设置了 wxmlTransform 时才有 */
172
+ private readonly wxmlMirror;
173
+ /** 开启了 less / sass 编译插件时才有;插件设置变了就换一个 */
174
+ private styleMirror;
175
+ constructor(project: MiniProgram, options?: AppBuilderOptions);
176
+ /** wxmlTransform 的镜像目录;没有设置转换或还没编译过时为 null */
177
+ get wxmlMirrorDir(): string | null;
178
+ /** 删除 wxmlTransform 和样式预处理的镜像目录,开发服务器关闭时调用 */
179
+ dispose(): void;
138
180
  /** 根据变化的文件标记需要重新构建的部分;返回 true 表示需要刷新 */
139
181
  invalidate(changedFiles?: string[]): boolean;
140
182
  /**
@@ -153,11 +195,47 @@ declare class AppBuilder {
153
195
  private compileTemplates;
154
196
  /** 与开发者工具一致,项目里的 wxss 全部交给 wcsc:被 @import 的文件(如 uni-app 的 common/main.wxss)也要在列表里 */
155
197
  private compileStyles;
198
+ private currentStyleMirror;
156
199
  /** $gwx 加上各页面、组件的 json / wxml 注册;逻辑层用裁剪版 $gwx,渲染层用完整版 */
157
200
  private createTemplates;
158
201
  private createServiceBootstrap;
159
202
  }
160
203
 
204
+ /**
205
+ * 开发服务器扩展:检查器这类开发工具把要用的扩展点打包成一个扩展,
206
+ * 由 DevServer 的 extensions 选项或命令行的 --extension 加载。runner 只认这个约定,不认识具体的工具。
207
+ *
208
+ * (「插件」在 runner 里指小程序插件,见 plugins.ts,所以这里叫扩展)
209
+ */
210
+
211
+ interface DevServerExtension {
212
+ /** 出现在报错和启动信息里 */
213
+ name: string;
214
+ /** 开发服务器构造时调用一次 */
215
+ setup(context: ExtensionContext): ExtensionSetup;
216
+ }
217
+ interface ExtensionContext {
218
+ /** 项目目录(DevServer 的 projectPath,绝对路径) */
219
+ projectPath: string;
220
+ /** 小程序代码根目录,已考虑 project.config.json 的 miniprogramRoot */
221
+ root: string;
222
+ }
223
+ interface ExtensionSetup {
224
+ webviewScripts?: WebviewScript[];
225
+ middlewares?: DevServerMiddleware[];
226
+ wxmlTransform?: (code: string, file: string) => string;
227
+ /** 扩展自己的页面:启动信息里打印,命令行 --open 时打开 */
228
+ entry?: {
229
+ label: string;
230
+ path: string;
231
+ };
232
+ }
233
+ interface ExtensionEntry {
234
+ name: string;
235
+ label: string;
236
+ path: string;
237
+ }
238
+
161
239
  /**
162
240
  * 开发服务器
163
241
  *
@@ -179,9 +257,31 @@ declare class AppBuilder {
179
257
  * /__wxa__/region/<kind> 地区选择器用的行政区划数据(districts / streets),取自本机开发者工具
180
258
  * /__wxa__/api/* --devtools-login:wx.login 的 code、手机号,服务市场、插件的请求转发,只允许本机访问
181
259
  * /__wxa__/ws 文件变化通知:热更新(hot)或整页刷新(reload);开启 forwardConsole 时浏览器从这里发来报错
260
+ * middlewares / 扩展挂载的路径 排在 runner 自己的路由之前
182
261
  * 其余路径 小程序目录下的静态资源
183
262
  */
184
263
 
264
+ /** 注入每个渲染层页面的脚本,src 与 content 二选一 */
265
+ type WebviewScript = ({
266
+ src: string;
267
+ content?: never;
268
+ } | {
269
+ content: string;
270
+ src?: never;
271
+ }) & {
272
+ /**
273
+ * 'head':在基础库(WAWebview.js)之前执行,用于要赶在基础库之前注册事件监听的脚本,执行时还没有 document.body;
274
+ * 'body'(默认):在 <body> 开头、页面开始渲染之前执行。不能放在 <body> 末尾:基础库渲染时会换掉 body,
275
+ * 之后才解析到的脚本落在脱离文档的旧 body 里,不会执行
276
+ */
277
+ position?: 'head' | 'body';
278
+ };
279
+ /** 挂在开发服务器上的中间件:按前缀匹配,handler 收到的 req.url 已去掉 path 这段前缀 */
280
+ interface DevServerMiddleware {
281
+ /** 以 / 开头的字面量路径前缀,如 /__tool__;不能是 /,不能含通配符和参数,也不能落在 runner 保留的前缀下(见 RESERVED_PREFIXES) */
282
+ path: string;
283
+ handler: (req: IncomingMessage, res: ServerResponse, next: (error?: unknown) => void) => void;
284
+ }
185
285
  interface DevServerOptions {
186
286
  projectPath: string;
187
287
  /** 不传时从 3000 起找空闲的端口;指定的端口被占用时启动失败;传 0 使用随机端口 */
@@ -212,6 +312,17 @@ interface DevServerOptions {
212
312
  * 默认不转发;命令行默认 'errors',检测到编程助手时 'all'
213
313
  */
214
314
  forwardConsole?: ForwardConsole;
315
+ /** 注入每个渲染层页面(含插件页面、跳转后新建的页面)的脚本,供检查器等开发工具使用 */
316
+ webviewScripts?: WebviewScript[];
317
+ /** 挂在开发服务器上的中间件,供开发工具提供自己的页面和接口 */
318
+ middlewares?: DevServerMiddleware[];
319
+ /**
320
+ * wxml 交给 wcc 编译前的转换,file 是相对小程序根目录的路径(如 pages/index/index.wxml)。
321
+ * 不能改变行数,编译错误和热更新才能对应到源文件;相同输入要返回相同输出。源文件不会被修改
322
+ */
323
+ wxmlTransform?: (code: string, file: string) => string;
324
+ /** 开发服务器扩展:把上面几个扩展点打包在一起的开发工具,按顺序合并在直接给出的选项之后,见 extensions.ts */
325
+ extensions?: DevServerExtension[];
215
326
  logger?: Pick<Console, 'log' | 'warn' | 'error'>;
216
327
  }
217
328
  declare const DEFAULT_DEVICE: DeviceProfile;
@@ -222,6 +333,8 @@ declare class DevServer {
222
333
  readonly baseLib: ResolvedBaseLib;
223
334
  /** 生效的 setup 文件绝对路径,没有时为 null */
224
335
  readonly setupFile: string | null;
336
+ /** 扩展提供的页面,按扩展的顺序 */
337
+ readonly extensionEntries: ExtensionEntry[];
225
338
  private readonly setupEnv;
226
339
  private readonly device;
227
340
  private readonly logger;
@@ -237,6 +350,9 @@ declare class DevServer {
237
350
  /** 开启 --devtools-login 时才有 */
238
351
  private readonly ticketSource;
239
352
  private readonly plugins;
353
+ /** 选项里直接给出的扩展点与各个扩展合并后的结果 */
354
+ private readonly webviewScripts;
355
+ private readonly middlewares;
240
356
  constructor(options: DevServerOptions);
241
357
  /** 本机访问的地址 */
242
358
  get url(): string;
@@ -271,4 +387,4 @@ interface WxConfigInput {
271
387
  }
272
388
  declare function createWxConfig(input: WxConfigInput): Record<string, any>;
273
389
 
274
- export { AppBuilder, type AppJson, type BuildResult, DEFAULT_DEVICE, DevServer, type DevServerOptions, DeviceProfile, ForwardConsole, MiniProgram, type UnitJson, createWxConfig };
390
+ export { AppBuilder, type AppBuilderOptions, type AppJson, type BuildResult, DEFAULT_DEVICE, DevServer, type DevServerExtension, type DevServerMiddleware, type DevServerOptions, DeviceProfile, type ExtensionContext, type ExtensionEntry, type ExtensionSetup, ForwardConsole, MiniProgram, type UnitJson, type WebviewScript, createWxConfig };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,34 @@
1
+ import { IncomingMessage, ServerResponse } from 'http';
1
2
  import { ResolvedBaseLib } from '@open-wxa/wxa-runner-extractor';
2
3
  import { D as DeviceProfile, F as ForwardConsole } from './setup-Bac8XdhR.js';
3
4
  export { A as ApiContext, a as ApiHandler, b as ApiResult, c as AppInfo, M as MockConfig, d as MockRequest, e as MockResponse, f as MockValue, N as NetworkConfig, R as RouteHandler, S as SetupApi, g as SetupConfig, h as SetupContext, i as SetupDefinition } from './setup-Bac8XdhR.js';
4
5
  export { F as FrameError, P as PageSnapshot, R as RecordedRequest, W as WxaTestApi } from './testApi-BOZSXSnV.js';
5
6
 
7
+ /**
8
+ * 样式预处理:project.config.json 的 setting.useCompilerPlugins 开启 less / sass 时,
9
+ * 按开发者工具(summer 编译器的 summer-less、summer-sass 插件)的规则把 .less / .scss / .sass 编译成同名的 .wxss
10
+ *
11
+ * - 同一路径有多种源文件时,预处理文件覆盖 .wxss;less 和 sass 都开启时,在 useCompilerPlugins 里排在后面的优先,.scss 优先于 .sass
12
+ * - 除公共文件本身外,每个 .less 先引用小程序根目录的 app.less(lessSetting.commonUseFilePath),
13
+ * 每个 .scss / .sass 先 @use global.scss 或 global.sass(sassSetting);公共文件不存在时跳过
14
+ * - @import "x.wxss"; 原样保留,由 wcsc 处理
15
+ * - 编译器优先用项目里安装的 less / sass,没装时用 wxa-runner 自带的(开发者工具也自带编译器)
16
+ *
17
+ * wcsc 只接收文件路径、自己从磁盘读文件:和 WxmlMirror 一样,把编译结果和原有的 .wxss 写进临时目录,让 wcsc 在这里编译。
18
+ */
19
+
20
+ type StylePluginName = 'less' | 'sass';
21
+ interface StyleSetting {
22
+ /** 开启的样式插件,按 useCompilerPlugins 里的顺序 */
23
+ plugins: StylePluginName[];
24
+ /** ["less", { globalVars }] 写法给出的 less 全局变量 */
25
+ lessGlobalVars: Record<string, string>;
26
+ /** 相对小程序根目录 */
27
+ lessCommonFile: string;
28
+ sassCommonFile: string;
29
+ scssCommonFile: string;
30
+ }
31
+
6
32
  /**
7
33
  * 小程序项目结构解析
8
34
  *
@@ -10,6 +36,7 @@ export { F as FrameError, P as PageSnapshot, R as RecordedRequest, W as WxaTestA
10
36
  * - app.json 的全局 usingComponents 展开到每个页面和组件(miniprogram_npm 内除外)
11
37
  * - 每个页面/组件 json 都保证有 usingComponents 字段
12
38
  */
39
+
13
40
  interface AppJson {
14
41
  pages: string[];
15
42
  entryPagePath?: string;
@@ -53,6 +80,8 @@ declare class MiniProgram {
53
80
  readonly root: string;
54
81
  readonly appid: string;
55
82
  constructor(projectPath: string);
83
+ /** project.config.json 里与 less / sass 编译插件有关的设置;每次重新读取,开发中修改了也能生效 */
84
+ get styleSetting(): StyleSetting;
56
85
  readAppJson(): AppJson;
57
86
  subPackages(app: AppJson): {
58
87
  [key: string]: any;
@@ -98,7 +127,8 @@ declare class MiniProgram {
98
127
  *
99
128
  * 渲染层(page-frame):
100
129
  * 1. 完整版 $gwx(wcc -cc)与每个页面/组件的 __wxAppCode__ json / wxml(pageTemplates)
101
- * 2. wcsc 的公共样式运行时 + app.wxss,与每个页面/组件的 __wxAppCode__ wxss(pageStyles)
130
+ * 2. wcsc 的公共样式运行时 + app.wxss,与每个页面/组件的 __wxAppCode__ wxss(pageStyles)。
131
+ * 开启 less / sass 编译插件时,先把 .less / .scss / .sass 编译成 .wxss(见 StyleMirror)
102
132
  * 两部分在热更新时分别下发
103
133
  * 样式和模板里的 env(safe-area-inset-*) 改写成 CSS 变量,见 rewriteSafeAreaInsets
104
134
  *
@@ -124,6 +154,10 @@ interface BuildResult {
124
154
  components: string[];
125
155
  durationMs: number;
126
156
  }
157
+ interface AppBuilderOptions {
158
+ /** wxml 交给 wcc 前的转换,见 DevServerOptions.wxmlTransform */
159
+ wxmlTransform?: (code: string, file: string) => string;
160
+ }
127
161
  declare class AppBuilder {
128
162
  readonly project: MiniProgram;
129
163
  private version;
@@ -134,7 +168,15 @@ declare class AppBuilder {
134
168
  private dirty;
135
169
  private wxmlCache;
136
170
  private wxssCache;
137
- constructor(project: MiniProgram);
171
+ /** 设置了 wxmlTransform 时才有 */
172
+ private readonly wxmlMirror;
173
+ /** 开启了 less / sass 编译插件时才有;插件设置变了就换一个 */
174
+ private styleMirror;
175
+ constructor(project: MiniProgram, options?: AppBuilderOptions);
176
+ /** wxmlTransform 的镜像目录;没有设置转换或还没编译过时为 null */
177
+ get wxmlMirrorDir(): string | null;
178
+ /** 删除 wxmlTransform 和样式预处理的镜像目录,开发服务器关闭时调用 */
179
+ dispose(): void;
138
180
  /** 根据变化的文件标记需要重新构建的部分;返回 true 表示需要刷新 */
139
181
  invalidate(changedFiles?: string[]): boolean;
140
182
  /**
@@ -153,11 +195,47 @@ declare class AppBuilder {
153
195
  private compileTemplates;
154
196
  /** 与开发者工具一致,项目里的 wxss 全部交给 wcsc:被 @import 的文件(如 uni-app 的 common/main.wxss)也要在列表里 */
155
197
  private compileStyles;
198
+ private currentStyleMirror;
156
199
  /** $gwx 加上各页面、组件的 json / wxml 注册;逻辑层用裁剪版 $gwx,渲染层用完整版 */
157
200
  private createTemplates;
158
201
  private createServiceBootstrap;
159
202
  }
160
203
 
204
+ /**
205
+ * 开发服务器扩展:检查器这类开发工具把要用的扩展点打包成一个扩展,
206
+ * 由 DevServer 的 extensions 选项或命令行的 --extension 加载。runner 只认这个约定,不认识具体的工具。
207
+ *
208
+ * (「插件」在 runner 里指小程序插件,见 plugins.ts,所以这里叫扩展)
209
+ */
210
+
211
+ interface DevServerExtension {
212
+ /** 出现在报错和启动信息里 */
213
+ name: string;
214
+ /** 开发服务器构造时调用一次 */
215
+ setup(context: ExtensionContext): ExtensionSetup;
216
+ }
217
+ interface ExtensionContext {
218
+ /** 项目目录(DevServer 的 projectPath,绝对路径) */
219
+ projectPath: string;
220
+ /** 小程序代码根目录,已考虑 project.config.json 的 miniprogramRoot */
221
+ root: string;
222
+ }
223
+ interface ExtensionSetup {
224
+ webviewScripts?: WebviewScript[];
225
+ middlewares?: DevServerMiddleware[];
226
+ wxmlTransform?: (code: string, file: string) => string;
227
+ /** 扩展自己的页面:启动信息里打印,命令行 --open 时打开 */
228
+ entry?: {
229
+ label: string;
230
+ path: string;
231
+ };
232
+ }
233
+ interface ExtensionEntry {
234
+ name: string;
235
+ label: string;
236
+ path: string;
237
+ }
238
+
161
239
  /**
162
240
  * 开发服务器
163
241
  *
@@ -179,9 +257,31 @@ declare class AppBuilder {
179
257
  * /__wxa__/region/<kind> 地区选择器用的行政区划数据(districts / streets),取自本机开发者工具
180
258
  * /__wxa__/api/* --devtools-login:wx.login 的 code、手机号,服务市场、插件的请求转发,只允许本机访问
181
259
  * /__wxa__/ws 文件变化通知:热更新(hot)或整页刷新(reload);开启 forwardConsole 时浏览器从这里发来报错
260
+ * middlewares / 扩展挂载的路径 排在 runner 自己的路由之前
182
261
  * 其余路径 小程序目录下的静态资源
183
262
  */
184
263
 
264
+ /** 注入每个渲染层页面的脚本,src 与 content 二选一 */
265
+ type WebviewScript = ({
266
+ src: string;
267
+ content?: never;
268
+ } | {
269
+ content: string;
270
+ src?: never;
271
+ }) & {
272
+ /**
273
+ * 'head':在基础库(WAWebview.js)之前执行,用于要赶在基础库之前注册事件监听的脚本,执行时还没有 document.body;
274
+ * 'body'(默认):在 <body> 开头、页面开始渲染之前执行。不能放在 <body> 末尾:基础库渲染时会换掉 body,
275
+ * 之后才解析到的脚本落在脱离文档的旧 body 里,不会执行
276
+ */
277
+ position?: 'head' | 'body';
278
+ };
279
+ /** 挂在开发服务器上的中间件:按前缀匹配,handler 收到的 req.url 已去掉 path 这段前缀 */
280
+ interface DevServerMiddleware {
281
+ /** 以 / 开头的字面量路径前缀,如 /__tool__;不能是 /,不能含通配符和参数,也不能落在 runner 保留的前缀下(见 RESERVED_PREFIXES) */
282
+ path: string;
283
+ handler: (req: IncomingMessage, res: ServerResponse, next: (error?: unknown) => void) => void;
284
+ }
185
285
  interface DevServerOptions {
186
286
  projectPath: string;
187
287
  /** 不传时从 3000 起找空闲的端口;指定的端口被占用时启动失败;传 0 使用随机端口 */
@@ -212,6 +312,17 @@ interface DevServerOptions {
212
312
  * 默认不转发;命令行默认 'errors',检测到编程助手时 'all'
213
313
  */
214
314
  forwardConsole?: ForwardConsole;
315
+ /** 注入每个渲染层页面(含插件页面、跳转后新建的页面)的脚本,供检查器等开发工具使用 */
316
+ webviewScripts?: WebviewScript[];
317
+ /** 挂在开发服务器上的中间件,供开发工具提供自己的页面和接口 */
318
+ middlewares?: DevServerMiddleware[];
319
+ /**
320
+ * wxml 交给 wcc 编译前的转换,file 是相对小程序根目录的路径(如 pages/index/index.wxml)。
321
+ * 不能改变行数,编译错误和热更新才能对应到源文件;相同输入要返回相同输出。源文件不会被修改
322
+ */
323
+ wxmlTransform?: (code: string, file: string) => string;
324
+ /** 开发服务器扩展:把上面几个扩展点打包在一起的开发工具,按顺序合并在直接给出的选项之后,见 extensions.ts */
325
+ extensions?: DevServerExtension[];
215
326
  logger?: Pick<Console, 'log' | 'warn' | 'error'>;
216
327
  }
217
328
  declare const DEFAULT_DEVICE: DeviceProfile;
@@ -222,6 +333,8 @@ declare class DevServer {
222
333
  readonly baseLib: ResolvedBaseLib;
223
334
  /** 生效的 setup 文件绝对路径,没有时为 null */
224
335
  readonly setupFile: string | null;
336
+ /** 扩展提供的页面,按扩展的顺序 */
337
+ readonly extensionEntries: ExtensionEntry[];
225
338
  private readonly setupEnv;
226
339
  private readonly device;
227
340
  private readonly logger;
@@ -237,6 +350,9 @@ declare class DevServer {
237
350
  /** 开启 --devtools-login 时才有 */
238
351
  private readonly ticketSource;
239
352
  private readonly plugins;
353
+ /** 选项里直接给出的扩展点与各个扩展合并后的结果 */
354
+ private readonly webviewScripts;
355
+ private readonly middlewares;
240
356
  constructor(options: DevServerOptions);
241
357
  /** 本机访问的地址 */
242
358
  get url(): string;
@@ -271,4 +387,4 @@ interface WxConfigInput {
271
387
  }
272
388
  declare function createWxConfig(input: WxConfigInput): Record<string, any>;
273
389
 
274
- export { AppBuilder, type AppJson, type BuildResult, DEFAULT_DEVICE, DevServer, type DevServerOptions, DeviceProfile, ForwardConsole, MiniProgram, type UnitJson, createWxConfig };
390
+ export { AppBuilder, type AppBuilderOptions, type AppJson, type BuildResult, DEFAULT_DEVICE, DevServer, type DevServerExtension, type DevServerMiddleware, type DevServerOptions, DeviceProfile, type ExtensionContext, type ExtensionEntry, type ExtensionSetup, ForwardConsole, MiniProgram, type UnitJson, type WebviewScript, createWxConfig };