react-thermostat
Version:
A Controller to display temperature or use with a smart home integration like home assistant (react application talking to web sockets or rest api)
65 lines (61 loc) • 1.86 kB
text/typescript
import * as react_jsx_runtime from 'react/jsx-runtime';
import React from 'react';
interface HandleColors {
handle?: string;
icon?: string;
pulse?: string;
}
interface HandleProps {
size?: number;
colors?: HandleColors;
}
interface TrackProps {
colors?: string[];
thickness?: number;
markers?: {
enabled?: boolean;
every?: number;
count?: number;
main?: {
color?: string;
length?: number;
thickness?: number;
};
sub?: {
color?: string;
length?: number;
thickness?: number;
};
};
}
interface ThermostatProps extends Omit<React.ComponentProps<'div'>, 'onChange'> {
/** the minimum value */
min?: number;
/** the maximum value */
max?: number;
/** the current value */
value: number;
/** the suffix of the value in the center */
valueSuffix?: string;
/** Called every time the slider value changes */
onChange?: (value: number) => void;
/** the props for the handle */
handle?: HandleProps;
/** if the component should be disabled */
disabled?: boolean;
/** the props for the track */
track?: TrackProps;
}
declare function Thermostat({ min, max, value, valueSuffix, handle: handleInput, track: trackInput, onChange, disabled, ...rest }: ThermostatProps): react_jsx_runtime.JSX.Element;
interface ThermometerProps {
min: number;
max: number;
value: number;
size: number;
thickness?: number;
className?: string;
textColor?: string;
suffix?: string;
}
declare function Thermometer({ min, max, value, size, thickness, className, suffix }: ThermometerProps): react_jsx_runtime.JSX.Element;
export { HandleColors, HandleProps, Thermometer, ThermometerProps, Thermostat, ThermostatProps, TrackProps };