跳转到主要内容
static getKeyWords(notePath: string, pageList: number[]): Promise<APIResponse<KeyWord[]>>;
参数
参数类型说明
notePathstring笔记/文档文件路径
pageListnumber[]页码列表(从 0 开始)
返回

示例

import { PluginFileAPI } from 'sn-plugin-lib';

/**
 * 获取关键字列表的示例。
 */
export async function exampleGetKeyWords() {
  const notePath = '/storage/emulated/0/Note/demo.note';
  const res = await PluginFileAPI.getKeyWords(notePath, [1]);
  if (!res.success) {
    throw new Error(res.error?.message ?? 'getKeyWords 调用失败');
  }
  return res.result;
}