@withjoy/sdk-js
Version:
Joy Javascript SDK
91 lines (90 loc) • 3.31 kB
TypeScript
import { ITelemetry } from "../telemetry/ITelemetry";
import { EventFirebaseConnection } from "./EventFirebaseConnection";
import { Event } from "./Event";
import { EventsServiceApi } from './EventServiceApi';
/**
* EventsManager - Manages a set of events, and caches related to these events
* @constructor
*/
export declare class EventsManager {
private telemetry;
private eventNames;
eventPublicInfoCache: any;
eventInfoCache: any;
eventIdAndPasswordToActiveAuthCache: any;
eventIdAndPasswordToPermitCache: any;
eventSecretToActiveAuthCache: any;
eventSecretToPermitCache: any;
eventIdToEventPasswordKVStore: any;
eventIdToEventSecretKVStore: any;
eventIdToCurrentPersonIdKVStore: any;
private events;
private activeAuths;
private eventConnection;
private lastActiveAuth;
constructor(telemetry: ITelemetry);
getPromiseLib(): any;
getTelemetry(): ITelemetry;
getEventConnection(): EventFirebaseConnection;
setCurrentPersonIdForEventId(eventId: string, personId: string): any;
getCurrentPersonIdForEventId(eventId: string): any;
/**
* Converts a active auth to a string id, so you can compare them with each other instead of
* trying to see in their instances are the same
*/
getActiveAuthKey(activeAuth: any): any;
getActiveAuth(): any;
getUserId(): any;
getBestActiveAuthForEventId(eventId: string): any;
getBestServiceApiForEvent(event: Event): EventsServiceApi;
getEventSecretActiveAuthForEventId(eventId: string): any;
getEventInfoCache(): any;
getEventPublicInfoCache(): any;
getEventNameCache(): any;
private onActiveAuthChanged_shouldIgnore;
private onActiveAuthChanged;
private checkForSecretOrPassword;
/**
* Get a promise for a event with the given namegetEventBySecret
* @param eventName
* @returns {*}
*/
getEventByName(eventName: string): Promise<Event>;
/**
* Get a promise for a event with the given eventId
* @param eventId
* @returns {*}
*/
getEventById(eventId: string): Promise<Event>;
private eventBySecretOrPassword;
private getEventBySecret_permit;
private getEventByPassword_permit;
private reloadActiveAuth;
private getEventByPassword_join;
private getEventBySecret_join;
getEventBySecret(eventSecret: any, eventId?: any): any;
getEventByCode(eventSecret: any): any;
getEventByPassword(eventId: any, eventPassword: any): any;
/**
* Most useful when logging out to complete the rsvp as someone else.
*
* @param eventId
* @param eventSecret
* @param callback
* @returns {*}
* @public
*/
saveEventSecretForEventIdAndLogout(eventId: string, eventSecret: string): any;
/**
* Public for reasons relating to symmetry of the two versions of
* EventsManager and Event (js and ts)
* Should not be called from the outside, public because it needs to be
* called from Event
* @returns {PromiseLike<any>}
* @public
*/
logout(eventId?: string): Promise<any>;
private saveEVentPassword;
private saveEventSecret;
}
export declare const eventsManager: EventsManager;