@jlceda/pro-api-types 0.2.25 → 0.2.27

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 +706 -43
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -383,6 +383,8 @@ declare global {
383
383
  type: ELIB_SymbolType;
384
384
  /** 描述 */
385
385
  description?: string;
386
+ /** 子部件名称数组 */
387
+ subPartNames: [];
386
388
  }
387
389
  /**
388
390
  * 搜索到的符号属性
@@ -515,6 +517,7 @@ declare global {
515
517
  getRenderImage(source: {
516
518
  symbolUuid: string;
517
519
  libraryUuid: string;
520
+ subPartName?: string;
518
521
  }): Promise<Blob | undefined>;
519
522
  }
520
523
 
@@ -957,7 +960,7 @@ declare global {
957
960
  * @beta
958
961
  * @param libraryUuid - 库 UUID,可以使用 {@link LIB_LibrariesList} 内的接口获取
959
962
  * @param libraryType - 库类型,支持符号和封装
960
- * @param uuid - 符号、封装 UUID
963
+ * @param uuid - 符号、��装 UUID
961
964
  * @param splitScreenId - 分屏 ID,即 {@link DMT_EditorControl.getSplitScreenTree} 方法获取到的 {@link IDMT_EditorSplitScreenItem.id}
962
965
  * @returns 标签页 ID,如若为 `undefined`,则打开文档失败
963
966
  */
@@ -1390,7 +1393,7 @@ declare global {
1390
1393
  * @param projectFriendlyName - 工程友好名称
1391
1394
  * @param projectName - 工程名称,不可重复,仅支持字母 `a-zA-Z`、数字 `0-9`、中划线 `-`,如若不指定,则根据工程友好名称自动生成
1392
1395
  * @param teamUuid - 团队 UUID,如若不指定,则默认为个人;在不存在个人工程的环境下必须指定团队 UUID
1393
- * @param folderUuid - 文件夹 UUID,如若不指定,则为根文��夹
1396
+ * @param folderUuid - 文件夹 UUID,如若不指定,则为根文件夹
1394
1397
  * @param description - 工程描述
1395
1398
  * @param collaborationMode - 工程协作模式,如若团队权限无需工程设置协作模式,则该参数将被忽略
1396
1399
  * @returns 工程 UUID,如若为 `undefined` 则创建失败
@@ -1879,7 +1882,7 @@ declare global {
1879
1882
  * @beta
1880
1883
  * @remarks 如希望清除某些属性,则将其的值设置为 `null`
1881
1884
  * @param cbbUuid - 复用模块 UUID
1882
- * @param libraryUuid - 库 UUID,可以使用 {@link LIB_LibrariesList} 内的接口��取
1885
+ * @param libraryUuid - 库 UUID,可以使用 {@link LIB_LibrariesList} 内的接口获取
1883
1886
  * @param cbbName - 复用模块名称
1884
1887
  * @param classification - 分类
1885
1888
  * @param description - 描述
@@ -2012,7 +2015,7 @@ declare global {
2012
2015
  supplier?: string;
2013
2016
  /** 供应商编号 */
2014
2017
  supplierId?: string;
2015
- /** 其它参数 */
2018
+ /** 其它属性 */
2016
2019
  otherProperty?: {
2017
2020
  [key: string]: boolean | number | string | undefined;
2018
2021
  };
@@ -2039,6 +2042,8 @@ declare global {
2039
2042
  description?: string;
2040
2043
  /** 扩展属性 */
2041
2044
  property: ILIB_DeviceExtendPropertyItem;
2045
+ /** 子部件名称数组 */
2046
+ subPartNames: [];
2042
2047
  }
2043
2048
  /**
2044
2049
  * 搜索到的器件属性
@@ -2168,7 +2173,7 @@ declare global {
2168
2173
  * @deprecated 在 `otherProperty` 中替代
2169
2174
  */
2170
2175
  jlcLibraryCategory?: ELIB_DeviceJlcLibraryCategory;
2171
- /** 其它参数 */
2176
+ /** 其它属性 */
2172
2177
  otherProperty?: {
2173
2178
  [key: string]: boolean | number | string | undefined;
2174
2179
  };
@@ -2213,7 +2218,7 @@ declare global {
2213
2218
  * @param classification - 分类
2214
2219
  * @param association - 关联符号、封装、图像,指定 `symbolType` 则创建新符号,无需新建符号则无需指定 `symbolType`,但请注意,如若不新建符号也不指定符号的关联信息将无法创建器件
2215
2220
  * @param description - 描述
2216
- * @param property - 其它参数,仅 `designator`、`addIntoBom`、`addIntoPcb` 存在默认值
2221
+ * @param property - 其它属性,仅 `designator`、`addIntoBom`、`addIntoPcb` 存在默认值
2217
2222
  * @returns 器件 UUID
2218
2223
  */
2219
2224
  create(libraryUuid: string, deviceName: string, classification?: ILIB_ClassificationIndex | Array<string>, association?: {
@@ -2254,7 +2259,7 @@ declare global {
2254
2259
  * @param classification - 分类
2255
2260
  * @param association - 关联符号、封装、图像
2256
2261
  * @param description - 描述
2257
- * @param property - 其它参数
2262
+ * @param property - 其它属性
2258
2263
  * @returns 操作是否成功
2259
2264
  */
2260
2265
  modify(deviceUuid: string, libraryUuid: string, deviceName?: string, classification?: ILIB_ClassificationIndex | Array<string> | null, association?: {
@@ -2326,7 +2331,7 @@ declare global {
2326
2331
  *
2327
2332
  * @alpha
2328
2333
  * @remarks
2329
- * 注意:本接口仅客户端有效,在浏览器环境内调用将始终 `throw Error`
2334
+ * 注意:本接口仅全离线客户端有效,在浏览器环境内调用将始终 `throw Error`
2330
2335
  * @param properties - 属性
2331
2336
  * @param libraryUuid - 库 UUID,默认为系统库,可以使用 {@link LIB_LibrariesList} 内的接口获取
2332
2337
  * @param classification - 分类,默认为全部
@@ -2878,7 +2883,7 @@ declare global {
2878
2883
  * 获取工程库的 UUID
2879
2884
  *
2880
2885
  * @public
2881
- * @remarks 在未打开工程的情况下调用将返�� `undefined`
2886
+ * @remarks 在未打开工程的情况下调用将返回 `undefined`
2882
2887
  * @returns 工程库的 UUID
2883
2888
  */
2884
2889
  getProjectLibraryUuid(): Promise<string | undefined>;
@@ -3356,7 +3361,7 @@ declare global {
3356
3361
  * 即 `setCanvasOrigin(0, 0)`;
3357
3362
  *
3358
3363
  * 此处的单位为数据层面单位,在跨度上等同于画布层面的 mil
3359
- * @param offsetX - 画布原点相对于数据原点的 X 坐标偏移
3364
+ * @param offsetX - 画布原点相���于数据原点的 X 坐标偏移
3360
3365
  * @param offsetY - 画布原点相对于数据原点的 Y 坐标偏移
3361
3366
  * @returns 操作是否成功
3362
3367
  */
@@ -4938,6 +4943,36 @@ declare global {
4938
4943
  * @param layers - 导出层,默认则按照嘉立创生产需求导出
4939
4944
  * @param objects - 导出对象,默认则按照嘉立创生产需求导出
4940
4945
  * @returns PCB 制版文件数据
4946
+ * @example
4947
+ * ```javascript
4948
+ * // 导出默认的 Gerber 文件
4949
+ * const gerberFile = await eda.pcb_ManufactureData.getGerberFile('MyBoard_Gerber');
4950
+ * if (gerberFile) {
4951
+ * console.log('Gerber 文件已生成:', gerberFile);
4952
+ * }
4953
+ *
4954
+ * // 导出并保存到本地
4955
+ * const gerberFile = await eda.pcb_ManufactureData.getGerberFile(
4956
+ * 'MyBoard_Gerber',
4957
+ * false,
4958
+ * ESYS_Unit.MILLIMETER,
4959
+ * { integerNumber: 2, decimalNumber: 6 }
4960
+ * );
4961
+ * if (gerberFile) {
4962
+ * await eda.sys_FileSystem.saveFile(gerberFile,'Gerber.zip');
4963
+ * }
4964
+ *
4965
+ * // 自定义导出层和对象
4966
+ * const gerberFile = await eda.pcb_ManufactureData.getGerberFile(
4967
+ * 'Custom_Gerber',
4968
+ * false,
4969
+ * ESYS_Unit.INCH,
4970
+ * { integerNumber: 3, decimalNumber: 5 },
4971
+ * { metallicDrillingInformation: true, nonMetallicDrillingInformation: true, drillTable: false, flyingProbeTestingFile: false },
4972
+ * [{ layerId: 1, isMirror: false }, { layerId: 2, isMirror: false }, { layerId: 11, isMirror: false }],
4973
+ * ['Pad', 'Via', 'Track', 'BoardOutline']
4974
+ * );
4975
+ * ```
4941
4976
  */
4942
4977
  getGerberFile(fileName?: string, colorSilkscreen?: boolean, unit?: ESYS_Unit.MILLIMETER | ESYS_Unit.INCH, digitalFormat?: {
4943
4978
  integerNumber: number;
@@ -4963,8 +4998,40 @@ declare global {
4963
4998
  * @param fileType - 文件类型
4964
4999
  * @param element - 导出对象
4965
5000
  * @param modelMode - 导出模式,`Outfit` = 装配体,`Parts` = 零件
4966
- * @param autoGenerateModels - 是否为未绑定 3D 模型的元件自动生成 3D 模型(根据元件的“高度”属性)
5001
+ * @param autoGenerateModels - 是否为未绑定 3D 模型的元件自动生成 3D 模型(根据元件的"高度"属性)
4967
5002
  * @returns 3D 模型文件数据
5003
+ * @example
5004
+ * ```javascript
5005
+ * // 导出装配体模式的 STEP 文件(包含元件模型)
5006
+ * const stepFile = await eda.pcb_ManufactureData.get3DFile(
5007
+ * 'MyBoard_3D',
5008
+ * 'step',
5009
+ * ['Component Model'],
5010
+ * 'Outfit',
5011
+ * true
5012
+ * );
5013
+ * if (stepFile) {
5014
+ * await eda.sys_FileSystem.saveFile(stepFile);
5015
+ * }
5016
+ *
5017
+ * // 导出包含多种对象的完整 3D 模型
5018
+ * const full3DFile = await eda.pcb_ManufactureData.get3DFile(
5019
+ * 'Complete_3D_Model',
5020
+ * 'step',
5021
+ * ['Component Model', 'Via', 'Silkscreen', 'Wire In Signal Layer'],
5022
+ * 'Outfit',
5023
+ * true
5024
+ * );
5025
+ *
5026
+ * // 导出零件模式 OBJ 文件
5027
+ * const objFile = await eda.pcb_ManufactureData.get3DFile(
5028
+ * 'MyBoard_OBJ',
5029
+ * 'obj',
5030
+ * ['Component Model'],
5031
+ * 'Parts',
5032
+ * false
5033
+ * );
5034
+ * ```
4968
5035
  */
4969
5036
  get3DFile(fileName?: string, fileType?: 'step' | 'obj', element?: Array<'Component Model' | 'Via' | 'Silkscreen' | 'Wire In Signal Layer'>, modelMode?: 'Outfit' | 'Parts', autoGenerateModels?: boolean): Promise<File | undefined>;
4970
5037
  /**
@@ -4975,6 +5042,20 @@ declare global {
4975
5042
  * @param fileName - 文件名
4976
5043
  * @param fileType - 文件类型
4977
5044
  * @returns 3D 外壳文件数据
5045
+ * @example
5046
+ * ```javascript
5047
+ * // 导出 STL 格式 3D 外壳
5048
+ * const stlFile = await eda.pcb_ManufactureData.get3DShellFile('Board_Shell', 'stl');
5049
+ * if (stlFile) {
5050
+ * await eda.sys_FileSystem.saveFile(stlFile);
5051
+ * }
5052
+ *
5053
+ * // 导出 STEP 格式 3D 外壳
5054
+ * const stepShellFile = await eda.pcb_ManufactureData.get3DShellFile('Board_Shell_STEP', 'step');
5055
+ * if (stepShellFile) {
5056
+ * await eda.sys_FileSystem.saveFile(stepShellFile);
5057
+ * }
5058
+ * ```
4978
5059
  */
4979
5060
  get3DShellFile(fileName?: string, fileType?: 'stl' | 'step' | 'obj'): Promise<File | undefined>;
4980
5061
  /**
@@ -4986,6 +5067,19 @@ declare global {
4986
5067
  * @param fileType - 文件类型
4987
5068
  * @param unit - 单位
4988
5069
  * @returns 坐标文件数据
5070
+ * @example
5071
+ * ```javascript
5072
+ * // 导出毫米单位的 Excel 格式坐标文件
5073
+ * const pnpFile = await eda.pcb_ManufactureData.getPickAndPlaceFile(
5074
+ * 'PickAndPlace',
5075
+ * 'xlsx',
5076
+ * ESYS_Unit.MILLIMETER
5077
+ * );
5078
+ * if (pnpFile) {
5079
+ * await eda.sys_FileSystem.saveFile(pnpFile);
5080
+ * }
5081
+ *
5082
+ * ```
4989
5083
  */
4990
5084
  getPickAndPlaceFile(fileName?: string, fileType?: 'xlsx' | 'csv', unit?: ESYS_Unit.MILLIMETER | ESYS_Unit.MIL): Promise<File | undefined>;
4991
5085
  /**
@@ -4994,6 +5088,14 @@ declare global {
4994
5088
  * @beta
4995
5089
  * @param fileName - 文件名
4996
5090
  * @returns 飞针测试文件数据
5091
+ * @example
5092
+ * ```javascript
5093
+ * // 保存飞针测试文件到本地
5094
+ * const flyingProbeFile = await eda.pcb_ManufactureData.getFlyingProbeTestFile('FlyingProbe_Test');
5095
+ * if (flyingProbeFile) {
5096
+ * await eda.sys_FileSystem.saveFile(flyingProbeFile);
5097
+ * }
5098
+ * ```
4997
5099
  */
4998
5100
  getFlyingProbeTestFile(fileName?: string): Promise<File | undefined>;
4999
5101
  /**
@@ -5001,6 +5103,15 @@ declare global {
5001
5103
  *
5002
5104
  * @beta
5003
5105
  * @returns BOM 模板列表
5106
+ * @example
5107
+ * ```javascript
5108
+ * // 获取所有可用的 BOM 模板
5109
+ * const templates = await eda.pcb_ManufactureData.getBomTemplates();
5110
+ * console.log('可用的 BOM 模板:', templates);
5111
+ * templates.forEach((template, index) => {
5112
+ * console.log(`${index + 1}. ${template}`);
5113
+ * });
5114
+ * ```
5004
5115
  */
5005
5116
  getBomTemplates(): Promise<Array<string>>;
5006
5117
  /**
@@ -5010,6 +5121,20 @@ declare global {
5010
5121
  * @param templateFile - BOM 模板文件
5011
5122
  * @param template - BOM 模板名称,如若为 `undefined` 则自动从 `templateFile` 中取值
5012
5123
  * @returns BOM 模板名称
5124
+ * @example
5125
+ * ```javascript
5126
+ * // 从文件选择器读取模板文件
5127
+ * const templateFile = await eda.sys_FileSystem.openReadFileDialog('.xlsx');
5128
+ * if (templateFile) {
5129
+ * const templateName = await eda.pcb_ManufactureData.uploadBomTemplateFile(
5130
+ * templateFile,
5131
+ * 'MyCustomTemplate'
5132
+ * );
5133
+ * if (templateName) {
5134
+ * console.log('模板上传成功:', templateName);
5135
+ * }
5136
+ * }
5137
+ * ```
5013
5138
  */
5014
5139
  uploadBomTemplateFile(templateFile: File, template?: string): Promise<string | undefined>;
5015
5140
  /**
@@ -5018,6 +5143,14 @@ declare global {
5018
5143
  * @beta
5019
5144
  * @param template - BOM 模板名称
5020
5145
  * @returns BOM 模板文件
5146
+ * @example
5147
+ * ```javascript
5148
+ * // 获取指定模板的文件
5149
+ * const templateFile = await eda.pcb_ManufactureData.getBomTemplateFile('MyCustomTemplate');
5150
+ * if (templateFile) {
5151
+ * await eda.sys_FileSystem.saveFile(templateFile);
5152
+ * }
5153
+ * ```
5021
5154
  */
5022
5155
  getBomTemplateFile(template: string): Promise<File | undefined>;
5023
5156
  /**
@@ -5026,6 +5159,16 @@ declare global {
5026
5159
  * @beta
5027
5160
  * @param template - BOM 模板名称
5028
5161
  * @returns 操作是否成功
5162
+ * @example
5163
+ * ```javascript
5164
+ * // 删除指定的 BOM 模板
5165
+ * const success = await eda.pcb_ManufactureData.deleteBomTemplate('MyCustomTemplate');
5166
+ * if (success) {
5167
+ * console.log('BOM 模板删除成功');
5168
+ * } else {
5169
+ * console.log('删除失败,可能是默认模板或模板不存在');
5170
+ * }
5171
+ * ```
5029
5172
  */
5030
5173
  deleteBomTemplate(template: string): Promise<boolean>;
5031
5174
  /**
@@ -5041,6 +5184,41 @@ declare global {
5041
5184
  * @param property - 属性,包含所有需要启用的属性的名称
5042
5185
  * @param columns - 列的属性及排序,`title`、`sort`、`group`、`orderWeight` 不传入则取默认值,`null` 代表 **无** 或 **空**
5043
5186
  * @returns BOM 文件数据
5187
+ * @example
5188
+ * ```javascript
5189
+ * // 使用默认配置导出 BOM
5190
+ * const bomFile = await eda.pcb_ManufactureData.getBomFile('MyBOM', 'xlsx');
5191
+ * if (bomFile) {
5192
+ * await eda.sys_FileSystem.saveFile(bomFile);
5193
+ * }
5194
+ *
5195
+ * // 自定义 BOM 过滤和列配置
5196
+ * const bomFile = await eda.pcb_ManufactureData.getBomFile(
5197
+ * 'Custom_Production_BOM',
5198
+ * 'xlsx',
5199
+ * undefined,
5200
+ * [
5201
+ * { property: 'Add into BOM', includeValue: 'yes' },
5202
+ * { property: 'Convert to PCB', includeValue: 'yes' }
5203
+ * ],
5204
+ * ['No.', 'Quantity', 'Comment'],
5205
+ * ['Name', 'Device', 'Designator', 'Supplier'],
5206
+ * [
5207
+ * { property: 'Designator', title: '位号', sort: 'asc', group: 'No', orderWeight: 10 },
5208
+ * { property: 'Quantity', title: '数量', sort: 'desc', group: 'Yes', orderWeight: 9 }
5209
+ * ]
5210
+ * );
5211
+ *
5212
+ * // 导出 CSV 格式 BOM
5213
+ * const csvBomFile = await eda.pcb_ManufactureData.getBomFile(
5214
+ * 'Simple_BOM',
5215
+ * 'csv',
5216
+ * undefined,
5217
+ * [{ property: 'Add into BOM', includeValue: 'yes' }],
5218
+ * ['No.', 'Quantity'],
5219
+ * ['Designator', 'Footprint', 'Value']
5220
+ * );
5221
+ * ```
5044
5222
  */
5045
5223
  getBomFile(fileName?: string, fileType?: 'xlsx' | 'csv', template?: string, filterOptions?: Array<{
5046
5224
  property: string;
@@ -5054,6 +5232,14 @@ declare global {
5054
5232
  * @param fileName - 文件名
5055
5233
  * @param fileType - 文件类型
5056
5234
  * @returns 测试点报告文件数据
5235
+ * @example
5236
+ * ```javascript
5237
+ * // 保存测试点报告文件到本地
5238
+ * const testPointFile = await eda.pcb_ManufactureData.getTestPointFile('Test_Point_Report', 'xlsx');
5239
+ * if (testPointFile) {
5240
+ * await eda.sys_FileSystem.saveFile(testPointFile);
5241
+ * }
5242
+ * ```
5057
5243
  */
5058
5244
  getTestPointFile(fileName?: string, fileType?: 'xlsx' | 'csv'): Promise<File | undefined>;
5059
5245
  /**
@@ -5064,6 +5250,29 @@ declare global {
5064
5250
  * @param fileName - 文件名
5065
5251
  * @param netlistType - 网表类型
5066
5252
  * @returns 网表文件数据
5253
+ * @example
5254
+ * ```javascript
5255
+ * // 导出嘉立创 EDA 专业版格式网表
5256
+ * const netlistFile = await eda.pcb_ManufactureData.getNetlistFile(
5257
+ * 'MyNetlist',
5258
+ * ESYS_NetlistType.JLCEDA_PRO
5259
+ * );
5260
+ * if (netlistFile) {
5261
+ * await eda.sys_FileSystem.saveFile(netlistFile);
5262
+ * }
5263
+ *
5264
+ * // 导出 Altium Designer 格式
5265
+ * const altiumNetlist = await eda.pcb_ManufactureData.getNetlistFile(
5266
+ * 'Netlist_Altium',
5267
+ * ESYS_NetlistType.ALTIUM_DESIGNER
5268
+ * );
5269
+ *
5270
+ * // 导出 PADS 格式
5271
+ * const padsNetlist = await eda.pcb_ManufactureData.getNetlistFile(
5272
+ * 'Netlist_PADS',
5273
+ * ESYS_NetlistType.PADS
5274
+ * );
5275
+ * ```
5067
5276
  */
5068
5277
  getNetlistFile(fileName?: string, netlistType?: ESYS_NetlistType): Promise<File | undefined>;
5069
5278
  /**
@@ -5093,6 +5302,17 @@ declare global {
5093
5302
  * @param contentConfig - 内容配置
5094
5303
  * @param watermark - 水印
5095
5304
  * @returns PDF 文件数据(或压缩包)
5305
+ * @example
5306
+ * ```javascript
5307
+ * // 导出多页 PDF(包含所有图层)
5308
+ * const pdfFile = await eda.pcb_ManufactureData.getPdfFile(
5309
+ * 'PCB_Documentation',
5310
+ * EPCB_PdfOutputMethod.MULTI_PAGE_PDF
5311
+ * );
5312
+ * if (pdfFile) {
5313
+ * await eda.sys_FileSystem.saveFile(pdfFile);
5314
+ * }
5315
+ * ```
5096
5316
  */
5097
5317
  getPdfFile(fileName?: string, outputMethod?: EPCB_PdfOutputMethod, contentConfig?: {
5098
5318
  displayAttributesAsMenu: boolean;
@@ -5121,6 +5341,13 @@ declare global {
5121
5341
  * @remarks 可以使用 {@link SYS_FileSystem.saveFile} 接口将文件导出到本地文件系统
5122
5342
  * @param fileName - 文件名
5123
5343
  * @returns IPC-D-356A 文件数据
5344
+ * @example
5345
+ * ```javascript
5346
+ * const ipcFile = await eda.pcb_ManufactureData.getIpcD356AFile('IPC_D356A_Test');
5347
+ * if (ipcFile) {
5348
+ * await eda.sys_FileSystem.saveFile(ipcFile);
5349
+ * }
5350
+ * ```
5124
5351
  */
5125
5352
  getIpcD356AFile(fileName?: string): Promise<File | undefined>;
5126
5353
  /**
@@ -5143,6 +5370,23 @@ declare global {
5143
5370
  * @param layers - 导出层,默认则按照嘉立创生产需求导出
5144
5371
  * @param objects - 导出对象,默认则按照嘉立创生产需求导出
5145
5372
  * @returns ODB++ 文件数据
5373
+ * @example
5374
+ * ```javascript
5375
+ * // 导出 ODB++ 文件,自定义单位和选项
5376
+ * const odbFile = await eda.pcb_ManufactureData.getOpenDatabaseDoublePlusFile(
5377
+ * 'MyBoard_ODB',
5378
+ * ESYS_Unit.INCH,
5379
+ * {
5380
+ * metallizedDrilledHoles: true,
5381
+ * nonMetallizedDrilledHoles: true,
5382
+ * drillTable: true,
5383
+ * flyingProbeTestFile: false
5384
+ * }
5385
+ * );
5386
+ * if (odbFile) {
5387
+ * await eda.sys_FileSystem.saveFile(odbFile);
5388
+ * }
5389
+ * ```
5146
5390
  */
5147
5391
  getOpenDatabaseDoublePlusFile(fileName?: string, unit?: ESYS_Unit.INCH, otherData?: {
5148
5392
  metallizedDrilledHoles?: boolean;
@@ -5171,6 +5415,13 @@ declare global {
5171
5415
  * @remarks 可以使用 {@link SYS_FileSystem.saveFile} 接口将文件导出到本地文件系统
5172
5416
  * @param fileName - 文件名
5173
5417
  * @returns 自动布线 DSN 文件数据
5418
+ * @example
5419
+ * ```javascript
5420
+ * const dsnFile = await eda.pcb_ManufactureData.getDsnFile('AutoRoute_DSN');
5421
+ * if (dsnFile) {
5422
+ * await eda.sys_FileSystem.saveFile(dsnFile);
5423
+ * }
5424
+ * ```
5174
5425
  */
5175
5426
  getDsnFile(fileName?: string): Promise<File | undefined>;
5176
5427
  /**
@@ -5180,8 +5431,24 @@ declare global {
5180
5431
  * @remarks 可以使用 {@link SYS_FileSystem.saveFile} 接口将文件导出到本地文件系统
5181
5432
  * @param fileName - 文件名
5182
5433
  * @returns 自动布线 JSON 文件数据
5434
+ * @example
5435
+ * ```javascript
5436
+ * const autoRouteJson = await eda.pcb_ManufactureData.getAutoRouteJsonFile('AutoRoute_Json');
5437
+ * if (autoRouteJson) {
5438
+ * await eda.sys_FileSystem.saveFile(autoRouteJson);
5439
+ * }
5440
+ * ```
5183
5441
  */
5184
5442
  getAutoRouteJsonFile(fileName?: string): Promise<File | undefined>;
5443
+ /**
5444
+ * 获取 JRouter 专用自动布线文件(JSON)
5445
+ *
5446
+ * @beta
5447
+ * @remarks 可以使用 {@link SYS_FileSystem.saveFile} 接口将文件导出到本地文件系统
5448
+ * @param fileName - 文件名
5449
+ * @returns 自动布线 JSON 文件数据
5450
+ */
5451
+ getAutoRouteJsonFileForJRouter(fileName?: string): Promise<File | undefined>;
5185
5452
  /**
5186
5453
  * 获取自动布局文件(JSON)
5187
5454
  *
@@ -5189,6 +5456,13 @@ declare global {
5189
5456
  * @remarks 可以使用 {@link SYS_FileSystem.saveFile} 接口将文件导出到本地文件系统
5190
5457
  * @param fileName - 文件名
5191
5458
  * @returns 自动布局 JSON 文件数据
5459
+ * @example
5460
+ * ```javascript
5461
+ * const autoLayoutJson = await eda.pcb_ManufactureData.getAutoLayoutJsonFile('AutoLayout_Json');
5462
+ * if (autoLayoutJson) {
5463
+ * await eda.sys_FileSystem.saveFile(autoLayoutJson);
5464
+ * }
5465
+ * ```
5192
5466
  */
5193
5467
  getAutoLayoutJsonFile(fileName?: string): Promise<File | undefined>;
5194
5468
  /**
@@ -5198,6 +5472,14 @@ declare global {
5198
5472
  * @remarks 可以使用 {@link SYS_FileSystem.saveFile} 接口将文件导出到本地文件系统
5199
5473
  * @param fileName - 文件名
5200
5474
  * @returns Altium Designer 文件数据
5475
+ * @example
5476
+ * ```javascript
5477
+ * //获取 Altium Designer 格式文件
5478
+ * const adFile = await eda.pcb_ManufactureData.getAltiumDesignerFile('Converted_To_AD');
5479
+ * if (adFile) {
5480
+ * await eda.sys_FileSystem.saveFile(adFile);
5481
+ * }
5482
+ * ```
5201
5483
  */
5202
5484
  getAltiumDesignerFile(fileName?: string): Promise<File | undefined>;
5203
5485
  /**
@@ -5207,6 +5489,14 @@ declare global {
5207
5489
  * @remarks 可以使用 {@link SYS_FileSystem.saveFile} 接口将文件导出到本地文件系统
5208
5490
  * @param fileName - 文件名
5209
5491
  * @returns PADS 文件数据
5492
+ * @example
5493
+ * ```javascript
5494
+ * // 获取 PADS 格式文件
5495
+ * const padsFile = await eda.pcb_ManufactureData.getPadsFile('Converted_To_PADS');
5496
+ * if (padsFile) {
5497
+ * await eda.sys_FileSystem.saveFile(padsFile);
5498
+ * }
5499
+ * ```
5210
5500
  */
5211
5501
  getPadsFile(fileName?: string): Promise<File | undefined>;
5212
5502
  /**
@@ -5216,6 +5506,13 @@ declare global {
5216
5506
  * @remarks 可以使用 {@link SYS_FileSystem.saveFile} 接口将文件导出到本地文件系统
5217
5507
  * @param fileName - 文件名
5218
5508
  * @returns PCB 信息文件
5509
+ * @example
5510
+ * ```javascript
5511
+ * const pcbInfoFile = await eda.pcb_ManufactureData.getPcbInfoFile('Board_Information');
5512
+ * if (pcbInfoFile) {
5513
+ * await eda.sys_FileSystem.saveFile(pcbInfoFile);
5514
+ * }
5515
+ * ```
5219
5516
  */
5220
5517
  getPcbInfoFile(fileName?: string): Promise<File | undefined>;
5221
5518
  /**
@@ -5224,6 +5521,13 @@ declare global {
5224
5521
  * @beta
5225
5522
  * @remarks 可以使用 {@link SYS_FileSystem.saveFile} 接口将文件导出到本地文件系统
5226
5523
  * @returns IDX 文件
5524
+ * @example
5525
+ * ```javascript
5526
+ * const idxFile = await eda.pcb_ManufactureData.getIdxFile('Design_Exchange');
5527
+ * if (idxFile) {
5528
+ * await eda.sys_FileSystem.saveFile(idxFile);
5529
+ * }
5530
+ * ```
5227
5531
  */
5228
5532
  getIdxFile(fileName?: string): Promise<File | undefined>;
5229
5533
  /**
@@ -5685,7 +5989,7 @@ declare global {
5685
5989
  */
5686
5990
  unhighlightNet(net: string): Promise<boolean>;
5687
5991
  /**
5688
- * 取消高亮所有网络
5992
+ * 取消高亮��有网络
5689
5993
  *
5690
5994
  * @beta
5691
5995
  * @returns 操作是否成功
@@ -6821,7 +7125,7 @@ declare global {
6821
7125
  * 获取文本
6822
7126
  *
6823
7127
  * @alpha
6824
- * @remarks 如若传入多个图元 ID,任意图元 ID 未匹配到不影响其它图元的返回,即可能返回少于传入的图元 ID 数量的图元对象
7128
+ * @remarks 如若传入多个图元 ID,任意图元 ID 未匹配到不影响其它图元的返回,即可能返回少于传入的图元 ID 数量的��元对象
6825
7129
  * @param primitiveIds - 文本的图元 ID,可以为字符串或字符串数组,如若为数组,则返回的也是数组
6826
7130
  * @returns 文本图元对象,空数组表示获取失败
6827
7131
  */
@@ -7815,7 +8119,7 @@ declare global {
7815
8119
  * 删除区域
7816
8120
  *
7817
8121
  * @beta
7818
- * @param primitiveIds - 区域的���元 ID 或区域图元对象
8122
+ * @param primitiveIds - 区域的图元 ID 或区域图元对象
7819
8123
  * @returns 删除操作是否成功
7820
8124
  */
7821
8125
  delete(primitiveIds: string | IPCB_PrimitiveRegion | Array<string> | Array<IPCB_PrimitiveRegion>): Promise<boolean>;
@@ -8578,7 +8882,7 @@ declare global {
8578
8882
  */
8579
8883
  getState_Polygon(): IPCB_Polygon;
8580
8884
  /**
8581
- * 获取属性状态:线宽
8885
+ * ��取属性状态:线宽
8582
8886
  *
8583
8887
  * @public
8584
8888
  * @returns 线宽
@@ -9721,7 +10025,11 @@ declare global {
9721
10025
  create(component: {
9722
10026
  libraryUuid: string;
9723
10027
  uuid: string;
9724
- } | ILIB_DeviceItem, layer: TPCB_LayersOfComponent, x: number, y: number, rotation?: number, primitiveLock?: boolean): Promise<IPCB_PrimitiveComponent | undefined>;
10028
+ } | ILIB_DeviceItem | ILIB_DeviceSearchItem | {
10029
+ libraryType: ELIB_LibraryType.FOOTPRINT;
10030
+ libraryUuid: string;
10031
+ uuid: string;
10032
+ } | ILIB_FootprintItem | ILIB_FootprintSearchItem, layer: TPCB_LayersOfComponent, x: number, y: number, rotation?: number, primitiveLock?: boolean): Promise<IPCB_PrimitiveComponent | undefined>;
9725
10033
  /**
9726
10034
  * 删除器件
9727
10035
  *
@@ -9814,7 +10122,7 @@ declare global {
9814
10122
  /**
9815
10123
  * 使用鼠标放置器件
9816
10124
  *
9817
- * @alpha
10125
+ * @beta
9818
10126
  * @remarks
9819
10127
  * 本接口模拟前端点击放置按钮,指定的器件将绑定到当前鼠标,并在用户后续点击时放置于画布
9820
10128
  *
@@ -9825,14 +10133,34 @@ declare global {
9825
10133
  placeComponentWithMouse(component: {
9826
10134
  libraryUuid: string;
9827
10135
  uuid: string;
9828
- } | ILIB_DeviceItem): Promise<boolean>;
10136
+ } | ILIB_DeviceItem | ILIB_DeviceSearchItem): Promise<boolean>;
10137
+ /**
10138
+ * 使用鼠标放置封装
10139
+ *
10140
+ * @alpha
10141
+ * @remarks
10142
+ * DEFINED since API v0.2.26
10143
+ *
10144
+ * 本接口模拟前端点击放置按钮,指定的封装将绑定到当前鼠标,并在用户后续点击时放置于画布
10145
+ *
10146
+ * 本接口的返回时机并不会等待用户的放置操作,一旦封装被绑定到鼠标,本接口将立即返回 `true` 的结果
10147
+ * @param footprint - 关联库封装
10148
+ * @param properties - 器件属性
10149
+ * @returns 是否找到封装
10150
+ */
10151
+ placeFootprintWithMouse(footprint: {
10152
+ libraryUuid: string;
10153
+ uuid: string;
10154
+ } | ILIB_FootprintItem | ILIB_FootprintSearchItem, properties?: {
10155
+ [key: string]: boolean | number | string | undefined;
10156
+ }): Promise<boolean>;
9829
10157
  /**
9830
10158
  * 获取所有器件的所有属性名称集合
9831
10159
  *
9832
10160
  * @alpha
9833
10161
  * @returns 所有器件的所有属性名称集合
9834
10162
  */
9835
- getAllPropertyNames(): Promise<string[]>;
10163
+ getAllPropertyNames(): Promise<Array<string>>;
9836
10164
  }
9837
10165
  /**
9838
10166
  * 器件图元
@@ -9847,7 +10175,7 @@ declare global {
9847
10175
  /** 图元 ID */
9848
10176
  private primitiveId?;
9849
10177
  /** 关联库器件 */
9850
- private component;
10178
+ private component?;
9851
10179
  /** 关联库封装 */
9852
10180
  private footprint?;
9853
10181
  /** 层 */
@@ -9886,14 +10214,18 @@ declare global {
9886
10214
  private _attributeVisible?;
9887
10215
  /** @internal */
9888
10216
  constructor(component: {
10217
+ libraryType?: ELIB_LibraryType.DEVICE | ELIB_LibraryType.FOOTPRINT;
9889
10218
  libraryUuid: string;
9890
10219
  uuid: string;
10220
+ name?: string;
9891
10221
  }, layer: TPCB_LayersOfComponent, x: number, y: number, rotation?: number, primitiveLock?: boolean, addIntoBom?: boolean, primitiveId?: string, footprint?: {
9892
10222
  libraryUuid: string;
9893
10223
  uuid: string;
10224
+ name?: string;
9894
10225
  }, model3D?: {
9895
10226
  libraryUuid: string;
9896
10227
  uuid: string;
10228
+ name?: string;
9897
10229
  }, designator?: string, pads?: Array<{
9898
10230
  primitiveId: string;
9899
10231
  net: string;
@@ -9931,7 +10263,8 @@ declare global {
9931
10263
  getState_Component(): {
9932
10264
  libraryUuid: string;
9933
10265
  uuid: string;
9934
- };
10266
+ name?: string;
10267
+ } | undefined;
9935
10268
  /**
9936
10269
  * 获取属性状态:关联库封装
9937
10270
  *
@@ -9941,6 +10274,7 @@ declare global {
9941
10274
  getState_Footprint(): {
9942
10275
  libraryUuid: string;
9943
10276
  uuid: string;
10277
+ name?: string;
9944
10278
  } | undefined;
9945
10279
  /**
9946
10280
  * 获取属性状态:层
@@ -9993,6 +10327,7 @@ declare global {
9993
10327
  getState_Model3D(): {
9994
10328
  libraryUuid: string;
9995
10329
  uuid: string;
10330
+ name?: string;
9996
10331
  } | undefined;
9997
10332
  /**
9998
10333
  * 获取属性状态:位号
@@ -10721,7 +11056,7 @@ declare global {
10721
11056
  * 获取属性状态:图元类型
10722
11057
  *
10723
11058
  * @public
10724
- * @returns 图元类型
11059
+ * @returns 图元类���
10725
11060
  */
10726
11061
  getState_PrimitiveType(): EPCB_PrimitiveType;
10727
11062
  /**
@@ -14080,7 +14415,7 @@ declare global {
14080
14415
  *
14081
14416
  * @public
14082
14417
  * @remarks
14083
- * 器件引脚图元是一个特殊的图元,它指的是在原理图画布上关联到符号的引脚
14418
+ * 器件引脚图元是一个特��的图元,它指的是在原理图画布上关联到符号的引脚
14084
14419
  *
14085
14420
  * 器件引脚图元仅可更改 `pinNumber`、`noConnected` 属性,其它所有属性均为只读,
14086
14421
  * 并且你只能通过 {@link SCH_PrimitiveComponent.getAllPinsByPrimitiveId | 器件类的 getAllPinsByPrimitiveId 方法} 或 {@link ISCH_PrimitiveComponent.getAllPins | 器件图元的 getAllPins 方法} 获取到器件引脚图元
@@ -14495,14 +14830,14 @@ declare global {
14495
14830
  placeComponentWithMouse(component: {
14496
14831
  libraryUuid: string;
14497
14832
  uuid: string;
14498
- } | ILIB_DeviceItem, subPartName?: string): Promise<boolean>;
14833
+ } | ILIB_DeviceItem | ILIB_DeviceSearchItem, subPartName?: string): Promise<boolean>;
14499
14834
  /**
14500
14835
  * 获取所有器件的所有属性名称集合
14501
14836
  *
14502
14837
  * @beta
14503
14838
  * @returns 所有器件的所有属性名称集合
14504
14839
  */
14505
- getAllPropertyNames(): Promise<string[]>;
14840
+ getAllPropertyNames(): Promise<Array<string>>;
14506
14841
  /**
14507
14842
  * 到 pro-ui 获取器件的详细信息
14508
14843
  *
@@ -15072,7 +15407,7 @@ declare global {
15072
15407
  *
15073
15408
  * @beta
15074
15409
  * @param component - 关联库器件
15075
- * @param subPartName - 子图块名称
15410
+ * @param subPartName - 子部件名称
15076
15411
  * @param x - 坐标 X
15077
15412
  * @param y - 坐标 Y
15078
15413
  * @param rotation - 旋转角度
@@ -15082,9 +15417,14 @@ declare global {
15082
15417
  * @returns 器件图元对象
15083
15418
  */
15084
15419
  create(component: {
15420
+ libraryType?: ELIB_LibraryType.DEVICE;
15421
+ libraryUuid: string;
15422
+ uuid: string;
15423
+ } | ILIB_DeviceItem | ILIB_DeviceSearchItem | {
15424
+ libraryType: ELIB_LibraryType.SYMBOL;
15085
15425
  libraryUuid: string;
15086
15426
  uuid: string;
15087
- } | ILIB_DeviceItem | ILIB_DeviceSearchItem, x: number, y: number, subPartName?: string, rotation?: number, mirror?: boolean, addIntoBom?: boolean, addIntoPcb?: boolean): Promise<ISCH_PrimitiveComponent | undefined>;
15427
+ } | ILIB_SymbolItem | ILIB_SymbolSearchItem, x: number, y: number, subPartName?: string, rotation?: number, mirror?: boolean, addIntoBom?: boolean, addIntoPcb?: boolean): Promise<ISCH_PrimitiveComponent | undefined>;
15088
15428
  /**
15089
15429
  * 创建网络标识
15090
15430
  *
@@ -15126,7 +15466,7 @@ declare global {
15126
15466
  * 创建复用模块符号
15127
15467
  *
15128
15468
  * @alpha
15129
- * @param cbbSymbol - 关联库复用模块符号
15469
+ * @param cbbSymbol - 关联库复用模块符号,libraryUuid 是 CBB 工程所在库的 UUID,cbbUuid 是 CBB 工程的 UUID,uuid 是 CBB 工程内符号的 UUID,name 是符号的显示名称
15130
15470
  * @param x - 坐标 X
15131
15471
  * @param y - 坐标 Y
15132
15472
  * @param rotation - 旋转角度
@@ -15136,7 +15476,7 @@ declare global {
15136
15476
  createCbbSymbol(cbbSymbol: {
15137
15477
  libraryUuid: string;
15138
15478
  cbbUuid: string;
15139
- uuid: string;
15479
+ uuid?: string;
15140
15480
  }, x: number, y: number, rotation?: number, mirror?: boolean): Promise<ISCH_PrimitiveCbbSymbolComponent | undefined>;
15141
15481
  /**
15142
15482
  * 放置复用模块原理图图页
@@ -15252,19 +15592,41 @@ declare global {
15252
15592
  *
15253
15593
  * 本接口的返回时机并不会等待用户的放置操作,一旦器件被绑定到鼠标,本接口将立即返回 `true` 的结果
15254
15594
  * @param component - 关联库器件
15595
+ * @param subPartName - 子部件名称
15255
15596
  * @returns 是否找到器件
15256
15597
  */
15257
15598
  placeComponentWithMouse(component: {
15258
15599
  libraryUuid: string;
15259
15600
  uuid: string;
15260
- } | ILIB_DeviceItem, subPartName?: string): Promise<boolean>;
15601
+ } | ILIB_DeviceItem | ILIB_DeviceSearchItem, subPartName?: string): Promise<boolean>;
15602
+ /**
15603
+ * 使用鼠标放置符号
15604
+ *
15605
+ * @alpha
15606
+ * @remarks
15607
+ * DEFINED since API v0.2.26
15608
+ *
15609
+ * 本接口模拟前端点击放置按钮,指定的符号将绑定到当前鼠标,并在用户后续点击时放置于画布
15610
+ *
15611
+ * 本接口的返回时机并不会等待用户的放置操作,一旦符号被绑定到鼠标,本接口将立即返回 `true` 的结果
15612
+ * @param symbol - 关联库符号
15613
+ * @param subPartName - 子部件名称
15614
+ * @param properties - 器件属性
15615
+ * @returns 是否找到符号
15616
+ */
15617
+ placeSymbolWithMouse(symbol: {
15618
+ libraryUuid: string;
15619
+ uuid: string;
15620
+ } | ILIB_SymbolItem | ILIB_SymbolSearchItem, subPartName?: string, properties?: {
15621
+ [key: string]: boolean | number | string | undefined;
15622
+ }): Promise<boolean>;
15261
15623
  /**
15262
15624
  * 获取所有器件的所有属性名称集合
15263
15625
  *
15264
15626
  * @alpha
15265
15627
  * @returns 所有器件的所有属性名称集合
15266
15628
  */
15267
- getAllPropertyNames(): Promise<string[]>;
15629
+ getAllPropertyNames(): Promise<Array<string>>;
15268
15630
  /**
15269
15631
  * 到 pro-ui 获取器件的详细信息
15270
15632
  *
@@ -15317,8 +15679,8 @@ declare global {
15317
15679
  /** 器件类型 */
15318
15680
  private componentType;
15319
15681
  /** 关联库器件 */
15320
- private component;
15321
- /** 子图块名称 */
15682
+ private component?;
15683
+ /** 子部件名称 */
15322
15684
  private subPartName?;
15323
15685
  /** Component 属性:是否加入 BOM */
15324
15686
  private addIntoBom?;
@@ -15350,6 +15712,7 @@ declare global {
15350
15712
  * @internal
15351
15713
  */
15352
15714
  constructor(componentType: ESCH_PrimitiveComponentType, component: {
15715
+ libraryType?: ELIB_LibraryType.DEVICE | ELIB_LibraryType.SYMBOL;
15353
15716
  libraryUuid: string;
15354
15717
  uuid: string;
15355
15718
  name?: string;
@@ -15402,7 +15765,7 @@ declare global {
15402
15765
  libraryUuid: string;
15403
15766
  uuid: string;
15404
15767
  name?: string;
15405
- };
15768
+ } | undefined;
15406
15769
  /**
15407
15770
  * 获取属性状态:坐标 X
15408
15771
  *
@@ -15418,10 +15781,10 @@ declare global {
15418
15781
  */
15419
15782
  getState_Y(): number;
15420
15783
  /**
15421
- * 获取属性状态:子图块名称
15784
+ * 获取属性状态:子部件名称
15422
15785
  *
15423
15786
  * @public
15424
- * @returns 子图块名称
15787
+ * @returns 子部件名称
15425
15788
  */
15426
15789
  getState_SubPartName(): string | undefined;
15427
15790
  /**
@@ -15712,10 +16075,10 @@ declare global {
15712
16075
  */
15713
16076
  private setState_Component;
15714
16077
  /**
15715
- * 设置属性状态:子图块名称
16078
+ * 设置属性状态:子部件名称
15716
16079
  *
15717
16080
  * @internal
15718
- * @param subPartName - 子图块名称
16081
+ * @param subPartName - 子部件名称
15719
16082
  * @returns 器件图元对象
15720
16083
  */
15721
16084
  private setState_SubPartName;
@@ -15731,7 +16094,11 @@ declare global {
15731
16094
  *
15732
16095
  */
15733
16096
  private cbb;
15734
- /** 关联复用模块符号,cbbUuid是来源工程的uuid,uuid是来源符号的uuid */
16097
+ /**
16098
+ * 关联复用模块符号
16099
+ *
16100
+ * @remarks libraryUuid 是 CBB 工程所在库的 UUID,cbbUuid 是 CBB 工程的 UUID,uuid 是 CBB 工程内符号的 UUID,name 是符号的显示名称
16101
+ */
15735
16102
  private cbbSymbol;
15736
16103
  /**
15737
16104
  * @internal
@@ -15739,7 +16106,7 @@ declare global {
15739
16106
  constructor(cbbSymbol: {
15740
16107
  libraryUuid: string;
15741
16108
  cbbUuid: string;
15742
- uuid: string;
16109
+ uuid?: string;
15743
16110
  name?: string;
15744
16111
  }, x: number, y: number, rotation?: number, mirror?: boolean, primitiveId?: string, symbol?: {
15745
16112
  libraryUuid: string;
@@ -15772,7 +16139,7 @@ declare global {
15772
16139
  getState_CbbSymbol(): {
15773
16140
  libraryUuid: string;
15774
16141
  cbbUuid: string;
15775
- uuid: string;
16142
+ uuid?: string;
15776
16143
  name?: string;
15777
16144
  };
15778
16145
  /**
@@ -15798,6 +16165,301 @@ declare global {
15798
16165
  private setState_CbbSymbol;
15799
16166
  }
15800
16167
 
16168
+ /**
16169
+ * 原理图 & 符号 / 二进制内嵌对象图元类
16170
+ *
16171
+ * @public
16172
+ */
16173
+ class SCH_PrimitiveObject implements ISCH_PrimitiveAPI {
16174
+ /**
16175
+ * 创建二进制内嵌对象
16176
+ *
16177
+ * @alpha
16178
+ * @param startX - 起点坐标 X
16179
+ * @param startY - 起点坐标 Y
16180
+ * @param width - 宽
16181
+ * @param height - 高
16182
+ * @param rotation - 旋转角度
16183
+ * @param mirror - 是否镜像
16184
+ * @param fileName - 文件名称
16185
+ * @param content - 对象内容
16186
+ * @returns 二进制内嵌对象图元对象
16187
+ */
16188
+ create(content: File | string, startX: number, startY: number, width?: number, height?: number, rotation?: number, mirror?: boolean, fileName?: string): Promise<ISCH_PrimitiveObject | undefined>;
16189
+ /**
16190
+ * 删除二进制内嵌对象
16191
+ *
16192
+ * @alpha
16193
+ * @param primitiveIds - 二进制内嵌对象的图元 ID 或二进制内嵌对象图元对象
16194
+ * @returns 删除操作是否成功
16195
+ */
16196
+ delete(primitiveIds: string | ISCH_PrimitiveObject | Array<string> | Array<ISCH_PrimitiveObject>): Promise<boolean>;
16197
+ /**
16198
+ * 修改二进制内嵌对象
16199
+ *
16200
+ * @alpha
16201
+ * @param primitiveId - 图元 ID
16202
+ * @param property - 修改参数
16203
+ * @returns 二进制内嵌对象图元对象,`undefined` 表示修改失败
16204
+ */
16205
+ modify(primitiveId: string | ISCH_PrimitiveObject, property: {
16206
+ content?: File | string;
16207
+ startX?: number;
16208
+ startY?: number;
16209
+ width?: number;
16210
+ height?: number;
16211
+ rotation?: number;
16212
+ mirror?: boolean;
16213
+ fileName?: string;
16214
+ }): Promise<ISCH_PrimitiveObject | undefined>;
16215
+ /**
16216
+ * 获取二进制内嵌对象
16217
+ *
16218
+ * @alpha
16219
+ * @param primitiveIds - 二进制内嵌对象的图元 ID,可以为字符串或字符串数组,如若为数组,则返回的也是数组
16220
+ * @returns 二进制内嵌对象图元对象,`undefined` 表示获取失败
16221
+ */
16222
+ get(primitiveIds: string): Promise<ISCH_PrimitiveObject | undefined>;
16223
+ /**
16224
+ * 获取二进制内嵌对象
16225
+ *
16226
+ * @alpha
16227
+ * @remarks 如若传入多个图元 ID,任意图元 ID 未匹配到不影响其它图元的返回,即可能返回少于传入的图元 ID 数量的图元对象
16228
+ * @param primitiveIds - 二进制内嵌对象的图元 ID,可以为字符串或字符串数组,如若为数组,则返回的也是数组
16229
+ * @returns 二进制内嵌对象图元对象,空数组表示获取失败
16230
+ */
16231
+ get(primitiveIds: Array<string>): Promise<Array<ISCH_PrimitiveObject>>;
16232
+ /**
16233
+ * 获取所有二进制内嵌对象的图元 ID
16234
+ *
16235
+ * @alpha
16236
+ * @returns 二进制内嵌对象的图元 ID 数组
16237
+ */
16238
+ getAllPrimitiveId(): Promise<Array<string>>;
16239
+ /**
16240
+ * 获取所有二进制内嵌对象
16241
+ *
16242
+ * @alpha
16243
+ * @returns 二进制内嵌对象图元对象数组
16244
+ */
16245
+ getAll(): Promise<Array<ISCH_PrimitiveObject>>;
16246
+ }
16247
+ /**
16248
+ * 二进制内嵌对象图元
16249
+ *
16250
+ * @public
16251
+ */
16252
+ class ISCH_PrimitiveObject implements ISCH_Primitive {
16253
+ /** 异步 */
16254
+ private async;
16255
+ /** 图元类型 */
16256
+ private readonly primitiveType;
16257
+ /** 图元 ID */
16258
+ private primitiveId?;
16259
+ /** 对象内容 */
16260
+ private content;
16261
+ /** 起点坐标 X */
16262
+ private startX;
16263
+ /** 起点坐标 Y */
16264
+ private startY;
16265
+ /** 宽度 */
16266
+ private width;
16267
+ /** 高度 */
16268
+ private height;
16269
+ /** 旋转角度 */
16270
+ private rotation;
16271
+ /** 是否镜像 */
16272
+ private mirror;
16273
+ /** 文件名称 */
16274
+ private fileName;
16275
+ /** @internal */
16276
+ constructor(content: File | string, startX: number, startY: number, width?: number, height?: number, rotation?: number, mirror?: boolean, fileName?: string, primitiveId?: string);
16277
+ /**
16278
+ * 在原理图画布中创建图元
16279
+ *
16280
+ * @internal
16281
+ * @returns 二进制内嵌对象图元对象
16282
+ */
16283
+ create(): Promise<ISCH_PrimitiveObject>;
16284
+ /**
16285
+ * 将 File 对象转换为 base64 字符串
16286
+ *
16287
+ * @internal
16288
+ * @param file - File 对象
16289
+ * @returns base64 字符串
16290
+ */
16291
+ private fileToBase64;
16292
+ /**
16293
+ * 获取属性状态:图元类型
16294
+ *
16295
+ * @public
16296
+ * @returns 图元类型
16297
+ */
16298
+ getState_PrimitiveType(): ESCH_PrimitiveType;
16299
+ /**
16300
+ * 获取属性状态:图元 ID
16301
+ *
16302
+ * @public
16303
+ * @returns 图元 ID
16304
+ */
16305
+ getState_PrimitiveId(): string;
16306
+ /**
16307
+ * 获取属性状态:对象内容
16308
+ *
16309
+ * @public
16310
+ * @returns 对象内容
16311
+ */
16312
+ getState_Content(): File | string;
16313
+ /**
16314
+ * 获取属性状态:坐标 X
16315
+ *
16316
+ * @public
16317
+ * @returns 坐标 X
16318
+ */
16319
+ getState_StartX(): number;
16320
+ /**
16321
+ * 获取属性状态:坐标 Y
16322
+ *
16323
+ * @public
16324
+ * @returns 坐标 Y
16325
+ */
16326
+ getState_StartY(): number;
16327
+ /**
16328
+ * 获取属性状态:宽度
16329
+ *
16330
+ * @public
16331
+ * @returns 宽度
16332
+ */
16333
+ getState_Width(): number;
16334
+ /**
16335
+ * 获取属性状态:高度
16336
+ *
16337
+ * @public
16338
+ * @returns 高度
16339
+ */
16340
+ getState_Height(): number;
16341
+ /**
16342
+ * 获取属性状态:旋转角度
16343
+ *
16344
+ * @public
16345
+ * @returns 旋转角度
16346
+ */
16347
+ getState_Rotation(): number;
16348
+ /**
16349
+ * 获取属性状态:是否镜像
16350
+ *
16351
+ * @public
16352
+ * @returns 是否镜像
16353
+ */
16354
+ getState_Mirror(): boolean;
16355
+ /**
16356
+ * 获取属性状态:文件名称
16357
+ *
16358
+ * @public
16359
+ * @returns 文件名称
16360
+ */
16361
+ getState_FileName(): string;
16362
+ /**
16363
+ * 设置属性状态:对象内容
16364
+ *
16365
+ * @beta
16366
+ * @param content - 对象内容
16367
+ * @returns 二进制内嵌对象图元对象
16368
+ */
16369
+ setState_Content(content: File | string): ISCH_PrimitiveObject;
16370
+ /**
16371
+ * 设置属性状态:起点坐标 X
16372
+ *
16373
+ * @beta
16374
+ * @param startX - 起点坐标 X
16375
+ * @returns 二进制内嵌对象图元对象
16376
+ */
16377
+ setState_StartX(startX: number): ISCH_PrimitiveObject;
16378
+ /**
16379
+ * 设置属性状态:起点坐标 Y
16380
+ *
16381
+ * @beta
16382
+ * @param startY - 起点坐标 Y
16383
+ * @returns 二进制内嵌对象图元对象
16384
+ */
16385
+ setState_StartY(startY: number): ISCH_PrimitiveObject;
16386
+ /**
16387
+ * 设置属性状态:宽度
16388
+ *
16389
+ * @beta
16390
+ * @param width - 宽度
16391
+ * @returns 二进制内嵌对象图元对象
16392
+ */
16393
+ setState_Width(width: number): ISCH_PrimitiveObject;
16394
+ /**
16395
+ * 设置属性状态:高度
16396
+ *
16397
+ * @beta
16398
+ * @param height - 高度
16399
+ * @returns 二进制内嵌对象图元对象
16400
+ */
16401
+ setState_Height(height: number): ISCH_PrimitiveObject;
16402
+ /**
16403
+ * 设置属性状态:旋转角度
16404
+ *
16405
+ * @beta
16406
+ * @param rotation - 旋转角度
16407
+ * @returns 二进制内嵌对象图元对象
16408
+ */
16409
+ setState_Rotation(rotation: number): ISCH_PrimitiveObject;
16410
+ /**
16411
+ * 设置属性状态:是否镜像
16412
+ *
16413
+ * @beta
16414
+ * @param mirror - 是否镜像
16415
+ * @returns 二进制内嵌对象图元对象
16416
+ */
16417
+ setState_Mirror(mirror: boolean): ISCH_PrimitiveObject;
16418
+ /**
16419
+ * 设置属性状态:文件名称
16420
+ *
16421
+ * @beta
16422
+ * @param fileName - 文件名称
16423
+ * @returns 二进制内嵌对象图元对象
16424
+ */
16425
+ setState_FileName(fileName: string): ISCH_PrimitiveObject;
16426
+ /**
16427
+ * 将图元转换为异步图元
16428
+ *
16429
+ * @public
16430
+ * @returns 二进制内嵌对象图元对象
16431
+ */
16432
+ toAsync(): ISCH_PrimitiveObject;
16433
+ /**
16434
+ * 将图元转换为同步图元
16435
+ *
16436
+ * @public
16437
+ * @returns 二进制内嵌对象图元对象
16438
+ */
16439
+ toSync(): ISCH_PrimitiveObject;
16440
+ /**
16441
+ * 查询图元是否为异步图元
16442
+ *
16443
+ * @public
16444
+ * @returns 是否为异步图元
16445
+ */
16446
+ isAsync(): boolean;
16447
+ /**
16448
+ * 将异步图元重置为当前画布状态
16449
+ *
16450
+ * @alpha
16451
+ * @returns 二进制内嵌对象图元对象
16452
+ */
16453
+ reset(): Promise<ISCH_PrimitiveObject>;
16454
+ /**
16455
+ * 将对图元的更改应用到画布
16456
+ *
16457
+ * @alpha
16458
+ * @returns 二进制内嵌对象图元对象
16459
+ */
16460
+ done(): Promise<ISCH_PrimitiveObject>;
16461
+ }
16462
+
15801
16463
  /**
15802
16464
  * 原理图 & 符号 / 多边形(折线)图元类
15803
16465
  *
@@ -17711,7 +18373,7 @@ declare global {
17711
18373
  *
17712
18374
  * @beta
17713
18375
  * @remarks
17714
- * 注意 1:本接口仅离线客户端有效,在浏览器环境内调用将始终 `throw Error`
18376
+ * 注意 1:本接口仅半、全离线客户端有效,在浏览器环境内调用将始终 `throw Error`
17715
18377
  *
17716
18378
  * 注意 2:本接口需要使用者启用扩展的外部交互权限,如若未启用将始终 `throw Error`
17717
18379
  * @returns 工程目录路径数组
@@ -18008,7 +18670,7 @@ declare global {
18008
18670
  *
18009
18671
  * 本接口新增的子菜单将默认排列在原菜单的结尾
18010
18672
  *
18011
- * 注意:本接口需要使用者启用扩展的外部交互权限,如若未启用将始��� `throw Error`
18673
+ * 注意:本接口需要使用者启用扩展的外部交互权限,如若未启用将始终 `throw Error`
18012
18674
  *
18013
18675
  * 非公开接口使用提醒:本接口按原样提供,不提供参数的额外文档,参数可能在任何版本出现破坏性更改并不另行通知
18014
18676
  * @param headerMenus - 顶部菜单数据
@@ -19480,6 +20142,7 @@ declare global {
19480
20142
  sch_SelectControl: SCH_SelectControl;
19481
20143
  sch_SimulationEngine: SCH_SimulationEngine;
19482
20144
  sch_Utils: SCH_Utils;
20145
+ sch_PrimitiveObject: SCH_PrimitiveObject;
19483
20146
  sys_ClientUrl: SYS_ClientUrl;
19484
20147
  sys_Dialog: SYS_Dialog;
19485
20148
  sys_Environment: SYS_Environment;
package/package.json CHANGED
@@ -1 +1 @@
1
- { "name": "@jlceda/pro-api-types", "type": "module", "version": "0.2.25", "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.27", "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" } }