跳转到主要内容
static searchFiveStars(filePath: string): Promise<APIResponse<number[]>>;
参数
参数类型说明
filePathstring笔记/文档文件路径
返回

示例

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

/**
 * 搜索文件中五角星所在页的示例。
 */
export async function exampleSearchFiveStars() {
  const filePath = '/storage/emulated/0/Note/demo.note';
  const res = await PluginFileAPI.searchFiveStars(filePath);
  if (!res.success) {
    throw new Error(res.error?.message ?? 'searchFiveStars 调用失败');
  }
  return res.result;
}