saltfish
Version:
An interactive video-guided tour system for web applications
52 lines • 2.15 kB
TypeScript
/**
* Application-wide constants for timing, thresholds, and configuration values.
*
* This file centralizes magic numbers to improve code readability and maintainability.
* All timing values are in milliseconds unless otherwise noted.
*/
/**
* Analytics-related constants
*/
export declare const ANALYTICS: {
/** Interval for flushing analytics events to the backend (30 seconds) */
readonly FLUSH_INTERVAL_MS: 30000;
/** Maximum number of events to queue before forcing a flush */
readonly MAX_QUEUE_SIZE: 10;
};
/**
* Timing constants for various operations (all values in milliseconds)
*/
export declare const TIMING: {
/** Video progress polling interval (50ms) */
readonly VIDEO_PROGRESS_POLL_INTERVAL: 50;
/** Cursor position update throttle interval (100ms) */
readonly CURSOR_UPDATE_THROTTLE: 100;
/** Delay for state processing operations (100ms) */
readonly STATE_PROCESSING_DELAY_MS: 100;
/** Analytics event flush interval (30 seconds) */
readonly ANALYTICS_FLUSH_INTERVAL: 30000;
/** User data loading timeout (5 seconds) */
readonly USER_DATA_TIMEOUT: 5000;
/** Step timeout - player will be destroyed if user stays on same step (120 seconds) */
readonly STEP_TIMEOUT: 120000;
/** Retry delay for failed operations (0.5 seconds) */
readonly RETRY_DELAY_MS: 500;
/** Delay for DOM stabilization before cursor operations (0.5 seconds) */
readonly DOM_STABILIZATION_DELAY_MS: 500;
/** Default cursor animation distance in pixels */
readonly CURSOR_DEFAULT_DISTANCE: 100;
/** Interval for checking URL path changes (5 seconds) */
readonly URL_PATH_CHECK_INTERVAL_MS: 5000;
/** Session expiry time (30 minutes) */
readonly SESSION_EXPIRY: number;
/** Pending navigation expiry time (60 seconds) - longer than normal 6s rule for URL transitions */
readonly PENDING_NAVIGATION_EXPIRY: number;
};
/**
* UI interaction thresholds
*/
export declare const THRESHOLDS: {
/** Minimum scroll distance in pixels to trigger scroll events */
readonly SCROLL_THRESHOLD_PX: 10;
};
//# sourceMappingURL=constants.d.ts.map