import { DynamicForm, FormItemInfo } from './form-items.mjs'; /** * Fluent-style builder helper class. * * I'm making this to share common fields' settings among witness classes. * * Descend from this class for sharing other commonalities. */ export declare class DynamicFormBuilder { protected lc: string; protected items: FormItemInfo[]; protected what: string; /** * pool of uuids pre-calculated to be passed in to the builder. if this is * falsy, then it will use a Math.random() based approach. */ protected idPool: string[]; /** * hacky wrapper for this.idPool.pop() */ protected getNewId(): string; /** * Start fluent calls with this. */ forA({ what, }: { /** * Common name for the reified concrete type of the witness. * * Used in things like placeholders, descriptions, etc. * * @example "robbot" or "space" */ what: string; }): DynamicFormBuilder; protected addItem(item: FormItemInfo): void; /** * Empty function simply for more natural looking fluent syntax. * * You can override this for custom form builders that descend from this * class. * * @returns this */ with({ idPool, }: { /** * pre-built pool of uuids to draw from. this builder * will mutate this array. */ idPool?: string[]; }): T; /** * I'm not a great fluent builder writer for TypeScript, * and this function acts as a caster for which members of * which concrete classes to expose for the proceeding builder lines. * * * Basically, you use this to typecast the builder, possibly redundantly since * I don't have any ordering implemented atow. * * @returns typecasted fluent builder */ and(): T; name({ of: value, required, defaultValue, }: { of: string; required?: boolean; defaultValue?: string; }): T; description({ of: value, required, defaultValue, }: { of: string; required?: boolean; defaultValue?: string; }): DynamicFormBuilder; classname({ of, required, }: { of: string; required?: boolean; }): DynamicFormBuilder; uuid({ of, label, required, }: { of: string; label?: string; required?: boolean; }): DynamicFormBuilder; version({ of, required, }: { of: string | undefined; required?: boolean; }): DynamicFormBuilder; /** * To pass in a completely customized item info. * * @returns `this` for fluent builder */ customItem(item: FormItemInfo): DynamicFormBuilder; outputItems(): FormItemInfo[]; outputForm({ formName, label, }: { formName: string; label?: string; }): DynamicForm; } //# sourceMappingURL=form-helper.d.mts.map