Home > LIB_Device > searchByProperties
LIB_Device.searchByProperties() method
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
Search devices precisely by properties
Signature
typescript
function searchByProperties(
properties: ILIB_DevicePropertiesForSearch,
libraryUuid?: string,
classification?: Array<string>,
symbolType?: ELIB_SymbolType,
itemsOfPage?: number,
page?: number,
): Promise<Array<ILIB_DeviceSearchItem>>;1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
Parameters
Parameter | Type | Description |
|---|---|---|
properties | Property | |
libraryUuid | string | (Optional) Library UUID, default is system library, you can use LIB_LibrariesList APIs in |
classification | Array<string> | (Optional) Classification, defaults to all ADD since EDA v4 |
symbolType | (Optional) Symbol type, defaults to all | |
itemsOfPage | number | (Optional) Number of search results per page |
page | number | (Optional) Page count |
Returns
Promise<Array<ILIB_DeviceSearchItem>>
List of searched device properties
Example
javascript
// 1. 按立创 C 编号精确搜索,每页 5 条
const results = await eda.lib_Device.searchByProperties(
{ supplierId: 'C1523' },
undefined,
undefined,
undefined,
5,
1
);
// 2. 输出搜索结果
console.log('count:', results.length);
results.forEach((item, i) => {
console.log(`[${i}] name:`, item.name, 'uuid:', item.uuid, 'supplierId:', item.supplierId);
});1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15