import { Subscription } from 'rxjs/internal/Subscription'; import { PersonalRoutine } from '../../models/personalRoutine.model'; import { Service } from '../../services/service'; export declare const PERSONAL_ROUTINES_SVC = "PersonalRoutinesService"; /** * Collection of events fired by {@link PersonalRoutinesService} * @public * @readonly */ export declare enum PersonalRoutineEvent { /** * This event is fired when the personal routine list is updated (at start-up for example) * @public */ RAINBOW_ONPERSONALROUTINELISTUPDATED = "onpersonalroutinelistupdated", /** * This event is fired when a personal routine is being activated * @public */ RAINBOW_ONACTIVATINGPERSONALROUTINE = "onactivatingpersonalroutine", /** * This event is fired when a personal routine is activated * @public * @param routineId - ID of routine that has been activated */ RAINBOW_ONPERSONALROUTINEACTIVATED = "onpersonalroutineactivated", /** * This event is fired when a personal routine is updated * @public * @param routineId - ID of routine that has been updated */ RAINBOW_ONPERSONALROUTINEUPDATED = "onpersonalroutineupdated", /** * This event is fired when a personal routine is created * @public * @param routineId - ID of routine that has been created */ RAINBOW_ONPERSONALROUTINECREATED = "onpersonalroutinecreated", /** * This event is fired when a personal routine is deleted * @public * @param routineId - ID of routine that has been deleted */ RAINBOW_ONPERSONALROUTINEDELETED = "onpersonalroutinedeleted" } /** * This service manages personal routines * @public */ export declare class PersonalRoutinesService extends Service { /*********************************************************/ /** Services used */ /*********************************************************/ private logger; private authService; private xmppService; private profileService; private i18nService; private errorHelperService; private contactService; private portalURL; private listeners; private xmppMessageHandler; private _personalRoutines; get personalRoutines(): PersonalRoutine[]; set personalRoutines(value: PersonalRoutine[]); private _activatingRoutine; get activatingRoutine(): boolean; set activatingRoutine(value: boolean); private rxSubject; static getInstance(): PersonalRoutinesService; static build(): PersonalRoutinesService; private constructor(); /************************************************************/ /** OBSERVABLE STUFF */ subscribe(callback: any): Subscription; sendEvent(type: PersonalRoutineEvent, value: any): void; start(): Promise; stop(): void; reconnect(attempt?: number): Promise; attachHandlers(): void; private onHeadlineMessageReceived; private onPersonalRoutineActivation; private onPersonalRoutineUpdate; private onPersonalRoutineCreated; private onPersonalRoutineDeleted; /** * Get the personal routine currently active * @public * @returns active personal routine object */ getActiveRoutine(): PersonalRoutine; /** * Get the first personal routine that is not the default work routine * @public * @returns first personal routine that is not the default work routine */ getFirstNoWorkRoutine(): PersonalRoutine; /** * Get personal routines of user, except the default work routine * @public * @returns array of personal routines */ getPersonalRoutinesExceptWork(): PersonalRoutine[]; getRoutineById(routineId: string): PersonalRoutine; /** * Activate a personal routine * @public * @param routineId - id of routine to activate * @param userId - id of the user for which the routine is activated (used by supervisors only). If not set, the user modified is the logged user * @returns resolves with the routine data from server */ activatePersonalRoutine(routineId: string, userId?: string): Promise; /** * Retrieve a personal routine from server by its ID * @public * @param routineId - id of routine to retrieve * @param updateLocalData - whether we should update local personal routine data. Default value: false * @returns resolves with the personal routine */ retrievePersonalRoutineFromServer(routineId: string, updateLocalData?: boolean): Promise; /** * Retrieve all personal routines from server * @public * @param updateLocalData - whether we should update local personal routine data. Default value: false * @returns resolves with the personal routines data from server */ retrieveAllPersonalRoutinesFromServer(updateLocalData?: boolean): Promise; /** * Retrieve all personal routines from server for a given contact * @public * @param userId - Identifier of the user for which we want to get the personal routines. * @returns resolves with the personal routines data from server */ retrieveAllPersonalRoutinesForContactFromServer(userId: string): Promise; /** * Updates a personal routine data * @public * @param routineId - id of routine to update * @param data - data for update * @returns resolves with the updated personal routine data from server */ updatePersonalRoutine(routineId: string, data: any): Promise; /** * Creates a custom personal routine * @public * @param name - name of new personal routine * @returns resolves with the newly created personal routine data */ createCustomPersonalRoutine(name: string): Promise; /** * Delete a custom personal routine * @public * @param routineId - unique identifier of routine to be deleted * @returns resolves when routine is deleted */ deleteCustomPersonalRoutine(routineId: string): Promise; } //# sourceMappingURL=personal-routines.service.d.ts.map