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>>;
Parameters
| Parameter | Type | Description |
|---|
notePath | string | Note file path |
page | number | Page index (starting from 0) |
Returns
Example
import { PluginFileAPI } from 'sn-plugin-lib';
/**
* Example: get the number of elements on a note page.
*/
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 call failed');
}
return res.result;
}