import type { JSONSchema7, JSONSchema7TypeName } from 'json-schema'; import type { LocalizedText } from '../utils'; import type { DateOptions } from './date'; import type { FiltersOptions } from './filter'; import type { FormLinkOptions } from './link'; import type { LookupOptions } from './lookup'; export declare type CellIconShape = 'square' | 'roundedSquare'; export interface CellIcon { shape?: CellIconShape; color?: string; } export interface VisualizationOptions { template?: LocalizedText; hidden?: boolean; hiddenLabel?: boolean; iconMap?: Record; joinDelimiter?: string; sortable?: boolean; tag?: string; properties?: Record; } export declare type ExtendedJSONSchema7TypeName = JSONSchema7TypeName | 'form-addon' | 'custom'; export declare type DateFormat = 'date-time' | 'time' | 'date'; export declare type TextFormat = 'email' | 'uri' | 'regex' | 'password' | 'text'; export declare type EditorFormat = 'editor' | 'html-editor'; export declare type StringFormat = DateFormat | TextFormat | EditorFormat | 'text-area' | 'lookup'; export declare type ObjectFormat = 'file' | 'localized-text'; export declare type ArrayFormat = 'multilookup'; export declare type FormAddonFormat = 'link' | 'title' | 'subtitle'; export declare type DataFormat = StringFormat | ArrayFormat | FormAddonFormat | ObjectFormat | string; export declare type PropertySchemaType = ExtendedJSONSchema7TypeName | ExtendedJSONSchema7TypeName[] | undefined; export interface HiddenOptions { hidden?: boolean; hiddenOnUpdate?: boolean; hiddenOnInsert?: boolean; } export interface ReadOnlyOptions { readOnly?: boolean; readOnlyOnUpdate?: boolean; readOnlyOnInsert?: boolean; } export interface DisabledOptions { disabled?: boolean; disabledOnUpdate?: boolean; disabledOnInsert?: boolean; } export interface FormOptions { template?: LocalizedText; disabled?: boolean; hidden?: boolean; placeholder?: LocalizedText; readOnly?: boolean; showFileInViewer?: boolean; geopointFormat?: ['lat', 'lon'] | ['lon', 'lat']; isPartialFormat?: boolean; } export interface ExtendedJSONSchema7Definition extends Omit { type?: PropertySchemaType; properties?: { [key: string]: ExtendedJSONSchema7Definition; } | undefined; items?: ExtendedJSONSchema7Definition | undefined; dataSchema?: ExtendedJSONSchema7Definition | undefined; /** Formats of certain kind of types that are commonly used. */ format?: DataFormat; /** Specific configuration for the form components. */ formOptions?: FormOptions & HiddenOptions & ReadOnlyOptions & DisabledOptions; /** * Human readable name of the property. * It will be displayed in the table, form, filters, ecc... */ label?: LocalizedText; /** * Human readable description of the property. * It will be displayed in the form as info tooltip next to the label */ description?: LocalizedText; /** * Options for lookups. Only applicable for type "string" and * format "lookup" or type "array" and format * "multilookup". */ lookupOptions?: LookupOptions; /** Sorting order to be used when displaying the properties */ order?: number; /** Specific configuration for the visualization components. */ visualizationOptions?: VisualizationOptions; /** Specific configuration for values of type string and format date-time, date, or time. */ dateOptions?: DateOptions; /** Specific configuration for values of type form-addon and format link. */ formLinkOptions?: FormLinkOptions; /** Specific configuration for the filters components. */ filtersOptions?: FiltersOptions; /** Mark this field as unique or as unique key */ unique?: boolean; /** Exclude this field from the query generated by a free search */ excludeFromSearch?: boolean; } export declare type DataSchema = ExtendedJSONSchema7Definition;