@jlceda/pro-api-types 0.1.166 → 0.1.168

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.
Files changed (2) hide show
  1. package/index.d.ts +63 -11
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -10055,9 +10055,48 @@ declare class PCB_Document {
10055
10055
  * @returns 操作是否成功
10056
10056
  */
10057
10057
  navigateToCoordinates(x: number, y: number): Promise<boolean>;
10058
- /* Excluded from this release type: navigateToRegion */
10059
- /* Excluded from this release type: getPrimitiveAtPoint */
10060
- /* Excluded from this release type: getPrimitivesInRegion */
10058
+ /**
10059
+ * 定位到画布区域
10060
+ *
10061
+ * @beta
10062
+ * @remarks
10063
+ * 本接口在前端画布上定位到指定的区域,区域数据为相对于数据原点的偏移;
10064
+ *
10065
+ * 例如:传入数据为 `{left: 0, right: 60, top: 100, bottom: -20}` =\> `navigateToRegion(0, 60, 100, -20)`,
10066
+ * 则画布将会定位到以 `[30, 40]` 为中心的,`x` 轴方向长度为 `60`,`y` 轴方向长度为 `120` 的矩形范围;
10067
+ *
10068
+ * 本接口不进行缩放操作,但会生成指示定位中心及表示区域范围的矩形框;
10069
+ *
10070
+ * 此处的单位为数据层面单位,在跨度上等同于画布层面的 mil
10071
+ * @param left - 矩形框第一 X 坐标
10072
+ * @param right - 矩形框第二 X 坐标
10073
+ * @param top - 矩形框第一 Y 坐标
10074
+ * @param bottom - 矩形框第二 Y 坐标
10075
+ * @returns 操作是否成功
10076
+ */
10077
+ navigateToRegion(left: number, right: number, top: number, bottom: number): Promise<boolean>;
10078
+ /**
10079
+ * 获取坐标点的图元
10080
+ *
10081
+ * @beta
10082
+ * @remarks 本操作和前端鼠标点击操作类似,将会获取指定坐标点上的图元
10083
+ * @param x - 坐标点 X
10084
+ * @param y - 坐标点 Y
10085
+ * @returns 坐标点的图元,如若坐标点无法找到图元,将返回 `undefined`
10086
+ */
10087
+ getPrimitiveAtPoint(x: number, y: number): Promise<IPCB_Primitive | undefined>;
10088
+ /**
10089
+ * 获取区域内所有图元
10090
+ *
10091
+ * @beta
10092
+ * @param left - 矩形框第一 X 坐标
10093
+ * @param right - 矩形框第二 X 坐标
10094
+ * @param top - 矩形框第一 Y 坐标
10095
+ * @param bottom - 矩形框第二 Y 坐标
10096
+ * @param leftToRight - 是否仅获取完全框选的图元,`false` 则触碰即获取
10097
+ * @returns 区域内所有图元
10098
+ */
10099
+ getPrimitivesInRegion(left: number, right: number, top: number, bottom: number, leftToRight?: boolean): Promise<Array<IPCB_Primitive>>;
10061
10100
  /**
10062
10101
  * 缩放到板框(适应板框)
10063
10102
  *
@@ -10065,6 +10104,7 @@ declare class PCB_Document {
10065
10104
  * @returns 操作是否成功
10066
10105
  */
10067
10106
  zoomToBoardOutline(): Promise<boolean>;
10107
+ /* Excluded from this release type: getCurrentFilterConfiguration */
10068
10108
  }
10069
10109
 
10070
10110
  /**
@@ -11970,7 +12010,7 @@ declare class PCB_PrimitivePolyline implements IPCB_PrimitiveAPI {
11970
12010
  * 获取折线
11971
12011
  *
11972
12012
  * @beta
11973
- * @remarks 如若传入多个图元 ID,任意图元 ID 未匹配到不影响其它图元的返回,即可���返回少于传入的图元 ID 数量的图元对象
12013
+ * @remarks 如若传入多个图元 ID,任意图元 ID 未匹配到不影响其它图元的返回,即可能返回少于传入的图元 ID 数量的图元对象
11974
12014
  * @param primitiveIds - 折线的图元 ID,可以为字符串或字符串数组,如若为数组,则返回的也是数组
11975
12015
  * @returns 折线图元对象,空数组表示获取失败
11976
12016
  */
@@ -12391,6 +12431,7 @@ declare class SCH_Document {
12391
12431
  /* Excluded from this release type: navigateToRegion */
12392
12432
  /* Excluded from this release type: getPrimitiveAtPoint */
12393
12433
  /* Excluded from this release type: getPrimitivesInRegion */
12434
+ /* Excluded from this release type: getCurrentFilterConfiguration */
12394
12435
  }
12395
12436
 
12396
12437
  /**
@@ -12404,7 +12445,7 @@ declare class SCH_Drc {
12404
12445
  * 检查 DRC
12405
12446
  *
12406
12447
  * @public
12407
- * @remarks 如若检查结果存在 **错误** 或以上级别,将会始终呼出底��� DRC 窗口,无视 `userInterface` 参数
12448
+ * @remarks 如若检查结果存在 **错误** 或以上级别,将会始终呼出底部 DRC 窗口,无视 `userInterface` 参数
12408
12449
  * @param strict - 是否严格检查,严格检查时存在 Warning 将返回 `false`,否则返回 `true`
12409
12450
  * @param userInterface - 是否显示 UI(呼出底部 DRC 窗口)
12410
12451
  * @returns DRC 检查是否无错误
@@ -13484,7 +13525,7 @@ declare class SCH_PrimitivePolygon implements ISCH_PrimitiveAPI {
13484
13525
  * 获取多边形
13485
13526
  *
13486
13527
  * @beta
13487
- * @remarks 如若传入多个图元 ID,任意图元 ID 未匹配到不影响其它图元的返回,即可能返回少于传入的图元 ID 数量的图元对象
13528
+ * @remarks 如若传入多个图元 ID,任意图元 ID 未匹配到不影响其它图元的返回,即可能返���少于传入的图元 ID 数量的图元对象
13488
13529
  * @param primitiveIds - 多边形的图元 ID,可以为字符串或字符串数组,如若为数组,则返回的也是数组
13489
13530
  * @returns 多边形图元对象,空数组表示获取失败
13490
13531
  */
@@ -13954,7 +13995,7 @@ declare class SYS_Dialog {
13954
13995
  showSelectDialog(options: Array<string> | Array<{
13955
13996
  value: string;
13956
13997
  displayContent: string;
13957
- }>, beforeContent?: string, afterContent?: string, title?: string, defaultOption?: string, multiple?: false, callbackFn?: (value: string) => void): void;
13998
+ }>, beforeContent?: string, afterContent?: string, title?: string, defaultOption?: string, multiple?: false, callbackFn?: (value: string) => void | Promise<void>): void;
13958
13999
  /**
13959
14000
  * 弹出多选窗口
13960
14001
  *
@@ -13976,7 +14017,8 @@ declare class SYS_Dialog {
13976
14017
  showSelectDialog(options: Array<string> | Array<{
13977
14018
  value: string;
13978
14019
  displayContent: string;
13979
- }>, beforeContent?: string, afterContent?: string, title?: string, defaultOption?: Array<string>, multiple?: true, callbackFn?: (value: Array<string>) => void): void;
14020
+ }>, beforeContent?: string, afterContent?: string, title?: string, defaultOption?: Array<string>, multiple?: true, callbackFn?: (value: Array<string>) => void | Promise<void>): void;
14021
+ /* Excluded from this release type: insertScriptToDialog */
13980
14022
  }
13981
14023
 
13982
14024
  /**
@@ -14469,19 +14511,29 @@ declare class SYS_IFrame {
14469
14511
  * 内联框架需要展示 `htmlFileName` 的内容,该 HTML 从扩展包内获取,并已在安装时被存储至 IndexedDB 中
14470
14512
  *
14471
14513
  * 注意:本接口仅扩展有效,在独立脚本环境内调用将始终 `throw Error`
14472
- * @param htmlFileName - 需要加载的 HTML 文件在扩展包内的路径
14514
+ * @param htmlFileName - 需要加载的 HTML 文件在扩展包内的路径,从扩展根目录起始,例如 `/iframe/index.html`
14473
14515
  * @param width - 内联框架窗口的宽度
14474
14516
  * @param height - 内联框架窗口的高度
14475
14517
  * @param id - 内联框架窗口 ID,用于关闭内联框架窗口
14518
+ * @param props - 其它参数
14476
14519
  * @returns 操作是否成功
14477
14520
  */
14478
- openIFrame(htmlFileName: string, width?: number, height?: number, id?: string): Promise<boolean>;
14521
+ openIFrame(htmlFileName: string, width?: number, height?: number, id?: string, props?: {
14522
+ /** 是否显示最大化按钮 */
14523
+ maximizeButton?: boolean;
14524
+ /** 是否显示最小化按钮 */
14525
+ minimizeButton?: boolean;
14526
+ /** 按钮点击回调 */
14527
+ buttonCallbackFn?: (button: 'close' | 'minimize' | 'maximize') => void;
14528
+ /** 是否背景置灰 */
14529
+ grayscaleMask?: boolean;
14530
+ }): Promise<boolean>;
14479
14531
  /**
14480
14532
  * 关闭内联框架窗口
14481
14533
  *
14482
14534
  * @beta
14483
14535
  * @remarks
14484
- * 关闭当前扩展打开的所有内联框架窗口;
14536
+ * 关闭指定 ID 的内联框架窗口;
14485
14537
  *
14486
14538
  * 注意:本接口仅扩展有效,在独立脚本环境内调用将始终 `throw Error`
14487
14539
  * @param id - 内联框架窗口 ID,如若传入 `undefined`,将关闭由本扩展打开的所有内联框架窗口
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jlceda/pro-api-types",
3
- "version": "0.1.166",
3
+ "version": "0.1.168",
4
4
  "description": "嘉立创EDA & EasyEDA 专业版扩展 API 接口类型定义",
5
5
  "typings": "index.d.ts",
6
6
  "keywords": [