/** * Side of target element for positioning */ type Side = 'top' | 'bottom' | 'left' | 'right'; /** * Alignment along the side */ type Alignment = 'start' | 'center' | 'end'; /** * Combined placement (side + optional alignment) */ type Placement = Side | `${Side}-${Alignment}`; /** * Point coordinates */ interface Position { x: number; y: number; } /** * Rectangle dimensions */ interface Rect { x: number; y: number; width: number; height: number; } /** * Keyboard navigation configuration */ interface KeyboardConfig { enabled?: boolean; nextKeys?: string[]; prevKeys?: string[]; exitKeys?: string[]; trapFocus?: boolean; } /** * Spotlight/overlay configuration */ interface SpotlightConfig { enabled?: boolean; color?: string; padding?: number; borderRadius?: number; animate?: boolean; animationDuration?: number; clickToExit?: boolean; } /** * Storage interface for custom adapters */ interface Storage { getItem: (key: string) => string | null | Promise; setItem: (key: string, value: string) => void | Promise; removeItem: (key: string) => void | Promise; } /** * Active flow session configuration — single tour at a time, scoped to one tab. * Differs from `useRoutePersistence`, which is multi-tour cross-route state. * * @remarks * Opt-in: undefined by default. When set, `useFlowSession` will persist the * active tour's `(tourId, stepIndex)` so a hard reload resumes it in place. */ interface FlowSessionConfig { storage: 'sessionStorage' | 'localStorage'; /** TTL in ms. Default: 1h for sessionStorage, 24h for localStorage. */ ttlMs?: number; /** * Storage key (under the configured `keyPrefix`). * Default: `'flow:active'` — full key shape `${keyPrefix}:flow:active`. * The persisted blob carries its own `tourId`, so a single fixed key is * sufficient for the active-tour resume case (one active tour per tab). */ key?: string; } /** * Cross-tab pause/resume gate (BroadcastChannel-based). * Pauses the tour in this tab when another tab posts `tour:active`. * * @remarks * Opt-in: undefined by default. Recommended when using `flowSession.storage = 'localStorage'` * so a tour started in tab A doesn't double-show after the user closed it in tab B. */ interface CrossTabConfig { enabled: boolean; /** Channel name. Default: `'tourkit:active-flow'`. */ channel?: string; } /** * Persistence configuration */ interface PersistenceConfig { enabled?: boolean; storage?: 'localStorage' | 'sessionStorage' | 'cookie' | Storage; keyPrefix?: string; rememberStep?: boolean; trackCompleted?: boolean; dontShowAgain?: boolean; /** * Active flow session — single tour at a time, scoped to one tab. * Differs from `useRoutePersistence`, which is multi-tour cross-route state. */ flowSession?: FlowSessionConfig; /** * Cross-tab pause/resume gate (BroadcastChannel-based). * Pauses tour in this tab when another tab posts `tour:active`. */ crossTab?: CrossTabConfig; } /** * Accessibility configuration */ interface A11yConfig { announceSteps?: boolean; ariaLive?: 'polite' | 'assertive' | 'off'; focusTrap?: boolean; restoreFocus?: boolean; reducedMotion?: 'respect' | 'always-animate' | 'never-animate'; } /** * Scroll behavior configuration */ interface ScrollConfig { enabled?: boolean; behavior?: 'auto' | 'smooth'; block?: 'start' | 'center' | 'end' | 'nearest'; offset?: number; } /** * Text direction for RTL/LTR layouts */ type Direction = 'ltr' | 'rtl' | 'auto'; /** * Global TourKit configuration */ interface TourKitConfig { keyboard?: KeyboardConfig; spotlight?: SpotlightConfig; persistence?: PersistenceConfig; a11y?: A11yConfig; scroll?: ScrollConfig; /** * Text direction for RTL/LTR support * - 'ltr': Left-to-right (default) * - 'rtl': Right-to-left (Arabic, Hebrew, Persian, etc.) * - 'auto': Detect from document.dir * @default 'auto' */ dir?: Direction; } declare const defaultKeyboardConfig: Required; declare const defaultSpotlightConfig: Required; declare const defaultPersistenceConfig: Required> & { storage: 'localStorage'; flowSession?: FlowSessionConfig; crossTab?: CrossTabConfig; }; declare const defaultA11yConfig: Required; declare const defaultScrollConfig: Required; export { type A11yConfig as A, type CrossTabConfig as C, type Direction as D, type FlowSessionConfig as F, type KeyboardConfig as K, type Placement as P, type Rect as R, type SpotlightConfig as S, type TourKitConfig as T, type PersistenceConfig as a, type ScrollConfig as b, type Side as c, type Alignment as d, type Storage as e, type Position as f, defaultA11yConfig as g, defaultKeyboardConfig as h, defaultPersistenceConfig as i, defaultScrollConfig as j, defaultSpotlightConfig as k };