| 参数 | 类型 | 说明 |
|---|---|---|
notePath | string | 笔记文件路径 |
APIResponse<number>:result为笔记总页数
SDK 文档版本:v0.1.25
获取笔记文件总页数。
static getNoteTotalPageNum(notePath: string): Promise<APIResponse<number>>;
| 参数 | 类型 | 说明 |
|---|---|---|
notePath | string | 笔记文件路径 |
APIResponse<number>:
result 为笔记总页数import { PluginFileAPI } from 'sn-plugin-lib';
/**
* 获取笔记总页数的示例。
*/
export async function exampleGetNoteTotalPageNum() {
const notePath = '/storage/emulated/0/Note/demo.note';
const res = await PluginFileAPI.getNoteTotalPageNum(notePath);
if (!res.success) {
throw new Error(res.error?.message ?? 'getNoteTotalPageNum 调用失败');
}
return res.result;
}