import EventEmitter from 'eventemitter3'; import { Authenticator } from './Authenticator'; import { Authorizer } from './Authorizer'; import { AccessFailure, AccessSuccess, AuthManagerConfig, Identity, TokenConfig } from './types'; type Events = 'authentication-attempt' | 'authentication-success' | 'authentication-failure' | 'authentication-logout' | 'authentication-licensechange' | 'authentication-notifications-unavailable' | 'authentication-error' | 'authorization-start' | 'authorization-complete' | 'authorization-attempt' | 'authorization-success' | 'authorization-failure'; export declare class AuthManager extends EventEmitter { private _authenticator; private _authorizer; private _authChangeNotifier; private _config; identity: Identity | null; constructor(authenticator: Authenticator, authorizer: Authorizer, config: Partial); on(event: 'authentication-error', fn: (message: string, err: Error) => void, context?: any): this; on(event: 'authentication-attempt', fn: () => void, context?: any): this; on(event: 'authentication-success', fn: (event: { identity: Identity; }) => void, context?: any): this; on(event: 'authentication-failure', fn: (event: { err: Error; }) => void, context?: any): this; on(event: 'authentication-logout', fn: () => void, context?: any): this; on(event: 'authentication-licensechange', fn: (event: { newIdentity: Identity; prevIdentity: Identity | null; }) => void, context?: any): this; on(event: 'authentication-notifications-unavailable', fn: () => void, context?: any): this; on(event: 'authorization-start', fn: () => void, context?: any): this; on(event: 'authorization-complete', fn: () => void, context?: any): this; on(event: 'authorization-attempt', fn: (event: { tokenConfig: TokenConfig; license: string; }) => void, context?: any): this; on(event: 'authorization-success', fn: (event: { access: AccessSuccess; }) => void, context?: any): this; on(event: 'authorization-failure', fn: (event: { access: AccessFailure; }) => void, context?: any): this; /** * Login to the system and authorize tokens if successful, otherwise redirect to login page */ login(): Promise; changeActiveLicense(newLicense: string): Promise; hasValidProfile(identity: Identity): string | false; requireValidProfile(identity: Identity): void; logout(returnUrl?: string): Promise; callback(): Promise<{ license: string | undefined; identity: { id: string | undefined; } | undefined; token: import("auth0-js").Auth0DecodedHash; }>; authorize(tokenConfig: TokenConfig, license: string): Promise; authorizeOnce(tokenConfig: TokenConfig, license: string): Promise; getAuthorizer(): Authorizer; getAuthenticator(): Authenticator; getTokenConfig(): TokenConfig[]; private _handleLoggedOut; private _handleLicenseChanged; private _handleAuthorizationSuccess; private _handleAuthorizationFailure; private _handleAuthChange; } export {};