@jlceda/pro-api-types 0.2.60 → 0.2.62
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/index.d.ts +167 -18
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -975,7 +975,7 @@ declare global {
|
|
|
975
975
|
* 文档树 / 编辑器控制类
|
|
976
976
|
*
|
|
977
977
|
* @public
|
|
978
|
-
* @remarks
|
|
978
|
+
* @remarks 此处编辑器控制基于当前已打开的工程设计下���图页,其它任何 `documentUuid` 都将被认为是不存在的文档页
|
|
979
979
|
*/
|
|
980
980
|
class DMT_EditorControl {
|
|
981
981
|
/**
|
|
@@ -1381,7 +1381,7 @@ declare global {
|
|
|
1381
1381
|
*/
|
|
1382
1382
|
createPanel(): Promise<string | undefined>;
|
|
1383
1383
|
/**
|
|
1384
|
-
*
|
|
1384
|
+
* 修改面���名称
|
|
1385
1385
|
*
|
|
1386
1386
|
* @public
|
|
1387
1387
|
* @param panelUuid - 面板 UUID
|
|
@@ -2391,7 +2391,7 @@ declare global {
|
|
|
2391
2391
|
* @param targetLibraryUuid - 目标库 UUID
|
|
2392
2392
|
* @param targetClassification - 目标库内的分类
|
|
2393
2393
|
* @param newDeviceName - 新器件名称,如若目标库内存在重名器件将导致复制失败
|
|
2394
|
-
* @returns
|
|
2394
|
+
* @returns 目标库内新器件的 UUID
|
|
2395
2395
|
*/
|
|
2396
2396
|
copy(deviceUuid: string, libraryUuid: string, targetLibraryUuid: string, targetClassification?: ILIB_ClassificationIndex | Array<string>, newDeviceName?: string): Promise<string | undefined>;
|
|
2397
2397
|
/**
|
|
@@ -2840,6 +2840,9 @@ declare global {
|
|
|
2840
2840
|
};
|
|
2841
2841
|
};
|
|
2842
2842
|
};
|
|
2843
|
+
/**
|
|
2844
|
+
*/
|
|
2845
|
+
images?: Array<ILIB_ExtendLibraryItem>;
|
|
2843
2846
|
/**
|
|
2844
2847
|
* @deprecated - 使用 attributes['Value'] 替代
|
|
2845
2848
|
*/
|
|
@@ -3902,7 +3905,7 @@ declare global {
|
|
|
3902
3905
|
*/
|
|
3903
3906
|
createPolygon(polygon: TPCB_PolygonSourceArray): IPCB_Polygon | undefined;
|
|
3904
3907
|
/**
|
|
3905
|
-
*
|
|
3908
|
+
* 创建复杂多��形
|
|
3906
3909
|
*
|
|
3907
3910
|
* @public
|
|
3908
3911
|
* @param complexPolygon - 复杂多边形数据
|
|
@@ -4233,6 +4236,119 @@ declare global {
|
|
|
4233
4236
|
/** 停用 */
|
|
4234
4237
|
INACTIVE = "inactive"
|
|
4235
4238
|
}
|
|
4239
|
+
/**
|
|
4240
|
+
* 自动布线拐角风格
|
|
4241
|
+
*
|
|
4242
|
+
* @public
|
|
4243
|
+
*/
|
|
4244
|
+
enum EPCB_AutoRoutingCornerStyle {
|
|
4245
|
+
/** 任意角度 */
|
|
4246
|
+
/** 45 度 */
|
|
4247
|
+
DEGREE_45 = "45Degree",
|
|
4248
|
+
/** 90 度 */
|
|
4249
|
+
DEGREE_90 = "90Degree"
|
|
4250
|
+
}
|
|
4251
|
+
/**
|
|
4252
|
+
* 自动布线效果优先级
|
|
4253
|
+
*
|
|
4254
|
+
* @public
|
|
4255
|
+
*/
|
|
4256
|
+
enum EPCB_AutoRoutingOptimization {
|
|
4257
|
+
/** 优先布线长度(最短路径) */
|
|
4258
|
+
/** 优先布线美观(减少过孔、均匀分布) */
|
|
4259
|
+
/** 优先布通率(尽可能完成所有网络) */
|
|
4260
|
+
COMPLETION = "completion",
|
|
4261
|
+
/** 优先布线速度 */
|
|
4262
|
+
FASTER = "faster"
|
|
4263
|
+
}
|
|
4264
|
+
/**
|
|
4265
|
+
* 自动布线对已有导线/过孔的处理方式
|
|
4266
|
+
*
|
|
4267
|
+
* @public
|
|
4268
|
+
*/
|
|
4269
|
+
enum EPCB_AutoRoutingExistingPrimitiveMode {
|
|
4270
|
+
/** 保留已有导线和过孔(在其基础上继续布线) */
|
|
4271
|
+
KEEP = "keep",
|
|
4272
|
+
/** 移除已有导线和过孔(推倒重布) */
|
|
4273
|
+
REMOVE = "remove"
|
|
4274
|
+
}
|
|
4275
|
+
/**
|
|
4276
|
+
* 自动布线入参
|
|
4277
|
+
*
|
|
4278
|
+
* @public
|
|
4279
|
+
*/
|
|
4280
|
+
interface IPCB_AutoRoutingProps {
|
|
4281
|
+
/**
|
|
4282
|
+
* 布线网络
|
|
4283
|
+
*
|
|
4284
|
+
* @remarks 指定需要参与自动布线的网络名称数组;如不传入或传入空数组,则对所有未布线的网络进行自动布线
|
|
4285
|
+
*/
|
|
4286
|
+
RoutingNets?: 'selected' | 'selectedComponents' | Array<string>;
|
|
4287
|
+
/**
|
|
4288
|
+
* 布线拐角风格
|
|
4289
|
+
*
|
|
4290
|
+
* @remarks 指定自动布线使用的拐角风格,默认为 45 度
|
|
4291
|
+
*/
|
|
4292
|
+
cornerStyle?: EPCB_AutoRoutingCornerStyle;
|
|
4293
|
+
/**
|
|
4294
|
+
* 已有导线/过孔的处理方式
|
|
4295
|
+
*
|
|
4296
|
+
* @remarks 指定对画布上已有导线和过孔的处理方式,默认为保留
|
|
4297
|
+
*/
|
|
4298
|
+
existingPrimitiveMode?: EPCB_AutoRoutingExistingPrimitiveMode;
|
|
4299
|
+
/**
|
|
4300
|
+
* 效果优先级
|
|
4301
|
+
*
|
|
4302
|
+
* @remarks 指定自动布线的优化目标,默认为布通率
|
|
4303
|
+
*/
|
|
4304
|
+
optimization?: EPCB_AutoRoutingOptimization;
|
|
4305
|
+
/**
|
|
4306
|
+
* 布线图层
|
|
4307
|
+
*
|
|
4308
|
+
* @remarks 指定允许参与自动布线的图层 ID 数组;如不传入,则使用当前 PCB 的所有可用信号层
|
|
4309
|
+
*/
|
|
4310
|
+
layers?: Array<TPCB_LayersOfCopper>;
|
|
4311
|
+
/**
|
|
4312
|
+
* 忽略网络
|
|
4313
|
+
*
|
|
4314
|
+
* @remarks 指定需要忽略(不参与自动布线)的网络名称数组;如不传入,则不忽略任何网络
|
|
4315
|
+
*/
|
|
4316
|
+
ignoreNets?: Array<string>;
|
|
4317
|
+
}
|
|
4318
|
+
/**
|
|
4319
|
+
* 自动布局结果
|
|
4320
|
+
*
|
|
4321
|
+
* @public
|
|
4322
|
+
*/
|
|
4323
|
+
interface IPCB_AutoLayoutResult {
|
|
4324
|
+
/** 自动布局是否成功启动 */
|
|
4325
|
+
success: boolean;
|
|
4326
|
+
/** 参与自动布局的器件总数 */
|
|
4327
|
+
totalComponentsCount: number;
|
|
4328
|
+
/** 成功完成布局的器件数量 */
|
|
4329
|
+
successComponentsCount: number;
|
|
4330
|
+
/** 未能完成布局的器件图元 ID 列表 */
|
|
4331
|
+
failedComponents: Array<string>;
|
|
4332
|
+
/** 自动布局耗时(毫秒) */
|
|
4333
|
+
duration: number;
|
|
4334
|
+
}
|
|
4335
|
+
/**
|
|
4336
|
+
* 自动布线结果
|
|
4337
|
+
*
|
|
4338
|
+
* @public
|
|
4339
|
+
*/
|
|
4340
|
+
interface IPCB_AutoRoutingResult {
|
|
4341
|
+
/** 自动布线是否成功启动 */
|
|
4342
|
+
success: boolean;
|
|
4343
|
+
/** 参与自动布线的网络总数 */
|
|
4344
|
+
totalNetsCount: number;
|
|
4345
|
+
/** 成功完成布线的网络数量 */
|
|
4346
|
+
successNetsCount: number;
|
|
4347
|
+
/** 未能完成布线的网络名称列表 */
|
|
4348
|
+
failedNets: Array<string>;
|
|
4349
|
+
/** 自动布线耗时(毫秒) */
|
|
4350
|
+
duration: number;
|
|
4351
|
+
}
|
|
4236
4352
|
/**
|
|
4237
4353
|
* PCB & 封装 / 文档操作类
|
|
4238
4354
|
*
|
|
@@ -4449,6 +4565,36 @@ declare global {
|
|
|
4449
4565
|
* @param type - 清除类型,如若需要指定清除类型,请提前选择指定图元
|
|
4450
4566
|
*/
|
|
4451
4567
|
clearRouting(type?: 'all' | 'net' | 'connection'): Promise<boolean>;
|
|
4568
|
+
/**
|
|
4569
|
+
* 自动布线
|
|
4570
|
+
*
|
|
4571
|
+
* @alpha
|
|
4572
|
+
* @remarks 如不传入任何参数,将对所有未布线的网络进行自动布线
|
|
4573
|
+
* @param props - 自动布线参数
|
|
4574
|
+
* @returns 自动布线结果
|
|
4575
|
+
* @example
|
|
4576
|
+
* ```javascript
|
|
4577
|
+
* // 对所有未布线的网络进行自动布线
|
|
4578
|
+
* const result = await eda.pcb_Document.autoRouting();
|
|
4579
|
+
* console.log(`布线完成:${result.routedNets}/${result.totalNets}`);
|
|
4580
|
+
*
|
|
4581
|
+
* // 指定网络进行自动布线,并忽略部分网络
|
|
4582
|
+
* const result = await eda.pcb_Document.autoRouting({
|
|
4583
|
+
* nets: ['VCC', 'GND', 'SDA', 'SCL'],
|
|
4584
|
+
* ignoreNets: ['NC'],
|
|
4585
|
+
* cornerStyle: EPCB_AutoRoutingCornerStyle.DEGREE_45,
|
|
4586
|
+
* optimization: EPCB_AutoRoutingOptimization.COMPLETION,
|
|
4587
|
+
* });
|
|
4588
|
+
* ```
|
|
4589
|
+
*/
|
|
4590
|
+
autoRouting(props?: IPCB_AutoRoutingProps): Promise<IPCB_AutoRoutingResult>;
|
|
4591
|
+
/**
|
|
4592
|
+
* 自动布局
|
|
4593
|
+
*
|
|
4594
|
+
* @alpha
|
|
4595
|
+
* @returns 自动布局结果
|
|
4596
|
+
*/
|
|
4597
|
+
autoLayout(): Promise<IPCB_AutoLayoutResult>;
|
|
4452
4598
|
}
|
|
4453
4599
|
|
|
4454
4600
|
/**
|
|
@@ -7470,7 +7616,7 @@ declare global {
|
|
|
7470
7616
|
* 获取文本
|
|
7471
7617
|
*
|
|
7472
7618
|
* @alpha
|
|
7473
|
-
* @remarks 如若传入多个图元 ID,任意图元 ID
|
|
7619
|
+
* @remarks 如若传入多个图元 ID,任意图元 ID 未匹配到不影响其它图元的返回,���可能返回少于传入的图元 ID 数量的图元对象
|
|
7474
7620
|
* @param primitiveIds - 文本的图元 ID,可以为字符串或字符串数组,如若为数组,则返回的也是数组
|
|
7475
7621
|
* @returns 文本图元对象,空数组表示获取失败
|
|
7476
7622
|
*/
|
|
@@ -8268,7 +8414,7 @@ declare global {
|
|
|
8268
8414
|
* 修改覆铜填充
|
|
8269
8415
|
*
|
|
8270
8416
|
* @internal
|
|
8271
|
-
* @remarks
|
|
8417
|
+
* @remarks 覆铜填充图元不支持修改,本接口调用将不会有任何效果
|
|
8272
8418
|
* @returns `undefined`
|
|
8273
8419
|
*/
|
|
8274
8420
|
modify(): undefined;
|
|
@@ -10317,7 +10463,7 @@ declare global {
|
|
|
10317
10463
|
*/
|
|
10318
10464
|
setState_PadNumber(): IPCB_PrimitiveComponentPad;
|
|
10319
10465
|
/**
|
|
10320
|
-
*
|
|
10466
|
+
* ���异步图元重置为当前画布状态
|
|
10321
10467
|
*
|
|
10322
10468
|
* @internal
|
|
10323
10469
|
* @remarks 本器件焊盘图元属性不支持修改,本接口调用将不会有任何效果
|
|
@@ -12316,8 +12462,9 @@ declare global {
|
|
|
12316
12462
|
* 自动布线
|
|
12317
12463
|
*
|
|
12318
12464
|
* @beta
|
|
12465
|
+
* @remarks 如不传入任何参数,将对所有未布线的网络进行自动布线
|
|
12319
12466
|
* @param props - 自动布线参数
|
|
12320
|
-
* @returns
|
|
12467
|
+
* @returns 自动布线结果
|
|
12321
12468
|
*/
|
|
12322
12469
|
autoRouting(props?: {
|
|
12323
12470
|
uuids?: Array<string>;
|
|
@@ -12345,8 +12492,9 @@ declare global {
|
|
|
12345
12492
|
* 自动布局
|
|
12346
12493
|
*
|
|
12347
12494
|
* @beta
|
|
12495
|
+
* @remarks 如不传入任何参数,将对所有器件进行自动布局
|
|
12348
12496
|
* @param props - 自动布局参数
|
|
12349
|
-
* @returns
|
|
12497
|
+
* @returns 自动布局结果
|
|
12350
12498
|
*/
|
|
12351
12499
|
autoLayout(props?: {
|
|
12352
12500
|
uuids?: Array<string>;
|
|
@@ -13592,6 +13740,7 @@ declare global {
|
|
|
13592
13740
|
* 创建网络标签
|
|
13593
13741
|
*
|
|
13594
13742
|
* @alpha
|
|
13743
|
+
* @remarks ADD since EDA v4
|
|
13595
13744
|
* @param x - 坐标 X
|
|
13596
13745
|
* @param y - 坐标 Y
|
|
13597
13746
|
* @param net - 网络名称
|
|
@@ -14143,7 +14292,7 @@ declare global {
|
|
|
14143
14292
|
*/
|
|
14144
14293
|
toAsync(): ISCH_PrimitiveBus;
|
|
14145
14294
|
/**
|
|
14146
|
-
*
|
|
14295
|
+
* ���图元转换为同步图元
|
|
14147
14296
|
*
|
|
14148
14297
|
* @public
|
|
14149
14298
|
* @returns 总线图元对象
|
|
@@ -16235,7 +16384,7 @@ declare global {
|
|
|
16235
16384
|
* 获取属性状态:是否转到 PCB
|
|
16236
16385
|
*
|
|
16237
16386
|
* @public
|
|
16238
|
-
* @returns
|
|
16387
|
+
* @returns ��否转到 PCB
|
|
16239
16388
|
*/
|
|
16240
16389
|
getState_AddIntoPcb(): boolean | undefined;
|
|
16241
16390
|
/**
|
|
@@ -17405,7 +17554,7 @@ declare global {
|
|
|
17405
17554
|
*/
|
|
17406
17555
|
setState_LineType(lineType: ESCH_PrimitiveLineType | null): ISCH_PrimitiveRectangle;
|
|
17407
17556
|
/**
|
|
17408
|
-
*
|
|
17557
|
+
* 设置属���状态:填充样式
|
|
17409
17558
|
*
|
|
17410
17559
|
* @beta
|
|
17411
17560
|
* @param fillStyle - 填充样式
|
|
@@ -19570,16 +19719,16 @@ declare global {
|
|
|
19570
19719
|
*
|
|
19571
19720
|
* 本接口无法移除 {@link SYS_HeaderMenu.insertSystemHeaderMenus | 导入系统顶部菜单} 接口导入的系统顶部菜单项
|
|
19572
19721
|
*
|
|
19573
|
-
*
|
|
19722
|
+
* 当 `id` 数组仅包含一个元素时,将移除对应的一级菜单;当 `id` 数组包含多个元素时,将按照数组顺序按层级匹配菜单项,并移除数组最后一位对应的子菜单项
|
|
19574
19723
|
*
|
|
19575
|
-
* 本接口无法移除 **高级**
|
|
19724
|
+
* 本接口无法移除 **高级** 菜单本身及其下的任何子菜单
|
|
19576
19725
|
*
|
|
19577
|
-
*
|
|
19726
|
+
* 注意:本接口需要使用者启用扩展的外部交互权限,如若未启用将始终 `throw Error`
|
|
19578
19727
|
*
|
|
19579
19728
|
* 非公开接口使用提醒:本接口按原样提供,不提供参数的额外文档,参数可能在任何版本出现破坏性更改并不另行通知
|
|
19580
19729
|
* @param env - 环境
|
|
19581
|
-
* @param id - 菜单项 ID
|
|
19582
|
-
* @param props -
|
|
19730
|
+
* @param id - 菜单项 ID 树,将会按照数组顺序按层级匹配菜单项,并移除数组最后一位对应的菜单项;仅传递一个元素时移除对应的一级菜单
|
|
19731
|
+
* @param props - 其它参数,是否移除菜单项之前、之后的分隔线(仅在移除子菜单项时生效)
|
|
19583
19732
|
* @returns 移除操作是否成功,菜单已移除但分隔线未找到也会返回 `true` 的结果
|
|
19584
19733
|
*/
|
|
19585
19734
|
removeSystemHeaderMenuItem(id: Array<string>, props?: {
|
|
@@ -20899,7 +21048,7 @@ declare global {
|
|
|
20899
21048
|
*
|
|
20900
21049
|
* @public
|
|
20901
21050
|
* @remarks 注意:本接口需要使用者启用扩展的外部交互权限,如若未启用将始终 `throw Error`
|
|
20902
|
-
* @param id -
|
|
21051
|
+
* @param id - 自��义的 WebSocket ID
|
|
20903
21052
|
* @param code - 数字状态码,对应 {@link https://developer.mozilla.org/docs/Web/API/CloseEvent/code | WebSocket.CloseEvent} 内允许的状态码
|
|
20904
21053
|
* @param reason - 一个人类可读的字符串,解释连接关闭的原因
|
|
20905
21054
|
* @param extensionUuid - 扩展 UUID,一般不需要指定,仅当需要操作其它扩展建立的 WebSocket 连接时才需要指定为其它扩展的 UUID
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{ "name": "@jlceda/pro-api-types", "type": "module", "version": "0.2.
|
|
1
|
+
{ "name": "@jlceda/pro-api-types", "type": "module", "version": "0.2.62", "description": "嘉立创EDA & EasyEDA 专业版扩展 API 接口类型定义", "typings": "index.d.ts", "author": "JLCEDA <support@lceda.cn>", "license": "Apache-2.0", "homepage": "https://pro.lceda.cn/", "keywords": ["jlceda", "pro-api"], "scripts": { "lint": "eslint", "fix": "eslint --fix", "build": "ts-node ./build/build.ts" }, "devDependencies": { "@antfu/eslint-config": "^5.4.1", "@types/fast-text-encoding": "^1.0.3", "@types/fs-extra": "^11.0.4", "dotenv": "^16.4.7", "eslint": "^9.37.0", "fast-text-encoding": "^1.0.6", "fs-extra": "^11.3.0", "lint-staged": "^16.2.3", "simple-git-hooks": "^2.13.1", "ts-node": "^10.9.2", "typescript": "^5.7.3" }, "simple-git-hooks": { "pre-commit": "npx lint-staged" }, "lint-staged": { "*": "eslint --fix" } }
|