跳转到主要内容
static deleteKeyWord(notePath: string, page: number, index: number): Promise<APIResponse<boolean>>;
参数
参数类型说明
notePathstring笔记/文档文件路径
pagenumber删除关键字所在的页码(从 0 开始)
indexnumber删除关键字的序列号(页内从 1 开始)
返回

示例

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;
}