jsketcher/web/app/cad/mdf/ui/field.ts
2022-06-25 15:19:48 -07:00

24 lines
No EOL
533 B
TypeScript

import {OperationParamValue, ValueResolver} from "cad/craft/schema/schema";
import {ParamsPathSegment} from "cad/craft/wizard/wizardTypes";
export interface FieldBasicProps {
name: ParamsPathSegment;
label?: string;
defaultValue?: OperationParamValue;
optional?: boolean;
resolve?: ValueResolver<any, any>
}
export function fieldToSchemaGeneric(props: FieldBasicProps) {
return {
label: props.label,
defaultValue: props.defaultValue,
optional: !!props.optional,
resolve: props.resolve
}
}