Home > LIB_Classification > deleteByIndex
LIB_Classification.deleteByIndex() 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.
Warning: This API is now obsolete.
since EDA v3.2; dropped EDA v3.3
Delete the classification at the specified index
Signature
typescript
function deleteByIndex(classificationIndex: ILIB_ClassificationIndex): Promise<boolean>;1
Parameters
Parameter | Type | Description |
|---|---|---|
classificationIndex | Classification index |
Returns
Promise<boolean>
Whether the operation is successful
Example
javascript
// 1. 获取个人库 UUID
const libraryUuid = await eda.lib_LibrariesList.getPersonalLibraryUuid();
// 2. 创建一个测试分类作为删除对象(复用模块库,ELIB_LibraryType.CBB = '1')
const name = `嘉立创示例_待删除分类_${Date.now()}`;
const index = await eda.lib_Classification.createPrimary(libraryUuid, '1', name);
// 3. 按索引对象删除该分类
const deleted = await eda.lib_Classification.deleteByIndex(index);
// 删除类保留现场(分类已不存在,库面板中可确认)
console.log('name:', name);
console.log('deleted:', deleted);1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14