/// <reference types="node" />
import EventEmitter from 'events';
import * as SetUser from './Actions/SetUser.generated';
import * as AuthUser from './Actions/AuthenticateUser.generated';
import * as SetUserAttrs from './Actions/SetUserAttributes.generated';
declare type FiresquadOptions = {
    /**
     * If firesquad is self-hosted, use this alternate endpoint for connection.
     */
    endpoint?: string;
    /**
     * If firesquad is self-hosted, use this alternate WS endpoint for connection.
     */
    wsEndpoint?: string;
};
declare class Firesquad {
    /** Assigned appId */
    private __app_id;
    /** True when the app profile has been loaded */
    private __ready;
    /** True when the websocket connection has been adquired */
    private __wsReady;
    /** Main endpoint */
    private __endpoint;
    /** Event emitter instance */
    private eventEmitter;
    /** Token to use for authenticate the app */
    private __token;
    /**
     * Returns a boolean indicating if the widget is ready to be used.
     * @returns {Boolean} true if the widget is ready to be used.
     */
    static initialized(): boolean;
    /**
     * If the widget is ready (Profile loaded and websocket running) this is true.
     */
    get ready(): boolean;
    /**
     * Initializes the widget.
     * @param {string} appId - The app id to initialize this widget.
     */
    constructor(appId: string, options?: FiresquadOptions);
    private getToken;
    /**
     * Methods calls will need to wait for the widget to be set so we receive a proper behavior.
     * @returns {Promise<true>} It's ready
     */
    private readyListener;
    /**
     * Adds the `listener` function to the end of the listeners array for the
     * event named `eventName`.
     * @param eventName - Event name.
     * @param listener - Listener callback.
     * @returns Event emitter reference.
     */
    on<T extends unknown[]>(eventName: string, listener: (...args: T) => void): EventEmitter;
    /**
     * Removes the specified `listener` from the listener array for the event named`eventName`.
     * @param eventName - Event name.
     * @param listener - Listener callback.
     * @returns Event emitter reference.
     */
    off<T extends unknown[]>(eventName: string, listener: (...args: T) => void): EventEmitter;
    /**
     * Adds a **one-time**`listener` function for the event named `eventName`. The
     * next time `eventName` is triggered, this listener is removed and then invoked.
     * @param eventName - Event name.
     * @param listener - Listener callback.
     * @returns Event emitter reference.
     */
    once<T extends unknown[]>(eventName: string, listener: (...args: T) => void): EventEmitter;
    /**
     * Set data about the current widget visitor.
     * @param user - User object to set.
     * @returns Result operation.
     */
    SetUser(user: SetUser.SetUserMutationVariables['data']): Promise<import("@apollo/client").FetchResult<SetUser.SetUserMutation, Record<string, any>, Record<string, any>>>;
    /**
     * Set attributes (or data points) about the current widget visitor.
     * @param attrs - Attributes to set.
     * @returns Result operation.
     */
    SetUserAttributes(attrs: SetUserAttrs.SetUserAttributesMutationVariables['data']): Promise<import("@apollo/client").FetchResult<SetUserAttrs.SetUserAttributesMutation, Record<string, any>, Record<string, any>>>;
    /**
     * Starts the authentication procedure against a secure backend.
     * @param input - Authentication data, only `token` is required, attributes are optional.
     * @returns Result operation.
     */
    AuthenticateUser(input: AuthUser.AuthenticateUserMutationVariables['data']): Promise<import("@apollo/client").FetchResult<AuthUser.AuthenticateUserMutation, Record<string, any>, Record<string, any>>>;
    /**
     * Closes and disposes the widget.
     */
    dispose(): void;
}
export default Firesquad;
