Documentation Index
Fetch the complete documentation index at: https://docs.supernote.com/llms.txt
Use this file to discover all available pages before exploring further.
static getElementCounts(notePath: string, page: number): Promise<APIResponse<number>>;
参数
| 参数 | 类型 | 说明 |
|---|
notePath | string | 笔记文件路径 |
page | number | 页码(从 0 开始) |
返回
import { PluginFileAPI } from 'sn-plugin-lib';
/**
* 获取笔记某一页元素数量的示例。
*/
export async function exampleGetElementCounts() {
const notePath = '/storage/emulated/0/Note/demo.note';
const page = 0;
const res = await PluginFileAPI.getElementCounts(notePath, page);
if (!res.success) {
throw new Error(res.error?.message ?? 'getElementCounts 调用失败');
}
return res.result;
}