globular-element
Version:
Collection of webcomponent to work with globular
54 lines (53 loc) • 2.81 kB
TypeScript
import { Account, Session } from "globular-web-client/resource/resource_pb";
import { Globular } from "globular-web-client";
export declare class AccountController {
private static __account__;
private static __accounts__;
static get account(): Account;
static set account(account: Account);
static getAccounts(query: string, init: boolean, callback: (accounts: Array<Account>) => void, errorCallback: (err: any) => void, globule?: Globular): void;
static getSession(account: Account, callback: (session: Session) => void, errorCallback: (err: any) => void): void;
/**
*
* @param account
* @param initCallback
* @param errorCallback
*/
static initSession(account: Account, successCallback: (session: Session) => void, errorCallback: (err: any) => void): void;
static saveSession(onSave: () => void, onError: (err: any) => void): void;
/**
* Get an account with a given id.
* @param id The id of the account to retreive
* @param successCallback Callback when succed
* @param errorCallback Error Callback.
*/
static getAccount(id: string, successCallback: (account: Account) => void, errorCallback: (err: any) => void): void;
/**
* Must be called once when the session open.
* @param account
*/
static initData(account: Account, callback: (account: Account) => void, errorCallback: (err: any) => void): void;
/**
* Read user data one result at time.
*/
private static readOneUserData;
/**
* Close the current session explicitelty.
*/
static logout(): void;
static authenticate(globule: Globular, user: string, password: string, callback: (token: string) => void, errorCallback: (err: any) => void): void;
/**
* Register a new account with the application.
* @param name The account name
* @param email The account email
* @param password The account password
*/
static register(name: string, email: string, password: string, confirmPassord: string, domain: string, onRegister: (account: Account) => void, onError: (err: any) => void, globule?: Globular, firstName?: string, lastName?: string, profilePicture?: string): void;
static getContacts(account: Account, query: string, callback: (contacts: Array<any>) => void, errorCallback: (err: any) => void): void;
static setContact(from: Account, status_from: string, to: Account, status_to: string, successCallback: () => void, errorCallback: (err: any) => void): void;
static onInviteContact(contact: Account): void;
static onAcceptContactInvitation(contact: Account): void;
static onDeclineContactInvitation(contact: Account): void;
static onRevokeContactInvitation(contact: Account): void;
static onDeleteContact(contact: Account): void;
}