import { type EventEmitter } from "../../stencil-public-runtime"; import type { LogoutResult, PromptOption, ResponseType } from "../../auth"; export type AuthResult = { success: true; token: string; } | { success: false; error: string; }; export declare class UnidyLogin { el: HTMLElement; /** The base URL of the Unidy authentication server, example: https://your-domain.unidy.de */ baseUrl: string; /** The client ID for the application */ clientId: string; /** The OAuth scopes to request, defaults to "openid email" */ scope: string; /** The OAuth response type, defaults to "id_token" */ responseType: ResponseType; /** The prompt option for authentication, can be "none", "login", "consent", "select_account" or null */ prompt: PromptOption; /** Whether to enable logging, defaults to true */ enableLogging: boolean; /** The rendering mode - 'dialog' for modal popup, 'inline' for embedded in page */ mode: "dialog" | "inline"; /** Whether to use the special redirect behavior, for browsers limitation access to third party cookies. * This should be disabled, when the Unidy instance runs on the same second level domain. Defaults to true */ redirectFlowForLimitedThirdPartyCookieAccess: boolean; /** When in inline mode and the browser has no access to third-party cookies, * a login button is rendered with this label. Defaults to "Login" */ redirectFlowLoginButtonLabel: string; iframeUrl: string; isLoading: boolean; popupWindow: Window | null; authEvent: EventEmitter<{ token: string; }>; private dialog; private popupCheckInterval?; private authPromise; private logoutPromise; private logger; connectedCallback(): void; componentDidLoad(): void; /** * Initiates the authentication process * * @param options - Options for the authentication process * @param options.trySilentAuth - Whether to attempt silent authentication without showing UI (defaults to false) * @returns Promise that resolves with authentication result containing success status and token or error * * @example * ```typescript * // Default authentication, using the prompt prop * const result = await component.auth(); * * // Silent authentication, will override the prompt prop with 'none' * const result = await component.auth({ trySilentAuth: true }); * * if (result.success) { * console.log('Token:', result.token); * } else { * console.error('Auth failed:', result.error); * } * ``` */ auth({ trySilentAuth }?: { trySilentAuth?: boolean; }): Promise; /** * Logs out the current user and clears any stored session data. * * @returns Promise that resolves with logout result indicating success status * * @example * ```typescript * const result = await component.logout(); * * if (result.success) { * console.log('Successfully logged out'); * } * ``` */ logout(): Promise; /** * Shows the authentication dialog modal to the user. * * @returns Promise that resolves when the dialog is shown * * @example * ```typescript * await component.show(); * ``` */ show(): Promise; /** * Hides the authentication dialog modal. * * @returns Promise that resolves when the dialog is hidden * * @example * ```typescript * await component.hide(); * ``` */ hide(): Promise; private handleDialogBackdropClick; private setAuthorizeUrl; private getAuthorizeUrl; private handleIframeLoad; private handleIframeMessage; private openPopupWithForm; private startPopupTokenCheck; private cleanupPopup; private handleSuccessfulAuth; render(): any; }