UNPKG

@datocms/cma-client

Version:
23 lines (22 loc) 987 B
import { type LocalizedFieldValue } from '../utilities/normalizedFieldValues'; import type { DatePickerEditorConfiguration } from './appearance/date_picker'; import type { DateRangeValidator } from './validators/date_range'; import type { RequiredValidator } from './validators/required'; export type DateFieldValue = string | null; export declare function isDateFieldValue(value: unknown): value is DateFieldValue; export declare function isLocalizedDateFieldValue(value: unknown): value is LocalizedFieldValue<DateFieldValue>; export type DateFieldValidators = { /** Value must be specified or it won't be valid */ required?: RequiredValidator; /** Accept dates only inside a specified date range */ date_range?: DateRangeValidator; }; export type DateFieldAppearance = { editor: 'date_picker'; parameters: DatePickerEditorConfiguration; } | { /** Plugin ID */ editor: string; /** Plugin configuration */ parameters: Record<string, unknown>; };