import RouterService from '@ember/routing/router-service'; import Service from '@ember/service'; import { CognitoAccessToken, CognitoIdToken, CognitoUser, CognitoUserPool, CognitoUserSession, ICognitoStorage } from 'amazon-cognito-identity-js'; import { CognitoUserMfa } from 'ember-cognito-identity/utils/cognito-mfa'; export interface CognitoData { cognitoUser: CognitoUser; userAttributes: UserAttributes; cognitoUserSession: CognitoUserSession; jwtToken: string; getAccessToken: () => CognitoAccessToken; getIdToken: () => CognitoIdToken; mfa: CognitoUserMfa; } export declare type UserAttributes = { [key: string]: any; }; export default class CognitoService extends Service { router: RouterService; _cognitoStorage: undefined | ICognitoStorage; cognitoData: null | CognitoData; _tempMfaCognitoUser?: CognitoUser; _assert?: any; get isAuthenticated(): boolean; get config(): { userPoolId: string; clientId: string; endpoint?: string; authenticationFlowType?: 'USER_SRP_AUTH' | 'USER_PASSWORD_AUTH'; }; shouldAutoRefresh: boolean; _userPool: CognitoUserPool | undefined; get userPool(): CognitoUserPool; restoreAndLoad(): Promise; refreshAccessToken(): Promise; authenticate({ username, password, }: { username: string; password: string; }): Promise; logout(): void; logoutForce(): void; invalidateAccessTokens(): Promise; triggerResetPasswordMail({ username }: { username: string; }): Promise; mfaCompleteAuthentication(code: string): Promise; updateResetPassword({ username, code, newPassword, }: { username: string; code: string; newPassword: string; }): Promise; setNewPassword({ username, password, newPassword, }: { username: string; password: string; newPassword: string; }, newAttributes?: {}): Promise; updatePassword({ oldPassword, newPassword, }: { oldPassword: string; newPassword: string; }): Promise; updateAttributes(attributes: { [index: string]: string; }): Promise<{ [index: string]: string; }>; authenticateUser(cognitoUser: CognitoUser, { username, password }: { username: string; password: string; }): Promise; _debouncedRefreshAccessToken(): any; _authenticate({ username, password, cognitoUser, }: { username: string; password: string; cognitoUser?: CognitoUser; }): Promise; _createCognitoUser({ username }: { username: string; }): CognitoUser; } declare module '@ember/service' { interface Registry { cognito: CognitoService; } } //# sourceMappingURL=cognito.d.ts.map