import { SessionState, ISession, SessionRecorderOptions, SessionRecorderEvents } from './types';
import './index.scss';
import { SessionType } from '@multiplayer-app/session-recorder-common';
import { ISessionRecorder } from './types';
import { Observable } from 'lib0/observable';
import { NavigationRecorderPublicApi } from './navigation';
export declare class SessionRecorder extends Observable<SessionRecorderEvents> implements ISessionRecorder {
    private _configs;
    private _apiService;
    private _tracer;
    private _recorder;
    private _sessionWidget;
    private _navigationRecorder;
    private _startRequestController;
    get navigation(): NavigationRecorderPublicApi;
    private _isInitialized;
    get isInitialized(): boolean;
    private _sessionId;
    get sessionId(): string | null;
    set sessionId(sessionId: string | null);
    private _sessionType;
    get sessionType(): SessionType;
    set sessionType(sessionType: SessionType);
    get continuousRecording(): boolean;
    private _sessionState;
    get sessionState(): SessionState | null;
    set sessionState(state: SessionState | null);
    private _session;
    get session(): ISession | null;
    set session(session: ISession | null);
    private _sessionAttributes;
    get sessionAttributes(): Record<string, any>;
    set sessionAttributes(attributes: Record<string, any> | null);
    /**
     * Error message getter and setter
     */
    private _error;
    get error(): string;
    set error(v: string);
    /**
     * Returns the HTML button element for the session widget's recorder button.
     *
     * This element is used to control the start/stop recording functionality in the session widget UI.
     *
     * @returns {HTMLButtonElement | null} The recorder button element from the session widget.
     */
    get sessionWidgetButtonElement(): HTMLButtonElement | null;
    /**
     * Initialize debugger with default or custom configurations
     */
    constructor();
    /**
     * Initialize the session debugger
     * @param configs - custom configurations for session debugger
     */
    init(configs: SessionRecorderOptions): void;
    /**
     * Save the continuous recording session
     */
    save(): Promise<any>;
    /**
     * Start a new session
     * @param type - the type of session to start
     * @param session - the session to start
     */
    start(type?: SessionType, session?: ISession): void;
    /**
     * Stop the current session with an optional comment
     * @param comment - user-provided comment to include in session session attributes
     */
    stop(comment?: string): Promise<void>;
    /**
     * Pause the current session
     */
    pause(): Promise<void>;
    /**
     * Resume the current session
     */
    resume(): Promise<void>;
    /**
     * Cancel the current session
     */
    cancel(): Promise<void>;
    /**
     * Set the session attributes
     * @param attributes - the attributes to set
    */
    setSessionAttributes(attributes: Record<string, any>): void;
    /**
     * Updates the button click handler in the library.
     * @param handler - A function that will be invoked when the button is clicked.
     *                  The function receives the click event as its parameter and
     *                  should return `false` to prevent the default button action,
     *                  or `true` (or nothing) to allow it.
    */
    set recordingButtonClickHandler(handler: () => boolean | void);
    /**
     * Capture an exception manually and send it as an error trace.
     */
    captureException(error: unknown, errorInfo?: Record<string, any>): void;
    /**
     * @description Check if session should be started/stopped automatically
     * @param {ISession} [sessionPayload]
     * @returns {Promise<void>}
     */
    checkRemoteContinuousSession(sessionPayload?: Omit<ISession, '_id' | 'shortId'>): Promise<void>;
    /**
     * Register session widget event listeners for controlling session actions
     */
    private _registerWidgetEvents;
    /**
     * Register session limit reaching listeners for controlling session end
     */
    private _registerSessionLimitReach;
    /**
     * Register session auto creation listeners during continuous recording
     */
    private _registerSessionAutoCreation;
    /**
     * Create a new session and start it
     */
    private _createSessionAndStart;
    /**
     * Start tracing and recording for the session
     */
    private _start;
    /**
     * Stop tracing and recording for the session
     */
    private _stop;
    /**
     * Pause the session tracing and recording
     */
    private _pause;
    /**
     * Resume the session tracing and recording
     */
    private _resume;
    private _setupSessionAndStart;
    /**
     * Set the session ID in localStorage
     * @param sessionId - the session ID to set or clear
     */
    private _setSession;
    private _clearSession;
    /**
     * Check the operation validity based on the session state and action
     * @param action - action being checked ('init', 'start', 'stop', 'cancel', 'pause', 'resume')
     */
    private _checkOperation;
    private _normalizeError;
    private _normalizeErrorInfo;
}
//# sourceMappingURL=sessionRecorder.d.ts.map