import type { NotionDataSource } from "./bridge/dataSources/dataSource.js"; import type { NotionBlockId } from "./bridge/ids.js"; import { type CustomBlockInitErrorCode } from "./bridge/messages/init.js"; import type { CustomBlockPage } from "./bridge/pages/page.js"; import type { NotionParent } from "./bridge/parent.js"; import type { NotionTheme } from "./bridge/theme.js"; import type { NotionUser } from "./bridge/users/user.js"; /** * The payload sent by the host in the `init` message in response to the sandbox's `ready` message. */ export type CustomBlockInitial = { theme: NotionTheme; blockId: NotionBlockId; parent: NotionParent; page: CustomBlockPage; currentUser: NotionUser; dataSources: NotionDataSource[]; }; /** * Error thrown when the SDK is loaded in a top-level standalone window with no parent frame. * `postMessage` would just hit the same window and the handshake can never complete. * `` catches this specifically and falls back to a standalone preview with a * warning banner. Direct callers can `instanceof` it to apply their own policy. */ export declare class NotInIframeError extends Error { constructor(message?: string); code: CustomBlockInitErrorCode; isRetryable: boolean; } /** * Options for {@link initCustomBlock}. */ export type InitCustomBlockOptions = { /** * How long to wait for the host's `init` response before rejecting with an error. * * @default 15000 - Intentionally longer than Notion's 10s host-dependency watchdog * so host-owned init errors can arrive before the SDK's generic fallback appears. */ timeoutMs?: number; }; /** * Performs the SDK <-> host handshake: loads `custom_blocks.json`, posts * `ready`, then awaits the host's `init` message. Resolves with that payload. * * Rejects with a `CustomBlockInitError` if the host doesn't respond inside `timeoutMs`. * * Idempotent: subsequent calls return the same promise as the first and ignore any new options. * Mount your React tree (or call any SDK hook / `customBlock.subscribe`) only after the * returned promise resolves. */ export declare function initCustomBlock(opts?: InitCustomBlockOptions): Promise; //# sourceMappingURL=init.d.ts.map