@jlceda/pro-api-types 0.2.61 → 0.2.63
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 +164 -16
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -502,7 +502,7 @@ declare global {
|
|
|
502
502
|
* @param libraryUuid - 库 UUID,可以使用 {@link LIB_LibrariesList} 内的接口获取
|
|
503
503
|
* @param targetLibraryUuid - 目标库 UUID
|
|
504
504
|
* @param targetClassification - 目标库内的分类
|
|
505
|
-
* @param newSymbolName -
|
|
505
|
+
* @param newSymbolName - 新符号名称,如若目标库内存在���名符号将导致复制失败
|
|
506
506
|
* @returns 目标库内新符号的 UUID
|
|
507
507
|
*/
|
|
508
508
|
copy(symbolUuid: string, libraryUuid: string, targetLibraryUuid: string, targetClassification?: ILIB_ClassificationIndex | Array<string>, newSymbolName?: string): Promise<string | undefined>;
|
|
@@ -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
|
*/
|
|
@@ -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
|
/**
|
|
@@ -4720,7 +4866,7 @@ declare global {
|
|
|
4720
4866
|
* 覆写区域规则
|
|
4721
4867
|
*
|
|
4722
4868
|
* @beta
|
|
4723
|
-
* @remarks 将会覆写当前 PCB
|
|
4869
|
+
* @remarks 将会覆写当前 PCB 的所有区域规则,请注意数据丢��风险
|
|
4724
4870
|
* @param regionRules - 区域规则
|
|
4725
4871
|
* @returns 覆写是否成功
|
|
4726
4872
|
*/
|
|
@@ -6900,7 +7046,7 @@ declare global {
|
|
|
6900
7046
|
*/
|
|
6901
7047
|
setState_Layer(layer: TPCB_LayersOfLine): IPCB_PrimitiveLine;
|
|
6902
7048
|
/**
|
|
6903
|
-
*
|
|
7049
|
+
* 设置属性状��:起始位置 X
|
|
6904
7050
|
*
|
|
6905
7051
|
* @beta
|
|
6906
7052
|
* @param startX - 起始位置 X
|
|
@@ -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
|
*/
|
|
@@ -8102,7 +8248,7 @@ declare global {
|
|
|
8102
8248
|
*/
|
|
8103
8249
|
setState_Value(value: string): IPCB_PrimitiveAttribute;
|
|
8104
8250
|
/**
|
|
8105
|
-
*
|
|
8251
|
+
* 设置属性状��:Key 是否可见
|
|
8106
8252
|
*
|
|
8107
8253
|
* @beta
|
|
8108
8254
|
* @param keyVisible - Key 是否可见
|
|
@@ -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;
|
|
@@ -8653,7 +8799,7 @@ declare global {
|
|
|
8653
8799
|
*
|
|
8654
8800
|
* @beta
|
|
8655
8801
|
* @param lineWidth - 线宽
|
|
8656
|
-
* @returns
|
|
8802
|
+
* @returns ��域图元对象
|
|
8657
8803
|
*/
|
|
8658
8804
|
setState_LineWidth(lineWidth: number): IPCB_PrimitiveRegion;
|
|
8659
8805
|
/**
|
|
@@ -8797,7 +8943,7 @@ declare global {
|
|
|
8797
8943
|
*
|
|
8798
8944
|
* @beta
|
|
8799
8945
|
* @remarks 如若传入多个图元 ID,任意图元 ID 未匹配到不影响其它图元的返回,即可能返回少于传入的图元 ID 数量的图元对象
|
|
8800
|
-
* @param primitiveIds - 覆铜边框的图元 ID
|
|
8946
|
+
* @param primitiveIds - 覆铜边框的图元 ID,可以为字符串或字符串数组,如若为数组,则返回的也是数组
|
|
8801
8947
|
* @returns 覆铜边框图元对象,空数组表示获取失败
|
|
8802
8948
|
*/
|
|
8803
8949
|
get(primitiveIds: Array<string>): Promise<Array<IPCB_PrimitivePour>>;
|
|
@@ -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>;
|
|
@@ -14879,7 +15027,7 @@ declare global {
|
|
|
14879
15027
|
*
|
|
14880
15028
|
* @internal
|
|
14881
15029
|
* @remarks 本器件引脚图元属性不支持修改,本接口调用将不会有任何效果
|
|
14882
|
-
* @returns
|
|
15030
|
+
* @returns 器件引脚图元对象
|
|
14883
15031
|
*/
|
|
14884
15032
|
setState_Y(): ISCH_PrimitiveComponentPin;
|
|
14885
15033
|
/**
|
|
@@ -15882,7 +16030,7 @@ declare global {
|
|
|
15882
16030
|
* @param x - 坐标 X
|
|
15883
16031
|
* @param y - 坐标 Y
|
|
15884
16032
|
* @param rotation - 旋转角度
|
|
15885
|
-
* @param mirror -
|
|
16033
|
+
* @param mirror - 是否镜像
|
|
15886
16034
|
* @returns 器件图元对象
|
|
15887
16035
|
*/
|
|
15888
16036
|
createShortCircuitFlag(x: number, y: number, rotation?: number, mirror?: boolean): Promise<ISCH_PrimitiveComponent | undefined>;
|
|
@@ -20558,7 +20706,7 @@ declare global {
|
|
|
20558
20706
|
BLANK = 0,
|
|
20559
20707
|
/** 开始页 */
|
|
20560
20708
|
HOME = 1,
|
|
20561
|
-
/**
|
|
20709
|
+
/** 原理图图页 */
|
|
20562
20710
|
SCHEMATIC_PAGE = 2,
|
|
20563
20711
|
/** 符号 */
|
|
20564
20712
|
SYMBOL = 3,
|
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.63", "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" } }
|