/** * Options for token management */ interface TokenOptions { /** * Key to use for storing the token in localStorage * @default "b44_access_token" */ storageKey?: string; /** * Parameter name to look for in URL * @default "access_token" */ paramName?: string; /** * Whether to save the token to localStorage * @default true */ saveToStorage?: boolean; /** * Whether to remove the token from URL after retrieval * @default true */ removeFromUrl?: boolean; } /** * Options for constructing a login URL */ interface LoginUrlOptions { /** * Base URL of the server */ serverUrl: string; /** * Application ID */ appId: string | number; /** * Path to the login endpoint * @default "/login" */ loginPath?: string; } /** * Get the access token from URL parameters or localStorage * @param options Token options * @returns Access token or null if not found */ declare function getAccessToken(options?: TokenOptions): string | null; /** * Save the access token to localStorage * @param token Access token * @param options Token options * @returns Whether the token was successfully saved */ declare function saveAccessToken(token: string, options?: TokenOptions): boolean; /** * Remove the access token from localStorage * @param options Token options * @returns Whether the token was successfully removed */ declare function removeAccessToken(options?: TokenOptions): boolean; /** * Get the login URL for the specified return URL and configuration * @param returnUrl URL to return to after login * @param options Login URL options * @returns Login URL */ declare function getLoginUrl(returnUrl: string | undefined, options: LoginUrlOptions): string; export { getAccessToken, getLoginUrl, removeAccessToken, saveAccessToken };