Home > SYS_FileManager > extractLibInfo
SYS_FileManager.extractLibInfo() method
提取文件内的库配置信息
签名
typescript
function extractLibInfo(data: File | Array<File>): Promise<any>;1
参数名
参数 | 类型 | 描述 |
|---|---|---|
data | File | Array<File> | 库文件 |
返回值
Promise<any>
库配置信息
示例
javascript
// 1. 导出当前工程为文件
const projectFile = await eda.sys_FileManager.getProjectFile();
// 2. 从工程文件中提取库配置信息
const libInfo = await eda.sys_FileManager.extractLibInfo(projectFile);
// 3. 输出各类型库的引用数量(字段:devices / symbols / footprints / panelLibs)
console.log('器件数:', libInfo.devices.length);
console.log('符号数:', libInfo.symbols.length);
console.log('封装数:', libInfo.footprints.length);
console.log('面板库数:', libInfo.panelLibs.length);
// 4. 列出第一个封装的库信息(uuid 可用于后续按 UUID 下载封装文件)
const firstFootprint = libInfo.footprints[0];
console.log('首个封装标题:', firstFootprint?.title);
console.log('首个封装 uuid:', firstFootprint?.uuid);1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16