import type { EliceCDK } from './EliceCDK'; /** * Navigation interface for moving between lecture pages within the Elice platform. * * Requires the content to be embedded in an iframe. Methods communicate with the * parent frame via `postMessage` and will timeout after 1 second if not embedded. */ export declare class EliceCDKNavigation { #private; private readonly ctx; constructor(ctx: EliceCDK); /** * Checks if a previous lecture page exists. * * @returns `true` if navigation to the previous page is available. * @throws {Error} Timeout after 1 second if not embedded in Elice. * * @example * ```ts * import { EliceCDK } from '@eliceio/cdk'; * * const sdk = new EliceCDK(); * await sdk.init(); * * try { * const hasPrev = await sdk.navigation.getHasPrevious(); * console.log('Can go back:', hasPrev); * } catch { * console.log('Not embedded in Elice'); * } * ``` */ getHasPrevious(): Promise; /** * Checks if a next lecture page exists. * * @returns `true` if navigation to the next page is available. * @throws {Error} Timeout after 1 second if not embedded in Elice. * * @example * ```ts * import { EliceCDK } from '@eliceio/cdk'; * * const sdk = new EliceCDK(); * await sdk.init(); * * try { * const hasNext = await sdk.navigation.getHasNext(); * console.log('Can go forward:', hasNext); * } catch { * console.log('Not embedded in Elice'); * } * ``` */ getHasNext(): Promise; /** * Navigates to the previous lecture page. * * @example * ```ts * import { EliceCDK } from '@eliceio/cdk'; * * const sdk = new EliceCDK(); * await sdk.init(); * * sdk.navigation.previous(); * ``` */ previous(): void; /** * Navigates to the next lecture page. * * @example * ```ts * import { EliceCDK } from '@eliceio/cdk'; * * const sdk = new EliceCDK(); * await sdk.init(); * * sdk.navigation.next(); * ``` */ next(): void; /** * Navigates to the given lecture page. * * Resolves the target lecture page on the parent frame via the given * `lecturePageId` and navigates to it. No-op if the lecture page cannot be * resolved or the user has no access. * * @param lecturePageId - The id of the lecture page to navigate to. * * @example * ```ts * import { EliceCDK } from '@eliceio/cdk'; * * const sdk = new EliceCDK(); * await sdk.init(); * * sdk.navigation.navigate(12345); * ``` */ navigate(lecturePageId: number): void; }