import ReactiveStore from '../reactive-store'; import AuthProvider from './provider'; import type { ICredentials, IAuthenticationResult } from './provider'; import Translator from '../i18n'; import KeyValueStorage from '../key-value-storage'; interface IState { authenticating: boolean; authenticationError: string; userId: string; userName: string; accessToken: string; refreshToken: string; } export default class AuthStore extends ReactiveStore { protected provider: AuthProvider; protected trans: Translator; protected persistentStorage: KeyValueStorage; constructor(provider?: AuthProvider, trans?: Translator, persistentStorage?: KeyValueStorage); getInitialState(): IState; onTokensUpdate(tokens: IAuthenticationResult): void; get isAuthorized(): boolean; get isAuthenticating(): boolean; get error(): string; get userName(): string; private syncWithProvider; authenticate(credentials: ICredentials): Promise; recoverAccessToken(): Promise; logout(): void; saveToStorage(): void; loadFromStorage(): void; } export {};