@jlceda/pro-api-types 0.2.8 → 0.2.11

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 +272 -19
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1,3 +1,7 @@
1
+ import * as react from 'react';
2
+ import react__default from 'react';
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
4
+
1
5
  /**
2
6
  * 文档树项目类型
3
7
  *
@@ -1379,7 +1383,7 @@ declare class DMT_Project {
1379
1383
  * 修改工程友好名称
1380
1384
  *
1381
1385
  * @internal
1382
- * @param projectUuid - 工程 UUID
1386
+ * @param projectUuid - ���程 UUID
1383
1387
  * @param projectFriendlyName - 工程友好名称
1384
1388
  * @returns 是否修改成功
1385
1389
  */
@@ -3360,9 +3364,9 @@ declare class PCB_Document {
3360
3364
  * 本接口在前端画布上定位到指定的区域,区域数据为相对于数据原点的偏移;
3361
3365
  *
3362
3366
  * 例如:传入数据为 `{left: 0, right: 60, top: 100, bottom: -20}` =\> `navigateToRegion(0, 60, 100, -20)`,
3363
- * 则画布将会定位到以 `[30, 40]` 为中心的,`x` 轴方向长度为 `60`,`y` 轴方向长度为 `120` 的矩形范围;
3367
+ * 则画布将会定位到以 `[30, 40]` ���中心的,`x` 轴方向长度为 `60`,`y` 轴方向长度为 `120` 的矩形范围;
3364
3368
  *
3365
- * 本��口不进行缩放操作,但会生成指示定位中心及表示区域范围的矩形框;
3369
+ * 本接口不进行缩放操作,但会生成指示定位中心及表示区域范围的矩形框;
3366
3370
  *
3367
3371
  * 此处的单位为数据层面单位,在跨度上等同于画布层面的 mil
3368
3372
  * @param left - 矩形框第一 X 坐标
@@ -3773,9 +3777,15 @@ declare class PCB_Drc {
3773
3777
  * 获取所有差分对的详细属性
3774
3778
  *
3775
3779
  * @beta
3780
+ * @remarks
3781
+ * BREAKING CHANGE since EDA v3.4
3782
+ *
3783
+ * - 返回值类型更改为对象
3776
3784
  * @returns 所有差分对的详细属性
3777
3785
  */
3778
- getAllDifferentialPairs(): Promise<Array<IPCB_DifferentialPairItem>>;
3786
+ getAllDifferentialPairs(): Promise<Array<IPCB_DifferentialPairItem> | {
3787
+ [key: string]: any;
3788
+ }>;
3779
3789
  /**
3780
3790
  * 创建等长网络组
3781
3791
  *
@@ -4729,7 +4739,7 @@ declare class SYS_FileManager {
4729
4739
  *
4730
4740
  * @beta
4731
4741
  * @remarks
4732
- * 可以���用 {@link SYS_FileSystem.saveFile} 接口将文件导出到本地文件系统
4742
+ * 可以使用 {@link SYS_FileSystem.saveFile} 接口将文件导出到本地文件系统
4733
4743
  *
4734
4744
  * 注意:本接口需要启用 **团队库 \> 下载库** 权限,没有权限调用将始终 `throw Error`
4735
4745
  * @param footprintUuid - 封装 UUID 或封装 UUID 列表
@@ -5098,7 +5108,7 @@ declare class PCB_ManufactureData {
5098
5108
  * @param fileName - 文件名
5099
5109
  * @param unit - 单位
5100
5110
  * @param otherData - 其它
5101
- * @param layers - 导��层,默认则按照嘉立创生产需求导出
5111
+ * @param layers - 导出层,默认则按照嘉立创生产需求导出
5102
5112
  * @param objects - 导出对象,默认则按照嘉立创生产需求导出
5103
5113
  * @returns ODB++ 文件数据
5104
5114
  */
@@ -5489,7 +5499,7 @@ declare class IPCB_ComplexPolygon {
5489
5499
  * 获取复杂多边形数据
5490
5500
  *
5491
5501
  * @public
5492
- * @remarks 强制返回复杂多边形格式数据,即使它仅包含单一的单多边形
5502
+ * @remarks 强制返回复杂多边形格式数据��即使它仅包含单一的单多边形
5493
5503
  * @returns 复杂多边形数据
5494
5504
  */
5495
5505
  getSourceStrictComplex(): Array<TPCB_PolygonSourceArray>;
@@ -6051,7 +6061,7 @@ declare class PCB_PrimitiveLine implements IPCB_PrimitiveAPI {
6051
6061
  *
6052
6062
  * @beta
6053
6063
  * @param primitiveIds - 直线的图元 ID,可以为字符串或字符串数组,如若为数组,则返回的也是数组
6054
- * @returns 直线图元对象,`undefined` 表示获取失败
6064
+ * @returns 直线图元对象,`undefined` 表示获取失���
6055
6065
  */
6056
6066
  get(primitiveIds: string): Promise<IPCB_PrimitiveLine | undefined>;
6057
6067
  /**
@@ -6646,7 +6656,7 @@ declare class IPCB_PrimitiveArc implements IPCB_Primitive {
6646
6656
  */
6647
6657
  isAsync(): boolean;
6648
6658
  /**
6649
- * 将异步图元重置为当前画布状态
6659
+ * 将异��图元重置为当前画布状态
6650
6660
  *
6651
6661
  * @beta
6652
6662
  * @returns 圆弧线图元对象
@@ -6656,7 +6666,7 @@ declare class IPCB_PrimitiveArc implements IPCB_Primitive {
6656
6666
  * 将对图元的更改应用到画布
6657
6667
  *
6658
6668
  * @beta
6659
- * @returns 圆弧线图元对��
6669
+ * @returns 圆弧线图元对象
6660
6670
  */
6661
6671
  done(): Promise<IPCB_PrimitiveArc>;
6662
6672
  /**
@@ -7232,7 +7242,7 @@ declare class IPCB_PrimitiveAttribute implements IPCB_Primitive {
7232
7242
  * 在 PCB 画布中创建图元
7233
7243
  *
7234
7244
  * @internal
7235
- * @remarks 属性图���不支持新建,本接口调用将不会有任何效果
7245
+ * @remarks 属性图元不支持新建,本接口调用将不会有任何效果
7236
7246
  * @returns 属性图元对象
7237
7247
  */
7238
7248
  create(): IPCB_PrimitiveAttribute;
@@ -13926,7 +13936,7 @@ declare class ISCH_PrimitivePin implements ISCH_Primitive {
13926
13936
  *
13927
13937
  * @public
13928
13938
  * @remarks
13929
- * 器件��脚图元是一个特殊的图元,它指的是在原理图画布上关联到符号的引脚
13939
+ * 器件引脚图元是一个特殊的图元,它指的是在原理图画布上关联到符号的引脚
13930
13940
  *
13931
13941
  * 器件引脚图元仅可更改 `pinNumber`、`noConnected` 属性,其它所有属性均为只读,
13932
13942
  * 并且你只能通过 {@link SCH_PrimitiveComponent.getAllPinsByPrimitiveId | 器件类的 getAllPinsByPrimitiveId 方法} 或 {@link ISCH_PrimitiveComponent.getAllPins | 器件图元的 getAllPins 方法} 获取到器件引脚图元
@@ -16572,7 +16582,7 @@ declare enum ESCH_SpiceSimulationEnginePushEventType {
16572
16582
  * 原理图 & 符号 / 仿真引擎类
16573
16583
  *
16574
16584
  * @public
16575
- * @remarks 控制仿真引擎的对接和��互
16585
+ * @remarks 控制仿真引擎的对接和交互
16576
16586
  */
16577
16587
  declare class SCH_SimulationEngine {
16578
16588
  /**
@@ -16643,6 +16653,249 @@ declare class SYS_ClientUrl {
16643
16653
  }, succeedCallFn?: (data: Response) => void | Promise<void>): Promise<Response>;
16644
16654
  }
16645
16655
 
16656
+ type IconProps = {
16657
+ /** 模板名称 */
16658
+ iconClass: string;
16659
+ } | {
16660
+ /** 图标地址 */
16661
+ iconUrl: string;
16662
+ } | {};
16663
+
16664
+ interface ButtonStoreProps {
16665
+ text?: string;
16666
+ disable?: boolean;
16667
+ type?: 'default' | 'primary' | 'danger' | 'forbidden' | 'text';
16668
+ width?: number | 'responsive';
16669
+ icon?: IconProps;
16670
+ }
16671
+ type ButtonStoreEvents = {
16672
+ event: 'click';
16673
+ };
16674
+
16675
+ interface PanelStoreProps {
16676
+ value: string;
16677
+ font?: string;
16678
+ textAlign?: 'left' | 'center' | 'right';
16679
+ }
16680
+ type PanelStoreEvents = {
16681
+ event: 'change';
16682
+ data: boolean;
16683
+ };
16684
+
16685
+ interface ContainerStyleProps {
16686
+ backgroundColor?: string;
16687
+ borderWidth?: number;
16688
+ borderColor?: string;
16689
+ hide?: boolean;
16690
+ }
16691
+
16692
+ interface FlexItemStoreProps extends ContainerStyleProps {
16693
+ flexRatio?: number;
16694
+ width?: number;
16695
+ height?: number;
16696
+ }
16697
+ type FlexItemStoreEvents = {
16698
+ event: 'change';
16699
+ data: boolean;
16700
+ };
16701
+
16702
+ interface FlexStoreProps extends ContainerStyleProps {
16703
+ padding?: number;
16704
+ direction?: 'column' | 'column-reverse' | 'row' | 'row-reverse';
16705
+ justify?: 'start' | 'center' | 'end';
16706
+ align?: 'start' | 'center' | 'end' | 'stretch';
16707
+ gap?: number;
16708
+ }
16709
+ type FlexStoreEvents = {
16710
+ event: 'change';
16711
+ data: boolean;
16712
+ };
16713
+
16714
+ interface ModalStoreProps {
16715
+ defaultTop: number;
16716
+ defaultLeft: number;
16717
+ defaultWidth: number;
16718
+ defaultHeight: number;
16719
+ maxDragX?: number;
16720
+ maxDragY?: number;
16721
+ hide?: boolean;
16722
+ }
16723
+ type ModalStoreEvents = {
16724
+ event: 'moved';
16725
+ top: number;
16726
+ left: number;
16727
+ };
16728
+
16729
+ interface GridSItemtoreProps extends ContainerStyleProps {
16730
+ colSpan?: number;
16731
+ rowSpan?: number;
16732
+ align?: 'start' | 'center' | 'end' | 'stretch';
16733
+ }
16734
+ type CheckBoxStoreEvents$4 = {
16735
+ event: 'resize';
16736
+ };
16737
+
16738
+ interface GridStoreProps extends ContainerStyleProps {
16739
+ columns: number;
16740
+ padding?: number;
16741
+ rowGap?: number;
16742
+ colGap?: number;
16743
+ }
16744
+ type CheckBoxStoreEvents$3 = {
16745
+ event: 'resize';
16746
+ };
16747
+
16748
+ interface InputProps {
16749
+ width?: number;
16750
+ disabled?: boolean;
16751
+ readonly?: boolean;
16752
+ clearBtn?: boolean | 'keepAlive';
16753
+ clickBtn?: Function;
16754
+ dropDownList?: {
16755
+ title: string;
16756
+ clearBtn: boolean;
16757
+ }[];
16758
+ searchBtn?: boolean;
16759
+ value?: string;
16760
+ placeholder?: string;
16761
+ preText?: string;
16762
+ type: 'text' | 'telephone' | 'number' | 'password' | 'color' | 'email';
16763
+ otherAttr?: {
16764
+ [key: string]: string;
16765
+ };
16766
+ testVal?: string;
16767
+ }
16768
+ type CheckBoxStoreEvents$2 = {
16769
+ event: 'change';
16770
+ data: string;
16771
+ };
16772
+
16773
+ interface SingleProps {
16774
+ disabled?: boolean;
16775
+ text: string;
16776
+ value: string;
16777
+ width?: number;
16778
+ }
16779
+ interface RadioStoreProps {
16780
+ group: SingleProps[];
16781
+ selectedValue?: string;
16782
+ onlyChangeByBox?: boolean;
16783
+ lineBreak?: boolean;
16784
+ }
16785
+ type CheckBoxStoreEvents$1 = {
16786
+ event: 'change';
16787
+ data: string;
16788
+ };
16789
+
16790
+ interface TextAreaStoreProps {
16791
+ disabled?: boolean;
16792
+ value?: string;
16793
+ width?: number;
16794
+ height?: number;
16795
+ resizable?: {
16796
+ x?: boolean;
16797
+ y?: boolean;
16798
+ };
16799
+ placeholder?: string;
16800
+ name?: string;
16801
+ }
16802
+ type TextAreaStoreEvents = {
16803
+ event: 'change';
16804
+ data: string;
16805
+ };
16806
+
16807
+ interface CheckBoxStoreProps {
16808
+ checked?: boolean;
16809
+ disabled?: boolean;
16810
+ text?: string;
16811
+ name?: string;
16812
+ onlyChangeByBox?: boolean;
16813
+ }
16814
+ type CheckBoxStoreEvents = {
16815
+ event: 'change';
16816
+ data: boolean;
16817
+ };
16818
+
16819
+ declare function Dialog({ children }: {
16820
+ children?: react__default.ReactElement | react__default.ReactElement[];
16821
+ }): react_jsx_runtime.JSX.Element;
16822
+
16823
+ declare abstract class PortalBase {
16824
+ Provider: (props: any) => react_jsx_runtime.JSX.Element;
16825
+ abstract createComponent(handl: string, type: string, props: any, parent: string): void;
16826
+ abstract updateComponent(handl: string, props: any): void;
16827
+ abstract detachComponent(handl: string): void;
16828
+ abstract bindEvent(handl: string, callback: (ev: any) => void): void;
16829
+ }
16830
+
16831
+ declare const Components: {
16832
+ Dialog: typeof Dialog;
16833
+ CheckBox: (props: CheckBoxStoreProps & {
16834
+ onEvent?: ((ev: CheckBoxStoreEvents) => void) | undefined;
16835
+ children?: react.JSX.Element[] | react.JSX.Element;
16836
+ }) => react.JSX.Element;
16837
+ TextArea: (props: TextAreaStoreProps & {
16838
+ onEvent?: ((ev: TextAreaStoreEvents) => void) | undefined;
16839
+ children?: react.JSX.Element[] | react.JSX.Element;
16840
+ }) => react.JSX.Element;
16841
+ RadioGroup: (props: RadioStoreProps & {
16842
+ onEvent?: ((ev: CheckBoxStoreEvents$1) => void) | undefined;
16843
+ children?: react.JSX.Element[] | react.JSX.Element;
16844
+ }) => react.JSX.Element;
16845
+ Input: (props: InputProps & {
16846
+ onEvent?: ((ev: CheckBoxStoreEvents$2) => void) | undefined;
16847
+ children?: react.JSX.Element[] | react.JSX.Element;
16848
+ }) => react.JSX.Element;
16849
+ Grid: (props: GridStoreProps & {
16850
+ onEvent?: ((ev: CheckBoxStoreEvents$3) => void) | undefined;
16851
+ children?: react.JSX.Element[] | react.JSX.Element;
16852
+ }) => react.JSX.Element;
16853
+ GridItem: (props: GridSItemtoreProps & {
16854
+ onEvent?: ((ev: CheckBoxStoreEvents$4) => void) | undefined;
16855
+ children?: react.JSX.Element[] | react.JSX.Element;
16856
+ }) => react.JSX.Element;
16857
+ Modal: (props: ModalStoreProps & {
16858
+ onEvent?: ((ev: ModalStoreEvents) => void) | undefined;
16859
+ children?: react.JSX.Element[] | react.JSX.Element;
16860
+ }) => react.JSX.Element;
16861
+ Flex: (props: FlexStoreProps & {
16862
+ onEvent?: ((ev: FlexStoreEvents) => void) | undefined;
16863
+ children?: react.JSX.Element[] | react.JSX.Element;
16864
+ }) => react.JSX.Element;
16865
+ FlexItem: (props: FlexItemStoreProps & {
16866
+ onEvent?: ((ev: FlexItemStoreEvents) => void) | undefined;
16867
+ children?: react.JSX.Element[] | react.JSX.Element;
16868
+ }) => react.JSX.Element;
16869
+ Text: (props: PanelStoreProps & {
16870
+ onEvent?: ((ev: PanelStoreEvents) => void) | undefined;
16871
+ children?: react.JSX.Element[] | react.JSX.Element;
16872
+ }) => react.JSX.Element;
16873
+ Button: (props: ButtonStoreProps & {
16874
+ onEvent?: ((ev: ButtonStoreEvents) => void) | undefined;
16875
+ children?: react.JSX.Element[] | react.JSX.Element;
16876
+ }) => react.JSX.Element;
16877
+ };
16878
+ type Components = typeof Components;
16879
+
16880
+ /**
16881
+ * WorkerPortal 类,用于在 pro-api 中与 EditorDesignPortal 通信
16882
+ */
16883
+ declare class WorkerPortal extends PortalBase {
16884
+ private readonly portal;
16885
+ private readonly compIndex;
16886
+ constructor(container: HTMLElement);
16887
+ createComponent(handle: string, type: string, props: any, parent: string): void;
16888
+ updateComponent(handle: string, props: any): void;
16889
+ detachComponent(handle: string): void;
16890
+ bindEvent(handle: string, callback: (ev: any) => void): void;
16891
+ }
16892
+ /**
16893
+ * 预制组件节点类型
16894
+ *
16895
+ * @remarks 只能使用 Components 内的预制组件
16896
+ */
16897
+ type TComponentsNode = react__default.ReactElement<any, Components[keyof Components]> | Array<TComponentsNode> | null | undefined | boolean | string | number;
16898
+
16646
16899
  /**
16647
16900
  * React 组件化弹出窗口接口
16648
16901
  *
@@ -16650,15 +16903,15 @@ declare class SYS_ClientUrl {
16650
16903
  */
16651
16904
  interface ISYS_ReactComponentizationDialogInterface {
16652
16905
  /** 预制组件 */
16653
- Components: any;
16906
+ Components: Components;
16654
16907
  /** Portal 实例 */
16655
- portal: any;
16908
+ portal: WorkerPortal;
16656
16909
  /**
16657
16910
  * 渲染 React 组件
16658
16911
  *
16659
- * @param node - React 节点
16912
+ * @param node - Components 内的预制组件
16660
16913
  */
16661
- render: (node: any) => void;
16914
+ render: (node: TComponentsNode) => void;
16662
16915
  }
16663
16916
  /**
16664
16917
  * 系统 / 对话框类
@@ -17002,7 +17255,7 @@ declare class SYS_FileSystem {
17002
17255
  * @remarks
17003
17256
  * 注意 1:本接口仅客户端有效,在浏览器环境内调用将始终 `throw Error`
17004
17257
  *
17005
- * 注意 2:本接口需要使用者启用扩展的外部交互权限,如若未���用将始终 `throw Error`
17258
+ * 注意 2:本接口需要使用者启用扩展的外部交互权限,如若未启用将始终 `throw Error`
17006
17259
  * @param uri - 文件资源定位符
17007
17260
  *
17008
17261
  * 如若结尾为斜杠 `/`(Windows 为反斜杠 `\`),则识别为文件夹;
@@ -18319,7 +18572,7 @@ declare class SYS_ShortcutKey {
18319
18572
  * 注册快捷键
18320
18573
  *
18321
18574
  * @beta
18322
- * @param shortcutKey - 快捷键,数组中包含多个元素则解析为组合快捷键,将按规则排序后存入缓存
18575
+ * @param shortcutKey - 快捷键,数组中包含多个元素则���析为组合快捷键,将按规则排序后存入缓存
18323
18576
  * @param title - 快捷键标题,快捷键的友好名称
18324
18577
  * @param callbackFn - 回调函数
18325
18578
  * @returns 注册操作是否成功
package/package.json CHANGED
@@ -1 +1 @@
1
- { "name": "@jlceda/pro-api-types", "type": "module", "version": "0.2.8", "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" } }
1
+ { "name": "@jlceda/pro-api-types", "type": "module", "version": "0.2.11", "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" } }