Farmbot-Web-App/frontend/controls/interfaces.ts

63 lines
1.6 KiB
TypeScript
Raw Normal View History

2019-12-27 11:37:54 -07:00
import {
2020-02-28 09:35:32 -07:00
BotState, Xyz, BotPosition, ShouldDisplay, UserEnv,
2019-12-27 11:37:54 -07:00
} from "../devices/interfaces";
2020-02-07 16:06:40 -07:00
import { Vector3, McuParams, FirmwareHardware } from "farmbot/dist";
import {
TaggedWebcamFeed,
2018-03-10 00:17:53 -07:00
TaggedPeripheral,
2018-07-19 23:48:32 -06:00
TaggedSensor,
2020-02-28 09:35:32 -07:00
TaggedSensorReading,
2018-08-01 07:03:35 -06:00
} from "farmbot";
2018-05-01 23:25:09 -06:00
import { GetWebAppConfigValue } from "../config_storage/actions";
2019-04-09 23:17:03 -06:00
import { TimeSettings } from "../interfaces";
2017-06-29 12:54:02 -06:00
export interface Props {
dispatch: Function;
bot: BotState;
2017-09-19 07:25:18 -06:00
feeds: TaggedWebcamFeed[];
2017-06-29 12:54:02 -06:00
peripherals: TaggedPeripheral[];
2018-03-10 00:17:53 -07:00
sensors: TaggedSensor[];
2018-03-09 02:34:24 -07:00
firmwareSettings: McuParams;
2018-03-10 00:17:53 -07:00
shouldDisplay: ShouldDisplay;
2018-05-01 23:25:09 -06:00
getWebAppConfigVal: GetWebAppConfigValue;
2018-07-19 23:48:32 -06:00
sensorReadings: TaggedSensorReading[];
2019-04-09 23:17:03 -06:00
timeSettings: TimeSettings;
2019-12-27 11:37:54 -07:00
env: UserEnv;
2020-02-07 16:06:40 -07:00
firmwareHardware: FirmwareHardware | undefined;
2017-06-29 12:54:02 -06:00
}
2017-07-26 14:29:35 -06:00
export interface AxisDisplayGroupProps {
2017-08-02 17:59:34 -06:00
position: BotPosition;
2017-07-26 14:29:35 -06:00
label: string;
}
2017-06-29 12:54:02 -06:00
export interface AxisInputBoxGroupProps {
2019-02-27 19:29:38 -07:00
onCommit: (v: Vector3) => void;
position: BotPosition;
2017-08-10 18:59:01 -06:00
disabled: boolean | undefined;
2017-06-29 12:54:02 -06:00
}
export interface AxisInputBoxGroupState {
x?: number | undefined;
y?: number | undefined;
z?: number | undefined;
}
export interface AxisInputBoxProps {
axis: Xyz;
value: number | undefined;
onChange: (key: string, val: number | undefined) => void;
}
export interface ToggleButtonProps {
/** Function that is executed when the toggle button is clicked */
toggleAction: () => void;
toggleValue: number | string | boolean | undefined;
2017-06-29 12:54:02 -06:00
disabled?: boolean | undefined;
2017-12-20 20:01:40 -07:00
customText?: { textFalse: string, textTrue: string };
2018-01-27 02:29:13 -07:00
dim?: boolean;
2018-01-29 13:53:24 -07:00
grayscale?: boolean;
2018-12-03 20:05:45 -07:00
title?: string;
2020-03-13 15:06:40 -06:00
className?: string;
2017-06-29 12:54:02 -06:00
}