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<void>;
    stop(): Promise<void>;
    init(useRestAtStartup: boolean): Promise<void>;
    private attachHandlers;
    reconnect(): Promise<void>;
    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 <br>
     * @param {string} id of the conversation/bubble
     * @param {string} type of Favorite (can be 'user' or 'bubble')
     * @return {Promise<Favorite>} A Favorite object
     */
    createFavorite(id: string, type: string): Promise<Favorite>;
    /**
     * @public
     * @since 1.56
     * @nodered true
     * @method deleteFavorite()
     * @category Favorites MANAGEMENT
     * @instance
     * @description
     *   Delete conversation/bubble/bot from Favorites Array <br>
     * @param {string} id of the Favorite item
     * @return {Favorite[]} A Favorite object
     */
    deleteFavorite(id: string): Promise<any>;
    /**
     * @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<Favorite>} The favorite corresponding to the peerId
     */
    getFavorite(peerId: string): Promise<Favorite>;
    /**
     * @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 <br>
     * @return {Array<Favorite>} An array of Favorite objects
     */
    fetchAllFavorites(peerId?: string): Promise<Array<Favorite>>;
    /**
     * @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. <br>
     * @return {Array<Favorite>} The result
     *
     *
     * | Champ | Type | Description |
     * | --- | --- | --- |
     * | isFavorite | Boolean | true if the requested peerId is in user's favorites, false otherwise. |
     *
     */
    checkIsPeerSettedAsFavorite(peerId: string): Promise<unknown>;
    /**
     * @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. <br>
     * @return {Array<Favorite>} 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:<br><br>* `user` for User to User favorite type,<br>* `room` for User to Room favorite type.<br>* `bot` for User to Bot service favorite type.<br>* `directory` for User to Directory service favorite type.<br>* `office365` for User to Office365 service favorite type.<br><br>Possibles values : `"user"`, `"room"`, `"bot"`, `"directory"`, `"office365"` |
     *
     */
    getFavoriteById(favoriteId: string): Promise<unknown>;
    /**
     * @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. <br>
     * @return {Array<Favorite>} 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:<br><br>* `user` for User to User favorite type,<br>* `room` for User to Room favorite type.<br>* `bot` for User to Bot service favorite type.<br>* `directory` for User to Directory service favorite type.<br>* `office365` for User to Office365 service favorite type.<br><br>Possibles values : `"user"`, `"room"`, `"bot"`, `"directory"`, `"office365"` |
     *
     */
    getAllUserFavoriteList(peerId: string): Promise<unknown>;
    /**
     * @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. <br>
     * @return {Array<Favorite>} 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:<br><br>* `user` for User to User favorite type,<br>* `room` for User to Room favorite type.<br>* `bot` for User to Bot service favorite type.<br>* `directory` for User to Directory service favorite type.<br>* `office365` for User to Office365 service favorite type.<br><br>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<unknown>;
    private onXmppEvent;
    onFavoriteCreated(fav: {
        id: string;
        peerId: string;
        type: string;
        position: number;
    }): Promise<void>;
    onFavoriteUpdated(fav: {
        id: string;
        peerId: string;
        type: string;
        position: number;
    }): Promise<void>;
    onFavoriteDeleted(fav: {
        id: string;
        peerId: string;
        type: string;
        position: number;
    }): Promise<void>;
}
export { FavoritesService };
