payload 3.0.0-beta.78 → 3.0.0-beta.79

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (234) hide show
  1. package/bin.js +33 -10
  2. package/dist/admin/RichText.d.ts +20 -17
  3. package/dist/admin/RichText.d.ts.map +1 -1
  4. package/dist/admin/RichText.js.map +1 -1
  5. package/dist/admin/elements/Cell.d.ts +11 -26
  6. package/dist/admin/elements/Cell.d.ts.map +1 -1
  7. package/dist/admin/elements/Cell.js.map +1 -1
  8. package/dist/admin/elements/Tab.d.ts +16 -15
  9. package/dist/admin/elements/Tab.d.ts.map +1 -1
  10. package/dist/admin/elements/Tab.js.map +1 -1
  11. package/dist/admin/fields/Array.d.ts +6 -13
  12. package/dist/admin/fields/Array.d.ts.map +1 -1
  13. package/dist/admin/fields/Array.js.map +1 -1
  14. package/dist/admin/fields/Blocks.d.ts +8 -25
  15. package/dist/admin/fields/Blocks.d.ts.map +1 -1
  16. package/dist/admin/fields/Blocks.js.map +1 -1
  17. package/dist/admin/fields/Checkbox.d.ts +9 -9
  18. package/dist/admin/fields/Checkbox.d.ts.map +1 -1
  19. package/dist/admin/fields/Checkbox.js.map +1 -1
  20. package/dist/admin/fields/Code.d.ts +5 -7
  21. package/dist/admin/fields/Code.d.ts.map +1 -1
  22. package/dist/admin/fields/Code.js.map +1 -1
  23. package/dist/admin/fields/Collapsible.d.ts +3 -4
  24. package/dist/admin/fields/Collapsible.d.ts.map +1 -1
  25. package/dist/admin/fields/Collapsible.js.map +1 -1
  26. package/dist/admin/fields/Date.d.ts +4 -7
  27. package/dist/admin/fields/Date.d.ts.map +1 -1
  28. package/dist/admin/fields/Date.js.map +1 -1
  29. package/dist/admin/fields/Email.d.ts +5 -7
  30. package/dist/admin/fields/Email.d.ts.map +1 -1
  31. package/dist/admin/fields/Email.js.map +1 -1
  32. package/dist/admin/fields/Group.d.ts +3 -6
  33. package/dist/admin/fields/Group.d.ts.map +1 -1
  34. package/dist/admin/fields/Group.js.map +1 -1
  35. package/dist/admin/fields/Hidden.d.ts +7 -5
  36. package/dist/admin/fields/Hidden.d.ts.map +1 -1
  37. package/dist/admin/fields/Hidden.js.map +1 -1
  38. package/dist/admin/fields/JSON.d.ts +4 -7
  39. package/dist/admin/fields/JSON.d.ts.map +1 -1
  40. package/dist/admin/fields/JSON.js.map +1 -1
  41. package/dist/admin/fields/Number.d.ts +5 -12
  42. package/dist/admin/fields/Number.d.ts.map +1 -1
  43. package/dist/admin/fields/Number.js.map +1 -1
  44. package/dist/admin/fields/Point.d.ts +4 -6
  45. package/dist/admin/fields/Point.d.ts.map +1 -1
  46. package/dist/admin/fields/Point.js.map +1 -1
  47. package/dist/admin/fields/Radio.d.ts +6 -9
  48. package/dist/admin/fields/Radio.d.ts.map +1 -1
  49. package/dist/admin/fields/Radio.js.map +1 -1
  50. package/dist/admin/fields/Relationship.d.ts +4 -9
  51. package/dist/admin/fields/Relationship.d.ts.map +1 -1
  52. package/dist/admin/fields/Relationship.js.map +1 -1
  53. package/dist/admin/fields/RichText.d.ts +5 -6
  54. package/dist/admin/fields/RichText.d.ts.map +1 -1
  55. package/dist/admin/fields/RichText.js.map +1 -1
  56. package/dist/admin/fields/Row.d.ts +3 -4
  57. package/dist/admin/fields/Row.d.ts.map +1 -1
  58. package/dist/admin/fields/Row.js.map +1 -1
  59. package/dist/admin/fields/Select.d.ts +6 -11
  60. package/dist/admin/fields/Select.d.ts.map +1 -1
  61. package/dist/admin/fields/Select.js.map +1 -1
  62. package/dist/admin/fields/Tabs.d.ts +8 -12
  63. package/dist/admin/fields/Tabs.d.ts.map +1 -1
  64. package/dist/admin/fields/Tabs.js.map +1 -1
  65. package/dist/admin/fields/Text.d.ts +7 -13
  66. package/dist/admin/fields/Text.d.ts.map +1 -1
  67. package/dist/admin/fields/Text.js.map +1 -1
  68. package/dist/admin/fields/Textarea.d.ts +7 -9
  69. package/dist/admin/fields/Textarea.d.ts.map +1 -1
  70. package/dist/admin/fields/Textarea.js.map +1 -1
  71. package/dist/admin/fields/Upload.d.ts +6 -7
  72. package/dist/admin/fields/Upload.d.ts.map +1 -1
  73. package/dist/admin/fields/Upload.js.map +1 -1
  74. package/dist/admin/forms/Error.d.ts +10 -10
  75. package/dist/admin/forms/Error.d.ts.map +1 -1
  76. package/dist/admin/forms/Error.js.map +1 -1
  77. package/dist/admin/forms/Field.d.ts +17 -24
  78. package/dist/admin/forms/Field.d.ts.map +1 -1
  79. package/dist/admin/forms/Field.js +1 -0
  80. package/dist/admin/forms/Field.js.map +1 -1
  81. package/dist/admin/forms/FieldDescription.d.ts +10 -9
  82. package/dist/admin/forms/FieldDescription.d.ts.map +1 -1
  83. package/dist/admin/forms/FieldDescription.js.map +1 -1
  84. package/dist/admin/forms/Label.d.ts +14 -15
  85. package/dist/admin/forms/Label.d.ts.map +1 -1
  86. package/dist/admin/forms/Label.js.map +1 -1
  87. package/dist/admin/types.d.ts +30 -11
  88. package/dist/admin/types.d.ts.map +1 -1
  89. package/dist/admin/types.js.map +1 -1
  90. package/dist/admin/views/types.d.ts +21 -13
  91. package/dist/admin/views/types.d.ts.map +1 -1
  92. package/dist/admin/views/types.js.map +1 -1
  93. package/dist/auth/baseFields/apiKey.js +2 -2
  94. package/dist/auth/baseFields/apiKey.js.map +1 -1
  95. package/dist/auth/baseFields/email.js +1 -1
  96. package/dist/auth/baseFields/email.js.map +1 -1
  97. package/dist/auth/baseFields/username.js +1 -1
  98. package/dist/auth/baseFields/username.js.map +1 -1
  99. package/dist/auth/baseFields/verification.js +1 -1
  100. package/dist/auth/baseFields/verification.js.map +1 -1
  101. package/dist/bin/generateImportMap/index.d.ts +47 -0
  102. package/dist/bin/generateImportMap/index.d.ts.map +1 -0
  103. package/dist/bin/generateImportMap/index.js +129 -0
  104. package/dist/bin/generateImportMap/index.js.map +1 -0
  105. package/dist/bin/generateImportMap/iterateCollections.d.ts +12 -0
  106. package/dist/bin/generateImportMap/iterateCollections.d.ts.map +1 -0
  107. package/dist/bin/generateImportMap/iterateCollections.js +41 -0
  108. package/dist/bin/generateImportMap/iterateCollections.js.map +1 -0
  109. package/dist/bin/generateImportMap/iterateConfig.d.ts +10 -0
  110. package/dist/bin/generateImportMap/iterateConfig.d.ts.map +1 -0
  111. package/dist/bin/generateImportMap/iterateConfig.js +75 -0
  112. package/dist/bin/generateImportMap/iterateConfig.js.map +1 -0
  113. package/dist/bin/generateImportMap/iterateFields.d.ts +12 -0
  114. package/dist/bin/generateImportMap/iterateFields.d.ts.map +1 -0
  115. package/dist/bin/generateImportMap/iterateFields.js +56 -0
  116. package/dist/bin/generateImportMap/iterateFields.js.map +1 -0
  117. package/dist/bin/generateImportMap/iterateGlobals.d.ts +12 -0
  118. package/dist/bin/generateImportMap/iterateGlobals.d.ts.map +1 -0
  119. package/dist/bin/generateImportMap/iterateGlobals.js +34 -0
  120. package/dist/bin/generateImportMap/iterateGlobals.js.map +1 -0
  121. package/dist/bin/generateImportMap/parsePayloadComponent.d.ts +6 -0
  122. package/dist/bin/generateImportMap/parsePayloadComponent.d.ts.map +1 -0
  123. package/dist/bin/generateImportMap/parsePayloadComponent.js +19 -0
  124. package/dist/bin/generateImportMap/parsePayloadComponent.js.map +1 -0
  125. package/dist/bin/index.d.ts.map +1 -1
  126. package/dist/bin/index.js +35 -4
  127. package/dist/bin/index.js.map +1 -1
  128. package/dist/collections/config/client.d.ts +32 -308
  129. package/dist/collections/config/client.d.ts.map +1 -1
  130. package/dist/collections/config/client.js +1 -82
  131. package/dist/collections/config/client.js.map +1 -1
  132. package/dist/collections/config/types.d.ts +9 -9
  133. package/dist/collections/config/types.d.ts.map +1 -1
  134. package/dist/collections/config/types.js.map +1 -1
  135. package/dist/config/client.d.ts +12 -6
  136. package/dist/config/client.d.ts.map +1 -1
  137. package/dist/config/client.js +1 -49
  138. package/dist/config/client.js.map +1 -1
  139. package/dist/config/defaults.d.ts.map +1 -1
  140. package/dist/config/defaults.js +4 -0
  141. package/dist/config/defaults.js.map +1 -1
  142. package/dist/config/types.d.ts +111 -52
  143. package/dist/config/types.d.ts.map +1 -1
  144. package/dist/config/types.js.map +1 -1
  145. package/dist/exports/node.d.ts +0 -1
  146. package/dist/exports/node.d.ts.map +1 -1
  147. package/dist/exports/node.js +0 -1
  148. package/dist/exports/node.js.map +1 -1
  149. package/dist/exports/shared.d.ts +2 -1
  150. package/dist/exports/shared.d.ts.map +1 -1
  151. package/dist/exports/shared.js +2 -1
  152. package/dist/exports/shared.js.map +1 -1
  153. package/dist/fields/config/client.d.ts +3 -1642
  154. package/dist/fields/config/client.d.ts.map +1 -1
  155. package/dist/fields/config/client.js +1 -81
  156. package/dist/fields/config/client.js.map +1 -1
  157. package/dist/fields/config/sanitize.d.ts.map +1 -1
  158. package/dist/fields/config/sanitize.js +23 -22
  159. package/dist/fields/config/sanitize.js.map +1 -1
  160. package/dist/fields/config/types.d.ts +385 -56
  161. package/dist/fields/config/types.d.ts.map +1 -1
  162. package/dist/fields/config/types.js +3 -0
  163. package/dist/fields/config/types.js.map +1 -1
  164. package/dist/globals/config/client.d.ts +26 -14
  165. package/dist/globals/config/client.d.ts.map +1 -1
  166. package/dist/globals/config/client.js +1 -47
  167. package/dist/globals/config/client.js.map +1 -1
  168. package/dist/globals/config/types.d.ts +3 -3
  169. package/dist/globals/config/types.js.map +1 -1
  170. package/dist/index.d.ts +15 -11
  171. package/dist/index.d.ts.map +1 -1
  172. package/dist/index.js +7 -7
  173. package/dist/index.js.map +1 -1
  174. package/dist/uploads/getBaseFields.d.ts.map +1 -1
  175. package/dist/uploads/getBaseFields.js +5 -2
  176. package/dist/uploads/getBaseFields.js.map +1 -1
  177. package/dist/uploads/types.d.ts +4 -0
  178. package/dist/uploads/types.d.ts.map +1 -1
  179. package/dist/uploads/types.js.map +1 -1
  180. package/dist/utilities/fieldSchemaToJSON.d.ts +4 -4
  181. package/dist/utilities/fieldSchemaToJSON.d.ts.map +1 -1
  182. package/dist/utilities/fieldSchemaToJSON.js +0 -10
  183. package/dist/utilities/fieldSchemaToJSON.js.map +1 -1
  184. package/dist/utilities/flattenTopLevelFields.d.ts +4 -3
  185. package/dist/utilities/flattenTopLevelFields.d.ts.map +1 -1
  186. package/dist/utilities/flattenTopLevelFields.js +12 -7
  187. package/dist/utilities/flattenTopLevelFields.js.map +1 -1
  188. package/dist/utilities/getEntityPolicies.d.ts.map +1 -1
  189. package/dist/utilities/getEntityPolicies.js +5 -5
  190. package/dist/utilities/getEntityPolicies.js.map +1 -1
  191. package/dist/utilities/telemetry/conf/index.js.map +1 -1
  192. package/dist/versions/baseFields.js +1 -1
  193. package/dist/versions/baseFields.js.map +1 -1
  194. package/package.json +3 -10
  195. package/dist/admin/fields/index.d.ts +0 -65
  196. package/dist/admin/fields/index.d.ts.map +0 -1
  197. package/dist/admin/fields/index.js +0 -3
  198. package/dist/admin/fields/index.js.map +0 -1
  199. package/dist/admin/forms/FieldMap.d.ts +0 -23
  200. package/dist/admin/forms/FieldMap.d.ts.map +0 -1
  201. package/dist/admin/forms/FieldMap.js +0 -3
  202. package/dist/admin/forms/FieldMap.js.map +0 -1
  203. package/dist/admin/forms/FieldTypes.d.ts +0 -27
  204. package/dist/admin/forms/FieldTypes.d.ts.map +0 -1
  205. package/dist/admin/forms/FieldTypes.js +0 -3
  206. package/dist/admin/forms/FieldTypes.js.map +0 -1
  207. package/dist/bin/loader/clientExtensions.d.ts +0 -2
  208. package/dist/bin/loader/clientExtensions.d.ts.map +0 -1
  209. package/dist/bin/loader/clientExtensions.js +0 -13
  210. package/dist/bin/loader/clientExtensions.js.map +0 -1
  211. package/dist/bin/loader/compile.d.ts +0 -5
  212. package/dist/bin/loader/compile.d.ts.map +0 -1
  213. package/dist/bin/loader/compile.js +0 -27
  214. package/dist/bin/loader/compile.js.map +0 -1
  215. package/dist/bin/loader/ignores.d.ts +0 -2
  216. package/dist/bin/loader/ignores.d.ts.map +0 -1
  217. package/dist/bin/loader/ignores.js +0 -5
  218. package/dist/bin/loader/ignores.js.map +0 -1
  219. package/dist/bin/loader/index.d.ts +0 -34
  220. package/dist/bin/loader/index.d.ts.map +0 -1
  221. package/dist/bin/loader/index.js +0 -116
  222. package/dist/bin/loader/index.js.map +0 -1
  223. package/dist/bin/loader/read-default-tsconfig.d.ts +0 -29
  224. package/dist/bin/loader/read-default-tsconfig.d.ts.map +0 -1
  225. package/dist/bin/loader/read-default-tsconfig.js +0 -116
  226. package/dist/bin/loader/read-default-tsconfig.js.map +0 -1
  227. package/dist/bin/loader/resolveOriginalPath.d.ts +0 -10
  228. package/dist/bin/loader/resolveOriginalPath.d.ts.map +0 -1
  229. package/dist/bin/loader/resolveOriginalPath.js +0 -36
  230. package/dist/bin/loader/resolveOriginalPath.js.map +0 -1
  231. package/dist/utilities/importWithoutClientFiles.d.ts +0 -7
  232. package/dist/utilities/importWithoutClientFiles.d.ts.map +0 -1
  233. package/dist/utilities/importWithoutClientFiles.js +0 -47
  234. package/dist/utilities/importWithoutClientFiles.js.map +0 -1
@@ -1,18 +1,17 @@
1
1
  import type { EditorProps } from '@monaco-editor/react';
2
- import type { CSSProperties } from 'react';
3
2
  import type { JSONSchema4 } from 'json-schema';
4
- import type React from 'react';
3
+ import type { CSSProperties } from 'react';
4
+ import type { DeepUndefinable } from 'ts-essentials';
5
5
  import type { RichTextAdapter, RichTextAdapterProvider } from '../../admin/RichText.js';
6
6
  import type { ErrorComponent } from '../../admin/forms/Error.js';
7
- import type { ConditionalDateProps, Description, DescriptionComponent, LabelComponent, RowLabelComponent } from '../../admin/types.js';
7
+ import type { ClientTab, ConditionalDateProps, Description, DescriptionComponent, LabelComponent, MappedComponent, RowLabelComponent, StaticDescription } from '../../admin/types.js';
8
8
  import type { SanitizedCollectionConfig, TypeWithID } from '../../collections/config/types.js';
9
- import type { CustomComponent, LabelFunction, LabelStatic } from '../../config/types.js';
9
+ import type { CustomComponent, LabelFunction, PayloadComponent, StaticLabel } from '../../config/types.js';
10
10
  import type { DBIdentifierName } from '../../database/types.js';
11
11
  import type { SanitizedGlobalConfig } from '../../globals/config/types.js';
12
12
  import type { CollectionSlug } from '../../index.js';
13
13
  import type { DocumentPreferences } from '../../preferences/types.js';
14
14
  import type { Operation, PayloadRequest, RequestContext, Where } from '../../types/index.js';
15
- import type { ClientFieldConfig } from './client.js';
16
15
  export type FieldHookArgs<TData extends TypeWithID = any, TValue = any, TSiblingData = any> = {
17
16
  /** The collection which the field belongs to. If the field belongs to a global, this will be null. */
18
17
  collection: SanitizedCollectionConfig | null;
@@ -120,7 +119,7 @@ type Admin = {
120
119
  /**
121
120
  * The Filter component has to be a client component
122
121
  */
123
- Filter?: React.ComponentType<any>;
122
+ Filter?: PayloadComponent;
124
123
  };
125
124
  /**
126
125
  * You can programmatically show / hide fields based on what other fields are doing.
@@ -148,9 +147,45 @@ type Admin = {
148
147
  style?: CSSProperties;
149
148
  width?: string;
150
149
  };
150
+ export type AdminClient = {
151
+ className?: string;
152
+ components?: {
153
+ Cell?: MappedComponent;
154
+ Description?: MappedComponent;
155
+ Field?: MappedComponent;
156
+ /**
157
+ * The Filter component has to be a client component
158
+ */
159
+ Filter?: MappedComponent;
160
+ };
161
+ /** Extension point to add your custom data. Available in server and client. */
162
+ custom?: Record<string, any>;
163
+ description?: StaticDescription;
164
+ disableBulkEdit?: boolean;
165
+ /**
166
+ * Shows / hides fields from appearing in the list view column selector.
167
+ * @type boolean
168
+ */
169
+ disableListColumn?: boolean;
170
+ /**
171
+ * Shows / hides fields from appearing in the list view filter options.
172
+ * @type boolean
173
+ */
174
+ disableListFilter?: boolean;
175
+ disabled?: boolean;
176
+ hidden?: boolean;
177
+ position?: 'sidebar';
178
+ readOnly?: boolean;
179
+ style?: CSSProperties;
180
+ width?: string;
181
+ };
151
182
  export type Labels = {
152
- plural: LabelFunction | LabelStatic;
153
- singular: LabelFunction | LabelStatic;
183
+ plural: LabelFunction | StaticLabel;
184
+ singular: LabelFunction | StaticLabel;
185
+ };
186
+ export type LabelsClient = {
187
+ plural: StaticLabel;
188
+ singular: StaticLabel;
154
189
  };
155
190
  export type BaseValidateOptions<TData, TSiblingData, TValue> = {
156
191
  collectionSlug?: string;
@@ -166,11 +201,16 @@ export type BaseValidateOptions<TData, TSiblingData, TValue> = {
166
201
  export type ValidateOptions<TData, TSiblingData, TFieldConfig extends object, TValue> = BaseValidateOptions<TData, TSiblingData, TValue> & TFieldConfig;
167
202
  export type Validate<TValue = any, TData = any, TSiblingData = any, TFieldConfig extends object = object> = (value: TValue, options: ValidateOptions<TData, TSiblingData, TFieldConfig, TValue>) => Promise<string | true> | string | true;
168
203
  export type OptionObject = {
169
- label: LabelFunction | LabelStatic;
204
+ label: LabelFunction | StaticLabel;
170
205
  value: string;
171
206
  };
172
207
  export type Option = OptionObject | string;
173
208
  export interface FieldBase {
209
+ /**
210
+ * Do not set this property manually. This is set to true during sanitization, to avoid
211
+ * sanitizing the same field multiple times.
212
+ */
213
+ _sanitized?: boolean;
174
214
  access?: {
175
215
  create?: FieldAccess;
176
216
  read?: FieldAccess;
@@ -192,7 +232,7 @@ export interface FieldBase {
192
232
  beforeValidate?: FieldHook[];
193
233
  };
194
234
  index?: boolean;
195
- label?: LabelFunction | LabelStatic | false;
235
+ label?: LabelFunction | StaticLabel | false;
196
236
  localized?: boolean;
197
237
  /**
198
238
  * The name of the field. Must be alphanumeric and cannot contain ' . '
@@ -213,6 +253,33 @@ export interface FieldBase {
213
253
  unique?: boolean;
214
254
  validate?: Validate;
215
255
  }
256
+ export interface FieldBaseClient {
257
+ _isPresentational?: undefined;
258
+ _path?: string;
259
+ _schemaPath?: string;
260
+ admin?: AdminClient;
261
+ hidden?: boolean;
262
+ index?: boolean;
263
+ label?: StaticLabel;
264
+ localized?: boolean;
265
+ /**
266
+ * The name of the field. Must be alphanumeric and cannot contain ' . '
267
+ *
268
+ * Must not be one of reserved field names: ['__v', 'salt', 'hash', 'file']
269
+ * @link https://payloadcms.com/docs/fields/overview#field-names
270
+ */
271
+ name?: string;
272
+ required?: boolean;
273
+ saveToJWT?: boolean | string;
274
+ /**
275
+ * Allows you to modify the base JSON schema that is generated during generate:types for this field.
276
+ * This JSON schema will be used to generate the TypeScript interface of this field.
277
+ */
278
+ typescriptSchema?: Array<(args: {
279
+ jsonSchema: JSONSchema4;
280
+ }) => JSONSchema4>;
281
+ unique?: boolean;
282
+ }
216
283
  export type NumberField = {
217
284
  admin?: {
218
285
  /** Set this property to a string that will be used for browser autocomplete. */
@@ -222,7 +289,7 @@ export type NumberField = {
222
289
  Label?: LabelComponent;
223
290
  afterInput?: CustomComponent[];
224
291
  beforeInput?: CustomComponent[];
225
- };
292
+ } & Admin['components'];
226
293
  /** Set this property to define a placeholder string for the field. */
227
294
  placeholder?: Record<string, string> | string;
228
295
  /** Set a value for the number field to increment / decrement using browser controls. */
@@ -249,6 +316,16 @@ export type NumberField = {
249
316
  /** Minimum number of numbers in the numbers array, if `hasMany` is set to true. */
250
317
  minRows?: undefined;
251
318
  }) & FieldBase;
319
+ export type NumberFieldClient = {
320
+ admin?: {
321
+ components?: {
322
+ Error?: MappedComponent;
323
+ Label?: MappedComponent;
324
+ afterInput?: MappedComponent[];
325
+ beforeInput?: MappedComponent[];
326
+ } & AdminClient['components'];
327
+ } & AdminClient & Pick<NumberField['admin'], 'autoComplete' | 'placeholder' | 'step'>;
328
+ } & FieldBaseClient & Pick<NumberField, 'hasMany' | 'max' | 'maxRows' | 'min' | 'minRows' | 'type'>;
252
329
  export type TextField = {
253
330
  admin?: {
254
331
  autoComplete?: string;
@@ -257,7 +334,7 @@ export type TextField = {
257
334
  Label?: LabelComponent;
258
335
  afterInput?: CustomComponent[];
259
336
  beforeInput?: CustomComponent[];
260
- };
337
+ } & Admin['components'];
261
338
  placeholder?: Record<string, string> | string;
262
339
  rtl?: boolean;
263
340
  } & Admin;
@@ -280,6 +357,16 @@ export type TextField = {
280
357
  /** Minimum number of strings in the strings array, if `hasMany` is set to true. */
281
358
  minRows?: undefined;
282
359
  }) & FieldBase;
360
+ export type TextFieldClient = {
361
+ admin?: {
362
+ components?: {
363
+ Error?: MappedComponent;
364
+ Label?: MappedComponent;
365
+ afterInput?: MappedComponent[];
366
+ beforeInput?: MappedComponent[];
367
+ } & AdminClient['components'];
368
+ } & AdminClient & Pick<TextField['admin'], 'autoComplete' | 'placeholder' | 'rtl'>;
369
+ } & FieldBaseClient & Pick<TextField, 'hasMany' | 'maxLength' | 'maxRows' | 'minLength' | 'minRows' | 'type'>;
283
370
  export type EmailField = {
284
371
  admin?: {
285
372
  autoComplete?: string;
@@ -288,12 +375,22 @@ export type EmailField = {
288
375
  Label?: LabelComponent;
289
376
  afterInput?: CustomComponent[];
290
377
  beforeInput?: CustomComponent[];
291
- };
378
+ } & Admin['components'];
292
379
  placeholder?: Record<string, string> | string;
293
380
  } & Admin;
294
381
  type: 'email';
295
382
  validate?: Validate<string, unknown, unknown, EmailField>;
296
383
  } & FieldBase;
384
+ export type EmailFieldClient = {
385
+ admin?: {
386
+ components?: {
387
+ Error?: MappedComponent;
388
+ Label?: MappedComponent;
389
+ afterInput?: MappedComponent[];
390
+ beforeInput?: MappedComponent[];
391
+ } & AdminClient['components'];
392
+ } & AdminClient & Pick<EmailField['admin'], 'placeholder'>;
393
+ } & FieldBaseClient & Pick<EmailField, 'type'>;
297
394
  export type TextareaField = {
298
395
  admin?: {
299
396
  components?: {
@@ -301,7 +398,7 @@ export type TextareaField = {
301
398
  Label?: LabelComponent;
302
399
  afterInput?: CustomComponent[];
303
400
  beforeInput?: CustomComponent[];
304
- };
401
+ } & Admin['components'];
305
402
  placeholder?: Record<string, string> | string;
306
403
  rows?: number;
307
404
  rtl?: boolean;
@@ -311,6 +408,16 @@ export type TextareaField = {
311
408
  type: 'textarea';
312
409
  validate?: Validate<string, unknown, unknown, TextareaField>;
313
410
  } & FieldBase;
411
+ export type TextareaFieldClient = {
412
+ admin?: {
413
+ components?: {
414
+ Error?: MappedComponent;
415
+ Label?: MappedComponent;
416
+ afterInput?: MappedComponent[];
417
+ beforeInput?: MappedComponent[];
418
+ } & AdminClient['components'];
419
+ } & AdminClient & Pick<TextareaField['admin'], 'placeholder' | 'rows' | 'rtl'>;
420
+ } & FieldBaseClient & Pick<TextareaField, 'maxLength' | 'minLength' | 'type'>;
314
421
  export type CheckboxField = {
315
422
  admin?: {
316
423
  components?: {
@@ -318,11 +425,21 @@ export type CheckboxField = {
318
425
  Label?: LabelComponent;
319
426
  afterInput?: CustomComponent[];
320
427
  beforeInput?: CustomComponent[];
321
- };
428
+ } & Admin['components'];
322
429
  } & Admin;
323
430
  type: 'checkbox';
324
431
  validate?: Validate<unknown, unknown, unknown, CheckboxField>;
325
432
  } & FieldBase;
433
+ export type CheckboxFieldClient = {
434
+ admin?: {
435
+ components?: {
436
+ Error?: MappedComponent;
437
+ Label?: MappedComponent;
438
+ afterInput?: MappedComponent[];
439
+ beforeInput?: MappedComponent[];
440
+ } & AdminClient['components'];
441
+ } & AdminClient;
442
+ } & FieldBaseClient & Pick<CheckboxField, 'type'>;
326
443
  export type DateField = {
327
444
  admin?: {
328
445
  components?: {
@@ -330,15 +447,28 @@ export type DateField = {
330
447
  Label?: LabelComponent;
331
448
  afterInput?: CustomComponent[];
332
449
  beforeInput?: CustomComponent[];
333
- };
450
+ } & Admin['components'];
334
451
  date?: ConditionalDateProps;
335
452
  placeholder?: Record<string, string> | string;
336
453
  } & Admin;
337
454
  type: 'date';
338
455
  validate?: Validate<unknown, unknown, unknown, DateField>;
339
456
  } & FieldBase;
457
+ export type DateFieldClient = {
458
+ admin?: {
459
+ components?: {
460
+ Error?: MappedComponent;
461
+ Label?: MappedComponent;
462
+ afterInput?: MappedComponent[];
463
+ beforeInput?: MappedComponent[];
464
+ } & AdminClient['components'];
465
+ } & AdminClient & Pick<DateField['admin'], 'date' | 'placeholder'>;
466
+ } & FieldBaseClient & Pick<DateField, 'type'>;
340
467
  export type GroupField = {
341
468
  admin?: {
469
+ components?: {
470
+ Label?: LabelComponent;
471
+ } & Admin['components'];
342
472
  hideGutter?: boolean;
343
473
  } & Admin;
344
474
  fields: Field[];
@@ -352,18 +482,30 @@ export type GroupField = {
352
482
  type: 'group';
353
483
  validate?: Validate<unknown, unknown, unknown, GroupField>;
354
484
  } & Omit<FieldBase, 'required'>;
355
- export type RowAdmin = Omit<Admin, 'description'>;
485
+ export type GroupFieldClient = {
486
+ admin?: {
487
+ components?: {
488
+ Label?: MappedComponent;
489
+ } & AdminClient['components'];
490
+ } & AdminClient & Pick<GroupField['admin'], 'hideGutter'>;
491
+ fields: ClientField[];
492
+ } & Omit<FieldBaseClient, 'required'> & Pick<GroupField, 'interfaceName' | 'type'>;
356
493
  export type RowField = {
357
- admin?: RowAdmin;
494
+ admin?: Omit<Admin, 'description'>;
358
495
  fields: Field[];
359
496
  type: 'row';
360
497
  } & Omit<FieldBase, 'admin' | 'label' | 'name' | 'validate'>;
498
+ export type RowFieldClient = {
499
+ admin?: Omit<AdminClient, 'description'>;
500
+ fields: ClientField[];
501
+ } & Omit<FieldBaseClient, 'admin' | 'label' | 'name' | 'validate'> & Pick<RowField, 'type'>;
361
502
  export type CollapsibleField = {
362
503
  fields: Field[];
363
504
  type: 'collapsible';
364
505
  } & ({
365
506
  admin: {
366
507
  components: {
508
+ Label?: LabelComponent;
367
509
  RowLabel: RowLabelComponent;
368
510
  } & Admin['components'];
369
511
  initCollapsed?: boolean;
@@ -371,11 +513,29 @@ export type CollapsibleField = {
371
513
  label?: Required<FieldBase['label']>;
372
514
  } | {
373
515
  admin?: {
516
+ components?: {
517
+ Label?: LabelComponent;
518
+ } & Admin['components'];
374
519
  initCollapsed?: boolean;
375
520
  } & Admin;
376
521
  label: Required<FieldBase['label']>;
377
522
  }) & Omit<FieldBase, 'label' | 'name' | 'validate'>;
378
- export type TabsAdmin = Omit<Admin, 'description'>;
523
+ export type CollapsibleFieldClient = {
524
+ fields: ClientField[];
525
+ } & ({
526
+ admin: {
527
+ components: {
528
+ RowLabel: MappedComponent;
529
+ } & AdminClient['components'];
530
+ initCollapsed?: boolean;
531
+ } & AdminClient;
532
+ label?: Required<FieldBaseClient['label']>;
533
+ } | {
534
+ admin?: {
535
+ initCollapsed?: boolean;
536
+ } & AdminClient;
537
+ label: Required<FieldBaseClient['label']>;
538
+ }) & Omit<FieldBaseClient, 'label' | 'name' | 'validate'> & Pick<CollapsibleField, 'type'>;
379
539
  type TabBase = {
380
540
  description?: Description;
381
541
  fields: Field[];
@@ -405,14 +565,19 @@ export type UnnamedTab = {
405
565
  } & Omit<TabBase, 'name'>;
406
566
  export type Tab = NamedTab | UnnamedTab;
407
567
  export type TabsField = {
408
- admin?: TabsAdmin;
568
+ admin?: Omit<Admin, 'description'>;
409
569
  tabs: Tab[];
410
570
  type: 'tabs';
411
571
  } & Omit<FieldBase, 'admin' | 'localized' | 'name' | 'saveToJWT'>;
572
+ export type TabsFieldClient = {
573
+ admin?: Omit<AdminClient, 'description'>;
574
+ tabs: ClientTab[];
575
+ } & Omit<FieldBaseClient, 'admin' | 'localized' | 'name' | 'saveToJWT'> & Pick<TabsField, 'type'>;
412
576
  export type TabAsField = {
413
577
  name?: string;
414
578
  type: 'tab';
415
579
  } & Tab;
580
+ export type TabAsFieldClient = ClientTab & Pick<TabAsField, 'name' | 'type'>;
416
581
  export type UIField = {
417
582
  admin: {
418
583
  components?: {
@@ -421,8 +586,8 @@ export type UIField = {
421
586
  /**
422
587
  * The Filter component has to be a client component
423
588
  */
424
- Filter?: React.ComponentType<any>;
425
- };
589
+ Filter?: PayloadComponent;
590
+ } & Admin['components'];
426
591
  condition?: Condition;
427
592
  /** Extension point to add your custom data. Available in server and client. */
428
593
  custom?: Record<string, any>;
@@ -441,12 +606,23 @@ export type UIField = {
441
606
  name: string;
442
607
  type: 'ui';
443
608
  };
609
+ export type UIFieldClient = {
610
+ _isPresentational?: true;
611
+ admin: DeepUndefinable<FieldBaseClient['admin']> & {
612
+ components?: {
613
+ Cell?: MappedComponent;
614
+ Field: MappedComponent;
615
+ Filter?: MappedComponent;
616
+ } & AdminClient['components'];
617
+ } & Pick<UIField['admin'], 'custom' | 'disableBulkEdit' | 'disableListColumn' | 'position' | 'width'>;
618
+ } & Omit<DeepUndefinable<FieldBaseClient>, '_isPresentational' | 'admin'> & // still include FieldBaseClient (even if it's undefinable) so that we don't need constant type checks (e.g. if('xy' in field))
619
+ Pick<UIField, 'label' | 'name' | 'type'>;
444
620
  export type UploadField = {
445
621
  admin?: {
446
622
  components?: {
447
623
  Error?: ErrorComponent;
448
624
  Label?: LabelComponent;
449
- };
625
+ } & Admin['components'];
450
626
  };
451
627
  displayPreview?: boolean;
452
628
  filterOptions?: FilterOptions;
@@ -460,30 +636,50 @@ export type UploadField = {
460
636
  type: 'upload';
461
637
  validate?: Validate<unknown, unknown, unknown, UploadField>;
462
638
  } & FieldBase;
463
- type CodeAdmin = {
464
- components?: {
465
- Error?: ErrorComponent;
466
- Label?: LabelComponent;
639
+ export type UploadFieldClient = {
640
+ admin?: {
641
+ components?: {
642
+ Error?: MappedComponent;
643
+ Label?: MappedComponent;
644
+ } & AdminClient['components'];
467
645
  };
468
- editorOptions?: EditorProps['options'];
469
- language?: string;
470
- } & Admin;
646
+ } & FieldBaseClient & Pick<UploadField, 'displayPreview' | 'maxDepth' | 'relationTo' | 'type'>;
471
647
  export type CodeField = {
472
- admin?: CodeAdmin;
648
+ admin?: {
649
+ components?: {
650
+ Error?: ErrorComponent;
651
+ Label?: LabelComponent;
652
+ afterInput?: CustomComponent[];
653
+ beforeInput?: CustomComponent[];
654
+ } & Admin['components'];
655
+ editorOptions?: EditorProps['options'];
656
+ language?: string;
657
+ } & Admin;
473
658
  maxLength?: number;
474
659
  minLength?: number;
475
660
  type: 'code';
476
661
  validate?: Validate<string, unknown, unknown, CodeField>;
477
662
  } & Omit<FieldBase, 'admin'>;
478
- type JSONAdmin = {
479
- components?: {
480
- Error?: ErrorComponent;
481
- Label?: LabelComponent;
482
- };
483
- editorOptions?: EditorProps['options'];
484
- } & Admin;
663
+ export type CodeFieldClient = {
664
+ admin?: {
665
+ components?: {
666
+ Error?: MappedComponent;
667
+ Label?: MappedComponent;
668
+ afterInput?: MappedComponent[];
669
+ beforeInput?: MappedComponent[];
670
+ } & AdminClient['components'];
671
+ } & AdminClient & Pick<CodeField['admin'], 'editorOptions' | 'language'>;
672
+ } & Omit<FieldBaseClient, 'admin'> & Pick<CodeField, 'maxLength' | 'minLength' | 'type'>;
485
673
  export type JSONField = {
486
- admin?: JSONAdmin;
674
+ admin?: {
675
+ components?: {
676
+ Error?: ErrorComponent;
677
+ Label?: LabelComponent;
678
+ afterInput?: CustomComponent[];
679
+ beforeInput?: CustomComponent[];
680
+ } & Admin['components'];
681
+ editorOptions?: EditorProps['options'];
682
+ } & Admin;
487
683
  jsonSchema?: {
488
684
  fileMatch: string[];
489
685
  schema: JSONSchema4;
@@ -492,12 +688,24 @@ export type JSONField = {
492
688
  type: 'json';
493
689
  validate?: Validate<Record<string, unknown>, unknown, unknown, JSONField>;
494
690
  } & Omit<FieldBase, 'admin'>;
691
+ export type JSONFieldClient = {
692
+ admin?: {
693
+ components?: {
694
+ Error?: MappedComponent;
695
+ Label?: MappedComponent;
696
+ afterInput?: MappedComponent[];
697
+ beforeInput?: MappedComponent[];
698
+ } & AdminClient['components'];
699
+ } & AdminClient & Pick<JSONField['admin'], 'editorOptions'>;
700
+ } & Omit<FieldBaseClient, 'admin'> & Pick<JSONField, 'jsonSchema' | 'type'>;
495
701
  export type SelectField = {
496
702
  admin?: {
497
703
  components?: {
498
704
  Error?: ErrorComponent;
499
705
  Label?: LabelComponent;
500
- };
706
+ afterInput?: CustomComponent[];
707
+ beforeInput?: CustomComponent[];
708
+ } & Admin['components'];
501
709
  isClearable?: boolean;
502
710
  isSortable?: boolean;
503
711
  } & Admin;
@@ -514,6 +722,16 @@ export type SelectField = {
514
722
  type: 'select';
515
723
  validate?: Validate<string, unknown, unknown, SelectField>;
516
724
  } & FieldBase;
725
+ export type SelectFieldClient = {
726
+ admin?: {
727
+ components?: {
728
+ Error?: MappedComponent;
729
+ Label?: MappedComponent;
730
+ afterInput?: MappedComponent[];
731
+ beforeInput?: MappedComponent[];
732
+ } & AdminClient['components'];
733
+ } & AdminClient & Pick<SelectField['admin'], 'isClearable' | 'isSortable'>;
734
+ } & FieldBaseClient & Pick<SelectField, 'hasMany' | 'options' | 'type'>;
517
735
  type SharedRelationshipProperties = {
518
736
  filterOptions?: FilterOptions;
519
737
  hasMany?: boolean;
@@ -550,14 +768,21 @@ type SharedRelationshipProperties = {
550
768
  min?: undefined;
551
769
  minRows?: undefined;
552
770
  }) & FieldBase;
771
+ type SharedRelationshipPropertiesClient = FieldBaseClient & Pick<SharedRelationshipProperties, 'hasMany' | 'max' | 'maxDepth' | 'maxRows' | 'min' | 'minRows' | 'type'>;
553
772
  type RelationshipAdmin = {
554
773
  allowCreate?: boolean;
555
774
  components?: {
556
775
  Error?: ErrorComponent;
557
776
  Label?: LabelComponent;
558
- };
777
+ } & Admin['components'];
559
778
  isSortable?: boolean;
560
779
  } & Admin;
780
+ type RelationshipAdminClient = {
781
+ components?: {
782
+ Error?: MappedComponent;
783
+ Label?: MappedComponent;
784
+ } & AdminClient['components'];
785
+ } & AdminClient & Pick<RelationshipAdmin, 'allowCreate' | 'isSortable'>;
561
786
  export type PolymorphicRelationshipField = {
562
787
  admin?: {
563
788
  sortOptions?: {
@@ -566,27 +791,36 @@ export type PolymorphicRelationshipField = {
566
791
  } & RelationshipAdmin;
567
792
  relationTo: CollectionSlug[];
568
793
  } & SharedRelationshipProperties;
794
+ export type PolymorphicRelationshipFieldClient = {
795
+ admin?: {
796
+ sortOptions?: Pick<PolymorphicRelationshipField['admin'], 'sortOptions'>;
797
+ } & RelationshipAdminClient;
798
+ } & Pick<PolymorphicRelationshipField, 'relationTo'> & SharedRelationshipPropertiesClient;
569
799
  export type SingleRelationshipField = {
570
800
  admin?: {
571
801
  sortOptions?: string;
572
802
  } & RelationshipAdmin;
573
803
  relationTo: CollectionSlug;
574
804
  } & SharedRelationshipProperties;
805
+ export type SingleRelationshipFieldClient = {
806
+ admin?: Pick<SingleRelationshipField['admin'], 'sortOptions'> & RelationshipAdminClient;
807
+ } & Pick<SingleRelationshipField, 'relationTo'> & SharedRelationshipPropertiesClient;
575
808
  export type RelationshipField = PolymorphicRelationshipField | SingleRelationshipField;
809
+ export type RelationshipFieldClient = PolymorphicRelationshipFieldClient;
576
810
  export type ValueWithRelation = {
577
811
  relationTo: CollectionSlug;
578
812
  value: number | string;
579
813
  };
580
814
  export declare function valueIsValueWithRelation(value: unknown): value is ValueWithRelation;
581
815
  export type RelationshipValue = (number | string)[] | ValueWithRelation | ValueWithRelation[] | (number | string);
582
- export type RichTextField<Value extends object = any, AdapterProps = any, ExtraProperties = object> = {
816
+ export type RichTextField<TValue extends object = any, TAdapterProps = any, TExtraProperties = object> = {
583
817
  admin?: {
584
818
  components?: {
585
819
  Error?: ErrorComponent;
586
820
  Label?: LabelComponent;
587
- };
821
+ } & Admin['components'];
588
822
  } & Admin;
589
- editor?: RichTextAdapter<Value, AdapterProps, AdapterProps> | RichTextAdapterProvider<Value, AdapterProps, AdapterProps>;
823
+ editor?: RichTextAdapter<TValue, TAdapterProps, TExtraProperties> | RichTextAdapterProvider<TValue, TAdapterProps, TExtraProperties>;
590
824
  /**
591
825
  * Sets a maximum population depth for this field, regardless of the remaining depth when this field is reached.
592
826
  *
@@ -594,10 +828,21 @@ export type RichTextField<Value extends object = any, AdapterProps = any, ExtraP
594
828
  */
595
829
  maxDepth?: number;
596
830
  type: 'richText';
597
- } & ExtraProperties & FieldBase;
831
+ } & FieldBase & TExtraProperties;
832
+ export type RichTextFieldClient<TValue extends object = any, TAdapterProps = any, TExtraProperties = object> = {
833
+ admin?: {
834
+ components?: {
835
+ Error?: MappedComponent;
836
+ Label?: MappedComponent;
837
+ } & AdminClient['components'];
838
+ } & AdminClient;
839
+ richTextComponentMap?: Map<string, any>;
840
+ } & FieldBaseClient & Pick<RichTextField<TValue, TAdapterProps, TExtraProperties>, 'maxDepth' | 'type'> & TExtraProperties;
598
841
  export type ArrayField = {
599
842
  admin?: {
600
843
  components?: {
844
+ Error?: ErrorComponent;
845
+ Label?: LabelComponent;
601
846
  RowLabel?: RowLabelComponent;
602
847
  } & Admin['components'];
603
848
  initCollapsed?: boolean;
@@ -624,12 +869,23 @@ export type ArrayField = {
624
869
  type: 'array';
625
870
  validate?: Validate<unknown[], unknown, unknown, ArrayField>;
626
871
  } & FieldBase;
872
+ export type ArrayFieldClient = {
873
+ admin?: {
874
+ components?: {
875
+ Error?: MappedComponent;
876
+ Label?: MappedComponent;
877
+ RowLabel?: MappedComponent;
878
+ } & AdminClient['components'];
879
+ } & AdminClient & Pick<ArrayField['admin'], 'initCollapsed' | 'isSortable'>;
880
+ fields: ClientField[];
881
+ labels?: LabelsClient;
882
+ } & FieldBaseClient & Pick<ArrayField, 'interfaceName' | 'maxRows' | 'minRows' | 'type'>;
627
883
  export type RadioField = {
628
884
  admin?: {
629
885
  components?: {
630
886
  Error?: ErrorComponent;
631
887
  Label?: LabelComponent;
632
- };
888
+ } & Admin['components'];
633
889
  layout?: 'horizontal' | 'vertical';
634
890
  } & Admin;
635
891
  /**
@@ -644,10 +900,23 @@ export type RadioField = {
644
900
  type: 'radio';
645
901
  validate?: Validate<string, unknown, unknown, RadioField>;
646
902
  } & FieldBase;
903
+ export type RadioFieldClient = {
904
+ admin?: {
905
+ components?: {
906
+ Error?: MappedComponent;
907
+ Label?: MappedComponent;
908
+ } & AdminClient['components'];
909
+ } & AdminClient & Pick<RadioField['admin'], 'layout'>;
910
+ } & FieldBaseClient & Pick<RadioField, 'options' | 'type'>;
647
911
  export type Block = {
912
+ /**
913
+ * Do not set this property manually. This is set to true during sanitization, to avoid
914
+ * sanitizing the same block multiple times.
915
+ */
916
+ _sanitized?: boolean;
648
917
  admin?: {
649
918
  components?: {
650
- Label?: React.FC<{
919
+ Label?: PayloadComponent<never, {
651
920
  blockKind: 'block' | 'lexicalBlock' | 'lexicalInlineBlock' | string;
652
921
  /**
653
922
  * May contain the formData
@@ -681,8 +950,20 @@ export type Block = {
681
950
  labels?: Labels;
682
951
  slug: string;
683
952
  };
953
+ export type ClientBlock = {
954
+ admin?: {
955
+ components?: {
956
+ Label?: MappedComponent;
957
+ };
958
+ } & Pick<Block['admin'], 'custom'>;
959
+ fields: ClientField[];
960
+ labels?: LabelsClient;
961
+ } & Pick<Block, 'imageAltText' | 'imageURL' | 'slug'>;
684
962
  export type BlockField = {
685
963
  admin?: {
964
+ components?: {
965
+ Error?: ErrorComponent;
966
+ } & Admin['components'];
686
967
  initCollapsed?: boolean;
687
968
  /**
688
969
  * Disable drag and drop sorting
@@ -697,32 +978,80 @@ export type BlockField = {
697
978
  type: 'blocks';
698
979
  validate?: Validate<string, unknown, unknown, BlockField>;
699
980
  } & FieldBase;
981
+ export type BlockFieldClient = {
982
+ admin?: {
983
+ components?: {
984
+ Error?: MappedComponent;
985
+ } & AdminClient['components'];
986
+ } & AdminClient & Pick<BlockField['admin'], 'initCollapsed' | 'isSortable'>;
987
+ blocks: ClientBlock[];
988
+ labels?: LabelsClient;
989
+ } & FieldBaseClient & Pick<BlockField, 'maxRows' | 'minRows' | 'type'>;
700
990
  export type PointField = {
991
+ admin?: {
992
+ components?: {
993
+ Error?: ErrorComponent;
994
+ Label?: LabelComponent;
995
+ afterInput?: CustomComponent[];
996
+ beforeInput?: CustomComponent[];
997
+ } & Admin['components'];
998
+ placeholder?: Record<string, string> | string;
999
+ step?: number;
1000
+ } & Admin;
701
1001
  type: 'point';
702
1002
  validate?: Validate<unknown, unknown, unknown, PointField>;
703
1003
  } & FieldBase;
1004
+ export type PointFieldClient = {
1005
+ admin?: {
1006
+ components?: {
1007
+ Error?: MappedComponent;
1008
+ Label?: MappedComponent;
1009
+ afterInput?: MappedComponent[];
1010
+ beforeInput?: MappedComponent[];
1011
+ } & AdminClient['components'];
1012
+ } & AdminClient & Pick<PointField['admin'], 'placeholder' | 'step'>;
1013
+ } & FieldBaseClient & Pick<PointField, 'type'>;
704
1014
  export type Field = ArrayField | BlockField | CheckboxField | CodeField | CollapsibleField | DateField | EmailField | GroupField | JSONField | NumberField | PointField | RadioField | RelationshipField | RichTextField | RowField | SelectField | TabsField | TextField | TextareaField | UIField | UploadField;
1015
+ export type ClientField = ArrayFieldClient | BlockFieldClient | CheckboxFieldClient | CodeFieldClient | CollapsibleFieldClient | DateFieldClient | EmailFieldClient | GroupFieldClient | JSONFieldClient | NumberFieldClient | PointFieldClient | RadioFieldClient | RelationshipFieldClient | RichTextFieldClient | RowFieldClient | SelectFieldClient | TabsFieldClient | TextFieldClient | TextareaFieldClient | UIFieldClient | UploadFieldClient;
1016
+ type ExtractFieldTypes<T> = T extends {
1017
+ type: infer U;
1018
+ } ? U : never;
1019
+ export type FieldTypes = ExtractFieldTypes<Field>;
705
1020
  export type FieldAffectingData = ArrayField | BlockField | CheckboxField | CodeField | DateField | EmailField | GroupField | JSONField | NumberField | PointField | RadioField | RelationshipField | RichTextField | SelectField | TabAsField | TextField | TextareaField | UploadField;
1021
+ export type FieldAffectingDataClient = ArrayFieldClient | BlockFieldClient | CheckboxFieldClient | CodeFieldClient | DateFieldClient | EmailFieldClient | GroupFieldClient | JSONFieldClient | NumberFieldClient | PointFieldClient | RadioFieldClient | RelationshipFieldClient | RichTextFieldClient | SelectFieldClient | TabAsFieldClient | TextFieldClient | TextareaFieldClient | UploadFieldClient;
706
1022
  export type NonPresentationalField = ArrayField | BlockField | CheckboxField | CodeField | CollapsibleField | DateField | EmailField | GroupField | JSONField | NumberField | PointField | RadioField | RelationshipField | RichTextField | RowField | SelectField | TabsField | TextField | TextareaField | UploadField;
1023
+ export type NonPresentationalFieldClient = ArrayFieldClient | BlockFieldClient | CheckboxFieldClient | CodeFieldClient | CollapsibleFieldClient | DateFieldClient | EmailFieldClient | GroupFieldClient | JSONFieldClient | NumberFieldClient | PointFieldClient | RadioFieldClient | RelationshipFieldClient | RichTextFieldClient | RowFieldClient | SelectFieldClient | TabsFieldClient | TextFieldClient | TextareaFieldClient | UploadFieldClient;
707
1024
  export type FieldWithPath = {
708
1025
  path?: string;
709
1026
  } & Field;
1027
+ export type FieldWithPathClient = {
1028
+ path?: string;
1029
+ } & ClientField;
710
1030
  export type FieldWithSubFields = ArrayField | CollapsibleField | GroupField | RowField;
1031
+ export type FieldWithSubFieldsClient = ArrayFieldClient | CollapsibleFieldClient | GroupFieldClient | RowFieldClient;
711
1032
  export type FieldPresentationalOnly = UIField;
1033
+ export type FieldPresentationalOnlyClient = UIFieldClient;
712
1034
  export type FieldWithMany = RelationshipField | SelectField;
1035
+ export type FieldWithManyClient = RelationshipFieldClient | SelectFieldClient;
713
1036
  export type FieldWithMaxDepth = RelationshipField | UploadField;
714
- export declare function fieldHasSubFields(field: ClientFieldConfig | Field): field is FieldWithSubFields;
715
- export declare function fieldIsArrayType(field: Field): field is ArrayField;
716
- export declare function fieldIsBlockType(field: Field): field is BlockField;
717
- export declare function fieldIsGroupType(field: Field): field is GroupField;
1037
+ export type FieldWithMaxDepthClient = RelationshipFieldClient | UploadFieldClient;
1038
+ export declare function fieldHasSubFields<T extends ClientField | Field>(field: T): field is T & (T extends ClientField ? FieldWithSubFieldsClient : FieldWithSubFields);
1039
+ export declare function fieldIsArrayType<T extends ClientField | Field>(field: T): field is T & (T extends ClientField ? ArrayFieldClient : ArrayField);
1040
+ export declare function fieldIsBlockType<T extends ClientField | Field>(field: T): field is T & (T extends ClientField ? BlockFieldClient : BlockField);
1041
+ export declare function fieldIsGroupType<T extends ClientField | Field>(field: T): field is T & (T extends ClientField ? GroupFieldClient : GroupField);
718
1042
  export declare function optionIsObject(option: Option): option is OptionObject;
719
1043
  export declare function optionsAreObjects(options: Option[]): options is OptionObject[];
720
1044
  export declare function optionIsValue(option: Option): option is string;
721
- export declare function fieldSupportsMany(field: Field): field is FieldWithMany;
722
- export declare function fieldHasMaxDepth(field: Field): field is FieldWithMaxDepth;
723
- export declare function fieldIsPresentationalOnly(field: ClientFieldConfig | Field | TabAsField): field is UIField;
724
- export declare function fieldAffectsData(field: ClientFieldConfig | Field | TabAsField): field is FieldAffectingData;
725
- export declare function tabHasName(tab: Tab): tab is NamedTab;
1045
+ export declare function fieldSupportsMany<T extends ClientField | Field>(field: T): field is T & (T extends ClientField ? FieldWithManyClient : FieldWithMany);
1046
+ export declare function fieldHasMaxDepth<T extends ClientField | Field>(field: T): field is T & (T extends ClientField ? FieldWithMaxDepthClient : FieldWithMaxDepth);
1047
+ export declare function fieldIsPresentationalOnly<T extends ClientField | Field | TabAsField | TabAsFieldClient>(field: T): field is T & (T extends ClientField | TabAsFieldClient ? UIFieldClient : UIField);
1048
+ export declare function fieldIsSidebar<T extends ClientField | Field | TabAsField | TabAsFieldClient>(field: T): field is {
1049
+ admin: {
1050
+ position: 'sidebar';
1051
+ };
1052
+ } & T;
1053
+ export declare function fieldAffectsData<T extends ClientField | Field | TabAsField | TabAsFieldClient>(field: T): field is T & (T extends ClientField | TabAsFieldClient ? FieldAffectingDataClient : FieldAffectingData);
1054
+ export declare function tabHasName<T extends ClientTab | Tab>(tab: T): tab is NamedTab & T;
726
1055
  export declare function fieldIsLocalized(field: Field | Tab): boolean;
727
1056
  export type HookName = 'afterChange' | 'afterRead' | 'beforeChange' | 'beforeRead' | 'beforeValidate';
728
1057
  export {};