@multiplayer-app/session-recorder-browser
Version:
Multiplayer Fullstack Session Recorder for Browser
76 lines • 3.33 kB
TypeScript
import { ToastConfig, WidgetTextOverridesConfig } from '../types';
export declare class UIManager {
private recorderButton;
private initialPopover;
private finalPopover;
private recordingOverlay;
private submitSessionDialog;
private toast;
private toastTimeout;
private widgetTextOverrides;
private showContinuousRecording;
/**
* Constructor initializes the UIManager with necessary DOM elements
* @param recorderButton - The main button to start recording
* @param initialPopover - Popover shown when starting the session
* @param finalPopover - Popover shown when the session ends
* @param previewModal - Modal to preview the recorded session
* @param recordingOverlay - Overlay element for recording indication in extension
* @param submitSessionDialog - Dialog that opens when recording is stopped from extension
* @param toast - Toast element for showing success messages
* @param widgetTextOverrides - Configuration for customizable text
* @param showContinuousRecording - Whether continuous recording is enabled
*/
constructor(recorderButton: HTMLButtonElement, initialPopover: HTMLElement, finalPopover: HTMLElement, recordingOverlay: HTMLElement, submitSessionDialog: HTMLElement, toast: HTMLElement, widgetTextOverrides: WidgetTextOverridesConfig, showContinuousRecording: boolean);
/**
* Sets the properties for the recorder button, including its class,
* tooltip, and inner HTML content (Record icon)
*/
setRecorderButtonProps(): void;
/**
* Sets the properties for the recording overlay, including its classes,
* tooltip, and inner HTML content
*/
setOverlayProps(): void;
/**
* Sets the properties for the session submission dialog, including its classes,
* tooltip, and inner HTML content
*/
setSubmitSessionDialogProps(): void;
/**
* Sets up the initial popover with its class and inner HTML structure.
* The popover includes a logo, heading, and start recording button.
*/
setInitialPopoverProps(): void;
/**
* Sets up the final popover with its class and inner HTML structure.
* The popover allows the user to preview or send the bug report after recording.
*/
setFinalPopoverProps(): void;
/**
* Updates the popover button to reflect a loading state.
*
* When `isLoading` is true, the button is disabled and shows a loading message.
* When `isLoading` is false, the button is enabled and resets to its default label.
*
* @param isLoading - Whether the popover button should show a loading state.
*/
setPopoverLoadingState(isLoading: boolean): void;
setTimerValue(time: string): void;
/**
* Sets the properties for the toast element, including its classes
*/
setToastProps(): void;
/**
* Shows a toast message with optional session URL
* @param message - The message to display
* @param sessionUrl - Optional URL to open when clicking the button
* @param duration - Duration in milliseconds to show the toast (default: 10000ms)
*/
showToast(config: ToastConfig, duration?: number): void;
/**
* Hides the toast message
*/
hideToast(): void;
}
//# sourceMappingURL=UIManager.d.ts.map