UNPKG

@wandelbots/wandelbots-js-react-components

Version:

React UI toolkit for building applications on top of the Wandelbots platform

50 lines 1.78 kB
export type CycleTimerState = "idle" | "measuring" | "measured" | "countdown" | "success"; export interface CycleTimerControls { startNewCycle: (maxTimeSeconds: number, elapsedSeconds?: number) => void; startMeasuring: (elapsedSeconds?: number) => void; setIdle: () => void; completeMeasuring: () => void; pause: () => void; resume: () => void; isPaused: () => boolean; } export interface CycleTimerProps { /** * Callback that receives the timer control functions */ onCycleComplete: (controls: CycleTimerControls) => void; /** Callback fired when a cycle actually completes (reaches zero) */ onCycleEnd?: () => void; /** Callback fired when measuring cycle completes */ onMeasuringComplete?: () => void; /** Whether the timer should start automatically when maxTime is set */ autoStart?: boolean; /** Visual variant of the timer */ variant?: "default" | "small"; /** For small variant: whether to show remaining time details (compact hides them) */ compact?: boolean; /** Additional CSS classes */ className?: string; /** Whether the timer is in an error state (pauses timer and shows error styling) */ hasError?: boolean; } export interface TimerState { currentState: CycleTimerState; remainingTime: number; maxTime: number | null; isRunning: boolean; isPausedState: boolean; currentProgress: number; wasRunningBeforeError: boolean; } export interface AnimationState { showPauseAnimation: boolean; showErrorAnimation: boolean; showPulsatingText: boolean; pulsatingFinished: boolean; showLabels: boolean; showMainText: boolean; showIdlePulsating: boolean; idleDotsCount: number; } //# sourceMappingURL=types.d.ts.map