import { Context } from "koa"; import { FieldTypes as SealiousFieldTypes } from "sealious"; import { FormField } from "./field.js"; import { MultipleFiles as MultipleFilesControl } from "../controls/multiple-files.js"; export class MultipleFiles extends FormField< false, undefined, MultipleFilesControl > { constructor( public collection_field: SealiousFieldTypes.ReverseSingleReference, public getItemId: (ctx: Context) => Promise | string ) { super(false); } getEmptyValue() { return undefined; } async parse() { return { parsed_value: undefined, parsable: true, error: null }; // the control is supposed to do the heavy lifting here } getControl() { return new MultipleFilesControl(this); } }