import { Logger } from '../../common/appContext/logging.js'; import { SharedState, StateListener } from '../../common/appContext/sharedState.js'; import { UserInfo } from './authUi.js'; interface ControllerConfig { userInfoEndpoint: string; loginRedirect: string; logoutRedirect: string; } interface Tools { config: ControllerConfig; log: Logger; state: SharedState; } export declare class Controller { /** * Controller factory enforces singleton */ static startController: () => Promise; tools: Tools; constructor(tools: Tools); /** * Fetch UserInfo from the config.userInfoEndpoint, * return anonymousUserInfo on failure to fetch */ fetchUserInfo(): Promise; /** * Fetch the latest user info, and update the shared state * if necessary */ updateUserInfo(): Promise; /** * Handle the login/logout statemachine: * #authmgr/login, #authmgr/logout, #authmgr/loginresult, #authmgr/userinfo * * @param ev */ navEventHandler: StateListener; } /** * Controller web component - launches singleton controller * when placed on page. */ export declare class LittleAuthController extends HTMLElement { connectedCallback(): void; disconnectedCallback(): void; } export default LittleAuthController;