跳转到主要内容
static getNoteTotalPageNum(notePath: string): Promise<APIResponse<number>>;
参数
参数类型说明
notePathstring笔记文件路径
返回

示例

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