import { Tokens } from "./Tokens"; import { KeeError } from "./KeeError"; import { Claim } from "./Claim"; import { Response } from "superagent"; export type Feature = string; export declare class Features { enabled: Feature[]; validUntil: number; source: string; subscriptionId?: string; } export declare class User { private email; private _emailHashed; get emailHashed(): string; private _userId; get userId(): string; private salt; private passKey; private features; private _tokens; get tokens(): Tokens; private loginParameters?; private _verificationStatus; get verificationStatus(): AccountVerificationStatus; static fromEmailAndKey(email: string, hashedMasterKey: ArrayBuffer): Promise; static fromEmail(email: string): Promise; static fromResetProcess(email: string, unverifiedJWTString: string, hashedMasterKey: ArrayBuffer, sendResetConfirmation: (obj: object) => Promise): Promise; currentFeatures(): string[]; setUserId(userId: string): void; derivePassKey(email: string, hashedMasterKey: ArrayBuffer): Promise; register(introEmailStatus: number, marketingEmailStatus: number, isMobile: boolean, code: string): Promise; loginStart(): Promise; loginFinish(hashedMasterKey?: ArrayBuffer): Promise; applyCouponToSubscription(code: string): Promise; refresh(): Promise; resendVerificationEmail(): Promise; restartTrial(): Promise; changePassword(hashedMasterKey: ArrayBuffer, onChangeStarted: () => Promise): Promise; resetStart(): Promise; private parseJWTs; } export declare class UserManager { static init(stage: "dev" | "beta" | "prod", tokenChangeHandlerParam: (tokens: Tokens) => void): void; static verifyJWT(jwt: string): Promise<{ audience: string; claim?: Claim | undefined; }>; } export declare function hashString(text: string, salt?: string): Promise; export declare function hashStringToHex(text: string, salt?: string): Promise; export declare function hashByteArray(text: Uint8Array, salt: Uint8Array): Promise; export declare function stretchByteArray(byteArray: Uint8Array, salt: string): Promise; export declare const EMAIL_ID_SALT = "a7d60f672fc7836e94dabbd7000f7ef4e5e72bfbc66ba4372add41d7d46a1c24"; export declare const EMAIL_AUTH_SALT = "4e1cc573ed8cd48a19beb6ec6729be6c7a19c91a40c6483be3c9d671b5fbae9a"; export declare const PASS_AUTH_SALT = "a90b6364315150a39a60d324bfafe6f4444deb15bee194a6d34726c31493dacc"; export declare const STRETCH_SALT = "509d04a4c27ea9947335e7aa45aabe4fcc2222c87daf0f0520712cefb000124a"; export declare enum AccountVerificationStatus { Never = 0, Reverify = 1, Sent = 2, Success = 3 }