static searchFiveStars(filePath: string): Promise<APIResponse<number[]>>;
| 参数 | 类型 | 说明 |
|---|---|---|
filePath | string | 笔记/文档文件路径 |
APIResponse<number[]>:result为五角星所在页码数组
示例
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;
}