UNPKG

@datocms/cma-client

Version:
30 lines (29 loc) 1.33 kB
import { type LocalizedFieldValue } from '../utilities/normalizedFieldValues'; import type { LinkEmbedEditorConfiguration } from './appearance/link_embed'; import type { LinkSelectEditorConfiguration } from './appearance/link_select'; import type { ItemItemTypeValidator } from './validators/item_item_type'; import type { RequiredValidator } from './validators/required'; import type { UniqueValidator } from './validators/unique'; export type LinkFieldValue = string | null; export declare function isLinkFieldValue(value: unknown): value is LinkFieldValue; export declare function isLocalizedLinkFieldValue(value: unknown): value is LocalizedFieldValue<LinkFieldValue>; export type LinkFieldValidators = { /** Only accept references to records of the specified models */ item_item_type: ItemItemTypeValidator; /** Value must be specified or it won't be valid */ required?: RequiredValidator; /** The value must be unique across the whole collection of records */ unique?: UniqueValidator; }; export type LinkFieldAppearance = { editor: 'link_select'; parameters: LinkSelectEditorConfiguration; } | { editor: 'link_embed'; parameters: LinkEmbedEditorConfiguration; } | { /** Plugin ID */ editor: string; /** Plugin configuration */ parameters: Record<string, unknown>; };