APIResponse<number>:resultis the total page count
PluginDocAPI
getCurrentTotalPages
Get total page count of the currently opened DOC.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Get total page count of the currently opened DOC.
static getCurrentTotalPages(): Promise<APIResponse<number>>;
APIResponse<number>:
result is the total page countimport { PluginDocAPI } from 'sn-plugin-lib';
/**
* Example: get total page count of the current document.
*/
export async function exampleGetCurrentTotalPages() {
const res = await PluginDocAPI.getCurrentTotalPages();
if (!res.success) {
throw new Error(res.error?.message ?? 'getCurrentTotalPages call failed');
}
return res.result;
}