import { ConnectionInformations, CreateUser, DatabaseInterface, Session, User } from '@accounts/types'; import { IndexOptions } from 'mongodb'; import { AccountsMongoOptions } from './types'; export declare class Mongo implements DatabaseInterface { private options; private db; private collection; private sessionCollection; constructor(db: any, options?: AccountsMongoOptions); /** * Setup the mongo indexes needed. * @param options Options passed to the mongo native `createIndex` method. */ setupIndexes(options?: Omit): Promise; createUser({ password, username, email, ...cleanUser }: CreateUser): Promise; findUserById(userId: string): Promise; findUserByEmail(email: string): Promise; findUserByUsername(username: string): Promise; findPasswordHash(userId: string): Promise; findUserByEmailVerificationToken(token: string): Promise; findUserByResetPasswordToken(token: string): Promise; findUserByServiceId(serviceName: string, serviceId: string): Promise; addEmail(userId: string, newEmail: string, verified: boolean): Promise; removeEmail(userId: string, email: string): Promise; verifyEmail(userId: string, email: string): Promise; setUsername(userId: string, newUsername: string): Promise; setPassword(userId: string, newPassword: string): Promise; setService(userId: string, serviceName: string, service: object): Promise; unsetService(userId: string, serviceName: string): Promise; setUserDeactivated(userId: string, deactivated: boolean): Promise; createSession(userId: string, token: string, connection?: ConnectionInformations, extraData?: object): Promise; updateSession(sessionId: string, connection: ConnectionInformations, newToken?: string): Promise; invalidateSession(sessionId: string): Promise; invalidateAllSessions(userId: string, excludedSessionIds?: string[]): Promise; removeAllResetPasswordTokens(userId: string): Promise; findSessionByToken(token: string): Promise; findSessionById(sessionId: string): Promise; addEmailVerificationToken(userId: string, email: string, token: string): Promise; addResetPasswordToken(userId: string, email: string, token: string, reason: string): Promise; setResetPassword(userId: string, email: string, newPassword: string): Promise; }