/** * ObjectUI * Copyright (c) 2024-present ObjectStack Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ /** * The slice of a field definition the widget decision reads beyond `type`. * * Structural (not the spec `Field`) for the same reason the spec's own * `ValueShapeFieldDef` is: every caller — object-schema metadata, a spec * `FormFieldSchema` override, an action param def — can pass its own trimmed * shape verbatim. `multiple` is the only key read; nothing else here is * consulted, so a caller that has the whole metadata object may hand it over * as-is. */ export interface FieldTypeMappingConfig { /** `FieldSchema.multiple` — the field holds zero-or-more values. */ multiple?: boolean | null; } /** * The retirement half of this module — the TOMBSTONE table * {@link RETIRED_FIELD_TYPES}, the {@link isRetiredFieldType} gate, and the * once-per-spelling reporter — now lives in `@object-ui/core` * (`utils/retired-field-types.ts`), hoisted there by objectui#4914 so that * `@object-ui/components`' filter builder can read the SAME table: `fields` * depends on `components`, so the six ruled predicate faces could not all * reach a table that lived here. The module's docblock carries the full * reasoning, including why a second copy in `components` would have broken the * ruling's "fires once" clause on day one. * * Re-exported from here, and from the `./index` barrel, so `@object-ui/fields`' * published surface is exactly what it was plus the newly ruled gate. This file * remains the retirement table's first consumer (the `field:text` tail below). */ export { RETIRED_FIELD_TYPES, isRetiredFieldType, reportRetiredFieldType, resetRetiredFieldTypeReports, } from '@object-ui/core'; /** * Map field type to form component type * * @param fieldType - The ObjectQL field type identifier to convert * (for example: `"text"`, `"number"`, `"date"`, `"lookup"`). * @param config - The rest of the field definition, for the types whose widget * identity depends on more than the type string. Only `multiple` is read; see * {@link MULTI_VALUE_FORM_TYPES}. Omitting it maps the single-value form, which * is what every non-multi-capable type resolves to anyway. * @returns The normalized form field type string used in the form schema * (for example: `"input"`, `"textarea"`, `"date-picker"`, `"select"`). */ export declare function mapFieldTypeToFormType(fieldType: string, config?: FieldTypeMappingConfig): string;