/** * Thrown when attempting to open a Kombo Connect modal while another one is already open. */ declare class KomboConnectAlreadyOpenError extends Error { constructor(message: string); } /** * Thrown when the user closes the Kombo Connect modal without completing the flow. */ declare class KomboConnectCancelledError extends Error { constructor(message: string); } /** * Options for {@link showKomboConnect}. */ interface ShowKomboConnectOptions { /** * The DOM element the iframe should be appended to. Defaults to * `document.body`. Useful when launching Kombo Connect from inside a * modal that traps focus to its own subtree, so the iframe stays * inside the focus container and remains interactive. */ container?: HTMLElement; } /** * Opens the Kombo Connect modal in an iframe and waits for the user to complete the connection flow. * * @param url - The Kombo Connect URL to load in the iframe * @param options - Optional configuration. See {@link ShowKomboConnectOptions}. * @returns A Promise that resolves with the activation token when the user successfully completes the flow * @throws {KomboConnectAlreadyOpenError} If a Kombo Connect modal is already open * @throws {KomboConnectCancelledError} If the user closes the modal without completing the flow * @throws {Error} If `options.container` is provided but not attached to the document */ declare function showKomboConnect(url: string, options?: ShowKomboConnectOptions): Promise; export { KomboConnectAlreadyOpenError, KomboConnectCancelledError, showKomboConnect }; export type { ShowKomboConnectOptions };