@jlceda/pro-api-types 0.1.75 → 0.1.77
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/README.en.md +1 -1
- package/index.d.ts +105 -16
- package/package.json +4 -4
package/README.en.md
CHANGED
|
@@ -10,7 +10,7 @@ JLCEDA & EasyEDA Pro Edition Extension API Interface Type Definition
|
|
|
10
10
|
|
|
11
11
|
It is recommended to use [pro-api-sdk](https://github.com/easyeda/pro-api-sdk) for extension development, this definition file is pre-configured within the SDK.
|
|
12
12
|
|
|
13
|
-
1.
|
|
13
|
+
1. Install type definition
|
|
14
14
|
|
|
15
15
|
```shell
|
|
16
16
|
npm install --save-dev @jlceda/pro-api-types
|
package/index.d.ts
CHANGED
|
@@ -784,6 +784,7 @@ declare class EDA {
|
|
|
784
784
|
sys_ToastMessage: SYS_ToastMessage;
|
|
785
785
|
sys_Unit: SYS_Unit;
|
|
786
786
|
sys_WebSocket: SYS_WebSocket;
|
|
787
|
+
sys_Window: SYS_Window;
|
|
787
788
|
/* Excluded from this release type: extensionUuid */
|
|
788
789
|
/* Excluded from this release type: allowExternalInteractions */
|
|
789
790
|
/* Excluded from this release type: __constructor */
|
|
@@ -1550,6 +1551,30 @@ declare enum ESYS_Unit {
|
|
|
1550
1551
|
MIL = "mil"
|
|
1551
1552
|
}
|
|
1552
1553
|
|
|
1554
|
+
/**
|
|
1555
|
+
* 窗口事件类型
|
|
1556
|
+
*
|
|
1557
|
+
* @public
|
|
1558
|
+
*/
|
|
1559
|
+
declare enum ESYS_WindowEventType {
|
|
1560
|
+
/** 失去焦点 */
|
|
1561
|
+
BLUR = "blur",
|
|
1562
|
+
/** 获取焦点 */
|
|
1563
|
+
FOCUS = "focus"
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1566
|
+
/**
|
|
1567
|
+
* 打开窗口上下文目标
|
|
1568
|
+
*
|
|
1569
|
+
* @public
|
|
1570
|
+
*/
|
|
1571
|
+
declare enum ESYS_WindowOpenTarget {
|
|
1572
|
+
/** 新标签页 */
|
|
1573
|
+
BLANK = "_blank",
|
|
1574
|
+
/** 当前页 */
|
|
1575
|
+
SELF = "_self"
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1553
1578
|
/**
|
|
1554
1579
|
* 板子属性
|
|
1555
1580
|
*
|
|
@@ -2554,7 +2579,7 @@ declare class IPCB_PrimitiveDimension implements IPCB_Primitive {
|
|
|
2554
2579
|
* @returns
|
|
2555
2580
|
*/
|
|
2556
2581
|
getState_PrimitiveId(): string;
|
|
2557
|
-
/** @alpha 所有的 setState_*
|
|
2582
|
+
/** @alpha 所有的 setState_* 方法都需要对数据进行基本的格式校验 */
|
|
2558
2583
|
/**
|
|
2559
2584
|
* 设置属性状态:尺寸标注类型
|
|
2560
2585
|
*
|
|
@@ -2997,7 +3022,7 @@ declare class IPCB_PrimitivePad implements IPCB_Primitive {
|
|
|
2997
3022
|
* @remarks
|
|
2998
3023
|
* 设置焊盘外形时将会联动设置部分其它属性状态:
|
|
2999
3024
|
*
|
|
3000
|
-
* 1.
|
|
3025
|
+
* 1. 特殊焊盘外形属性将被清空
|
|
3001
3026
|
*
|
|
3002
3027
|
* @param pad - 焊盘外形
|
|
3003
3028
|
* @returns 焊盘图元对象
|
|
@@ -3668,7 +3693,7 @@ declare class ISCH_PrimitiveComponent implements ISCH_Primitive {
|
|
|
3668
3693
|
private manufacturer?;
|
|
3669
3694
|
/** Component 属性:制造商编号 */
|
|
3670
3695
|
private manufacturerId?;
|
|
3671
|
-
/** Component
|
|
3696
|
+
/** Component ���性:供应商 */
|
|
3672
3697
|
private supplier?;
|
|
3673
3698
|
/** Component 属性:供应商编号 */
|
|
3674
3699
|
private supplierId?;
|
|
@@ -3935,7 +3960,7 @@ declare class ISCH_PrimitiveRectangle implements ISCH_Primitive {
|
|
|
3935
3960
|
private height;
|
|
3936
3961
|
/** 圆角半径 */
|
|
3937
3962
|
private cornerRadius;
|
|
3938
|
-
/**
|
|
3963
|
+
/** 旋��角度 */
|
|
3939
3964
|
private rotation;
|
|
3940
3965
|
/** 边框颜色 */
|
|
3941
3966
|
private color;
|
|
@@ -4201,6 +4226,20 @@ declare interface ISYS_MultilingualLanguagesData {
|
|
|
4201
4226
|
[language: string]: ISYS_LanguageKeyValuePairs;
|
|
4202
4227
|
}
|
|
4203
4228
|
|
|
4229
|
+
/**
|
|
4230
|
+
* 窗口事件监听可移除对象
|
|
4231
|
+
*
|
|
4232
|
+
* @public
|
|
4233
|
+
* @remarks 本对象从 {@link addEventListener} 获取,并可用于移除创建的事件监听,仅需将其传入 {@link removeEventListener}
|
|
4234
|
+
*/
|
|
4235
|
+
declare interface ISYS_WindowEventListenerRemovableObject {
|
|
4236
|
+
type: ESYS_WindowEventType;
|
|
4237
|
+
listener: (ev: any) => any;
|
|
4238
|
+
options?: {
|
|
4239
|
+
capture?: boolean;
|
|
4240
|
+
};
|
|
4241
|
+
}
|
|
4242
|
+
|
|
4204
4243
|
/**
|
|
4205
4244
|
* 综合库 / 3D 模型类
|
|
4206
4245
|
*
|
|
@@ -4581,7 +4620,7 @@ declare class LIB_Device {
|
|
|
4581
4620
|
*/
|
|
4582
4621
|
getByLcscIds<T extends boolean>(lcscIds: string, libraryUuid?: string, allowMultiMatch?: T): Promise<T extends true ? ILIB_DeviceSearchItem | undefined : Array<ILIB_DeviceSearchItem>>;
|
|
4583
4622
|
/**
|
|
4584
|
-
*
|
|
4623
|
+
* ���用立创 C 编号批量获取器件
|
|
4585
4624
|
*
|
|
4586
4625
|
* @beta
|
|
4587
4626
|
* @remarks
|
|
@@ -4989,7 +5028,7 @@ declare class PCB_Document {
|
|
|
4989
5028
|
* 嘉立创 EDA 专业版 API 使用的均为数据原点;
|
|
4990
5029
|
*
|
|
4991
5030
|
* 如果希望在 API 操作时前端画布坐标能与数据一致,
|
|
4992
|
-
*
|
|
5031
|
+
* 建议调用本方法并设置偏移量为零,
|
|
4993
5032
|
* 即 `setCanvasOrigin(0, 0)`;
|
|
4994
5033
|
*
|
|
4995
5034
|
* 此处的单位为数据层面单位,在跨度上等同于画布层面的 mil
|
|
@@ -5074,7 +5113,7 @@ declare class PCB_Drc {
|
|
|
5074
5113
|
* @param ruleConfiguration - 设计规则配置
|
|
5075
5114
|
* @param configurationName - 配置名称
|
|
5076
5115
|
* @param allowOverwrite - 是否允许覆写同名设计规则配置,`false` 则将在遇到同名设计规则配置时返回 `false`,请注意可能的数据丢失风险
|
|
5077
|
-
* @returns
|
|
5116
|
+
* @returns 保���是否成功
|
|
5078
5117
|
*/
|
|
5079
5118
|
saveRuleConfiguration(ruleConfiguration: {
|
|
5080
5119
|
[key: string]: any;
|
|
@@ -7142,7 +7181,7 @@ declare class SCH_PrimitiveComponent implements ISCH_PrimitiveAPI {
|
|
|
7142
7181
|
* @param primitiveId - 图元 ID
|
|
7143
7182
|
* @param x - 坐标 X
|
|
7144
7183
|
* @param y - 坐标 Y
|
|
7145
|
-
* @param rotation -
|
|
7184
|
+
* @param rotation - 旋转角度,可选 `0` `90` `180` `270`
|
|
7146
7185
|
* @param mirror - 是否镜像
|
|
7147
7186
|
* @param libraryPath - 库路径,默认为系统库
|
|
7148
7187
|
* @param addIntoBom - 是否加入 BOM
|
|
@@ -7326,7 +7365,7 @@ declare class SCH_PrimitivePolygon implements ISCH_PrimitiveAPI {
|
|
|
7326
7365
|
* 获取多边形
|
|
7327
7366
|
*
|
|
7328
7367
|
* @beta
|
|
7329
|
-
* @param primitiveIds - 多边形的图元 ID
|
|
7368
|
+
* @param primitiveIds - 多边形的图元 ID,可以为字符串或字符串数组,如若为数组,则返回的也是数组
|
|
7330
7369
|
* @returns 多边形图元对象
|
|
7331
7370
|
*/
|
|
7332
7371
|
get(primitiveIds: string): Promise<ISCH_PrimitivePolygon | undefined>;
|
|
@@ -7400,7 +7439,7 @@ declare class SCH_PrimitiveRectangle implements ISCH_PrimitiveAPI {
|
|
|
7400
7439
|
* 获取矩形
|
|
7401
7440
|
*
|
|
7402
7441
|
* @public
|
|
7403
|
-
* @param primitiveIds -
|
|
7442
|
+
* @param primitiveIds - 矩形的��元 ID,可以为字符串或字符串数组,如若为数组,则返回的也是数组
|
|
7404
7443
|
* @returns 矩形图元对象
|
|
7405
7444
|
*/
|
|
7406
7445
|
get(primitiveIds: string): Promise<ISCH_PrimitiveRectangle | undefined>;
|
|
@@ -7514,7 +7553,7 @@ declare class SCH_PrimitiveWire implements ISCH_PrimitiveAPI {
|
|
|
7514
7553
|
* 3. 有多个坐标点在多个不同网络的图元上,则创建失败
|
|
7515
7554
|
*
|
|
7516
7555
|
* 如若已指定,则遵循:
|
|
7517
|
-
* 1.
|
|
7556
|
+
* 1. 有一个或多个坐标点在其他网络的图元上,且其他图元并未显式(通常指的是包含网络标签或网络端口)指定网络,则其他图元跟随指定的网络;
|
|
7518
7557
|
* 2. 如若其他图元指定了网络,则创建失败
|
|
7519
7558
|
* @param color - 导线颜色,`null` 表示默认
|
|
7520
7559
|
* @param lineWidth - 线宽,范围 `1-10`,`null` 表示默认
|
|
@@ -8196,13 +8235,14 @@ declare class SYS_Timer {
|
|
|
8196
8235
|
* 设置循环定时器
|
|
8197
8236
|
*
|
|
8198
8237
|
* @public
|
|
8238
|
+
* @remarks 如果遇到 ID 重复的定时器,则之前设置的定时器将被清除
|
|
8199
8239
|
* @param id - 定时器 ID,用于定位&删除定时器
|
|
8200
8240
|
* @param timeout - 定时时间,单位 ms
|
|
8201
8241
|
* @param callFn - 定时调用函数
|
|
8202
|
-
* @param
|
|
8242
|
+
* @param args - 传给定时调用函数的参数
|
|
8203
8243
|
* @returns 定时器是否设置成功
|
|
8204
8244
|
*/
|
|
8205
|
-
setIntervalTimer(id: string, timeout: number, callFn: (
|
|
8245
|
+
setIntervalTimer(id: string, timeout: number, callFn: (...args: any) => void, ...args: any): boolean;
|
|
8206
8246
|
/**
|
|
8207
8247
|
* 清除指定循环定时器
|
|
8208
8248
|
*
|
|
@@ -8215,12 +8255,22 @@ declare class SYS_Timer {
|
|
|
8215
8255
|
* 设置单次定时器
|
|
8216
8256
|
*
|
|
8217
8257
|
* @public
|
|
8258
|
+
* @remarks 如果遇到 ID 重复的定时器,则之前设置的定时器将被清除
|
|
8259
|
+
* @param id - 定时器 ID
|
|
8218
8260
|
* @param timeout - 定时时间,单位 ms
|
|
8219
8261
|
* @param callFn - 定时调用函数
|
|
8220
|
-
* @param
|
|
8262
|
+
* @param args - 传给定时调用函数的参数
|
|
8221
8263
|
* @returns 定时器是否设置成功
|
|
8222
8264
|
*/
|
|
8223
|
-
setTimeoutTimer(timeout: number, callFn: (
|
|
8265
|
+
setTimeoutTimer(id: string, timeout: number, callFn: (...args: any) => void, ...args: any): boolean;
|
|
8266
|
+
/**
|
|
8267
|
+
* 清除指定单次定时器
|
|
8268
|
+
*
|
|
8269
|
+
* @public
|
|
8270
|
+
* @param id - 定时器 ID
|
|
8271
|
+
* @returns 定时器是否清除成功
|
|
8272
|
+
*/
|
|
8273
|
+
clearTimeoutTimer(id: string): boolean;
|
|
8224
8274
|
}
|
|
8225
8275
|
|
|
8226
8276
|
/**
|
|
@@ -8358,6 +8408,45 @@ declare class SYS_WebSocket {
|
|
|
8358
8408
|
close(id: string, code?: number, reason?: string, extensionUuid?: string): void;
|
|
8359
8409
|
}
|
|
8360
8410
|
|
|
8411
|
+
/**
|
|
8412
|
+
* 系统 / 窗口类
|
|
8413
|
+
*
|
|
8414
|
+
* @public
|
|
8415
|
+
* @remarks 为了保证安全性,仅提供有限的窗口跳转与监听支持,更多操作请使用内联框架窗口 {@link SYS_IFrame}
|
|
8416
|
+
*/
|
|
8417
|
+
declare class SYS_Window {
|
|
8418
|
+
/**
|
|
8419
|
+
* 打开资源窗口
|
|
8420
|
+
*
|
|
8421
|
+
* @beta
|
|
8422
|
+
* @param url - 欲加载资源的 URL 或路径
|
|
8423
|
+
* @param target - 上下文目标
|
|
8424
|
+
*/
|
|
8425
|
+
open(url: string, target?: ESYS_WindowOpenTarget): void;
|
|
8426
|
+
/**
|
|
8427
|
+
* 新增事件监听
|
|
8428
|
+
*
|
|
8429
|
+
* @beta
|
|
8430
|
+
* @param type - 事件类型,当前支持 `blur` `focus`
|
|
8431
|
+
* @param listener - 事件监听回调
|
|
8432
|
+
* @param options - 可选参数
|
|
8433
|
+
* @returns 事件监听方法,用于移除事件监听,如若为 `undefined` 则表示创建事件监听失败
|
|
8434
|
+
*/
|
|
8435
|
+
addEventListener(type: ESYS_WindowEventType, listener: (ev: any) => any, options?: {
|
|
8436
|
+
capture?: boolean;
|
|
8437
|
+
once?: boolean;
|
|
8438
|
+
passive?: boolean;
|
|
8439
|
+
signal?: AbortSignal;
|
|
8440
|
+
}): ISYS_WindowEventListenerRemovableObject | undefined;
|
|
8441
|
+
/**
|
|
8442
|
+
* 移除事件监听
|
|
8443
|
+
*
|
|
8444
|
+
* @beta
|
|
8445
|
+
* @param removableObject - 窗口事件监听可移除对象
|
|
8446
|
+
*/
|
|
8447
|
+
removeEventListener(removableObject: ISYS_WindowEventListenerRemovableObject): void;
|
|
8448
|
+
}
|
|
8449
|
+
|
|
8361
8450
|
/**
|
|
8362
8451
|
* 可选中图层
|
|
8363
8452
|
*
|
|
@@ -8516,7 +8605,7 @@ declare type TPCB_PolygonSourceArray = Array<'L' | 'ARC' | 'CARC' | 'C' | 'R' |
|
|
|
8516
8605
|
* @remarks
|
|
8517
8606
|
* 尺寸标注坐标集存在以下三种 {@link EPCB_PrimitiveDimensionType | 尺寸标注类型}:
|
|
8518
8607
|
*
|
|
8519
|
-
* ①
|
|
8608
|
+
* ① 半���标注
|
|
8520
8609
|
*
|
|
8521
8610
|
* `[x1, y1, x2, y2, x3, y3]`
|
|
8522
8611
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jlceda/pro-api-types",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.77",
|
|
4
4
|
"description": "嘉立创EDA & EasyEDA 专业版扩展 API 接口类型定义",
|
|
5
5
|
"typings": "index.d.ts",
|
|
6
6
|
"keywords": [
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"eslint-plugin-tsdoc": "^0.3.0",
|
|
31
31
|
"fast-text-encoding": "^1.0.6",
|
|
32
32
|
"fs-extra": "^11.2.0",
|
|
33
|
-
"husky": "^9.1.
|
|
34
|
-
"lint-staged": "^15.2.
|
|
33
|
+
"husky": "^9.1.6",
|
|
34
|
+
"lint-staged": "^15.2.10",
|
|
35
35
|
"prettier": "^3.3.3",
|
|
36
36
|
"ts-node": "^10.9.2",
|
|
37
|
-
"typescript": "^5.
|
|
37
|
+
"typescript": "^5.6.2"
|
|
38
38
|
},
|
|
39
39
|
"lint-staged": {
|
|
40
40
|
"*.ts": "eslint --cache --fix",
|