zentao-api 0.3.1 → 0.3.3

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.
@@ -0,0 +1,181 @@
1
+ import { ZentaoError } from '../misc/errors.js';
2
+ import { isRecord } from '../utils/object.js';
3
+ import { BUILTIN_MODULES } from './generated.js';
4
+ // 动作类型到 HTTP 方法 / 结果形态的默认推导表:当动作未显式声明 method / resultType 时按 type 补齐。
5
+ const METHOD_BY_TYPE = {
6
+ list: 'get',
7
+ get: 'get',
8
+ create: 'post',
9
+ update: 'put',
10
+ delete: 'delete',
11
+ action: 'post',
12
+ };
13
+ const RESULT_TYPE_BY_TYPE = {
14
+ list: 'list',
15
+ get: 'object',
16
+ create: 'object',
17
+ update: 'object',
18
+ delete: 'text',
19
+ action: 'text',
20
+ };
21
+ // 运行时注册表存放「深克隆 + 深冻结」后的模块定义:
22
+ // - 深克隆:避免用户后续修改自己的输入对象时污染注册表;
23
+ // - 深冻结:让 getModule / getModuleAction 可以零拷贝返回引用,
24
+ // 外部尝试改写会在严格模式下抛 TypeError,开销也降到 O(1) 查询。
25
+ //
26
+ // 该模块是「定义」(define)与「查询」(query)两侧共享的底层存储:
27
+ // - define 侧通过 mutate* 系列函数维护状态,并复用 freeze/clone/merge/validate 原语;
28
+ // - query 侧只读访问 modules / moduleMap。
29
+ let modules = freezeModules(cloneBuiltinModules());
30
+ let moduleMap = buildModuleMap(modules);
31
+ export function deepClone(value) {
32
+ if (Array.isArray(value)) {
33
+ return value.map((item) => deepClone(item));
34
+ }
35
+ if (value && typeof value === 'object' && !(value instanceof Function)) {
36
+ const result = {};
37
+ for (const [key, nestedValue] of Object.entries(value)) {
38
+ result[key] = deepClone(nestedValue);
39
+ }
40
+ return result;
41
+ }
42
+ return value;
43
+ }
44
+ /**
45
+ * 深度合并:以 `patch` 覆盖 `base`,返回新对象,不修改任何入参。
46
+ *
47
+ * - 仅当两侧同为普通对象时递归合并;其余情况(含数组)由 `patch` 整体替换。
48
+ * - `patch` 中值为 `undefined` 的键会被跳过,因此扩展方只需给出待修改的字段。
49
+ * - 未被 `patch` 触及的嵌套值沿用 `base` 的引用(外层会重新深冻结,引用本就不可变)。
50
+ */
51
+ export function deepMerge(base, patch) {
52
+ if (!isRecord(patch)) {
53
+ return (patch === undefined ? base : deepClone(patch));
54
+ }
55
+ const result = isRecord(base) ? { ...base } : {};
56
+ for (const [key, value] of Object.entries(patch)) {
57
+ if (value === undefined)
58
+ continue;
59
+ const current = result[key];
60
+ result[key] = isRecord(value) && isRecord(current) ? deepMerge(current, value) : deepClone(value);
61
+ }
62
+ return result;
63
+ }
64
+ export function cloneBuiltinModules() {
65
+ return deepClone(BUILTIN_MODULES);
66
+ }
67
+ export function deepFreeze(value) {
68
+ if (value === null || typeof value !== 'object')
69
+ return value;
70
+ if (Object.isFrozen(value))
71
+ return value;
72
+ for (const key of Object.keys(value)) {
73
+ deepFreeze(value[key]);
74
+ }
75
+ return Object.freeze(value);
76
+ }
77
+ /**
78
+ * 按 {@link ModuleAction.type} 就地补齐省略的 `method` / `resultType`。
79
+ *
80
+ * 已显式声明的字段保持不变;当 `type` 无法推导出对应默认值时抛错,提示显式指定。
81
+ *
82
+ * @throws {ZentaoError} `E_INDETERMINATE_ACTION_METHOD` / `E_INDETERMINATE_ACTION_RESULT_TYPE`
83
+ */
84
+ export function normalizeAction(action) {
85
+ if (action.method === undefined) {
86
+ const method = METHOD_BY_TYPE[action.type];
87
+ if (method === undefined) {
88
+ throw new ZentaoError('E_INDETERMINATE_ACTION_METHOD', { action: String(action.name), type: String(action.type) });
89
+ }
90
+ action.method = method;
91
+ }
92
+ if (action.resultType === undefined) {
93
+ const resultType = RESULT_TYPE_BY_TYPE[action.type];
94
+ if (resultType === undefined) {
95
+ throw new ZentaoError('E_INDETERMINATE_ACTION_RESULT_TYPE', { action: String(action.name), type: String(action.type) });
96
+ }
97
+ action.resultType = resultType;
98
+ }
99
+ return action;
100
+ }
101
+ export function freezeAction(action) {
102
+ return deepFreeze(normalizeAction(action));
103
+ }
104
+ export function freezeModule(module) {
105
+ module.actions.forEach(freezeAction);
106
+ return deepFreeze(module);
107
+ }
108
+ export function freezeModules(source) {
109
+ source.forEach(freezeModule);
110
+ return source;
111
+ }
112
+ export function findActionIndex(source, actionName) {
113
+ const key = actionName.toLowerCase();
114
+ return source.findIndex((action) => String(action.name).toLowerCase() === key);
115
+ }
116
+ export function mergeActions(base, extension) {
117
+ const next = base.slice();
118
+ for (const action of extension) {
119
+ const index = findActionIndex(next, String(action.name));
120
+ const frozen = freezeAction(deepClone(action));
121
+ if (index >= 0) {
122
+ next[index] = frozen;
123
+ }
124
+ else {
125
+ next.push(frozen);
126
+ }
127
+ }
128
+ return next;
129
+ }
130
+ export function mergeModule(base, extension) {
131
+ return freezeModule({
132
+ ...base,
133
+ ...deepClone(extension),
134
+ actions: mergeActions(base.actions, extension.actions),
135
+ });
136
+ }
137
+ export function buildModuleMap(source) {
138
+ return new Map(source.map((module) => [module.name.toLowerCase(), module]));
139
+ }
140
+ export function validateModule(module) {
141
+ if (!module || typeof module.name !== 'string' || !Array.isArray(module.actions)) {
142
+ throw new ZentaoError('E_INVALID_MODULE_DEFINITION');
143
+ }
144
+ }
145
+ export function validateAction(action) {
146
+ if (!action || typeof action.name !== 'string' || typeof action.path !== 'string') {
147
+ throw new ZentaoError('E_INVALID_ACTION_DEFINITION');
148
+ }
149
+ // method / resultType 可省略(由 normalizeAction 按 type 推导),但显式给出时必须是字符串。
150
+ if (action.method !== undefined && typeof action.method !== 'string') {
151
+ throw new ZentaoError('E_INVALID_ACTION_DEFINITION');
152
+ }
153
+ if (action.resultType !== undefined && typeof action.resultType !== 'string') {
154
+ throw new ZentaoError('E_INVALID_ACTION_DEFINITION');
155
+ }
156
+ }
157
+ /** 当前运行时注册表中的模块数组(define 侧原地修改,query 侧只读)。 */
158
+ export function getModulesState() {
159
+ return modules;
160
+ }
161
+ /** 当前模块名(小写)到模块定义的查找表(O(1) 查询)。 */
162
+ export function getModuleMapState() {
163
+ return moduleMap;
164
+ }
165
+ /** 依据当前 modules 重建 moduleMap。所有写入完成后调用以保持二者一致。 */
166
+ export function rebuildModuleMap() {
167
+ moduleMap = buildModuleMap(modules);
168
+ }
169
+ // 重置后钩子:在 resetState 把状态还原为内置基线之后触发,
170
+ // 用于让上层(barrel)重新应用内置覆盖(override),而无需 store / define 直接依赖 override。
171
+ let postResetHook;
172
+ /** 注册「重置后钩子」,在每次 {@link resetState} 还原内置基线后调用。 */
173
+ export function setPostResetHook(hook) {
174
+ postResetHook = hook;
175
+ }
176
+ /** 将注册表重置为内置模块(深克隆 + 深冻结),重建查找表,并触发重置后钩子。 */
177
+ export function resetState() {
178
+ modules = freezeModules(cloneBuiltinModules());
179
+ rebuildModuleMap();
180
+ postResetHook?.();
181
+ }
@@ -1,5 +1,5 @@
1
- import type { ModuleAction, ModuleDefinition } from '../types/index.js';
2
1
  import { BUILTIN_MODULES } from './generated.js';
2
+ import { applyBuiltinOverrides } from './override.js';
3
3
  export { BUILTIN_MODULES };
4
4
  export declare const MODULES: readonly [{
5
5
  readonly name: "user";
@@ -173,7 +173,6 @@ export declare const MODULES: readonly [{
173
173
  readonly pathParams: {
174
174
  readonly userID: "用户ID";
175
175
  };
176
- readonly render: "action";
177
176
  }];
178
177
  }, {
179
178
  readonly name: "program";
@@ -354,7 +353,6 @@ export declare const MODULES: readonly [{
354
353
  readonly pathParams: {
355
354
  readonly programID: "项目集ID";
356
355
  };
357
- readonly render: "action";
358
356
  }];
359
357
  }, {
360
358
  readonly name: "product";
@@ -579,7 +577,6 @@ export declare const MODULES: readonly [{
579
577
  readonly pathParams: {
580
578
  readonly productID: "产品ID";
581
579
  };
582
- readonly render: "action";
583
580
  }];
584
581
  }, {
585
582
  readonly name: "project";
@@ -775,7 +772,6 @@ export declare const MODULES: readonly [{
775
772
  readonly pathParams: {
776
773
  readonly projectID: "项目ID";
777
774
  };
778
- readonly render: "action";
779
775
  }];
780
776
  }, {
781
777
  readonly name: "execution";
@@ -1028,7 +1024,6 @@ export declare const MODULES: readonly [{
1028
1024
  readonly pathParams: {
1029
1025
  readonly executionID: "执行ID";
1030
1026
  };
1031
- readonly render: "action";
1032
1027
  }];
1033
1028
  }, {
1034
1029
  readonly name: "productplan";
@@ -1231,7 +1226,6 @@ export declare const MODULES: readonly [{
1231
1226
  readonly pathParams: {
1232
1227
  readonly productplanID: "产品计划ID";
1233
1228
  };
1234
- readonly render: "action";
1235
1229
  }];
1236
1230
  }, {
1237
1231
  readonly name: "story";
@@ -1479,7 +1473,6 @@ export declare const MODULES: readonly [{
1479
1473
  readonly pathParams: {
1480
1474
  readonly storyID: "需求ID";
1481
1475
  };
1482
- readonly render: "action";
1483
1476
  }, {
1484
1477
  readonly name: "activate";
1485
1478
  readonly display: "激活需求";
@@ -1507,7 +1500,6 @@ export declare const MODULES: readonly [{
1507
1500
  };
1508
1501
  };
1509
1502
  };
1510
- readonly render: "action";
1511
1503
  }, {
1512
1504
  readonly name: "change";
1513
1505
  readonly display: "变更需求";
@@ -1547,7 +1539,6 @@ export declare const MODULES: readonly [{
1547
1539
  readonly required: readonly ["reviewer"];
1548
1540
  };
1549
1541
  };
1550
- readonly render: "action";
1551
1542
  }, {
1552
1543
  readonly name: "close";
1553
1544
  readonly display: "关闭需求";
@@ -1576,7 +1567,6 @@ export declare const MODULES: readonly [{
1576
1567
  readonly required: readonly ["closedReason"];
1577
1568
  };
1578
1569
  };
1579
- readonly render: "action";
1580
1570
  }];
1581
1571
  }, {
1582
1572
  readonly name: "epic";
@@ -1809,7 +1799,6 @@ export declare const MODULES: readonly [{
1809
1799
  readonly pathParams: {
1810
1800
  readonly epicID: "业务需求ID";
1811
1801
  };
1812
- readonly render: "action";
1813
1802
  }, {
1814
1803
  readonly name: "activate";
1815
1804
  readonly display: "激活业务需求";
@@ -1837,7 +1826,6 @@ export declare const MODULES: readonly [{
1837
1826
  };
1838
1827
  };
1839
1828
  };
1840
- readonly render: "action";
1841
1829
  }, {
1842
1830
  readonly name: "change";
1843
1831
  readonly display: "变更业务需求";
@@ -1877,7 +1865,6 @@ export declare const MODULES: readonly [{
1877
1865
  readonly required: readonly ["reviewer"];
1878
1866
  };
1879
1867
  };
1880
- readonly render: "action";
1881
1868
  }, {
1882
1869
  readonly name: "close";
1883
1870
  readonly display: "关闭业务需求";
@@ -1906,7 +1893,6 @@ export declare const MODULES: readonly [{
1906
1893
  readonly required: readonly ["closedReason"];
1907
1894
  };
1908
1895
  };
1909
- readonly render: "action";
1910
1896
  }];
1911
1897
  }, {
1912
1898
  readonly name: "requirement";
@@ -2138,7 +2124,6 @@ export declare const MODULES: readonly [{
2138
2124
  readonly pathParams: {
2139
2125
  readonly requirementID: "用户需求ID";
2140
2126
  };
2141
- readonly render: "action";
2142
2127
  }, {
2143
2128
  readonly name: "activate";
2144
2129
  readonly display: "激活用户需求";
@@ -2166,7 +2151,6 @@ export declare const MODULES: readonly [{
2166
2151
  };
2167
2152
  };
2168
2153
  };
2169
- readonly render: "action";
2170
2154
  }, {
2171
2155
  readonly name: "change";
2172
2156
  readonly display: "变更用户需求";
@@ -2198,7 +2182,6 @@ export declare const MODULES: readonly [{
2198
2182
  };
2199
2183
  };
2200
2184
  };
2201
- readonly render: "action";
2202
2185
  }, {
2203
2186
  readonly name: "close";
2204
2187
  readonly display: "关闭用户需求";
@@ -2227,7 +2210,6 @@ export declare const MODULES: readonly [{
2227
2210
  readonly required: readonly ["closedReason"];
2228
2211
  };
2229
2212
  };
2230
- readonly render: "action";
2231
2213
  }];
2232
2214
  }, {
2233
2215
  readonly name: "bug";
@@ -2465,7 +2447,6 @@ export declare const MODULES: readonly [{
2465
2447
  readonly pathParams: {
2466
2448
  readonly bugID: "Bug ID";
2467
2449
  };
2468
- readonly render: "action";
2469
2450
  }, {
2470
2451
  readonly name: "activate";
2471
2452
  readonly display: "激活Bug";
@@ -2500,7 +2481,6 @@ export declare const MODULES: readonly [{
2500
2481
  };
2501
2482
  };
2502
2483
  };
2503
- readonly render: "action";
2504
2484
  }, {
2505
2485
  readonly name: "close";
2506
2486
  readonly display: "关闭Bug";
@@ -2524,7 +2504,6 @@ export declare const MODULES: readonly [{
2524
2504
  };
2525
2505
  };
2526
2506
  };
2527
- readonly render: "action";
2528
2507
  }, {
2529
2508
  readonly name: "resolve";
2530
2509
  readonly display: "解决Bug";
@@ -2565,7 +2544,6 @@ export declare const MODULES: readonly [{
2565
2544
  readonly required: readonly ["resolution"];
2566
2545
  };
2567
2546
  };
2568
- readonly render: "action";
2569
2547
  }];
2570
2548
  }, {
2571
2549
  readonly name: "testcase";
@@ -2816,7 +2794,6 @@ export declare const MODULES: readonly [{
2816
2794
  readonly pathParams: {
2817
2795
  readonly testcasID: "测试用例ID";
2818
2796
  };
2819
- readonly render: "action";
2820
2797
  }];
2821
2798
  }, {
2822
2799
  readonly name: "task";
@@ -3050,7 +3027,6 @@ export declare const MODULES: readonly [{
3050
3027
  readonly pathParams: {
3051
3028
  readonly taskID: "任务ID";
3052
3029
  };
3053
- readonly render: "action";
3054
3030
  }, {
3055
3031
  readonly name: "activate";
3056
3032
  readonly display: "激活任务";
@@ -3083,7 +3059,6 @@ export declare const MODULES: readonly [{
3083
3059
  };
3084
3060
  };
3085
3061
  };
3086
- readonly render: "action";
3087
3062
  }, {
3088
3063
  readonly name: "close";
3089
3064
  readonly display: "关闭任务";
@@ -3107,7 +3082,6 @@ export declare const MODULES: readonly [{
3107
3082
  };
3108
3083
  };
3109
3084
  };
3110
- readonly render: "action";
3111
3085
  }, {
3112
3086
  readonly name: "finish";
3113
3087
  readonly display: "完成任务";
@@ -3154,7 +3128,6 @@ export declare const MODULES: readonly [{
3154
3128
  readonly required: readonly ["currentConsumed", "realStarted", "finishedDate"];
3155
3129
  };
3156
3130
  };
3157
- readonly render: "action";
3158
3131
  }, {
3159
3132
  readonly name: "start";
3160
3133
  readonly display: "启动任务";
@@ -3197,7 +3170,6 @@ export declare const MODULES: readonly [{
3197
3170
  readonly required: readonly ["realStarted"];
3198
3171
  };
3199
3172
  };
3200
- readonly render: "action";
3201
3173
  }];
3202
3174
  }, {
3203
3175
  readonly name: "feedback";
@@ -3403,7 +3375,6 @@ export declare const MODULES: readonly [{
3403
3375
  readonly pathParams: {
3404
3376
  readonly feedbackID: "反馈ID";
3405
3377
  };
3406
- readonly render: "action";
3407
3378
  }, {
3408
3379
  readonly name: "activate";
3409
3380
  readonly display: "激活反馈";
@@ -3431,7 +3402,6 @@ export declare const MODULES: readonly [{
3431
3402
  };
3432
3403
  };
3433
3404
  };
3434
- readonly render: "action";
3435
3405
  }, {
3436
3406
  readonly name: "close";
3437
3407
  readonly display: "关闭反馈";
@@ -3460,7 +3430,6 @@ export declare const MODULES: readonly [{
3460
3430
  readonly required: readonly ["closedReason"];
3461
3431
  };
3462
3432
  };
3463
- readonly render: "action";
3464
3433
  }];
3465
3434
  }, {
3466
3435
  readonly name: "ticket";
@@ -3682,7 +3651,6 @@ export declare const MODULES: readonly [{
3682
3651
  readonly pathParams: {
3683
3652
  readonly ticketID: "工单ID";
3684
3653
  };
3685
- readonly render: "action";
3686
3654
  }, {
3687
3655
  readonly name: "activate";
3688
3656
  readonly display: "激活工单";
@@ -3710,7 +3678,6 @@ export declare const MODULES: readonly [{
3710
3678
  };
3711
3679
  };
3712
3680
  };
3713
- readonly render: "action";
3714
3681
  }, {
3715
3682
  readonly name: "close";
3716
3683
  readonly display: "关闭工单";
@@ -3739,7 +3706,6 @@ export declare const MODULES: readonly [{
3739
3706
  readonly required: readonly ["closedReason", "comment"];
3740
3707
  };
3741
3708
  };
3742
- readonly render: "action";
3743
3709
  }];
3744
3710
  }, {
3745
3711
  readonly name: "system";
@@ -3992,7 +3958,6 @@ export declare const MODULES: readonly [{
3992
3958
  readonly pathParams: {
3993
3959
  readonly buildID: "版本ID";
3994
3960
  };
3995
- readonly render: "action";
3996
3961
  }];
3997
3962
  }, {
3998
3963
  readonly name: "testtask";
@@ -4157,7 +4122,6 @@ export declare const MODULES: readonly [{
4157
4122
  readonly pathParams: {
4158
4123
  readonly testtaskID: "测试单ID";
4159
4124
  };
4160
- readonly render: "action";
4161
4125
  }];
4162
4126
  }, {
4163
4127
  readonly name: "release";
@@ -4290,7 +4254,6 @@ export declare const MODULES: readonly [{
4290
4254
  readonly pathParams: {
4291
4255
  readonly releasID: "发布ID";
4292
4256
  };
4293
- readonly render: "action";
4294
4257
  }];
4295
4258
  }, {
4296
4259
  readonly name: "file";
@@ -4327,87 +4290,8 @@ export declare const MODULES: readonly [{
4327
4290
  readonly pathParams: {
4328
4291
  readonly fileID: "附件ID";
4329
4292
  };
4330
- readonly render: "action";
4331
4293
  }];
4332
4294
  }];
4333
- /** {@link defineModules} 的选项。 */
4334
- export interface DefineModulesOptions {
4335
- /**
4336
- * 同名模块的写入策略。
4337
- *
4338
- * - `false`(默认):合并模块的元数据,并按动作名对动作做"同名替换、未知追加"。
4339
- * - `true`:整体替换已存在的模块定义,原有动作会被丢弃。
4340
- */
4341
- replace?: boolean;
4342
- }
4343
- /**
4344
- * 注册或扩展模块定义。
4345
- *
4346
- * 行为细节:
4347
- * - 模块名匹配大小写不敏感。
4348
- * - 未知模块直接追加到注册表末尾。
4349
- * - 已存在的模块默认按 `mergeModule` 合并:模块元数据浅合并、动作按名同名替换/未知追加;
4350
- * `options.replace` 为 `true` 时整体替换。
4351
- * - 所有写入都会做深克隆 + 深冻结:调用方后续修改自己的对象不会污染注册表,注册表也不可被外部改写。
4352
- *
4353
- * @param input - 单个或一组模块定义。
4354
- * @param options - 写入策略,参见 {@link DefineModulesOptions}。
4355
- * @throws {ZentaoError} `E_INVALID_MODULE_DEFINITION` —— 缺少 `name` 或 `actions` 字段。
4356
- */
4357
- export declare function defineModules(input: ModuleDefinition | ModuleDefinition[], options?: DefineModulesOptions): void;
4358
- /**
4359
- * 为已存在的模块追加或覆盖动作。
4360
- *
4361
- * 不做深度合并:同名动作整体替换,未知动作追加。这避免在 schema、参数数组等字段上出现隐式合并规则。
4362
- *
4363
- * @param moduleName - 目标模块名(大小写不敏感)。
4364
- * @param input - 单个或一组动作定义。
4365
- * @throws {ZentaoError} `E_INVALID_MODULE`(模块未注册)或 `E_INVALID_ACTION_DEFINITION`
4366
- * (动作缺少 `name` / `path` / `method` 等必填字段)。
4367
- */
4368
- export declare function defineModuleActions(moduleName: string, input: ModuleAction | ModuleAction[]): void;
4369
- /**
4370
- * 获取模块定义。
4371
- *
4372
- * 模块名匹配大小写不敏感。返回值是注册表内部的已深冻结引用(O(1) 查询、零拷贝),
4373
- * 任何写入尝试在严格模式下会抛 `TypeError`;如需修改请使用 {@link defineModules}。
4374
- *
4375
- * @param moduleName - 模块名。
4376
- * @returns 已注册的模块定义。
4377
- * @throws {ZentaoError} `E_INVALID_MODULE` —— 模块未注册。
4378
- */
4379
- export declare function getModule(moduleName: string): ModuleDefinition;
4380
- /**
4381
- * 获取指定模块下的某个动作。
4382
- *
4383
- * 解析顺序:
4384
- * 1. `actionName === 'ls'` 时映射为 `list`(仅作为别名,不会修改注册表)。
4385
- * 2. 在该模块的动作中按名称大小写不敏感匹配。
4386
- * 3. 当请求的动作不是基础 CRUD(`list`/`get`/`create`/`update`/`delete`)时,
4387
- * 额外允许命中 `type === 'action'` 的自定义动作(即使名字不在基础 CRUD 中)。
4388
- *
4389
- * 返回值同样是已深冻结的引用,请勿尝试修改。
4390
- *
4391
- * @param moduleName - 模块名(大小写不敏感)。
4392
- * @param actionName - 动作名(大小写不敏感);支持 `ls` 作为 `list` 的别名。
4393
- * @returns 匹配到的动作定义。
4394
- * @throws {ZentaoError} `E_INVALID_MODULE`(模块未注册)或 `E_INVALID_ACTION`(动作不存在)。
4395
- */
4396
- export declare function getModuleAction(moduleName: string, actionName: string): ModuleAction;
4397
- /**
4398
- * 返回当前运行时注册表中的所有模块名。
4399
- *
4400
- * 顺序与模块写入注册表的顺序一致;包括内置模块和通过 {@link defineModules} 追加的用户模块。
4401
- *
4402
- * @returns 模块名数组(保留原始大小写)。
4403
- */
4404
- export declare function getModuleNames(): string[];
4405
- /**
4406
- * 判断模块名是否已注册。
4407
- *
4408
- * @param moduleName - 模块名;匹配大小写不敏感。
4409
- * @returns 已注册返回 `true`,否则 `false`。
4410
- */
4411
- export declare function isModuleName(moduleName: string): boolean;
4412
- /** @internal */
4413
- export declare function resetModuleDefinitions(): void;
4295
+ export { type DefineModulesOptions, defineModules, defineModuleActions, extendModuleAction, resetModuleDefinitions, } from './define.js';
4296
+ export { applyBuiltinOverrides };
4297
+ export { getModule, getModuleAction, getModuleNames, isModuleName, } from './query.js';