@withjoy/sdk-js
Version:
Joy Javascript SDK
31 lines (30 loc) • 941 B
TypeScript
import { ActiveAuth } from "./activeAuth";
import { Observable } from "rxjs/Observable";
interface ILogoutOptions {
eventId?: string;
}
export interface ILoginManager {
/**
* Make sure that the initial loading of the saved auth is done
*/
loginIfPossible(): Promise<ActiveAuth>;
login(): Promise<ActiveAuth>;
signUp(): Promise<ActiveAuth>;
/**
* Logout currently logged in activeAuth
*/
logout(options?: ILogoutOptions): Promise<ActiveAuth>;
/**
* Allow consumers to listen to changes to the internal activeAuth object
* @returns {Observable<ActiveAuth>}
*/
activeAuthObservable(): Observable<ActiveAuth>;
isLoggedIn(): Promise<boolean>;
/**
* Get userId of logged in user or null
* @returns {Promise<string>}
*/
getUserId(): Promise<string | null>;
}
export declare const loginManager: ILoginManager;
export {};