2018-09-11 15:53:27 -06:00
|
|
|
import { ResourceIndex } from "../../../resources/interfaces";
|
|
|
|
import { DropDownItem } from "../../../ui";
|
2020-04-21 15:37:08 -06:00
|
|
|
import { UpdateResource, TaggedSequence, Resource, Identifier } from "farmbot";
|
2018-09-11 15:53:27 -06:00
|
|
|
|
|
|
|
/** Function that converts resources into dropdown selections based on
|
|
|
|
* use-case specific rules */
|
|
|
|
export type ListBuilder = (i: ResourceIndex) => DropDownItem[];
|
|
|
|
|
|
|
|
/** Input data for calls to commitStepChanges() */
|
|
|
|
export interface MarkAsEditProps {
|
|
|
|
nextAction: DropDownItem;
|
|
|
|
nextResource: DropDownItem | undefined;
|
2020-04-21 15:37:08 -06:00
|
|
|
step: UpdateResource;
|
2018-09-11 15:53:27 -06:00
|
|
|
index: number;
|
|
|
|
sequence: TaggedSequence
|
|
|
|
}
|
|
|
|
|
2020-04-21 15:37:08 -06:00
|
|
|
export interface PackedStepWithResourceIndex {
|
|
|
|
step: UpdateResource;
|
|
|
|
resourceIndex: ResourceIndex;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface UnpackedStepWithResourceIndex {
|
|
|
|
resource: Resource | Identifier;
|
|
|
|
field: string;
|
|
|
|
value: string | number | boolean;
|
2018-09-11 15:53:27 -06:00
|
|
|
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;
|
|
|
|
}
|