static getNoteTotalPageNum(notePath: string): Promise<APIResponse<number>>;
| Parameter | Type | Description |
|---|---|---|
notePath | string | NOTE file path |
APIResponse<number>:resultis the total page count
Example
import { PluginFileAPI } from 'sn-plugin-lib';
/**
* Example: get the total page count.
*/
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 call failed');
}
return res.result;
}