跳转到主要内容
static getElements(page: number, notePath: string): Promise<APIResponse<Element[]>>;
参数
参数类型说明
pagenumber页面索引(从 0 开始)
notePathstring笔记/文档文件路径
返回

示例

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

/**
 * 获取某页元素列表的示例。
 */
export async function exampleGetElements() {
  const notePath = '/storage/emulated/0/Note/demo.note';
  const page = 1;

  const res = await PluginFileAPI.getElements(page, notePath);
  if (!res.success) {
    throw new Error(res.error?.message ?? 'getElements 调用失败');
  }
  return res.result;
}