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 getElement(notePath: string, page: number, num: number): Promise<APIResponse<Element>>;
Parameters
| Parameter | Type | Description |
|---|
notePath | string | Note file path |
page | number | Page index (starting from 0) |
num | number | Element index within the page (starting from 0) |
Returns
Example
import { PluginFileAPI } from 'sn-plugin-lib';
/**
* Example: get a single element from a note page.
*/
export async function exampleGetElement() {
const notePath = '/storage/emulated/0/Note/demo.note';
const page = 0;
const num = 0;
const res = await PluginFileAPI.getElement(notePath, page, num);
if (!res.success) {
throw new Error(res.error?.message ?? 'getElement call failed');
}
return res.result;
}