static deleteKeyWord(notePath: string, page: number, index: number): Promise<APIResponse<boolean>>;
| 参数 | 类型 | 说明 |
|---|---|---|
notePath | string | 笔记/文档文件路径 |
page | number | 删除关键字所在的页码(从 0 开始) |
index | number | 删除关键字的序列号(页内从 1 开始) |
APIResponse<boolean>:result === true表示删关键字成功
示例
import { PluginFileAPI } from 'sn-plugin-lib';
/**
* 删除关键字的示例(按页内序号删除)。
*/
export async function exampleDeleteKeyWord() {
const notePath = '/storage/emulated/0/Note/demo.note';
const page = 1;
const index = 1;
const res = await PluginFileAPI.deleteKeyWord(notePath, page, index);
if (!res.success) {
throw new Error(res.error?.message ?? 'deleteKeyWord 调用失败');
}
return res.result;
}