import type { EditorProps } from '@monaco-editor/react'; import type { JSONSchema4 } from 'json-schema'; import type { CSSProperties } from 'react'; import type React from 'react'; import type { DeepUndefinable, MarkRequired } from 'ts-essentials'; import type { JoinFieldClientProps, JoinFieldErrorClientComponent, JoinFieldErrorServerComponent, JoinFieldLabelClientComponent, JoinFieldLabelServerComponent } from '../../admin/fields/Join.js'; import type { FieldClientComponent, FieldServerComponent } from '../../admin/forms/Field.js'; import type { RichTextAdapter, RichTextAdapterProvider } from '../../admin/RichText.js'; import type { ArrayFieldClientProps, ArrayFieldErrorClientComponent, ArrayFieldErrorServerComponent, ArrayFieldLabelClientComponent, ArrayFieldLabelServerComponent, BlocksFieldClientProps, BlocksFieldErrorClientComponent, BlocksFieldErrorServerComponent, BlocksFieldLabelClientComponent, BlocksFieldLabelServerComponent, CheckboxFieldClientProps, CheckboxFieldErrorClientComponent, CheckboxFieldErrorServerComponent, CheckboxFieldLabelClientComponent, CheckboxFieldLabelServerComponent, ClientTab, CodeFieldClientProps, CodeFieldErrorClientComponent, CodeFieldErrorServerComponent, CodeFieldLabelClientComponent, CodeFieldLabelServerComponent, CollapsibleFieldClientProps, CollapsibleFieldLabelClientComponent, CollapsibleFieldLabelServerComponent, ConditionalDateProps, Data, DateFieldClientProps, DateFieldErrorClientComponent, DateFieldErrorServerComponent, DateFieldLabelClientComponent, DateFieldLabelServerComponent, DefaultCellComponentProps, DefaultServerCellComponentProps, Description, EmailFieldClientProps, EmailFieldErrorClientComponent, EmailFieldErrorServerComponent, EmailFieldLabelClientComponent, EmailFieldLabelServerComponent, FieldDescriptionClientProps, FieldDescriptionServerProps, FieldDiffClientProps, FieldDiffServerProps, GroupFieldClientProps, GroupFieldLabelClientComponent, GroupFieldLabelServerComponent, HiddenFieldProps, JSONFieldClientProps, JSONFieldErrorClientComponent, JSONFieldErrorServerComponent, JSONFieldLabelClientComponent, JSONFieldLabelServerComponent, NumberFieldClientProps, NumberFieldErrorClientComponent, NumberFieldErrorServerComponent, NumberFieldLabelClientComponent, NumberFieldLabelServerComponent, PointFieldClientProps, PointFieldErrorClientComponent, PointFieldErrorServerComponent, PointFieldLabelClientComponent, PointFieldLabelServerComponent, RadioFieldClientProps, RadioFieldErrorClientComponent, RadioFieldErrorServerComponent, RadioFieldLabelClientComponent, RadioFieldLabelServerComponent, RelationshipFieldClientProps, RelationshipFieldErrorClientComponent, RelationshipFieldErrorServerComponent, RelationshipFieldLabelClientComponent, RelationshipFieldLabelServerComponent, RichTextFieldClientProps, RowFieldClientProps, RowLabelComponent, SelectFieldClientProps, SelectFieldErrorClientComponent, SelectFieldErrorServerComponent, SelectFieldLabelClientComponent, SelectFieldLabelServerComponent, StaticDescription, TabsFieldClientProps, TextareaFieldClientProps, TextareaFieldErrorClientComponent, TextareaFieldErrorServerComponent, TextareaFieldLabelClientComponent, TextareaFieldLabelServerComponent, TextFieldClientProps, TextFieldErrorClientComponent, TextFieldErrorServerComponent, TextFieldLabelClientComponent, TextFieldLabelServerComponent, UploadFieldClientProps } from '../../admin/types.js'; import type { SanitizedCollectionConfig, TypeWithID } from '../../collections/config/types.js'; import type { CustomComponent, LabelFunction, PayloadComponent, StaticLabel, Timezone, TimezonesConfig } from '../../config/types.js'; import type { DBIdentifierName } from '../../database/types.js'; import type { SanitizedGlobalConfig } from '../../globals/config/types.js'; import type { ArrayFieldValidation, BlocksFieldValidation, BlockSlug, CheckboxFieldValidation, CodeFieldValidation, CollectionSlug, DateFieldValidation, EmailFieldValidation, FieldCustom, JSONFieldValidation, PointFieldValidation, RadioFieldValidation, RequestContext, Sort, TextareaFieldValidation } from '../../index.js'; import type { DocumentPreferences } from '../../preferences/types.js'; import type { DefaultValue, JsonObject, Operation, PayloadRequest, PickPreserveOptional, Where } from '../../types/index.js'; import type { NumberFieldManyValidation, NumberFieldSingleValidation, RelationshipFieldManyValidation, RelationshipFieldSingleValidation, RichTextFieldValidation, SelectFieldManyValidation, SelectFieldSingleValidation, TextFieldManyValidation, TextFieldSingleValidation, UploadFieldManyValidation, UploadFieldSingleValidation } from '../validations.js'; export type FieldHookArgs = { /** * The data of the nearest parent block. If the field is not within a block, `blockData` will be equal to `undefined`. */ blockData: JsonObject | undefined; /** The collection which the field belongs to. If the field belongs to a global, this will be null. */ collection: null | SanitizedCollectionConfig; context: RequestContext; /** * Only available in `afterRead` hooks */ currentDepth?: number; /** * Only available in `afterRead` hooks */ /** The data passed to update the document within create and update operations, and the full document itself in the afterRead hook. */ data?: Partial; /** * Only available in the `afterRead` hook. */ depth?: number; draft?: boolean; /** The field which the hook is running against. */ field: FieldAffectingData; /** Boolean to denote if this hook is running against finding one, or finding many within the afterRead hook. */ findMany?: boolean; /** The global which the field belongs to. If the field belongs to a collection, this will be null. */ global: null | SanitizedGlobalConfig; indexPath: number[]; /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */ operation?: 'create' | 'delete' | 'read' | 'update'; /** The full original document in `update` operations. In the `afterChange` hook, this is the resulting document of the operation. */ originalDoc?: TData; overrideAccess?: boolean; /** * The path of the field, e.g. ["group", "myArray", 1, "textField"]. The path is the schemaPath but with indexes and would be used in the context of field data, not field schemas. */ path: (number | string)[]; /** The document before changes were applied, only in `afterChange` hooks. */ previousDoc?: TData; /** The sibling data of the document before changes being applied, only in `beforeChange`, `beforeValidate`, `beforeDuplicate` and `afterChange` field hooks. */ previousSiblingDoc?: TSiblingData; /** The previous value of the field, before changes, only in `beforeChange`, `afterChange`, `beforeDuplicate` and `beforeValidate` field hooks. */ previousValue?: TValue; /** The Express request object. It is mocked for Local API operations. */ req: PayloadRequest; /** * The schemaPath of the field, e.g. ["group", "myArray", "textField"]. The schemaPath is the path but without indexes and would be used in the context of field schemas, not field data. */ schemaPath: string[]; /** * Only available in the `afterRead` hook. */ showHiddenFields?: boolean; /** The sibling data passed to a field that the hook is running against. */ siblingData: Partial; /** * The original siblingData with locales (not modified by any hooks). Only available in `beforeChange` and `beforeDuplicate` field hooks. */ siblingDocWithLocales?: Record; /** * The sibling fields of the field which the hook is running against. */ siblingFields: (Field | TabAsField)[]; /** The value of the field. */ value?: TValue; }; export type FieldHook = (args: FieldHookArgs) => Promise | TValue; export type FieldAccessArgs = { /** * The data of the nearest parent block. If the field is not within a block, `blockData` will be equal to `undefined`. */ blockData?: JsonObject | undefined; /** * The incoming, top-level document data used to `create` or `update` the document with. */ data?: Partial; /** * The original data of the document before the `update` is applied. `doc` is undefined during the `create` operation. */ doc?: TData; /** * The `id` of the current document being read or updated. `id` is undefined during the `create` operation. */ id?: number | string; /** The `payload` object to interface with the payload API */ req: PayloadRequest; /** * Immediately adjacent data to this field. For example, if this is a `group` field, then `siblingData` will be the other fields within the group. */ siblingData?: Partial; }; export type FieldAccess = (args: FieldAccessArgs) => boolean | Promise; export type Condition = ( /** * The top-level document data */ data: Partial, /** * Immediately adjacent data to this field. For example, if this is a `group` field, then `siblingData` will be the other fields within the group. */ siblingData: Partial, { blockData, operation, path, user, }: { /** * The data of the nearest parent block. If the field is not within a block, `blockData` will be equal to `undefined`. */ blockData: Partial; /** * A string relating to which operation the field type is currently executing within. */ operation: Operation; /** * The path of the field, e.g. ["group", "myArray", 1, "textField"]. The path is the schemaPath but with indexes and would be used in the context of field data, not field schemas. */ path: (number | string)[]; user: PayloadRequest['user']; }) => boolean; export type FilterOptionsProps = { /** * The data of the nearest parent block. Will be `undefined` if the field is not within a block or when called on a `Filter` component within the list view. */ blockData: TData; /** * An object containing the full collection or global document currently being edited. Will be an empty object when called on a `Filter` component within the list view. */ data: TData; /** * The `id` of the current document being edited. Will be undefined during the `create` operation or when called on a `Filter` component within the list view. */ id: number | string; /** * The collection `slug` to filter against, limited to this field's `relationTo` property. */ relationTo: CollectionSlug; req: PayloadRequest; /** * An object containing document data that is scoped to only fields within the same parent of this field. Will be an empty object when called on a `Filter` component within the list view. */ siblingData: unknown; /** * An object containing the currently authenticated user. */ user: Partial; }; export type FilterOptionsFunc = (options: FilterOptionsProps) => boolean | Promise | Where; export type FilterOptions = FilterOptionsFunc | null | Where; type BlockSlugOrString = (({} & string) | BlockSlug)[]; export type BlocksFilterOptionsProps = { /** * The `id` of the current document being edited. Will be undefined during the `create` operation. */ id: number | string; } & Pick, 'data' | 'req' | 'siblingData' | 'user'>; export type BlocksFilterOptions = ((options: BlocksFilterOptionsProps) => BlockSlugOrString | Promise | true) | BlockSlugOrString; export type FieldPosition = 'main' | 'sidebar'; export type FieldAdmin = { className?: string; components?: { Cell?: PayloadComponent; Description?: PayloadComponent; Diff?: PayloadComponent; Field?: PayloadComponent; /** * The Filter component has to be a client component */ Filter?: PayloadComponent; }; /** * You can programmatically show / hide fields based on what other fields are doing. * This is also run on the server, to determine if the field should be validated. */ condition?: Condition; /** Extension point to add your custom data. Available in server and client. */ custom?: Record; /** * The field description will be displayed next to the field in the admin UI. Additionally, * we use the field description to generate JSDoc comments for the generated TypeScript types. */ description?: Description; disableBulkEdit?: boolean; disabled?: boolean; /** * Shows / hides fields from appearing in the list view groupBy options. * @type boolean */ disableGroupBy?: boolean; /** * Shows / hides fields from appearing in the list view column selector. * @type boolean */ disableListColumn?: boolean; /** * Shows / hides fields from appearing in the list view filter options. * @type boolean */ disableListFilter?: boolean; hidden?: boolean; position?: FieldPosition; readOnly?: boolean; style?: CSSProperties; width?: CSSProperties['width']; }; export type AdminClient = { className?: string; /** Extension point to add your custom data. Available in server and client. */ custom?: Record; description?: StaticDescription; disableBulkEdit?: boolean; disabled?: boolean; /** * Shows / hides fields from appearing in the list view groupBy options. * @type boolean */ disableGroupBy?: boolean; /** * Shows / hides fields from appearing in the list view column selector. * @type boolean */ disableListColumn?: boolean; /** * Shows / hides fields from appearing in the list view filter options. * @type boolean */ disableListFilter?: boolean; hidden?: boolean; position?: FieldPosition; readOnly?: boolean; style?: { '--field-width'?: CSSProperties['width']; } & CSSProperties; width?: CSSProperties['width']; }; export type Labels = { plural: LabelFunction | StaticLabel; singular: LabelFunction | StaticLabel; }; export type LabelsClient = { plural: StaticLabel; singular: StaticLabel; }; export type BaseValidateOptions = { /** * The data of the nearest parent block. If the field is not within a block, `blockData` will be equal to `undefined`. */ blockData: Partial; collectionSlug?: string; data: Partial; event?: 'onChange' | 'submit'; id?: number | string; operation?: Operation; /** * The `overrideAccess` flag that was attached to the request. This is used to bypass access control checks for fields. */ overrideAccess?: boolean; /** * The path of the field, e.g. ["group", "myArray", 1, "textField"]. The path is the schemaPath but with indexes and would be used in the context of field data, not field schemas. */ path: (number | string)[]; preferences: DocumentPreferences; previousValue?: TValue; req: PayloadRequest; required?: boolean; siblingData: Partial; }; export type ValidateOptions = BaseValidateOptions & TFieldConfig; export type Validate = (value: null | TValue | undefined, options: ValidateOptions) => Promise | string | true; export type OptionLabel = (() => React.JSX.Element) | LabelFunction | React.JSX.Element | StaticLabel; export type OptionObject = { label: OptionLabel; value: string; }; export type Option = OptionObject | string; export type FieldGraphQLType = { graphQL?: { /** * Complexity for the query. This is used to limit the complexity of the join query. * * @default 10 */ complexity?: number; }; }; export interface FieldBase { /** * Do not set this property manually. This is set to true during sanitization, to avoid * sanitizing the same field multiple times. */ _sanitized?: boolean; access?: { create?: FieldAccess; read?: FieldAccess; update?: FieldAccess; }; admin?: FieldAdmin; /** Extension point to add your custom data. Server only. */ custom?: FieldCustom; defaultValue?: DefaultValue; hidden?: boolean; hooks?: { afterChange?: FieldHook[]; afterRead?: FieldHook[]; beforeChange?: FieldHook[]; /** * Runs before a document is duplicated to prevent errors in unique fields or return null to use defaultValue. */ beforeDuplicate?: FieldHook[]; beforeValidate?: FieldHook[]; }; index?: boolean; label?: false | LabelFunction | StaticLabel; localized?: boolean; /** * The name of the field. Must be alphanumeric and cannot contain ' . ' * * Must not be one of reserved field names: ['__v', 'salt', 'hash', 'file'] * @link https://payloadcms.com/docs/fields/overview#field-names */ name: string; required?: boolean; saveToJWT?: boolean | string; /** * Allows you to modify the base JSON schema that is generated during generate:types for this field. * This JSON schema will be used to generate the TypeScript interface of this field. */ typescriptSchema?: Array<(args: { jsonSchema: JSONSchema4; }) => JSONSchema4>; unique?: boolean; validate?: Validate; /** * Pass `true` to disable field in the DB * for [Virtual Fields](https://payloadcms.com/blog/learn-how-virtual-fields-can-help-solve-common-cms-challenges): * A virtual field can be used in `admin.useAsTitle` only when linked to a relationship. */ virtual?: boolean | string; } export interface FieldBaseClient { admin?: AdminClient; hidden?: boolean; index?: boolean; label?: StaticLabel; localized?: boolean; /** * The name of the field. Must be alphanumeric and cannot contain ' . ' * * Must not be one of reserved field names: ['__v', 'salt', 'hash', 'file'] * @link https://payloadcms.com/docs/fields/overview#field-names */ name: string; required?: boolean; saveToJWT?: boolean | string; /** * Allows you to modify the base JSON schema that is generated during generate:types for this field. * This JSON schema will be used to generate the TypeScript interface of this field. */ typescriptSchema?: Array<(args: { jsonSchema: JSONSchema4; }) => JSONSchema4>; unique?: boolean; } export type NumberField = { admin?: { /** Set this property to a string that will be used for browser autocomplete. */ autoComplete?: string; components?: { afterInput?: CustomComponent[]; beforeInput?: CustomComponent[]; Error?: CustomComponent; Label?: CustomComponent; } & FieldAdmin['components']; /** Set this property to define a placeholder string for the field. */ placeholder?: Record | string; /** Set a value for the number field to increment / decrement using browser controls. */ step?: number; } & FieldAdmin; /** Maximum value accepted. Used in the default `validate` function. */ max?: number; /** Minimum value accepted. Used in the default `validate` function. */ min?: number; type: 'number'; } & ({ /** Makes this field an ordered array of numbers instead of just a single number. */ hasMany: true; /** Maximum number of numbers in the numbers array, if `hasMany` is set to true. */ maxRows?: number; /** Minimum number of numbers in the numbers array, if `hasMany` is set to true. */ minRows?: number; validate?: NumberFieldManyValidation; } | { /** Makes this field an ordered array of numbers instead of just a single number. */ hasMany?: false | undefined; /** Maximum number of numbers in the numbers array, if `hasMany` is set to true. */ maxRows?: undefined; /** Minimum number of numbers in the numbers array, if `hasMany` is set to true. */ minRows?: undefined; validate?: NumberFieldSingleValidation; }) & Omit; export type NumberFieldClient = { admin?: AdminClient & Pick; } & FieldBaseClient & Pick; export type TextField = { admin?: { autoComplete?: string; components?: { afterInput?: CustomComponent[]; beforeInput?: CustomComponent[]; Error?: CustomComponent; Label?: CustomComponent; } & FieldAdmin['components']; placeholder?: Record | string; rtl?: boolean; } & FieldAdmin; maxLength?: number; minLength?: number; type: 'text'; } & ({ /** Makes this field an ordered array of strings instead of just a single string. */ hasMany: true; /** Maximum number of strings in the strings array, if `hasMany` is set to true. */ maxRows?: number; /** Minimum number of strings in the strings array, if `hasMany` is set to true. */ minRows?: number; validate?: TextFieldManyValidation; } | { /** Makes this field an ordered array of strings instead of just a single string. */ hasMany?: false | undefined; /** Maximum number of strings in the strings array, if `hasMany` is set to true. */ maxRows?: undefined; /** Minimum number of strings in the strings array, if `hasMany` is set to true. */ minRows?: undefined; validate?: TextFieldSingleValidation; }) & Omit; export type TextFieldClient = { admin?: AdminClient & PickPreserveOptional, 'autoComplete' | 'placeholder' | 'rtl'>; } & FieldBaseClient & Pick; export type EmailField = { admin?: { autoComplete?: string; components?: { afterInput?: CustomComponent[]; beforeInput?: CustomComponent[]; Error?: CustomComponent; Label?: CustomComponent; } & FieldAdmin['components']; placeholder?: Record | string; } & FieldAdmin; type: 'email'; validate?: EmailFieldValidation; } & Omit; export type EmailFieldClient = { admin?: AdminClient & PickPreserveOptional, 'autoComplete' | 'placeholder'>; } & FieldBaseClient & Pick; export type TextareaField = { admin?: { components?: { afterInput?: CustomComponent[]; beforeInput?: CustomComponent[]; Error?: CustomComponent; Label?: CustomComponent; } & FieldAdmin['components']; placeholder?: Record | string; rows?: number; rtl?: boolean; } & FieldAdmin; maxLength?: number; minLength?: number; type: 'textarea'; validate?: TextareaFieldValidation; } & Omit; export type TextareaFieldClient = { admin?: AdminClient & PickPreserveOptional, 'placeholder' | 'rows' | 'rtl'>; } & FieldBaseClient & Pick; export type CheckboxField = { admin?: { components?: { afterInput?: CustomComponent[]; beforeInput?: CustomComponent[]; Error?: CustomComponent; Label?: CustomComponent; } & FieldAdmin['components']; } & FieldAdmin; type: 'checkbox'; validate?: CheckboxFieldValidation; } & Omit; export type CheckboxFieldClient = { admin?: AdminClient; } & FieldBaseClient & Pick; type DateFieldTimezoneConfigBase = { /** * Make only the timezone required in the admin interface. This means a timezone is always required to be selected. */ required?: boolean; supportedTimezones?: Timezone[]; } & Pick; type DateFieldTimezoneConfig = { /** * A function used to override the timezone field at a granular level. * Passes the base select field to you to manipulate beyond the exposed options. * @example * ```ts * { * type: 'date', * name: 'publishedAt', * timezone: { * override: ({ baseField }) => ({ * ...baseField, * admin: { * ...baseField.admin, * hidden: false, * }, * }), * }, * } * ``` */ override?: (args: { baseField: SelectField; }) => Field; } & DateFieldTimezoneConfigBase; type DateFieldTimezoneConfigClient = DateFieldTimezoneConfigBase; export type DateField = { admin?: { components?: { afterInput?: CustomComponent[]; beforeInput?: CustomComponent[]; Error?: CustomComponent; Label?: CustomComponent; } & FieldAdmin['components']; date?: ConditionalDateProps; placeholder?: Record | string; } & FieldAdmin; /** * Enable timezone selection in the admin interface. */ timezone?: DateFieldTimezoneConfig | true; type: 'date'; validate?: DateFieldValidation; } & Omit; export type DateFieldClient = { admin?: AdminClient & Pick; /** * Enable timezone selection in the admin interface. * Note: The `override` function is stripped on the client. */ timezone?: DateFieldTimezoneConfigClient | true; } & FieldBaseClient & Pick; export type GroupBase = { admin?: { components?: { afterInput?: CustomComponent[]; beforeInput?: CustomComponent[]; Label?: CustomComponent; } & FieldAdmin['components']; hideGutter?: boolean; } & FieldAdmin; fields: Field[]; type: 'group'; validate?: Validate; } & Omit; export type NamedGroupField = { /** Customize generated GraphQL and Typescript schema names. * By default, it is bound to the collection. * * This is useful if you would like to generate a top level type to share amongst collections/fields. * **Note**: Top level types can collide, ensure they are unique amongst collections, arrays, groups, blocks, tabs. */ interfaceName?: string; } & GroupBase; export type UnnamedGroupField = { interfaceName?: never; localized?: never; } & Omit; export type GroupField = NamedGroupField | UnnamedGroupField; export type UnnamedGroupFieldClient = { admin?: AdminClient & Pick; fields: ClientField[]; } & Omit & Pick; export type NamedGroupFieldClient = Pick & UnnamedGroupFieldClient; export type GroupFieldClient = NamedGroupFieldClient | UnnamedGroupFieldClient; export type RowField = { admin?: Omit; fields: Field[]; type: 'row'; } & Omit; export type RowFieldClient = { admin?: Omit; fields: ClientField[]; } & Omit & Pick; export type CollapsibleField = { fields: Field[]; type: 'collapsible'; } & ({ admin: { components: { afterInput?: CustomComponent[]; beforeInput?: CustomComponent[]; Label: CustomComponent; } & FieldAdmin['components']; initCollapsed?: boolean; } & FieldAdmin; label?: Required; } | { admin?: { components?: { afterInput?: CustomComponent[]; beforeInput?: CustomComponent[]; Label?: CustomComponent; } & FieldAdmin['components']; initCollapsed?: boolean; } & FieldAdmin; label: Required; }) & Omit; export type CollapsibleFieldClient = { admin?: { initCollapsed?: boolean; } & AdminClient; fields: ClientField[]; label: StaticLabel; } & Omit & Pick; type TabBase = { /** * @deprecated * Use `admin.description` instead. This will be removed in a future major version. */ description?: LabelFunction | StaticDescription; fields: Field[]; id?: string; interfaceName?: string; saveToJWT?: boolean | string; } & Omit; export type NamedTab = { /** Customize generated GraphQL and Typescript schema names. * The slug is used by default. * * This is useful if you would like to generate a top level type to share amongst collections/fields. * **Note**: Top level types can collide, ensure they are unique amongst collections, arrays, groups, blocks, tabs. */ interfaceName?: string; } & TabBase; export type UnnamedTab = { interfaceName?: never; /** * Can be either: * - A string, which will be used as the tab's label. * - An object, where the key is the language code and the value is the label. */ label: { [selectedLanguage: string]: string; } | LabelFunction | string; localized?: never; } & Omit; export type Tab = NamedTab | UnnamedTab; export type TabsField = { admin?: Omit; type: 'tabs'; } & { tabs: Tab[]; } & Omit; export type TabsFieldClient = { admin?: Omit; tabs: ClientTab[]; } & Omit & Pick; export type TabAsField = { name?: string; type: 'tab'; } & Tab; export type TabAsFieldClient = ClientTab & Pick; export type UIField = { admin: { components?: { /** * Allow any custom components to be added to the UI field. This allows * the UI field to be used as a vessel for getting components rendered. */ [key: string]: PayloadComponent | undefined; Cell?: CustomComponent; Field?: CustomComponent; /** * The Filter component has to be a client component */ Filter?: PayloadComponent; } & FieldAdmin['components']; condition?: Condition; /** Extension point to add your custom data. Available in server and client. */ custom?: Record; /** * Set `false` make the UI field appear in the list view column selector. `true` by default for UI fields. * @default true */ disableBulkEdit?: boolean; /** * Shows / hides fields from appearing in the list view column selector. * @type boolean */ disableListColumn?: boolean; position?: string; width?: CSSProperties['width']; }; /** Extension point to add your custom data. Server only. */ custom?: Record; label?: Record | string; name: string; type: 'ui'; }; export type UIFieldClient = { admin: DeepUndefinable & Pick; } & Omit, 'admin'> & // still include FieldBaseClient (even if it's undefinable) so that we don't need constant type checks (e.g. if('xy' in field)) Pick; type SharedUploadProperties = { /** * Toggle the preview in the admin interface. */ displayPreview?: boolean; filterOptions?: FilterOptions; /** * Sets a maximum population depth for this field, regardless of the remaining depth when this field is reached. * * {@link https://payloadcms.com/docs/getting-started/concepts#field-level-max-depth} */ maxDepth?: number; type: 'upload'; } & ({ hasMany: true; /** * @deprecated Use 'maxRows' instead */ max?: number; maxRows?: number; /** * @deprecated Use 'minRows' instead */ min?: number; minRows?: number; validate?: UploadFieldManyValidation; } | { hasMany?: false | undefined; /** * @deprecated Use 'maxRows' instead */ max?: undefined; maxRows?: undefined; /** * @deprecated Use 'minRows' instead */ min?: undefined; minRows?: undefined; validate?: UploadFieldSingleValidation; }) & FieldGraphQLType & Omit; type SharedUploadPropertiesClient = FieldBaseClient & Pick; type UploadAdmin = { allowCreate?: boolean; components?: { afterInput?: CustomComponent[]; beforeInput?: CustomComponent[]; Error?: CustomComponent; Label?: CustomComponent; } & FieldAdmin['components']; isSortable?: boolean; } & FieldAdmin; type UploadAdminClient = AdminClient & Pick; export type PolymorphicUploadField = { admin?: { sortOptions?: Partial>; } & UploadAdmin; /** * @todo v4: make relationTo: [] fail type checking */ relationTo: CollectionSlug[]; } & SharedUploadProperties; export type PolymorphicUploadFieldClient = { admin?: { sortOptions?: Pick; } & UploadAdminClient; } & Pick & SharedUploadPropertiesClient; export type SingleUploadField = { admin?: { sortOptions?: string; } & UploadAdmin; relationTo: CollectionSlug; } & SharedUploadProperties; export type SingleUploadFieldClient = { admin?: Pick & UploadAdminClient; } & Pick & SharedUploadPropertiesClient; export type UploadField = PolymorphicUploadField | SingleUploadField; export type UploadFieldClient = PolymorphicUploadFieldClient | SingleUploadFieldClient; export type CodeField = { admin?: { components?: { afterInput?: CustomComponent[]; beforeInput?: CustomComponent[]; Error?: CustomComponent; Label?: CustomComponent; } & FieldAdmin['components']; editorOptions?: EditorProps['options']; editorProps?: Partial; language?: string; } & FieldAdmin; maxLength?: number; minLength?: number; type: 'code'; validate?: CodeFieldValidation; } & Omit; export type CodeFieldClient = { admin?: AdminClient & Partial>; } & Omit & Pick; export type JSONField = { admin?: { components?: { afterInput?: CustomComponent[]; beforeInput?: CustomComponent[]; Error?: CustomComponent; Label?: CustomComponent; } & FieldAdmin['components']; editorOptions?: EditorProps['options']; maxHeight?: number; } & FieldAdmin; jsonSchema?: { fileMatch: string[]; schema: JSONSchema4; uri: string; }; type: 'json'; validate?: JSONFieldValidation; } & Omit; export type JSONFieldClient = { admin?: AdminClient & Pick; } & Omit & Pick; export type SelectField = { admin?: { components?: { afterInput?: CustomComponent[]; beforeInput?: CustomComponent[]; Error?: CustomComponent; Label?: CustomComponent; } & FieldAdmin['components']; isClearable?: boolean; isSortable?: boolean; placeholder?: LabelFunction | string; } & FieldAdmin; /** * Customize the SQL table name */ dbName?: DBIdentifierName; /** * Customize the DB enum name */ enumName?: DBIdentifierName; /** * Reduce the available options based on the current user, value of another field, etc. * Similar to the `filterOptions` property on `relationship` and `upload` fields, except with a different return type. */ filterOptions?: (args: { data: Data; options: Option[]; req: PayloadRequest; siblingData: Data; }) => Option[]; hasMany?: boolean; /** * Customize generated GraphQL and Typescript schema names. * By default, it is bound to the collection. * * This is useful if you would like to generate a top level type to share amongst collections/fields. * **Note**: Top level types can collide, ensure they are unique amongst collections, arrays, groups, blocks, tabs. */ interfaceName?: string; options: Option[]; type: 'select'; } & ({ hasMany: true; validate?: SelectFieldManyValidation; } | { hasMany?: false | undefined; validate?: SelectFieldSingleValidation; }) & Omit; export type SelectFieldClient = { admin?: AdminClient & Pick; } & FieldBaseClient & Pick; type SharedRelationshipProperties = { filterOptions?: FilterOptions; /** * Sets a maximum population depth for this field, regardless of the remaining depth when this field is reached. * * {@link https://payloadcms.com/docs/getting-started/concepts#field-level-max-depth} */ maxDepth?: number; type: 'relationship'; } & ({ hasMany: true; /** * @deprecated Use 'maxRows' instead */ max?: number; maxRows?: number; /** * @deprecated Use 'minRows' instead */ min?: number; minRows?: number; validate?: RelationshipFieldManyValidation; } | { hasMany?: false | undefined; /** * @deprecated Use 'maxRows' instead */ max?: undefined; maxRows?: undefined; /** * @deprecated Use 'minRows' instead */ min?: undefined; minRows?: undefined; validate?: RelationshipFieldSingleValidation; }) & FieldGraphQLType & Omit; type SharedRelationshipPropertiesClient = FieldBaseClient & Pick; type RelationshipAdmin = { allowCreate?: boolean; allowEdit?: boolean; appearance?: 'drawer' | 'select'; components?: { afterInput?: CustomComponent[]; beforeInput?: CustomComponent[]; Error?: CustomComponent; Label?: CustomComponent; } & FieldAdmin['components']; isSortable?: boolean; placeholder?: LabelFunction | string; } & FieldAdmin; type RelationshipAdminClient = AdminClient & Pick; export type PolymorphicRelationshipField = { admin?: { sortOptions?: Partial>; } & RelationshipAdmin; /** * @todo v4: make relationTo: [] fail type checking */ relationTo: CollectionSlug[]; } & SharedRelationshipProperties; export type PolymorphicRelationshipFieldClient = { admin?: { sortOptions?: PolymorphicRelationshipField['admin']['sortOptions']; } & RelationshipAdminClient; } & Pick & SharedRelationshipPropertiesClient; export type SingleRelationshipField = { admin?: { sortOptions?: string; } & RelationshipAdmin; relationTo: CollectionSlug; } & SharedRelationshipProperties; export type SingleRelationshipFieldClient = { admin?: Partial> & RelationshipAdminClient; } & Pick & SharedRelationshipPropertiesClient; export type RelationshipField = PolymorphicRelationshipField | SingleRelationshipField; export type RelationshipFieldClient = PolymorphicRelationshipFieldClient | SingleRelationshipFieldClient; export type ValueWithRelation = { relationTo: CollectionSlug; value: number | string; }; export declare function valueIsValueWithRelation(value: unknown): value is ValueWithRelation; export type RelationshipValue = RelationshipValueMany | RelationshipValueSingle; export type RelationshipValueMany = (number | string)[] | ValueWithRelation[]; export type RelationshipValueSingle = number | string | ValueWithRelation; export type RichTextField = { admin?: { components?: { afterInput?: CustomComponent[]; beforeInput?: CustomComponent[]; Error?: CustomComponent; Label?: CustomComponent; } & FieldAdmin['components']; } & FieldAdmin; editor?: RichTextAdapter | RichTextAdapterProvider; /** * Sets a maximum population depth for this field, regardless of the remaining depth when this field is reached. * * {@link https://payloadcms.com/docs/getting-started/concepts#field-level-max-depth} */ maxDepth?: number; type: 'richText'; validate?: RichTextFieldValidation; } & Omit & TExtraProperties; export type RichTextFieldClient = FieldBaseClient & Pick, 'maxDepth' | 'type'> & TExtraProperties; export type ArrayField = { admin?: { components?: { afterInput?: CustomComponent[]; beforeInput?: CustomComponent[]; Error?: CustomComponent; Label?: CustomComponent; RowLabel?: RowLabelComponent; } & FieldAdmin['components']; initCollapsed?: boolean; /** * Disable drag and drop sorting */ isSortable?: boolean; } & FieldAdmin; /** * Customize the SQL table name */ dbName?: DBIdentifierName; fields: Field[]; /** Customize generated GraphQL and Typescript schema names. * By default, it is bound to the collection. * * This is useful if you would like to generate a top level type to share amongst collections/fields. * **Note**: Top level types can collide, ensure they are unique amongst collections, arrays, groups, blocks, tabs. */ interfaceName?: string; labels?: Labels; maxRows?: number; minRows?: number; type: 'array'; validate?: ArrayFieldValidation; } & Omit; export type ArrayFieldClient = { admin?: AdminClient & Pick; fields: ClientField[]; labels?: LabelsClient; } & FieldBaseClient & Pick; export type RadioField = { admin?: { components?: { afterInput?: CustomComponent[]; beforeInput?: CustomComponent[]; Error?: CustomComponent; Label?: CustomComponent; } & FieldAdmin['components']; layout?: 'horizontal' | 'vertical'; } & FieldAdmin; /** * Customize the SQL table name */ dbName?: DBIdentifierName; /** * Customize the DB enum name */ enumName?: DBIdentifierName; /** Customize generated GraphQL and Typescript schema names. * By default, it is bound to the collection. * * This is useful if you would like to generate a top level type to share amongst collections/fields. * **Note**: Top level types can collide, ensure they are unique amongst collections, arrays, groups, blocks, tabs. */ interfaceName?: string; options: Option[]; type: 'radio'; validate?: RadioFieldValidation; } & Omit; export type RadioFieldClient = { admin?: AdminClient & Pick; } & FieldBaseClient & Pick; type BlockFields = { [key: string]: any; blockName?: string; blockType?: string; }; export type BlockJSX = { /** * Override the default regex used to search for the start of the block in the JSX. * By default, it's */ customStartRegex?: RegExp; /** * By default, all spaces at the beginning and end of every line of the * children (text between the open and close match) are removed. * Set this to true to disable this behavior. */ doNotTrimChildren?: boolean; /** * Function that receives the data for a given block and returns a JSX representation of it. * * This is used to convert Lexical => JSX */ export: (props: { fields: BlockFields; lexicalToMarkdown: (props: { editorState: Record; }) => string; }) => { children?: string; props?: object; } | false | string; /** * Function that receives the markdown string and parsed * JSX props for a given matched block and returns a Lexical representation of it. * * This is used to convert JSX => Lexical */ import: (props: { children: string; closeMatch: null | RegExpMatchArray; htmlToLexical?: ((props: { html: string; }) => any) | null; markdownToLexical: (props: { markdown: string; }) => Record; openMatch?: RegExpMatchArray; props: Record; }) => BlockFields | false; }; export type Block = { /** * Do not set this property manually. This is set to true during sanitization, to avoid * sanitizing the same block multiple times. */ _sanitized?: boolean; admin?: { components?: { /** * This will replace the entire block component, including the block header / collapsible. */ Block?: PayloadComponent; Label?: PayloadComponent; }; /** Extension point to add your custom data. Available in server and client. */ custom?: Record; /** * Hides the block name field from the Block's header * * @default false */ disableBlockName?: boolean; group?: Record | string; /** * Custom images for the block displayed in different UI contexts. * * @example * // Using string URLs (simplest form) * images: { * icon: 'https://example.com/icon.svg', * thumbnail: 'https://example.com/thumbnail.jpg', * } * * @example * // Using objects with alt text * images: { * icon: { url: 'https://example.com/icon.svg', alt: 'Quote icon' }, * thumbnail: { url: 'https://example.com/thumb.jpg', alt: 'Quote block thumbnail' }, * } */ images?: { /** * Icon image for the block in Lexical editor menus and toolbars (displayed at 20x20px). * Use square images or SVGs for best results. * Can be a URL string or an object with `url` and optional `alt` properties. */ icon?: { alt?: string; url: string; } | string; /** * Thumbnail image for the block in the Admin UI block selection drawer. * Preferred aspect ratio is 3:2 (e.g., 480x320, 600x400). * Can be a URL string or an object with `url` and optional `alt` properties. */ thumbnail?: { alt?: string; url: string; } | string; }; jsx?: PayloadComponent; }; /** Extension point to add your custom data. Server only. */ custom?: Record; /** * Customize the SQL table name */ dbName?: DBIdentifierName; fields: Field[]; /** @deprecated - please migrate to the interfaceName property instead. */ graphQL?: { singularName?: string; }; /** * @deprecated Use `admin.images` instead. */ imageAltText?: string; /** * @deprecated Use `admin.images` instead. Preferred aspect ratio of the image is 3:2. */ imageURL?: string; /** Customize generated GraphQL and Typescript schema names. * The slug is used by default. * * This is useful if you would like to generate a top level type to share amongst collections/fields. * **Note**: Top level types can collide, ensure they are unique amongst collections, arrays, groups, blocks, tabs. */ interfaceName?: string; jsx?: BlockJSX; labels?: Labels; slug: string; }; export type ClientBlock = { admin?: Pick, 'custom' | 'disableBlockName' | 'group' | 'images'>; fields: ClientField[]; labels?: LabelsClient; } & Pick; export type BlocksField = { admin?: { components?: { afterInput?: CustomComponent[]; beforeInput?: CustomComponent[]; Error?: CustomComponent; Label?: CustomComponent; } & FieldAdmin['components']; initCollapsed?: boolean; /** * Disable drag and drop sorting */ isSortable?: boolean; } & FieldAdmin; /** * Like `blocks`, but allows you to also pass strings that are slugs of blocks defined in `config.blocks`. * * @todo `blockReferences` will be merged with `blocks` in 4.0 */ blockReferences?: (Block | BlockSlug)[]; blocks: Block[]; defaultValue?: DefaultValue; /** * Blocks can be conditionally enabled using the `filterOptions` property on the blocks field. * It allows you to provide a function that returns which block slugs should be available based on the given context. * * @behavior * * - `filterOptions` is re-evaluated as part of the form state request, whenever the document data changes. * - If a block is present in the field but no longer allowed by `filterOptions`, a validation error will occur when saving. * * @example * * ```ts * { * name: 'blocksWithDynamicFilterOptions', * type: 'blocks', * filterOptions: ({ siblingData }) => { * return siblingData?.enabledBlocks?.length * ? [siblingData.enabledBlocks] // allow only the matching block * : true // allow all blocks if no value is set * }, * blocks: [ * { slug: 'block1', fields: [{ type: 'text', name: 'block1Text' }] }, * { slug: 'block2', fields: [{ type: 'text', name: 'block2Text' }] }, * { slug: 'block3', fields: [{ type: 'text', name: 'block3Text' }] }, * ], * } * ``` * In this example, the list of available blocks is determined by the enabledBlocks sibling field. If no value is set, all blocks remain available. */ filterOptions?: BlocksFilterOptions; labels?: Labels; maxRows?: number; minRows?: number; type: 'blocks'; validate?: BlocksFieldValidation; } & Omit; export type BlocksFieldClient = { admin?: AdminClient & Pick; /** * Like `blocks`, but allows you to also pass strings that are slugs of blocks defined in `config.blocks`. * * @todo `blockReferences` will be merged with `blocks` in 4.0 */ blockReferences?: (ClientBlock | string)[]; blocks: ClientBlock[]; labels?: LabelsClient; } & FieldBaseClient & Pick; export type PointField = { admin?: { components?: { afterInput?: CustomComponent[]; beforeInput?: CustomComponent[]; Error?: CustomComponent; Label?: CustomComponent; } & FieldAdmin['components']; placeholder?: Record | string; step?: number; } & FieldAdmin; type: 'point'; validate?: PointFieldValidation; } & Omit; export type PointFieldClient = { admin?: AdminClient & Pick; } & FieldBaseClient & Pick; /** * A virtual field that loads in related collections by querying a relationship or upload field. */ export type JoinField = { access?: { create?: never; read?: FieldAccess; update?: never; }; admin?: { allowCreate?: boolean; components?: { afterInput?: CustomComponent[]; beforeInput?: CustomComponent[]; Error?: CustomComponent; Label?: CustomComponent; } & FieldAdmin['components']; defaultColumns?: string[]; disableBulkEdit?: never; disableRowTypes?: boolean; readOnly?: never; } & FieldAdmin; /** * The slug of the collection to relate with. */ collection: CollectionSlug | CollectionSlug[]; defaultLimit?: number; defaultSort?: Sort; defaultValue?: never; /** * This does not need to be set and will be overridden by the relationship field's hasMany property. */ hasMany?: boolean; hidden?: false; index?: never; /** * This does not need to be set and will be overridden by the relationship field's localized property. */ localized?: boolean; /** * The maximum allowed depth to be permitted application-wide. This setting helps prevent against malicious queries. * * @see https://payloadcms.com/docs/getting-started/concepts#depth * * @default 1 */ maxDepth?: number; /** * A string for the field in the collection being joined to. */ on: string; /** * If true, enables custom ordering for the collection with the relationship, and joined documents can be reordered via drag and drop. * New documents are inserted at the end of the list according to this parameter. * * Under the hood, a field with {@link https://payloadcms.com/docs/configuration/collections#fractional-indexing|fractional indexing} is used to optimize inserts and reorderings. * * @default false * * @experimental There may be frequent breaking changes to this API */ orderable?: boolean; sanitizedMany?: JoinField[]; type: 'join'; validate?: never; where?: Where; } & FieldBase & FieldGraphQLType; export type JoinFieldClient = { admin?: AdminClient & Pick; } & { targetField: Pick; } & FieldBaseClient & Pick; export type FlattenedBlock = { flattenedFields: FlattenedField[]; } & Block; export type FlattenedBlocksField = { /** * Like `blocks`, but allows you to also pass strings that are slugs of blocks defined in `config.blocks`. * * @todo `blockReferences` will be merged with `blocks` in 4.0 */ blockReferences?: (FlattenedBlock | string)[]; blocks: FlattenedBlock[]; } & Omit; export type FlattenedGroupField = { flattenedFields: FlattenedField[]; name: string; } & GroupField; export type FlattenedArrayField = { flattenedFields: FlattenedField[]; } & ArrayField; export type FlattenedTabAsField = { flattenedFields: FlattenedField[]; } & MarkRequired; export type FlattenedJoinField = { targetField: RelationshipField | UploadField; } & JoinField; export type FlattenedField = CheckboxField | CodeField | DateField | EmailField | FlattenedArrayField | FlattenedBlocksField | FlattenedGroupField | FlattenedJoinField | FlattenedTabAsField | JSONField | NumberField | PointField | RadioField | RelationshipField | RichTextField | SelectField | TextareaField | TextField | UploadField; export type Field = ArrayField | BlocksField | CheckboxField | CodeField | CollapsibleField | DateField | EmailField | GroupField | JoinField | JSONField | NumberField | PointField | RadioField | RelationshipField | RichTextField | RowField | SelectField | TabsField | TextareaField | TextField | UIField | UploadField; export type ClientField = ArrayFieldClient | BlocksFieldClient | CheckboxFieldClient | CodeFieldClient | CollapsibleFieldClient | DateFieldClient | EmailFieldClient | GroupFieldClient | JoinFieldClient | JSONFieldClient | NumberFieldClient | PointFieldClient | RadioFieldClient | RelationshipFieldClient | RichTextFieldClient | RowFieldClient | SelectFieldClient | TabsFieldClient | TextareaFieldClient | TextFieldClient | UIFieldClient | UploadFieldClient; export type ClientFieldProps = ArrayFieldClientProps | BlocksFieldClientProps | CheckboxFieldClientProps | CodeFieldClientProps | CollapsibleFieldClientProps | DateFieldClientProps | EmailFieldClientProps | GroupFieldClientProps | HiddenFieldProps | JoinFieldClientProps | JSONFieldClientProps | NumberFieldClientProps | PointFieldClientProps | RadioFieldClientProps | RelationshipFieldClientProps | RichTextFieldClientProps | RowFieldClientProps | SelectFieldClientProps | TabsFieldClientProps | TextareaFieldClientProps | TextFieldClientProps | UploadFieldClientProps; type ExtractFieldTypes = T extends { type: infer U; } ? U : never; export type FieldTypes = ExtractFieldTypes; export type FieldAffectingData = ArrayField | BlocksField | CheckboxField | CodeField | DateField | EmailField | JoinField | JSONField | NamedGroupField | NumberField | PointField | RadioField | RelationshipField | RichTextField | SelectField | TabAsField | TextareaField | TextField | UploadField; export type FieldAffectingDataClient = ArrayFieldClient | BlocksFieldClient | CheckboxFieldClient | CodeFieldClient | DateFieldClient | EmailFieldClient | JoinFieldClient | JSONFieldClient | NamedGroupFieldClient | NumberFieldClient | PointFieldClient | RadioFieldClient | RelationshipFieldClient | RichTextFieldClient | SelectFieldClient | TabAsFieldClient | TextareaFieldClient | TextFieldClient | UploadFieldClient; export type NonPresentationalField = ArrayField | BlocksField | CheckboxField | CodeField | CollapsibleField | DateField | EmailField | JSONField | NamedGroupField | NumberField | PointField | RadioField | RelationshipField | RichTextField | RowField | SelectField | TabsField | TextareaField | TextField | UploadField; export type NonPresentationalFieldClient = ArrayFieldClient | BlocksFieldClient | CheckboxFieldClient | CodeFieldClient | CollapsibleFieldClient | DateFieldClient | EmailFieldClient | JSONFieldClient | NamedGroupFieldClient | NumberFieldClient | PointFieldClient | RadioFieldClient | RelationshipFieldClient | RichTextFieldClient | RowFieldClient | SelectFieldClient | TabsFieldClient | TextareaFieldClient | TextFieldClient | UploadFieldClient; export type FieldWithPath = { path?: string; } & Field; export type FieldWithPathClient = { path?: string; } & ClientField; export type FieldWithSubFields = ArrayField | CollapsibleField | GroupField | RowField; export type FieldWithSubFieldsClient = ArrayFieldClient | CollapsibleFieldClient | GroupFieldClient | RowFieldClient; export type FieldPresentationalOnly = UIField; export type FieldPresentationalOnlyClient = UIFieldClient; export type FieldWithMany = RelationshipField | SelectField; export type FieldWithManyClient = RelationshipFieldClient | SelectFieldClient; export type FieldWithMaxDepth = RelationshipField | UploadField; export type FieldWithMaxDepthClient = JoinFieldClient | RelationshipFieldClient | UploadFieldClient; export declare function fieldHasSubFields(field: TField): field is TField & (TField extends ClientField ? FieldWithSubFieldsClient : FieldWithSubFields); export declare function fieldIsArrayType(field: TField): field is TField & (TField extends ClientField ? ArrayFieldClient : ArrayField); export declare function fieldIsBlockType(field: TField): field is TField & (TField extends ClientField ? BlocksFieldClient : BlocksField); export declare function fieldIsGroupType(field: TField): field is TField & (TField extends ClientField ? GroupFieldClient : GroupField); export declare function optionIsObject(option: Option): option is OptionObject; export declare function optionsAreObjects(options: Option[]): options is OptionObject[]; export declare function optionIsValue(option: Option): option is string; export declare function fieldSupportsMany(field: TField): field is TField & (TField extends ClientField ? FieldWithManyClient : FieldWithMany); export declare function fieldHasMaxDepth(field: TField): field is TField & (TField extends ClientField ? FieldWithMaxDepthClient : FieldWithMaxDepth); export declare function fieldIsPresentationalOnly(field: TField): field is TField & (TField extends ClientField | TabAsFieldClient ? UIFieldClient : UIField); export declare function fieldIsSidebar(field: TField): field is { admin: { position: 'sidebar'; }; } & TField; export declare function fieldIsID(field: TField): field is { name: 'id'; } & TField; export declare function fieldIsHiddenOrDisabled(field: TField): field is { admin: { hidden: true; }; } & TField; export declare function fieldAffectsData(field: TField): field is TField & (TField extends ClientField | TabAsFieldClient ? FieldAffectingDataClient : FieldAffectingData); export declare function tabHasName(tab: TField): tab is NamedTab & TField; export declare function groupHasName(group: Partial): group is NamedGroupFieldClient; /** * Check if a field has localized: true set. This does not check if a field *should* * be localized. To check if a field should be localized, use `fieldShouldBeLocalized`. * * @deprecated this will be removed or modified in v4.0, as `fieldIsLocalized` can easily lead to bugs due to * parent field localization not being taken into account. */ export declare function fieldIsLocalized(field: Field | Tab): boolean; /** * Similar to `fieldIsLocalized`, but returns `false` if any parent field is localized. */ export declare function fieldShouldBeLocalized({ field, parentIsLocalized, }: { field: ClientField | ClientTab | Field | Tab; parentIsLocalized: boolean; }): boolean; export declare function fieldIsVirtual(field: Field | Tab): boolean; export type HookName = 'afterChange' | 'afterRead' | 'beforeChange' | 'beforeRead' | 'beforeValidate'; export {}; //# sourceMappingURL=types.d.ts.map