@wandelbots/wandelbots-js-react-components
Version:
React UI toolkit for building applications on top of the Wandelbots platform
49 lines • 1.9 kB
TypeScript
export declare enum ProgramState {
IDLE = "idle",
RUNNING = "running",
PAUSED = "paused",
STOPPING = "stopping",
ERROR = "error"
}
export interface ProgramControlProps {
/** The current state of the program control */
state: ProgramState;
/** Callback fired when the run/resume button is clicked */
onRun: () => void;
/** Callback fired when the pause button is clicked (only available in 'with_pause' variant) */
onPause?: () => void;
/** Callback fired when the stop button is clicked */
onStop: () => void;
/**
* Function to reset the component from 'stopping' state back to 'idle'.
* This must be called manually by the user when requiresManualReset is true.
*/
onReset?: () => void;
/**
* When true, the component will stay in 'stopping' state until onReset is called manually.
* When false (default), auto-resets to 'idle' after 2 seconds.
*/
requiresManualReset?: boolean;
/**
* Variant of the component:
* - 'with_pause': Shows run/pause/stop buttons (default)
* - 'without_pause': Shows only run/stop buttons
*/
variant?: "with_pause" | "without_pause";
/** Additional CSS class name */
className?: string;
}
/**
* A control component for program execution with run, pause, and stop functionality.
*
* Features:
* - State machine with idle, running, paused, stopping, and error states
* - Two variants: with_pause (3 buttons) and without_pause (2 buttons)
* - Optional manual reset functionality
* - Responsive design with 110px circular buttons
* - Material-UI theming integration
*/
export declare const ProgramControl: (({ state, onRun, onPause, onStop, onReset, requiresManualReset, variant, className, }: ProgramControlProps) => import("react/jsx-runtime").JSX.Element) & {
displayName: string;
};
//# sourceMappingURL=ProgramControl.d.ts.map