import { Logger } from "../common/Logger"; export {}; import { Favorite } from '../common/models/Favorite'; import { EventEmitter } from "events"; import { Core } from "../Core"; import { GenericService } from "./GenericService"; declare class FavoritesService extends GenericService { private _favoriteEventHandler; private _favoriteHandlerToken; private favorites; static getClassName(): string; getClassName(): string; static getAccessorName(): string; getAccessorName(): string; constructor(_core: Core, _eventEmitter: EventEmitter, _logger: Logger, _startConfig: { start_up: boolean; optional: boolean; }); start(_options: any): Promise; stop(): Promise; init(useRestAtStartup: boolean): Promise; private attachHandlers; reconnect(): Promise; private getServerFavorites; private addServerFavorite; private removeServerFavorite; private toggleFavorite; private updateFavorites; private createFavoriteObj; /** * @public * @nodered true * @since 1.56 * @method createFavorite() * @category Favorites MANAGEMENT * @instance * @description * Add conversation/bubble/bot to Favorites Array
* @param {string} id of the conversation/bubble * @param {string} type of Favorite (can be 'user' or 'bubble') * @return {Promise} A Favorite object */ createFavorite(id: string, type: string): Promise; /** * @public * @since 1.56 * @nodered true * @method deleteFavorite() * @category Favorites MANAGEMENT * @instance * @description * Delete conversation/bubble/bot from Favorites Array
* @param {string} id of the Favorite item * @return {Favorite[]} A Favorite object */ deleteFavorite(id: string): Promise; /** * @public * @nodered true * @method getFavorite * @category Favorites GET * @instance * @description * get favorite from cache by Id. * @param {string} peerId The id of the favorite. * @return {Promise} The favorite corresponding to the peerId */ getFavorite(peerId: string): Promise; /** * @public * @since 1.56 * @nodered true * @method fetchAllFavorites * @category Favorites GET * @instance * @param {string} peerId Allows to retrieve only the requested peerId(s) from user's favorites * @description * Fetch all the Favorites from the server in a form of an Array
* @return {Array} An array of Favorite objects */ fetchAllFavorites(peerId?: string): Promise>; /** * @public * @since 2.21.0 * @nodered true * @method checkIsPeerSettedAsFavorite * @category Favorites GET * @instance * @param {string} peerId peerId unique identifier * @description * This API can be used to check if a given peerId is in user's favorites.
* @return {Array} The result * * * | Champ | Type | Description | * | --- | --- | --- | * | isFavorite | Boolean | true if the requested peerId is in user's favorites, false otherwise. | * */ checkIsPeerSettedAsFavorite(peerId: string): Promise; /** * @public * @since 2.21.0 * @nodered true * @method getFavoriteById * @category Favorites GET * @instance * @param {string} favoriteId Favorite unique identifier * @description * This API can be used to retrieve a specific user's favorite by Id.
* @return {Array} The result * * * | Champ | Type | Description | * | --- | --- | --- | * | id | String | Id of the favorite. | * | peerId | String | userId, roomId, botId, directoryId or office365Id of the favorite. | * | position | Integer | position of the favorite in favorite list (first position is 0). | * | type | string | Type of the favorite peer:

* `user` for User to User favorite type,
* `room` for User to Room favorite type.
* `bot` for User to Bot service favorite type.
* `directory` for User to Directory service favorite type.
* `office365` for User to Office365 service favorite type.

Possibles values : `"user"`, `"room"`, `"bot"`, `"directory"`, `"office365"` | * */ getFavoriteById(favoriteId: string): Promise; /** * @public * @nodered true * @since 2.21.0 * @method getAllUserFavoriteList * @category Favorites GET * @instance * @param {string} peerId Allows to retrieve only the requested peerId(s) from user's favorites. * @description * This API can be used to retrieve the list of user's favorites.
* @return {Array} The result * * * Array of Favorites. * * | Champ | Type | Description | * | --- | --- | --- | * | id | String | Id of the favorite. | * | peerId | String | userId, roomId, botId, directoryId or office365Id of the favorite. | * | position | Integer | position of the favorite in favorite list (first position is 0). | * | type | string | Type of the favorite peer:

* `user` for User to User favorite type,
* `room` for User to Room favorite type.
* `bot` for User to Bot service favorite type.
* `directory` for User to Directory service favorite type.
* `office365` for User to Office365 service favorite type.

Possibles values : `"user"`, `"room"`, `"bot"`, `"directory"`, `"office365"` | * */ getAllUserFavoriteList(peerId: string): Promise; /** * @public * @since 2.21.0 * @nodered true * @method moveFavoriteToPosition * @category Favorites GET * @instance * @description * This API can be used to update a favorite's position in favorite list.
* @return {Array} The result * * * | Champ | Type | Description | * | --- | --- | --- | * | id | String | Id of the favorite. | * | peerId | String | userId, roomId, botId, directoryId or office365Id of the favorite. | * | position | Integer | position of the favorite in favorite list (first position is 0). | * | type | string | Type of the favorite peer:

* `user` for User to User favorite type,
* `room` for User to Room favorite type.
* `bot` for User to Bot service favorite type.
* `directory` for User to Directory service favorite type.
* `office365` for User to Office365 service favorite type.

Possibles values : `"user"`, `"room"`, `"bot"`, `"directory"`, `"office365"` | * * @param {string} favoriteId Favorite unique identifier * @param {number} position=1 new position in list. If position exceed favorites list size the favorite is moved to the end of the list */ moveFavoriteToPosition(favoriteId: string, position?: number): Promise; private onXmppEvent; onFavoriteCreated(fav: { id: string; peerId: string; type: string; position: number; }): Promise; onFavoriteUpdated(fav: { id: string; peerId: string; type: string; position: number; }): Promise; onFavoriteDeleted(fav: { id: string; peerId: string; type: string; position: number; }): Promise; } export { FavoritesService };