Returns
APIResponse<boolean>:result === trueindicates the jump succeeded
- Throws a parameter validation error when
pageis not an integer greater than or equal to0
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Jump to the specified page in the current file.
static jumpToPage(page: number): Promise<APIResponse<boolean>>;
| Parameter | Type | Description |
|---|---|---|
page | number | Target page index, starting from 0 |
APIResponse<boolean>:
result === true indicates the jump succeededpage is not an integer greater than or equal to 0import { PluginCommAPI } from 'sn-plugin-lib';
/**
* Example: jump to a specific page.
*/
export async function exampleJumpToPage() {
const res = await PluginCommAPI.jumpToPage(2);
if (!res.success) {
console.log('jumpToPage failed', res.error);
throw new Error(res.error?.message ?? 'jumpToPage call failed');
}
console.log('jumpToPage result', res.result);
return res.result;
}