import { Observable, BehaviorSubject } from 'rxjs'; import { VasatConfig, VasatStorage, VasatError, VasatServiceConfig, VasatSiteInfo, VasatSiteInitRequest, VasatModelDefinition, VasatPayload, VasatAPIResponse, RemoteLoginInfo } from './models/types'; import { VasatModelClass, VasatModel, VasatSession, VasatSearchQuery, VasatConnection, RemoteOAuthResponse } from './models/base-models'; import { DeviceMetaProvider } from './models/device'; export declare class Vasat> implements VasatConnection { config: VasatConfig; pathPrefix: string; private _logoutEvent; onLogout: Observable; private _errorEvent; onErrorEvent: Observable; token?: string; mediaToken?: string; private _modelCache; private _cacheClass; private _modelCacheHash; private _sessionObservable; private _sessionSubject; private _persistSession; private _loadingSession?; private _siteInfo?; readonly siteInfo: BehaviorSubject; services: VasatServiceConfig[]; servicesLoading?: Observable; private _remoteInfo?; UserModel: VasatModelClass; storage: VasatStorage; constructor(config: VasatConfig, _storage?: VasatStorage, userModel?: VasatModelClass); get authPrefix(): string; clientKey(): string; registerCacheClass>(obj: VasatModelClass | string, items: T[], overrideExisting?: boolean): void; private _modelPrefixes; private _domainPrefixes; registerPathPrefix(m: VasatModelClass, prefix: string): void; registerDomainPrefix(domain: string, prefix: string): void; modelPathPrefix(m: VasatModel): string; classNameForType(obj: VasatModelClass): string; registerClass>(obj: VasatModelClass): void; findCached>(obj: VasatModelClass | string, id: string | number | ((v: T) => boolean)): T | undefined; findCachedClass>(obj: string): VasatModelClass; getCached>(obj: VasatModelClass | string): T[]; filterCached>(obj: VasatModelClass | string, id: number | ((v: T) => boolean)): T[]; registeredClassForString(key: string): VasatModelClass; sessionObservable(fire?: Boolean): Observable; onReady(): Observable; localSession(): VasatSession | undefined; invalidateSession(): void; invalidateCache(): void; authToken(): any; saveLocalSession(obj: VasatSession): void; hasSession(): boolean; signup(username: string, password: string, email?: string, userMeta?: any, byoClientId?: string): Observable; signupWith2FA(username: string, pass?: string, userMeta?: any, mode?: 'password' | 'magic'): Observable; check2FASignup(token: string): Observable; complete2FASignup(token: string, password?: string, userMeta?: any): Observable; loginWithUsername(user: string, pass: string, persistSession?: boolean, byoClientId?: string): Observable; loginWithClientCredentials(): Observable; /** * Login using remote FacebookOauth * @param remoteClientId Facebook App ID * @param remoteClientToken Facebook access token given by the Facebook SDK. */ loginWithClientFacebook(remoteClientId: string, remoteClientToken: string): Observable; registerPushRegId(regId: string): Observable; resetPasswordRequest(email: string): Observable; /** * * @deprecated Renamed to resetPasswordRequest() */ requestForgetPassword(email: string): Observable; resetPasswordTokenCheck(token: string): Observable>; resetPassword(token: string, newPassword: string): Observable>; /** * * @deprecated Renamed to logout() */ logoutObservable(): Observable; logout(): Observable; private _refreshing?; private _refreshingObs?; refreshToken(): Observable; refreshMeUser(): Observable; private processResp; protected _getURL(url: string): string; api(url: string, meth?: string, args?: any): Observable; get(url: string, args?: any): Observable>; delete(url: string, args?: any): Observable>; put(url: string, obj: any, args?: any): Observable>; post(url: string, obj: any, args?: any): Observable>; _http(meth: string, url: string, obj: any, args?: any, tryedRefresh?: boolean): Observable>; file(url: string, meth?: string, payload?: any): Observable; searchByObject>(v: VasatModelClass): VasatSearchQuery; searchByObjectString>(obj: string): VasatSearchQuery; searchByObjectStringAndDomain>(obj: string, domain: string): VasatSearchQuery; /** * Generate a url to send the browser to so it can authenticate. * @client is the remote client uid * @redirectUrl is the url on your server to be sent to once the user has logged in (or not) * * returns observale of the url to be sent to */ loginViaOAuthUrl(client: string, redirectUrl: string, state?: string, scope?: string[]): Observable; /** * When an oauth site returns you back to this site * @client is the remote client uid * @redirectUrl is the url on your server to be sent to once the user has logged in (or not) * @code is the code returned by the oauth server * returns observale of the url to be sent to */ loginRemoteOAuthCode(client: string, code: string, redirectUrl: string): Observable>; completeRemoteOAuthSignup(sr: RemoteOAuthResponse, user: any): Observable; activeHostServices(): Observable; private _defaultDeviceMeta; setDeviceMeta(dm: DeviceMetaProvider): void; deviceMeta(): import("./models/device").DeviceMeta; private _loadSiteInfo; loadSiteInfo(force?: boolean, nest?: boolean): Observable; remoteLoginInfo(): Observable; /** * Returns the current VasatSiteInfo in memory. Will return null if not initialised. */ getSiteInfo(): VasatSiteInfo | undefined; initSite(params: VasatSiteInitRequest): Observable; apiModels(): Observable>; apiAccessModels(): Observable>; getOpenApiUrl(path: string): string; loginWith2FA(username: string, password: string): Observable>; loginWithMagic(username: string): Observable>; complete2FALogin(token: String): Observable; processV2Token(resp: VasatAPIResponse): VasatSession; }