Farmbot-Web-App/frontend/sequences/step_tiles/mark_as/interfaces.ts

34 lines
1.0 KiB
TypeScript
Raw Normal View History

2018-09-11 15:53:27 -06:00
import { ResourceIndex } from "../../../resources/interfaces";
import { DropDownItem } from "../../../ui";
import { ResourceUpdate, TaggedSequence } from "farmbot";
/** Function that converts resources into dropdown selections based on
* use-case specific rules */
export type ListBuilder = (i: ResourceIndex) => DropDownItem[];
/** Shape of step.args when step.kind = "resource_update" */
export type ResourceUpdateArgs = Partial<ResourceUpdate["args"]>;
/** Input data for calls to commitStepChanges() */
export interface MarkAsEditProps {
nextAction: DropDownItem;
nextResource: DropDownItem | undefined;
step: ResourceUpdate;
index: number;
sequence: TaggedSequence
}
export interface StepWithResourceIndex {
step: ResourceUpdate;
resourceIndex: ResourceIndex;
}
/** A pair of DropDownItems used to render the currently selected items in the
* "Mark As.." block. */
export interface DropDownPair {
/** Left side drop down */
leftSide: DropDownItem;
/** Right side drop down */
rightSide: DropDownItem;
}