@sanity/types 5.8.0 → 5.8.1-next.1

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 (2) hide show
  1. package/lib/index.d.ts +1490 -1325
  2. package/package.json +15 -15
package/lib/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
- import {Asset as Asset_2} from '@sanity/media-library-types'
2
- import {AssetInstanceDocument} from '@sanity/media-library-types'
3
- import {ClientPerspective} from '@sanity/client'
4
- import {ComponentType} from 'react'
5
- import {ElementType} from 'react'
6
- import {ReactNode} from 'react'
7
- import {SanityClient} from '@sanity/client'
8
- import {StackablePerspective} from '@sanity/client'
1
+ import { Asset as Asset_2 } from "@sanity/media-library-types";
2
+ import { AssetInstanceDocument } from "@sanity/media-library-types";
3
+ import { ClientPerspective } from "@sanity/client";
4
+ import { ComponentType } from "react";
5
+ import { ElementType } from "react";
6
+ import { ReactNode } from "react";
7
+ import { SanityClient } from "@sanity/client";
8
+ import { StackablePerspective } from "@sanity/client";
9
9
 
10
10
  /**
11
11
  * Types of array actions that can be performed
@@ -15,157 +15,161 @@ export declare type ArrayActionName =
15
15
  /**
16
16
  * Add any item to the array at any position
17
17
  */
18
- | 'add'
18
+ | "add"
19
19
  /**
20
20
  * Add item after an existing item
21
21
  */
22
- | 'addBefore'
22
+ | "addBefore"
23
23
  /**
24
24
  * Add item after an existing item
25
25
  */
26
- | 'addAfter'
26
+ | "addAfter"
27
27
  /**
28
28
  * Remove any item
29
29
  */
30
- | 'remove'
30
+ | "remove"
31
31
  /**
32
32
  * Duplicate item
33
33
  */
34
- | 'duplicate'
34
+ | "duplicate"
35
35
  /**
36
36
  * Copy item
37
37
  */
38
- | 'copy'
38
+ | "copy";
39
39
 
40
40
  /** @public */
41
41
  export declare interface ArrayDefinition extends BaseSchemaDefinition {
42
- type: 'array'
43
- of: ArrayOfType[]
44
- initialValue?: InitialValueProperty<any, unknown[]>
45
- validation?: ValidationBuilder<ArrayRule<unknown[]>, unknown[]>
46
- options?: ArrayOptions
42
+ type: "array";
43
+ of: ArrayOfType[];
44
+ initialValue?: InitialValueProperty<any, unknown[]>;
45
+ validation?: ValidationBuilder<ArrayRule<unknown[]>, unknown[]>;
46
+ options?: ArrayOptions;
47
47
  }
48
48
 
49
49
  /** @public */
50
- export declare type ArrayOfEntry<T> = Omit<T, 'name' | 'hidden'> & {
51
- name?: string
52
- }
50
+ export declare type ArrayOfEntry<T> = Omit<T, "name" | "hidden"> & {
51
+ name?: string;
52
+ };
53
53
 
54
54
  /** @public */
55
55
  export declare type ArrayOfType<
56
56
  TType extends IntrinsicTypeName = IntrinsicTypeName,
57
57
  TAlias extends IntrinsicTypeName | undefined = undefined,
58
- > = IntrinsicArrayOfDefinition[TType] | ArrayOfEntry<TypeAliasDefinition<string, TAlias>>
58
+ > =
59
+ | IntrinsicArrayOfDefinition[TType]
60
+ | ArrayOfEntry<TypeAliasDefinition<string, TAlias>>;
59
61
 
60
62
  /** @public */
61
63
  export declare interface ArrayOptions<V = unknown>
62
64
  extends SearchConfiguration, BaseSchemaTypeOptions {
63
- list?: TitledListValue<V>[] | V[]
64
- layout?: 'list' | 'tags' | 'grid'
65
+ list?: TitledListValue<V>[] | V[];
66
+ layout?: "list" | "tags" | "grid";
65
67
  /** @deprecated This option does not have any effect anymore */
66
- direction?: 'horizontal' | 'vertical'
67
- sortable?: boolean
68
+ direction?: "horizontal" | "vertical";
69
+ sortable?: boolean;
68
70
  modal?: {
69
- type?: 'dialog' | 'popover'
70
- width?: number | 'auto'
71
- }
71
+ type?: "dialog" | "popover";
72
+ width?: number | "auto";
73
+ };
72
74
  /** @alpha This API may change */
73
- insertMenu?: InsertMenuOptions
75
+ insertMenu?: InsertMenuOptions;
74
76
  /**
75
77
  * A boolean flag to enable or disable tree editing for the array.
76
78
  * If there are any nested arrays, they will inherit this value.
77
79
  * @deprecated tree editing beta feature has been disabled
78
80
  */
79
- treeEditing?: boolean
81
+ treeEditing?: boolean;
80
82
  /**
81
83
  * A list of array actions to disable
82
84
  * Possible options are defined by {@link ArrayActionName}
83
85
  * @beta
84
86
  */
85
- disableActions?: ArrayActionName[]
87
+ disableActions?: ArrayActionName[];
86
88
  }
87
89
 
88
90
  /** @public */
89
- export declare interface ArrayRule<Value> extends RuleDef<ArrayRule<Value>, Value> {
90
- min: (length: number | FieldReference) => ArrayRule<Value>
91
- max: (length: number | FieldReference) => ArrayRule<Value>
92
- length: (length: number | FieldReference) => ArrayRule<Value>
93
- unique: () => ArrayRule<Value>
91
+ export declare interface ArrayRule<Value> extends RuleDef<
92
+ ArrayRule<Value>,
93
+ Value
94
+ > {
95
+ min: (length: number | FieldReference) => ArrayRule<Value>;
96
+ max: (length: number | FieldReference) => ArrayRule<Value>;
97
+ length: (length: number | FieldReference) => ArrayRule<Value>;
98
+ unique: () => ArrayRule<Value>;
94
99
  }
95
100
 
96
101
  /** @public */
97
102
  export declare interface ArraySchemaType<V = unknown> extends BaseSchemaType {
98
- jsonType: 'array'
99
- of: (Exclude<SchemaType, ArraySchemaType> | ReferenceSchemaType)[]
103
+ jsonType: "array";
104
+ of: (Exclude<SchemaType, ArraySchemaType> | ReferenceSchemaType)[];
100
105
  options?: ArrayOptions<V> & {
101
- layout?: V extends string ? 'tag' : 'grid'
102
- }
106
+ layout?: V extends string ? "tag" : "grid";
107
+ };
103
108
  }
104
109
 
105
110
  /** @internal */
106
- export declare type ArraySchemaTypeOf<TSchemaType extends ArraySchemaType['of'][number]> = Omit<
107
- ArraySchemaType,
108
- 'of'
109
- > & {
110
- of: TSchemaType[]
111
- }
111
+ export declare type ArraySchemaTypeOf<
112
+ TSchemaType extends ArraySchemaType["of"][number],
113
+ > = Omit<ArraySchemaType, "of"> & {
114
+ of: TSchemaType[];
115
+ };
112
116
 
113
117
  /** @public */
114
118
  export declare interface Asset extends SanityDocument {
115
- url: string
116
- path: string
117
- assetId: string
118
- extension: string
119
- mimeType: string
120
- sha1hash: string
121
- size: number
122
- originalFilename?: string
123
- label?: string
124
- title?: string
125
- description?: string
126
- creditLine?: string
127
- source?: AssetSourceSpec
119
+ url: string;
120
+ path: string;
121
+ assetId: string;
122
+ extension: string;
123
+ mimeType: string;
124
+ sha1hash: string;
125
+ size: number;
126
+ originalFilename?: string;
127
+ label?: string;
128
+ title?: string;
129
+ description?: string;
130
+ creditLine?: string;
131
+ source?: AssetSourceSpec;
128
132
  }
129
133
 
130
134
  /** @public */
131
135
  export declare type AssetFromSource = {
132
- kind: 'assetDocumentId' | 'file' | 'base64' | 'url'
133
- value: string | File_2
134
- assetDocumentProps?: ImageAsset
136
+ kind: "assetDocumentId" | "file" | "base64" | "url";
137
+ value: string | File_2;
138
+ assetDocumentProps?: ImageAsset;
135
139
  mediaLibraryProps?: {
136
- mediaLibraryId: string
137
- assetId: string
138
- assetInstanceId: string
139
- }
140
- }
140
+ mediaLibraryId: string;
141
+ assetId: string;
142
+ assetInstanceId: string;
143
+ };
144
+ };
141
145
 
142
146
  /** @public */
143
147
  export declare type AssetMetadataType =
144
- | 'location'
145
- | 'exif'
146
- | 'image'
147
- | 'palette'
148
- | 'lqip'
149
- | 'blurhash'
150
- | 'thumbhash'
151
- | 'none'
148
+ | "location"
149
+ | "exif"
150
+ | "image"
151
+ | "palette"
152
+ | "lqip"
153
+ | "blurhash"
154
+ | "thumbhash"
155
+ | "none";
152
156
 
153
157
  /** @public */
154
158
  export declare interface AssetSchemaTypeOptions {
155
- accept?: string
156
- storeOriginalFilename?: boolean
159
+ accept?: string;
160
+ storeOriginalFilename?: boolean;
157
161
  }
158
162
 
159
163
  /** @public */
160
164
  export declare interface AssetSource {
161
- name: string
165
+ name: string;
162
166
  /** @deprecated provide `i18nKey` instead */
163
- title?: string
164
- i18nKey?: string
165
- component: ComponentType<AssetSourceComponentProps>
166
- icon?: ComponentType
167
+ title?: string;
168
+ i18nKey?: string;
169
+ component: ComponentType<AssetSourceComponentProps>;
170
+ icon?: ComponentType;
167
171
  /** @beta */
168
- Uploader?: AssetSourceUploaderClass
172
+ Uploader?: AssetSourceUploaderClass;
169
173
  /**
170
174
  * Resolve how to open an asset in its original source.
171
175
  *
@@ -180,32 +184,35 @@ export declare interface AssetSource {
180
184
  *
181
185
  * @beta
182
186
  */
183
- openInSource?: (asset: Asset) => AssetSourceOpenInSourceResult
187
+ openInSource?: (asset: Asset) => AssetSourceOpenInSourceResult;
184
188
  }
185
189
 
186
190
  /** @public */
187
- export declare type AssetSourceComponentAction = 'select' | 'upload' | 'openInSource'
191
+ export declare type AssetSourceComponentAction =
192
+ | "select"
193
+ | "upload"
194
+ | "openInSource";
188
195
 
189
196
  /** @public */
190
197
  export declare interface AssetSourceComponentProps {
191
- action?: AssetSourceComponentAction
192
- assetSource: AssetSource
193
- assetType?: 'file' | 'image' | 'sanity.video'
194
- accept: string
195
- selectionType: 'single'
196
- dialogHeaderTitle?: React.ReactNode
197
- selectedAssets: Asset[]
198
- onClose: () => void
199
- onSelect: (assetFromSource: AssetFromSource[]) => void
200
- onChangeAction?: (action: AssetSourceComponentAction) => void
201
- schemaType?: ImageSchemaType | FileSchemaType
198
+ action?: AssetSourceComponentAction;
199
+ assetSource: AssetSource;
200
+ assetType?: "file" | "image" | "sanity.video";
201
+ accept: string;
202
+ selectionType: "single";
203
+ dialogHeaderTitle?: React.ReactNode;
204
+ selectedAssets: Asset[];
205
+ onClose: () => void;
206
+ onSelect: (assetFromSource: AssetFromSource[]) => void;
207
+ onChangeAction?: (action: AssetSourceComponentAction) => void;
208
+ schemaType?: ImageSchemaType | FileSchemaType;
202
209
  /** @beta */
203
- uploader?: AssetSourceUploader
210
+ uploader?: AssetSourceUploader;
204
211
  /**
205
212
  * The asset to open in source. Only provided when action is 'openInSource'.
206
213
  * @beta
207
214
  */
208
- assetToOpen?: Asset
215
+ assetToOpen?: Asset;
209
216
  }
210
217
 
211
218
  /**
@@ -214,21 +221,21 @@ export declare interface AssetSourceComponentProps {
214
221
  */
215
222
  export declare type AssetSourceOpenInSourceResult =
216
223
  | {
217
- type: 'url'
218
- url: string
219
- target?: '_blank' | '_self'
224
+ type: "url";
225
+ url: string;
226
+ target?: "_blank" | "_self";
220
227
  }
221
228
  | {
222
- type: 'component'
229
+ type: "component";
223
230
  }
224
231
  | false
225
- | undefined
232
+ | undefined;
226
233
 
227
234
  /** @public */
228
235
  export declare interface AssetSourceSpec {
229
- id: string
230
- name: string
231
- url?: string
236
+ id: string;
237
+ name: string;
238
+ url?: string;
232
239
  }
233
240
 
234
241
  /** @beta */
@@ -240,45 +247,47 @@ export declare interface AssetSourceUploader {
240
247
  * The schema type of the field the asset is being uploaded to.
241
248
  * May be of interest to the uploader to read file and image options.
242
249
  */
243
- schemaType?: SchemaType
250
+ schemaType?: SchemaType;
244
251
  /**
245
252
  * The uploader may send patches directly to the field
246
253
  * Typed 'unknown' as we don't have patch definitions in sanity/types yet.
247
254
  */
248
- onChange?: (patch: unknown) => void
255
+ onChange?: (patch: unknown) => void;
249
256
  },
250
- ): AssetSourceUploadFile[]
257
+ ): AssetSourceUploadFile[];
251
258
  /**
252
259
  * Abort the upload of a file
253
260
  */
254
- abort(file?: AssetSourceUploadFile): void
261
+ abort(file?: AssetSourceUploadFile): void;
255
262
  /**
256
263
  * Get the files that are currently being uploaded
257
264
  */
258
- getFiles(): AssetSourceUploadFile[]
265
+ getFiles(): AssetSourceUploadFile[];
259
266
  /**
260
267
  * Subscribe to upload events from the uploader
261
268
  */
262
- subscribe(subscriber: (event: AssetSourceUploadEvent) => void): () => void
269
+ subscribe(subscriber: (event: AssetSourceUploadEvent) => void): () => void;
263
270
  /**
264
271
  * Update the status of a file. Will be emitted to subscribers.
265
272
  */
266
273
  updateFile(
267
274
  fileId: string,
268
275
  data: {
269
- progress?: number
270
- status?: string
271
- error?: Error
276
+ progress?: number;
277
+ status?: string;
278
+ error?: Error;
272
279
  },
273
- ): void
280
+ ): void;
274
281
  /**
275
282
  * Reset the uploader (clear files). Should be called by the uploader when all files are done.
276
283
  */
277
- reset(): void
284
+ reset(): void;
278
285
  }
279
286
 
280
287
  /** @beta */
281
- export declare type AssetSourceUploaderClass = new (...args: any[]) => AssetSourceUploader
288
+ export declare type AssetSourceUploaderClass = new (
289
+ ...args: any[]
290
+ ) => AssetSourceUploader;
282
291
 
283
292
  /** @beta */
284
293
  export declare type AssetSourceUploadEvent =
@@ -286,68 +295,76 @@ export declare type AssetSourceUploadEvent =
286
295
  | AssetSourceUploadEventStatus
287
296
  | AssetSourceUploadEventAllComplete
288
297
  | AssetSourceUploadEventError
289
- | AssetSourceUploadEventAbort
298
+ | AssetSourceUploadEventAbort;
290
299
 
291
300
  /**
292
301
  * Emitted when all files are done, either successfully, aborted or with errors
293
302
  * @beta */
294
303
  export declare type AssetSourceUploadEventAbort = {
295
- type: 'abort'
304
+ type: "abort";
296
305
  /**
297
306
  * Files aborted
298
307
  */
299
- files: AssetSourceUploadFile[]
300
- }
308
+ files: AssetSourceUploadFile[];
309
+ };
301
310
 
302
311
  /**
303
312
  * Emitted when all files are done, either successfully, aborted or with errors
304
313
  * @beta */
305
314
  export declare type AssetSourceUploadEventAllComplete = {
306
- type: 'all-complete'
307
- files: AssetSourceUploadFile[]
308
- }
315
+ type: "all-complete";
316
+ files: AssetSourceUploadFile[];
317
+ };
309
318
 
310
319
  /**
311
320
  * Emitted when all files are done, either successfully, aborted or with errors
312
321
  * @beta */
313
322
  export declare type AssetSourceUploadEventError = {
314
- type: 'error'
323
+ type: "error";
315
324
  /**
316
325
  * Files errored
317
326
  */
318
- files: AssetSourceUploadFile[]
319
- }
327
+ files: AssetSourceUploadFile[];
328
+ };
320
329
 
321
330
  /**
322
331
  * Emitted when a file upload is progressing
323
332
  * @beta */
324
333
  export declare type AssetSourceUploadEventProgress = {
325
- type: 'progress'
326
- file: AssetSourceUploadFile
327
- progress: number
328
- }
334
+ type: "progress";
335
+ file: AssetSourceUploadFile;
336
+ progress: number;
337
+ };
329
338
 
330
339
  /**
331
340
  * Emitted when a file upload is changing status
332
341
  * @beta */
333
342
  export declare type AssetSourceUploadEventStatus = {
334
- type: 'status'
335
- file: AssetSourceUploadFile
336
- status: AssetSourceUploadFile['status']
337
- }
343
+ type: "status";
344
+ file: AssetSourceUploadFile;
345
+ status: AssetSourceUploadFile["status"];
346
+ };
338
347
 
339
348
  /** @beta */
340
349
  export declare interface AssetSourceUploadFile {
341
- id: string
342
- file: globalThis.File
343
- progress: number
344
- status: 'pending' | 'uploading' | 'complete' | 'error' | 'aborted' | 'alreadyExists'
345
- error?: Error
346
- result?: unknown
350
+ id: string;
351
+ file: globalThis.File;
352
+ progress: number;
353
+ status:
354
+ | "pending"
355
+ | "uploading"
356
+ | "complete"
357
+ | "error"
358
+ | "aborted"
359
+ | "alreadyExists";
360
+ error?: Error;
361
+ result?: unknown;
347
362
  }
348
363
 
349
364
  /** @beta */
350
- export declare type AssetSourceUploadSubscriber = (event: AssetSourceUploadEvent) => void
365
+ export declare type AssetSourceUploadSubscriber = (
366
+ event: AssetSourceUploadEvent,
367
+ ) => void;
351
368
 
352
369
  /**
353
370
  * Enhances VSCode autocomplete by using a distinct type for strings.
@@ -361,52 +378,52 @@ export declare type AssetSourceUploadSubscriber = (event: AssetSourceUploadEvent
361
378
  *
362
379
  * @beta
363
380
  */
364
- export declare type AutocompleteString = string & {}
381
+ export declare type AutocompleteString = string & {};
365
382
 
366
383
  /** @public */
367
384
  export declare interface BaseSchemaDefinition {
368
- name: string
369
- title?: string
370
- description?: string | React.JSX.Element
371
- hidden?: ConditionalProperty
372
- readOnly?: ConditionalProperty
373
- icon?: ComponentType | ReactNode
374
- validation?: unknown
375
- initialValue?: unknown
376
- deprecated?: DeprecatedProperty
385
+ name: string;
386
+ title?: string;
387
+ description?: string | React.JSX.Element;
388
+ hidden?: ConditionalProperty;
389
+ readOnly?: ConditionalProperty;
390
+ icon?: ComponentType | ReactNode;
391
+ validation?: unknown;
392
+ initialValue?: unknown;
393
+ deprecated?: DeprecatedProperty;
377
394
  }
378
395
 
379
396
  /** @public */
380
397
  export declare interface BaseSchemaType extends Partial<DeprecationConfiguration> {
381
- name: string
382
- title?: string
383
- description?: string
384
- type?: SchemaType
385
- liveEdit?: boolean
386
- readOnly?: ConditionalProperty
387
- hidden?: ConditionalProperty
388
- icon?: ComponentType
389
- initialValue?: InitialValueProperty<any, any>
390
- validation?: SchemaValidationValue
391
- preview?: PreviewConfig
398
+ name: string;
399
+ title?: string;
400
+ description?: string;
401
+ type?: SchemaType;
402
+ liveEdit?: boolean;
403
+ readOnly?: ConditionalProperty;
404
+ hidden?: ConditionalProperty;
405
+ icon?: ComponentType;
406
+ initialValue?: InitialValueProperty<any, any>;
407
+ validation?: SchemaValidationValue;
408
+ preview?: PreviewConfig;
392
409
  /** @beta */
393
410
  components?: {
394
- block?: ComponentType<any>
395
- inlineBlock?: ComponentType<any>
396
- annotation?: ComponentType<any>
397
- diff?: ComponentType<any>
398
- field?: ComponentType<any>
399
- input?: ComponentType<any>
400
- item?: ComponentType<any>
401
- preview?: ComponentType<any>
411
+ block?: ComponentType<any>;
412
+ inlineBlock?: ComponentType<any>;
413
+ annotation?: ComponentType<any>;
414
+ diff?: ComponentType<any>;
415
+ field?: ComponentType<any>;
416
+ input?: ComponentType<any>;
417
+ item?: ComponentType<any>;
418
+ preview?: ComponentType<any>;
402
419
  portableText?: {
403
- plugins?: ComponentType<any>
404
- }
405
- }
420
+ plugins?: ComponentType<any>;
421
+ };
422
+ };
406
423
  /**
407
424
  * @deprecated This will be removed.
408
425
  */
409
- placeholder?: string
426
+ placeholder?: string;
410
427
  }
411
428
 
412
429
  /**
@@ -417,8 +434,8 @@ export declare interface BaseSchemaType extends Partial<DeprecationConfiguration
417
434
  * @public
418
435
  * */
419
436
  export declare interface BaseSchemaTypeOptions {
420
- sanityCreate?: SanityCreateOptions
421
- canvasApp?: CanvasAppOptions
437
+ sanityCreate?: SanityCreateOptions;
438
+ canvasApp?: CanvasAppOptions;
422
439
  }
423
440
 
424
441
  /**
@@ -454,7 +471,7 @@ export declare interface BaseSchemaTypeOptions {
454
471
  * ```
455
472
  */
456
473
  export declare interface BlockAnnotationDefinition extends ObjectDefinition {
457
- icon?: ReactNode | ComponentType
474
+ icon?: ReactNode | ComponentType;
458
475
  }
459
476
 
460
477
  /**
@@ -464,8 +481,8 @@ export declare interface BlockAnnotationDefinition extends ObjectDefinition {
464
481
  * @internal
465
482
  */
466
483
  export declare type BlockChildrenObjectField = {
467
- name: 'children'
468
- } & ObjectField<ArraySchemaType>
484
+ name: "children";
485
+ } & ObjectField<ArraySchemaType>;
469
486
 
470
487
  /**
471
488
  * Schema definition for text block decorators.
@@ -495,10 +512,10 @@ export declare type BlockChildrenObjectField = {
495
512
  * ```
496
513
  */
497
514
  export declare interface BlockDecoratorDefinition {
498
- title: string
499
- i18nTitleKey?: string
500
- value: string
501
- icon?: ReactNode | ComponentType
515
+ title: string;
516
+ i18nTitleKey?: string;
517
+ value: string;
518
+ icon?: ReactNode | ComponentType;
502
519
  }
503
520
 
504
521
  /**
@@ -555,14 +572,14 @@ export declare interface BlockDecoratorDefinition {
555
572
  * ```
556
573
  */
557
574
  export declare interface BlockDefinition extends BaseSchemaDefinition {
558
- type: 'block'
559
- styles?: BlockStyleDefinition[]
560
- lists?: BlockListDefinition[]
561
- marks?: BlockMarksDefinition
562
- of?: ArrayOfType<'object' | 'reference'>[]
563
- initialValue?: InitialValueProperty<any, any[]>
564
- options?: BlockOptions
565
- validation?: ValidationBuilder<BlockRule, any[]>
575
+ type: "block";
576
+ styles?: BlockStyleDefinition[];
577
+ lists?: BlockListDefinition[];
578
+ marks?: BlockMarksDefinition;
579
+ of?: ArrayOfType<"object" | "reference">[];
580
+ initialValue?: InitialValueProperty<any, any[]>;
581
+ options?: BlockOptions;
582
+ validation?: ValidationBuilder<BlockRule, any[]>;
566
583
  }
567
584
 
568
585
  /**
@@ -588,10 +605,10 @@ export declare interface BlockDefinition extends BaseSchemaDefinition {
588
605
  * ```
589
606
  */
590
607
  export declare interface BlockListDefinition {
591
- title: string
592
- i18nTitleKey?: string
593
- value: string
594
- icon?: ReactNode | ComponentType
608
+ title: string;
609
+ i18nTitleKey?: string;
610
+ value: string;
611
+ icon?: ReactNode | ComponentType;
595
612
  }
596
613
 
597
614
  /**
@@ -601,16 +618,16 @@ export declare interface BlockListDefinition {
601
618
  * @internal
602
619
  */
603
620
  export declare type BlockListObjectField = {
604
- name: 'list'
605
- } & ObjectField<StringSchemaType>
621
+ name: "list";
622
+ } & ObjectField<StringSchemaType>;
606
623
 
607
624
  /**
608
625
  * Schema definition for text block marks (decorators and annotations).
609
626
  *
610
627
  * @public */
611
628
  export declare interface BlockMarksDefinition {
612
- decorators?: BlockDecoratorDefinition[]
613
- annotations?: ArrayOfType<'object' | 'reference'>[]
629
+ decorators?: BlockDecoratorDefinition[];
630
+ annotations?: ArrayOfType<"object" | "reference">[];
614
631
  }
615
632
 
616
633
  /**
@@ -620,8 +637,8 @@ export declare interface BlockOptions extends BaseSchemaTypeOptions {
620
637
  /**
621
638
  * Turn on or off the builtin browser spellchecking. Default is on.
622
639
  */
623
- spellCheck?: boolean
624
- unstable_whitespaceOnPasteMode?: 'preserve' | 'normalize' | 'remove'
640
+ spellCheck?: boolean;
641
+ unstable_whitespaceOnPasteMode?: "preserve" | "normalize" | "remove";
625
642
  /**
626
643
  * When enabled, the editor will restrict all line breaks and soft breaks,
627
644
  * forcing content to remain on a single line. This will also update
@@ -631,7 +648,7 @@ export declare interface BlockOptions extends BaseSchemaTypeOptions {
631
648
  *
632
649
  * @defaultValue false
633
650
  */
634
- oneLine?: boolean
651
+ oneLine?: boolean;
635
652
  }
636
653
 
637
654
  /** @public */
@@ -645,8 +662,13 @@ export declare interface BlockRule extends RuleDef<BlockRule, any[]> {}
645
662
  * @internal
646
663
  */
647
664
  export declare interface BlockSchemaType extends ObjectSchemaType {
648
- fields: [BlockChildrenObjectField, BlockStyleObjectField, BlockListObjectField, ...ObjectField[]]
649
- options?: BlockOptions
665
+ fields: [
666
+ BlockChildrenObjectField,
667
+ BlockStyleObjectField,
668
+ BlockListObjectField,
669
+ ...ObjectField[],
670
+ ];
671
+ options?: BlockOptions;
650
672
  }
651
673
 
652
674
  /**
@@ -704,10 +726,10 @@ export declare interface BlockSchemaType extends ObjectSchemaType {
704
726
  * ```
705
727
  */
706
728
  export declare interface BlockStyleDefinition {
707
- title: string
708
- value: string
709
- i18nTitleKey?: string
710
- icon?: ReactNode | ComponentType
729
+ title: string;
730
+ value: string;
731
+ i18nTitleKey?: string;
732
+ icon?: ReactNode | ComponentType;
711
733
  }
712
734
 
713
735
  /**
@@ -717,20 +739,20 @@ export declare interface BlockStyleDefinition {
717
739
  * @internal
718
740
  */
719
741
  export declare type BlockStyleObjectField = {
720
- name: 'style'
721
- } & ObjectField<StringSchemaType>
742
+ name: "style";
743
+ } & ObjectField<StringSchemaType>;
722
744
 
723
745
  /** @public */
724
746
  export declare interface BooleanDefinition extends BaseSchemaDefinition {
725
- type: 'boolean'
726
- options?: BooleanOptions
727
- initialValue?: InitialValueProperty<any, boolean>
728
- validation?: ValidationBuilder<BooleanRule, boolean>
747
+ type: "boolean";
748
+ options?: BooleanOptions;
749
+ initialValue?: InitialValueProperty<any, boolean>;
750
+ validation?: ValidationBuilder<BooleanRule, boolean>;
729
751
  }
730
752
 
731
753
  /** @public */
732
754
  export declare interface BooleanOptions extends BaseSchemaTypeOptions {
733
- layout?: 'switch' | 'checkbox'
755
+ layout?: "switch" | "checkbox";
734
756
  }
735
757
 
736
758
  /** @public */
@@ -738,9 +760,9 @@ export declare interface BooleanRule extends RuleDef<BooleanRule, boolean> {}
738
760
 
739
761
  /** @public */
740
762
  export declare interface BooleanSchemaType extends BaseSchemaType {
741
- jsonType: 'boolean'
742
- options?: BooleanOptions
743
- initialValue?: InitialValueProperty<any, boolean>
763
+ jsonType: "boolean";
764
+ options?: BooleanOptions;
765
+ initialValue?: InitialValueProperty<any, boolean>;
744
766
  }
745
767
 
746
768
  /**
@@ -750,12 +772,12 @@ export declare interface BooleanSchemaType extends BaseSchemaType {
750
772
  */
751
773
  export declare interface CanvasAppOptions {
752
774
  /** Set to true to exclude a type or field from appearing in Canvas */
753
- exclude?: boolean
775
+ exclude?: boolean;
754
776
  /**
755
777
  * A short description of what the type or field is used for.
756
778
  * Purpose can be used to improve how and when content mapping uses the field.
757
779
  * */
758
- purpose?: string
780
+ purpose?: string;
759
781
  }
760
782
 
761
783
  /**
@@ -763,21 +785,21 @@ export declare interface CanvasAppOptions {
763
785
  * Payload that will be passed by canvas to our notifications system to display the notification in canvas.
764
786
  * */
765
787
  export declare interface CanvasNotificationPayload extends DashboardNotificationPayload {
766
- applicationType: 'canvas'
788
+ applicationType: "canvas";
767
789
  link: {
768
- type: 'dashboard'
769
- path: string
770
- }
790
+ type: "dashboard";
791
+ path: string;
792
+ };
771
793
  }
772
794
 
773
795
  /** @public */
774
796
  export declare interface CollapseOptions {
775
- collapsed?: boolean
776
- collapsible?: boolean
797
+ collapsed?: boolean;
798
+ collapsible?: boolean;
777
799
  /**
778
800
  * @deprecated Use `collapsible` instead
779
801
  */
780
- collapsable?: boolean
802
+ collapsable?: boolean;
781
803
  }
782
804
 
783
805
  /**
@@ -786,50 +808,55 @@ export declare interface CollapseOptions {
786
808
  *
787
809
  * @internal
788
810
  */
789
- export declare type ConditionalIndexAccess<T, U> = U extends keyof T ? T[U] : undefined
811
+ export declare type ConditionalIndexAccess<T, U> = U extends keyof T
812
+ ? T[U]
813
+ : undefined;
790
814
 
791
815
  /** @public */
792
- export declare type ConditionalProperty = boolean | ConditionalPropertyCallback | undefined
816
+ export declare type ConditionalProperty =
817
+ | boolean
818
+ | ConditionalPropertyCallback
819
+ | undefined;
793
820
 
794
821
  /** @public */
795
822
  export declare type ConditionalPropertyCallback = (
796
823
  context: ConditionalPropertyCallbackContext,
797
- ) => boolean
824
+ ) => boolean;
798
825
 
799
826
  /** @public */
800
827
  export declare interface ConditionalPropertyCallbackContext {
801
- document: SanityDocument | undefined
802
- parent: any
803
- value: any
804
- currentUser: Omit<CurrentUser, 'role'> | null
805
- path: Path
828
+ document: SanityDocument | undefined;
829
+ parent: any;
830
+ value: any;
831
+ currentUser: Omit<CurrentUser, "role"> | null;
832
+ path: Path;
806
833
  }
807
834
 
808
835
  /** @internal */
809
836
  export declare interface CreateIfNotExistsMutation {
810
837
  createIfNotExists: {
811
- _id: string
812
- _type: string
813
- [key: string]: unknown
814
- }
838
+ _id: string;
839
+ _type: string;
840
+ [key: string]: unknown;
841
+ };
815
842
  }
816
843
 
817
844
  /** @internal */
818
845
  export declare interface CreateMutation {
819
846
  create: {
820
- _id?: string
821
- _type: string
822
- [key: string]: unknown
823
- }
847
+ _id?: string;
848
+ _type: string;
849
+ [key: string]: unknown;
850
+ };
824
851
  }
825
852
 
826
853
  /** @internal */
827
854
  export declare interface CreateOrReplaceMutation {
828
855
  createOrReplace: {
829
- _id: string
830
- _type: string
831
- [key: string]: unknown
832
- }
856
+ _id: string;
857
+ _type: string;
858
+ [key: string]: unknown;
859
+ };
833
860
  }
834
861
 
835
862
  /**
@@ -844,114 +871,122 @@ export declare interface CreateSquashedMutation {
844
871
  /**
845
872
  * The user IDs of all the users who contributed to the document prior to the squashing
846
873
  */
847
- authors: string[]
874
+ authors: string[];
848
875
  /**
849
876
  * User ID of the person who initially created the document
850
877
  */
851
- createdBy: string
878
+ createdBy: string;
852
879
  /**
853
880
  * ISO-formatted timestamp (zulu-time) of when the document as initially created
854
881
  */
855
- createdAt: string
882
+ createdAt: string;
856
883
  /**
857
884
  * The document as it exists after squashing has occurred
858
885
  */
859
886
  document: {
860
- _id: string
861
- _type: string
862
- [key: string]: unknown
863
- }
864
- }
887
+ _id: string;
888
+ _type: string;
889
+ [key: string]: unknown;
890
+ };
891
+ };
865
892
  }
866
893
 
867
894
  /** @public */
868
895
  export declare interface CrossDatasetReferenceDefinition extends BaseSchemaDefinition {
869
- type: 'crossDatasetReference'
870
- weak?: boolean
896
+ type: "crossDatasetReference";
897
+ weak?: boolean;
871
898
  to: {
872
- type: string
873
- title?: string
874
- icon?: ComponentType
875
- preview?: PreviewConfig
899
+ type: string;
900
+ title?: string;
901
+ icon?: ComponentType;
902
+ preview?: PreviewConfig;
876
903
  /**
877
904
  * @deprecated Unused. Configuring search is no longer supported.
878
905
  */
879
906
  __experimental_search?: {
880
- path: string | string[]
881
- weight?: number
882
- mapWith?: string
883
- }[]
884
- }[]
885
- dataset: string
886
- studioUrl?: (document: {id: string; type?: string}) => string | null
887
- tokenId?: string
888
- options?: ReferenceOptions
907
+ path: string | string[];
908
+ weight?: number;
909
+ mapWith?: string;
910
+ }[];
911
+ }[];
912
+ dataset: string;
913
+ studioUrl?: (document: { id: string; type?: string }) => string | null;
914
+ tokenId?: string;
915
+ options?: ReferenceOptions;
889
916
  /**
890
917
  * @deprecated Cross-project references are no longer supported, only cross-dataset
891
918
  */
892
- projectId?: string
919
+ projectId?: string;
893
920
  }
894
921
 
895
922
  /** @beta */
896
923
  export declare type CrossDatasetReferenceFilterResolver = (options: {
897
- document: SanityDocument
898
- parent?: Record<string, unknown> | Record<string, unknown>[]
899
- parentPath: Path
900
- }) => CrossDatasetReferenceFilterSearchOptions | Promise<CrossDatasetReferenceFilterSearchOptions>
924
+ document: SanityDocument;
925
+ parent?: Record<string, unknown> | Record<string, unknown>[];
926
+ parentPath: Path;
927
+ }) =>
928
+ | CrossDatasetReferenceFilterSearchOptions
929
+ | Promise<CrossDatasetReferenceFilterSearchOptions>;
901
930
 
902
931
  /** @beta */
903
932
  export declare type CrossDatasetReferenceFilterSearchOptions = {
904
- filter?: string
905
- params?: Record<string, unknown>
906
- tag?: string
907
- }
933
+ filter?: string;
934
+ params?: Record<string, unknown>;
935
+ tag?: string;
936
+ };
908
937
 
909
938
  /** @beta */
910
- export declare interface CrossDatasetReferenceSchemaType extends Omit<ObjectSchemaType, 'options'> {
911
- jsonType: 'object'
912
- to: CrossDatasetType[]
913
- dataset: string
914
- studioUrl?: (document: {id: string; type?: string}) => string | null
915
- weak?: boolean
916
- options?: ReferenceFilterOptions
939
+ export declare interface CrossDatasetReferenceSchemaType extends Omit<
940
+ ObjectSchemaType,
941
+ "options"
942
+ > {
943
+ jsonType: "object";
944
+ to: CrossDatasetType[];
945
+ dataset: string;
946
+ studioUrl?: (document: { id: string; type?: string }) => string | null;
947
+ weak?: boolean;
948
+ options?: ReferenceFilterOptions;
917
949
  }
918
950
 
919
951
  /** @beta */
920
952
  export declare interface CrossDatasetReferenceValue {
921
- _type: string
922
- _dataset: string
923
- _projectId: string
924
- _ref: string
925
- _key?: string
926
- _weak?: boolean
953
+ _type: string;
954
+ _dataset: string;
955
+ _projectId: string;
956
+ _ref: string;
957
+ _key?: string;
958
+ _weak?: boolean;
927
959
  }
928
960
 
929
961
  /** @beta */
930
962
  export declare interface CrossDatasetType {
931
- type: string
932
- title?: string
933
- icon: ComponentType
934
- preview: PreviewConfig
963
+ type: string;
964
+ title?: string;
965
+ icon: ComponentType;
966
+ preview: PreviewConfig;
935
967
  /** @deprecated Unused. Configuring search is no longer supported for cross-dataset references. */
936
- __experimental_search?: ObjectSchemaType['__experimental_search']
968
+ __experimental_search?: ObjectSchemaType["__experimental_search"];
937
969
  }
938
970
 
939
971
  /** @public */
940
972
  export declare interface CurrentUser {
941
- id: string
942
- name: string
943
- email: string
944
- profileImage?: string
945
- provider?: string
973
+ id: string;
974
+ name: string;
975
+ email: string;
976
+ profileImage?: string;
977
+ provider?: string;
946
978
  /** @deprecated use `roles` instead */
947
- role: string
948
- roles: Role[]
979
+ role: string;
980
+ roles: Role[];
949
981
  }
950
982
 
951
983
  /** @public */
952
984
  export declare interface CustomValidator<T = unknown> {
953
- (value: T, context: ValidationContext): CustomValidatorResult | Promise<CustomValidatorResult>
954
- bypassConcurrencyLimit?: boolean
985
+ (
986
+ value: T,
987
+ context: ValidationContext,
988
+ ): CustomValidatorResult | Promise<CustomValidatorResult>;
989
+ bypassConcurrencyLimit?: boolean;
955
990
  }
956
991
 
957
992
  /** @public */
@@ -960,48 +995,48 @@ export declare type CustomValidatorResult =
960
995
  | string
961
996
  | ValidationError
962
997
  | ValidationError[]
963
- | LocalizedValidationMessages
998
+ | LocalizedValidationMessages;
964
999
 
965
1000
  /**
966
1001
  * @internal
967
1002
  * Payload notifications have to provide to the notification system in order to display correctly in dashboard
968
1003
  */
969
1004
  export declare interface DashboardNotificationPayload {
970
- version: '1.0.0'
971
- applicationType: string
972
- createdAt: string
1005
+ version: "1.0.0";
1006
+ applicationType: string;
1007
+ createdAt: string;
973
1008
  /**
974
1009
  * The user who took the action which triggered the notification.
975
1010
  */
976
- actor: User
977
- title: PortableTextBlock[]
978
- body: PortableTextBlock[] | undefined
979
- organizationId: string
980
- applicationId?: string
981
- workspaceName?: string
1011
+ actor: User;
1012
+ title: PortableTextBlock[];
1013
+ body: PortableTextBlock[] | undefined;
1014
+ organizationId: string;
1015
+ applicationId?: string;
1016
+ workspaceName?: string;
982
1017
  link:
983
1018
  | {
984
- type: 'url'
985
- url: string
1019
+ type: "url";
1020
+ url: string;
986
1021
  }
987
1022
  | {
988
- type: 'dashboard'
989
- path: string
990
- }
1023
+ type: "dashboard";
1024
+ path: string;
1025
+ };
991
1026
  }
992
1027
 
993
1028
  /** @public */
994
1029
  export declare interface DateDefinition extends BaseSchemaDefinition {
995
- type: 'date'
996
- options?: DateOptions
997
- placeholder?: string
998
- validation?: ValidationBuilder<DateRule, string>
999
- initialValue?: InitialValueProperty<any, string>
1030
+ type: "date";
1031
+ options?: DateOptions;
1032
+ placeholder?: string;
1033
+ validation?: ValidationBuilder<DateRule, string>;
1034
+ initialValue?: InitialValueProperty<any, string>;
1000
1035
  }
1001
1036
 
1002
1037
  /** @public */
1003
1038
  export declare interface DateOptions extends BaseSchemaTypeOptions {
1004
- dateFormat?: string
1039
+ dateFormat?: string;
1005
1040
  }
1006
1041
 
1007
1042
  /** @public */
@@ -1009,29 +1044,29 @@ export declare interface DateRule extends RuleDef<DateRule, string> {
1009
1044
  /**
1010
1045
  * @param minDate - Minimum date (inclusive). minDate should be in ISO 8601 format.
1011
1046
  */
1012
- min: (minDate: string | FieldReference) => DateRule
1047
+ min: (minDate: string | FieldReference) => DateRule;
1013
1048
  /**
1014
1049
  * @param maxDate - Maximum date (inclusive). maxDate should be in ISO 8601 format.
1015
1050
  */
1016
- max: (maxDate: string | FieldReference) => DateRule
1051
+ max: (maxDate: string | FieldReference) => DateRule;
1017
1052
  }
1018
1053
 
1019
1054
  /** @public */
1020
1055
  export declare interface DatetimeDefinition extends BaseSchemaDefinition {
1021
- type: 'datetime'
1022
- options?: DatetimeOptions
1023
- placeholder?: string
1024
- validation?: ValidationBuilder<DatetimeRule, string>
1025
- initialValue?: InitialValueProperty<any, string>
1056
+ type: "datetime";
1057
+ options?: DatetimeOptions;
1058
+ placeholder?: string;
1059
+ validation?: ValidationBuilder<DatetimeRule, string>;
1060
+ initialValue?: InitialValueProperty<any, string>;
1026
1061
  }
1027
1062
 
1028
1063
  /** @public */
1029
1064
  export declare interface DatetimeOptions extends BaseSchemaTypeOptions {
1030
- dateFormat?: string
1031
- timeFormat?: string
1032
- timeStep?: number
1033
- displayTimeZone?: string
1034
- allowTimeZoneSwitch?: boolean
1065
+ dateFormat?: string;
1066
+ timeFormat?: string;
1067
+ timeStep?: number;
1068
+ displayTimeZone?: string;
1069
+ allowTimeZoneSwitch?: boolean;
1035
1070
  }
1036
1071
 
1037
1072
  /** @public */
@@ -1039,11 +1074,11 @@ export declare interface DatetimeRule extends RuleDef<DatetimeRule, string> {
1039
1074
  /**
1040
1075
  * @param minDate - Minimum date (inclusive). minDate should be in ISO 8601 format.
1041
1076
  */
1042
- min: (minDate: string | FieldReference) => DatetimeRule
1077
+ min: (minDate: string | FieldReference) => DatetimeRule;
1043
1078
  /**
1044
1079
  * @param maxDate - Maximum date (inclusive). maxDate should be in ISO 8601 format.
1045
1080
  */
1046
- max: (maxDate: string | FieldReference) => DatetimeRule
1081
+ max: (maxDate: string | FieldReference) => DatetimeRule;
1047
1082
  }
1048
1083
 
1049
1084
  /**
@@ -1075,19 +1110,19 @@ export declare function defineArrayMember<
1075
1110
  TStrict extends StrictDefinition,
1076
1111
  >(
1077
1112
  arrayOfSchema: {
1078
- type: TType
1113
+ type: TType;
1079
1114
  /**
1080
1115
  * When provided, `name` is used as `_type` for the array item when stored.
1081
1116
  *
1082
1117
  * Necessary when an array contains multiple entries with the same `type`, each with
1083
1118
  * different configuration (title and initialValue for instance).
1084
1119
  */
1085
- name?: TName
1120
+ name?: TName;
1086
1121
  } & DefineArrayMemberBase<TType, TAlias> &
1087
1122
  NarrowPreview<TType, TAlias, TSelect, TPrepareValue> &
1088
1123
  MaybeAllowUnknownProps<TStrict>,
1089
1124
  defineOptions?: DefineSchemaOptions<TStrict, TAlias>,
1090
- ): typeof arrayOfSchema & WidenValidation & WidenInitialValue
1125
+ ): typeof arrayOfSchema & WidenValidation & WidenInitialValue;
1091
1126
 
1092
1127
  /** @beta */
1093
1128
  export declare type DefineArrayMemberBase<
@@ -1095,7 +1130,7 @@ export declare type DefineArrayMemberBase<
1095
1130
  TAlias extends IntrinsicTypeName | undefined,
1096
1131
  > = TType extends IntrinsicTypeName
1097
1132
  ? IntrinsicArrayOfBase[TType]
1098
- : ArrayOfEntry<TypeAliasDefinition<string, TAlias>>
1133
+ : ArrayOfEntry<TypeAliasDefinition<string, TAlias>>;
1099
1134
 
1100
1135
  /**
1101
1136
  * Define a Media Library asset aspect.
@@ -1107,7 +1142,7 @@ export declare type DefineArrayMemberBase<
1107
1142
  */
1108
1143
  export declare function defineAssetAspect(
1109
1144
  definition: MediaLibraryAssetAspectDefinition,
1110
- ): MediaLibraryAssetAspectDocument
1145
+ ): MediaLibraryAssetAspectDocument;
1111
1146
 
1112
1147
  /**
1113
1148
  * Define a field within a document, object, image or file definition `fields` array.
@@ -1138,20 +1173,22 @@ export declare function defineField<
1138
1173
  TStrict extends StrictDefinition,
1139
1174
  >(
1140
1175
  schemaField: {
1141
- type: TType
1142
- name: TName
1176
+ type: TType;
1177
+ name: TName;
1143
1178
  } & DefineSchemaBase<TType, TAlias> &
1144
1179
  NarrowPreview<TType, TAlias, TSelect, TPrepareValue> &
1145
1180
  MaybeAllowUnknownProps<TStrict> &
1146
1181
  FieldDefinitionBase,
1147
1182
  defineOptions?: DefineSchemaOptions<TStrict, TAlias>,
1148
- ): typeof schemaField & WidenValidation & WidenInitialValue
1183
+ ): typeof schemaField & WidenValidation & WidenInitialValue;
1149
1184
 
1150
1185
  /** @beta */
1151
1186
  export declare type DefineSchemaBase<
1152
1187
  TType extends string,
1153
1188
  TAlias extends IntrinsicTypeName | undefined,
1154
- > = TType extends IntrinsicTypeName ? IntrinsicBase[TType] : TypeAliasDefinition<TType, TAlias>
1189
+ > = TType extends IntrinsicTypeName
1190
+ ? IntrinsicBase[TType]
1191
+ : TypeAliasDefinition<TType, TAlias>;
1155
1192
 
1156
1193
  /** @beta */
1157
1194
  export declare interface DefineSchemaOptions<
@@ -1169,9 +1206,9 @@ export declare interface DefineSchemaOptions<
1169
1206
  *
1170
1207
  * @see defineType
1171
1208
  */
1172
- strict?: TStrict
1209
+ strict?: TStrict;
1173
1210
  /** Should be provided when type is a non-intrinsic type, ie type is a type alias */
1174
- aliasFor?: TAlias extends IntrinsicTypeName ? TAlias : never
1211
+ aliasFor?: TAlias extends IntrinsicTypeName ? TAlias : never;
1175
1212
  }
1176
1213
 
1177
1214
  /** @beta */
@@ -1180,7 +1217,7 @@ export declare type DefineSchemaType<
1180
1217
  TAlias extends IntrinsicTypeName | undefined,
1181
1218
  > = TType extends IntrinsicTypeName
1182
1219
  ? IntrinsicDefinitions[TType]
1183
- : TypeAliasDefinition<TType, TAlias>
1220
+ : TypeAliasDefinition<TType, TAlias>;
1184
1221
 
1185
1222
  /**
1186
1223
  * Helper function for defining a Sanity type definition. This function does not do anything on its own;
@@ -1350,57 +1387,61 @@ export declare function defineType<
1350
1387
  TStrict extends StrictDefinition,
1351
1388
  >(
1352
1389
  schemaDefinition: {
1353
- type: TType
1354
- name: TName
1390
+ type: TType;
1391
+ name: TName;
1355
1392
  } & DefineSchemaBase<TType, TAlias> &
1356
1393
  NarrowPreview<TType, TAlias, TSelect, TPrepareValue> &
1357
1394
  MaybeAllowUnknownProps<TStrict>,
1358
1395
  defineOptions?: DefineSchemaOptions<TStrict, TAlias>,
1359
- ): typeof schemaDefinition
1396
+ ): typeof schemaDefinition;
1360
1397
 
1361
1398
  /** @internal */
1362
1399
  export declare interface DeleteMutation {
1363
- delete: MutationSelection
1400
+ delete: MutationSelection;
1364
1401
  }
1365
1402
 
1366
1403
  /** @public */
1367
1404
  export declare interface DeprecatedProperty {
1368
- reason: string
1405
+ reason: string;
1369
1406
  }
1370
1407
 
1371
1408
  /** @public */
1372
- export declare type DeprecatedSchemaType<TSchemaType extends BaseSchemaType = BaseSchemaType> =
1373
- TSchemaType & DeprecationConfiguration
1409
+ export declare type DeprecatedSchemaType<
1410
+ TSchemaType extends BaseSchemaType = BaseSchemaType,
1411
+ > = TSchemaType & DeprecationConfiguration;
1374
1412
 
1375
1413
  /**
1376
1414
  * @public
1377
1415
  */
1378
1416
  export declare interface DeprecationConfiguration {
1379
- deprecated: DeprecatedProperty
1417
+ deprecated: DeprecatedProperty;
1380
1418
  }
1381
1419
 
1382
1420
  /** @public */
1383
- export declare interface DocumentDefinition extends Omit<ObjectDefinition, 'type'> {
1384
- type: 'document'
1385
- liveEdit?: boolean
1421
+ export declare interface DocumentDefinition extends Omit<
1422
+ ObjectDefinition,
1423
+ "type"
1424
+ > {
1425
+ type: "document";
1426
+ liveEdit?: boolean;
1386
1427
  /** @beta */
1387
- orderings?: SortOrdering[]
1388
- options?: DocumentOptions
1389
- validation?: ValidationBuilder<DocumentRule, SanityDocument>
1390
- initialValue?: InitialValueProperty<any, Record<string, unknown>>
1428
+ orderings?: SortOrdering[];
1429
+ options?: DocumentOptions;
1430
+ validation?: ValidationBuilder<DocumentRule, SanityDocument>;
1431
+ initialValue?: InitialValueProperty<any, Record<string, unknown>>;
1391
1432
  /** @deprecated Unused. Use the new field-level search config. */
1392
1433
  __experimental_search?: {
1393
- path: string
1394
- weight: number
1395
- mapWith?: string
1396
- }[]
1434
+ path: string;
1435
+ weight: number;
1436
+ mapWith?: string;
1437
+ }[];
1397
1438
  /** @alpha */
1398
- __experimental_omnisearch_visibility?: boolean
1439
+ __experimental_omnisearch_visibility?: boolean;
1399
1440
  /**
1400
1441
  * Determines whether the large preview title is displayed in the document pane form
1401
1442
  * @alpha
1402
1443
  * */
1403
- __experimental_formPreviewTitle?: boolean
1444
+ __experimental_formPreviewTitle?: boolean;
1404
1445
  }
1405
1446
 
1406
1447
  /**
@@ -1411,15 +1452,18 @@ export declare interface DocumentDefinition extends Omit<ObjectDefinition, 'type
1411
1452
  export declare interface DocumentOptions extends BaseSchemaTypeOptions {}
1412
1453
 
1413
1454
  /** @public */
1414
- export declare interface DocumentRule extends RuleDef<DocumentRule, SanityDocument> {}
1455
+ export declare interface DocumentRule extends RuleDef<
1456
+ DocumentRule,
1457
+ SanityDocument
1458
+ > {}
1415
1459
 
1416
1460
  /** @public */
1417
1461
  export declare interface EmailDefinition extends BaseSchemaDefinition {
1418
- type: 'email'
1419
- options?: EmailOptions
1420
- placeholder?: string
1421
- validation?: ValidationBuilder<EmailRule, string>
1422
- initialValue?: InitialValueProperty<any, string>
1462
+ type: "email";
1463
+ options?: EmailOptions;
1464
+ placeholder?: string;
1465
+ validation?: ValidationBuilder<EmailRule, string>;
1466
+ initialValue?: InitialValueProperty<any, string>;
1423
1467
  }
1424
1468
 
1425
1469
  /** @public */
@@ -1433,9 +1477,9 @@ export declare interface EmptyProps {}
1433
1477
 
1434
1478
  /** @public */
1435
1479
  export declare interface EnumListProps<V = unknown> {
1436
- list?: Array<TitledListValue<V> | V>
1437
- layout?: 'radio' | 'dropdown'
1438
- direction?: 'horizontal' | 'vertical'
1480
+ list?: Array<TitledListValue<V> | V>;
1481
+ layout?: "radio" | "dropdown";
1482
+ direction?: "horizontal" | "vertical";
1439
1483
  }
1440
1484
 
1441
1485
  /**
@@ -1453,35 +1497,36 @@ export declare interface EnumListProps<V = unknown> {
1453
1497
  export declare type FieldDefinition<
1454
1498
  TType extends IntrinsicTypeName = IntrinsicTypeName,
1455
1499
  TAlias extends IntrinsicTypeName | undefined = undefined,
1456
- > = (InlineFieldDefinition[TType] | TypeAliasDefinition<string, TAlias>) & FieldDefinitionBase
1500
+ > = (InlineFieldDefinition[TType] | TypeAliasDefinition<string, TAlias>) &
1501
+ FieldDefinitionBase;
1457
1502
 
1458
1503
  /** @public */
1459
1504
  export declare interface FieldDefinitionBase {
1460
- fieldset?: string
1461
- group?: string | string[]
1505
+ fieldset?: string;
1506
+ group?: string | string[];
1462
1507
  }
1463
1508
 
1464
1509
  /** @public */
1465
1510
  export declare interface FieldGroup {
1466
- name: string
1467
- icon?: ComponentType
1468
- title?: string
1469
- description?: string
1470
- i18n?: I18nTextRecord<'title'>
1471
- hidden?: ConditionalProperty
1472
- default?: boolean
1473
- fields?: ObjectField[]
1511
+ name: string;
1512
+ icon?: ComponentType;
1513
+ title?: string;
1514
+ description?: string;
1515
+ i18n?: I18nTextRecord<"title">;
1516
+ hidden?: ConditionalProperty;
1517
+ default?: boolean;
1518
+ fields?: ObjectField[];
1474
1519
  }
1475
1520
 
1476
1521
  /** @public */
1477
1522
  export declare type FieldGroupDefinition = {
1478
- name: string
1479
- title?: string
1480
- hidden?: ConditionalProperty
1481
- icon?: ComponentType
1482
- default?: boolean
1483
- i18n?: I18nTextRecord<'title'>
1484
- }
1523
+ name: string;
1524
+ title?: string;
1525
+ hidden?: ConditionalProperty;
1526
+ icon?: ComponentType;
1527
+ default?: boolean;
1528
+ i18n?: I18nTextRecord<"title">;
1529
+ };
1485
1530
 
1486
1531
  /**
1487
1532
  * Holds a reference to a different field
@@ -1490,65 +1535,65 @@ export declare type FieldGroupDefinition = {
1490
1535
  * @public
1491
1536
  */
1492
1537
  export declare interface FieldReference {
1493
- type: symbol
1494
- path: string | string[]
1538
+ type: symbol;
1539
+ path: string | string[];
1495
1540
  }
1496
1541
 
1497
1542
  /** @public */
1498
1543
  export declare type FieldRules = {
1499
- [fieldKey: string]: SchemaValidationValue
1500
- }
1544
+ [fieldKey: string]: SchemaValidationValue;
1545
+ };
1501
1546
 
1502
1547
  /** @public */
1503
- export declare type Fieldset = SingleFieldSet | MultiFieldSet
1548
+ export declare type Fieldset = SingleFieldSet | MultiFieldSet;
1504
1549
 
1505
1550
  /** @public */
1506
1551
  export declare interface FieldsetDefinition {
1507
- name: string
1508
- title?: string
1509
- description?: string
1510
- group?: string
1511
- hidden?: ConditionalProperty
1512
- readOnly?: ConditionalProperty
1513
- options?: ObjectOptions
1552
+ name: string;
1553
+ title?: string;
1554
+ description?: string;
1555
+ group?: string;
1556
+ hidden?: ConditionalProperty;
1557
+ readOnly?: ConditionalProperty;
1558
+ options?: ObjectOptions;
1514
1559
  }
1515
1560
 
1516
1561
  /** @public */
1517
1562
  declare interface File_2 {
1518
- [key: string]: unknown
1519
- asset?: Reference
1563
+ [key: string]: unknown;
1564
+ asset?: Reference;
1520
1565
  }
1521
- export {File_2 as File}
1566
+ export { File_2 as File };
1522
1567
 
1523
1568
  /** @public */
1524
1569
  export declare interface FileAsset extends Asset {
1525
- _type: 'sanity.fileAsset'
1526
- metadata: Record<string, unknown>
1570
+ _type: "sanity.fileAsset";
1571
+ metadata: Record<string, unknown>;
1527
1572
  }
1528
1573
 
1529
1574
  /** @public */
1530
1575
  export declare interface FileDefinition extends Omit<
1531
1576
  ObjectDefinition,
1532
- 'type' | 'fields' | 'options' | 'groups' | 'validation'
1577
+ "type" | "fields" | "options" | "groups" | "validation"
1533
1578
  > {
1534
- type: 'file'
1535
- fields?: ObjectDefinition['fields']
1536
- options?: FileOptions
1537
- validation?: ValidationBuilder<FileRule, FileValue>
1538
- initialValue?: InitialValueProperty<any, FileValue>
1579
+ type: "file";
1580
+ fields?: ObjectDefinition["fields"];
1581
+ options?: FileOptions;
1582
+ validation?: ValidationBuilder<FileRule, FileValue>;
1583
+ initialValue?: InitialValueProperty<any, FileValue>;
1539
1584
  }
1540
1585
 
1541
1586
  /** @public */
1542
1587
  export declare interface FileOptions extends ObjectOptions {
1543
- storeOriginalFilename?: boolean
1544
- accept?: string
1545
- sources?: AssetSource[]
1546
- mediaLibrary?: MediaLibraryOptions
1588
+ storeOriginalFilename?: boolean;
1589
+ accept?: string;
1590
+ sources?: AssetSource[];
1591
+ mediaLibrary?: MediaLibraryOptions;
1547
1592
  /**
1548
1593
  * When set to `true`, hides the upload UI, only allowing selection of existing assets from the media library.
1549
1594
  * Useful for centralized asset management workflows where ad-hoc uploads should be prevented.
1550
1595
  */
1551
- disableNew?: boolean
1596
+ disableNew?: boolean;
1552
1597
  }
1553
1598
 
1554
1599
  /** @public */
@@ -1566,40 +1611,46 @@ export declare interface FileRule extends RuleDef<FileRule, FileValue> {
1566
1611
  * })
1567
1612
  * ```
1568
1613
  */
1569
- assetRequired(): FileRule
1614
+ assetRequired(): FileRule;
1570
1615
  }
1571
1616
 
1572
1617
  /** @public */
1573
- export declare interface FileSchemaType extends Omit<ObjectSchemaType, 'options'> {
1574
- options?: FileOptions
1618
+ export declare interface FileSchemaType extends Omit<
1619
+ ObjectSchemaType,
1620
+ "options"
1621
+ > {
1622
+ options?: FileOptions;
1575
1623
  }
1576
1624
 
1577
1625
  /** @public */
1578
1626
  export declare interface FileValue {
1579
- asset?: Reference
1580
- [index: string]: unknown
1627
+ asset?: Reference;
1628
+ [index: string]: unknown;
1581
1629
  }
1582
1630
 
1583
1631
  /** @public */
1584
1632
  export declare interface FormNodeValidation {
1585
- level: 'error' | 'warning' | 'info'
1586
- message: string
1587
- path: Path
1633
+ level: "error" | "warning" | "info";
1634
+ message: string;
1635
+ path: Path;
1588
1636
  }
1589
1637
 
1590
1638
  /** @public */
1591
1639
  export declare interface GeopointDefinition extends BaseSchemaDefinition {
1592
- type: 'geopoint'
1593
- options?: GeopointOptions
1594
- validation?: ValidationBuilder<GeopointRule, GeopointValue>
1595
- initialValue?: InitialValueProperty<any, Omit<GeopointValue, '_type'>>
1640
+ type: "geopoint";
1641
+ options?: GeopointOptions;
1642
+ validation?: ValidationBuilder<GeopointRule, GeopointValue>;
1643
+ initialValue?: InitialValueProperty<any, Omit<GeopointValue, "_type">>;
1596
1644
  }
1597
1645
 
1598
1646
  /** @public */
1599
1647
  export declare interface GeopointOptions extends BaseSchemaTypeOptions {}
1600
1648
 
1601
1649
  /** @public */
1602
- export declare interface GeopointRule extends RuleDef<GeopointRule, GeopointValue> {}
1650
+ export declare interface GeopointRule extends RuleDef<
1651
+ GeopointRule,
1652
+ GeopointValue
1653
+ > {}
1603
1654
 
1604
1655
  /**
1605
1656
  * Geographical point representing a pair of latitude and longitude coordinates,
@@ -1612,209 +1663,213 @@ export declare interface GeopointValue {
1612
1663
  /**
1613
1664
  * Type of the object. Must be `geopoint`.
1614
1665
  */
1615
- _type: 'geopoint'
1666
+ _type: "geopoint";
1616
1667
  /**
1617
1668
  * Latitude in degrees
1618
1669
  */
1619
- lat: number
1670
+ lat: number;
1620
1671
  /**
1621
1672
  * Longitude in degrees
1622
1673
  */
1623
- lng: number
1674
+ lng: number;
1624
1675
  /**
1625
1676
  * Altitude in meters
1626
1677
  */
1627
- alt?: number
1678
+ alt?: number;
1628
1679
  }
1629
1680
 
1630
1681
  /** @public */
1631
1682
  export declare interface GlobalDocumentReferenceDefinition extends BaseSchemaDefinition {
1632
- type: 'globalDocumentReference'
1633
- weak?: boolean
1683
+ type: "globalDocumentReference";
1684
+ weak?: boolean;
1634
1685
  to: {
1635
- type: string
1636
- title?: string
1637
- icon?: ComponentType
1638
- preview?: PreviewConfig
1639
- }[]
1640
- resourceType: string
1641
- resourceId: string
1642
- options?: ReferenceOptions
1643
- studioUrl?: string | ((document: {id: string; type?: string}) => string | null)
1686
+ type: string;
1687
+ title?: string;
1688
+ icon?: ComponentType;
1689
+ preview?: PreviewConfig;
1690
+ }[];
1691
+ resourceType: string;
1692
+ resourceId: string;
1693
+ options?: ReferenceOptions;
1694
+ studioUrl?:
1695
+ | string
1696
+ | ((document: { id: string; type?: string }) => string | null);
1644
1697
  }
1645
1698
 
1646
1699
  /** @beta */
1647
1700
  export declare type GlobalDocumentReferenceFilterResolver = (options: {
1648
- document: SanityDocument
1649
- parent?: Record<string, unknown> | Record<string, unknown>[]
1650
- parentPath: Path
1701
+ document: SanityDocument;
1702
+ parent?: Record<string, unknown> | Record<string, unknown>[];
1703
+ parentPath: Path;
1651
1704
  }) =>
1652
1705
  | GlobalDocumentReferenceFilterSearchOptions
1653
- | Promise<GlobalDocumentReferenceFilterSearchOptions>
1706
+ | Promise<GlobalDocumentReferenceFilterSearchOptions>;
1654
1707
 
1655
1708
  /** @beta */
1656
1709
  export declare type GlobalDocumentReferenceFilterSearchOptions = {
1657
- filter?: string
1658
- params?: Record<string, unknown>
1659
- tag?: string
1660
- }
1710
+ filter?: string;
1711
+ params?: Record<string, unknown>;
1712
+ tag?: string;
1713
+ };
1661
1714
 
1662
1715
  /** @beta */
1663
1716
  export declare interface GlobalDocumentReferenceSchemaType extends Omit<
1664
1717
  ObjectSchemaType,
1665
- 'options'
1718
+ "options"
1666
1719
  > {
1667
- jsonType: 'object'
1668
- to: GlobalDocumentReferenceType[]
1669
- resourceType: string
1670
- resourceId: string
1671
- studioUrl?: string | ((document: {id: string; type?: string}) => string | null)
1672
- weak?: boolean
1673
- options?: ReferenceFilterOptions
1720
+ jsonType: "object";
1721
+ to: GlobalDocumentReferenceType[];
1722
+ resourceType: string;
1723
+ resourceId: string;
1724
+ studioUrl?:
1725
+ | string
1726
+ | ((document: { id: string; type?: string }) => string | null);
1727
+ weak?: boolean;
1728
+ options?: ReferenceFilterOptions;
1674
1729
  }
1675
1730
 
1676
1731
  /** @beta */
1677
1732
  export declare interface GlobalDocumentReferenceType {
1678
- type: string
1679
- title?: string
1680
- icon: ComponentType
1681
- preview: PreviewConfig
1733
+ type: string;
1734
+ title?: string;
1735
+ icon: ComponentType;
1736
+ preview: PreviewConfig;
1682
1737
  /** @deprecated Unused. It's only here for the type to be compatible with createSearchQuery.ts */
1683
- __experimental_search: never
1738
+ __experimental_search: never;
1684
1739
  }
1685
1740
 
1686
1741
  /** @beta */
1687
1742
  export declare interface GlobalDocumentReferenceValue {
1688
- _type: string
1743
+ _type: string;
1689
1744
  /** The reference to the document. This is a string of the form `a:b:c`,
1690
1745
  * where:
1691
1746
  * - `a` is the resource type, for example `dataset` or `media-library`
1692
1747
  * - `b` is the resource ID, for example data set name or media library ID
1693
1748
  * - `c` is the document ID */
1694
- _ref: `${string}:${string}:${string}`
1695
- _key?: string
1696
- _weak?: boolean
1749
+ _ref: `${string}:${string}:${string}`;
1750
+ _key?: string;
1751
+ _weak?: boolean;
1697
1752
  }
1698
1753
 
1699
1754
  /** @public */
1700
1755
  export declare interface HotspotOptions {
1701
- previews?: HotspotPreview[]
1756
+ previews?: HotspotPreview[];
1702
1757
  }
1703
1758
 
1704
1759
  /** @public */
1705
1760
  export declare interface HotspotPreview {
1706
- title: string
1707
- aspectRatio: number
1761
+ title: string;
1762
+ aspectRatio: number;
1708
1763
  }
1709
1764
 
1710
1765
  /** @public */
1711
1766
  export declare type I18nTextRecord<K extends string> = {
1712
1767
  [P in K]?: {
1713
- key: string
1714
- ns: string
1715
- }
1716
- }
1768
+ key: string;
1769
+ ns: string;
1770
+ };
1771
+ };
1717
1772
 
1718
1773
  /** @public */
1719
1774
  export declare interface I18nTitledListValue<V = unknown> {
1720
- _key?: string
1721
- title: string
1722
- i18nTitleKey?: string
1723
- value?: V
1775
+ _key?: string;
1776
+ title: string;
1777
+ i18nTitleKey?: string;
1778
+ value?: V;
1724
1779
  }
1725
1780
 
1726
1781
  /** @public */
1727
1782
  declare interface Image_2 {
1728
- [key: string]: unknown
1729
- asset?: Reference
1730
- crop?: ImageCrop
1731
- hotspot?: ImageHotspot
1783
+ [key: string]: unknown;
1784
+ asset?: Reference;
1785
+ crop?: ImageCrop;
1786
+ hotspot?: ImageHotspot;
1732
1787
  }
1733
- export {Image_2 as Image}
1788
+ export { Image_2 as Image };
1734
1789
 
1735
1790
  /** @public */
1736
1791
  export declare interface ImageAsset extends Asset {
1737
- _type: 'sanity.imageAsset'
1738
- metadata: ImageMetadata
1792
+ _type: "sanity.imageAsset";
1793
+ metadata: ImageMetadata;
1739
1794
  }
1740
1795
 
1741
1796
  /** @public */
1742
1797
  export declare interface ImageCrop {
1743
- _type?: 'sanity.imageCrop'
1744
- left: number
1745
- bottom: number
1746
- right: number
1747
- top: number
1798
+ _type?: "sanity.imageCrop";
1799
+ left: number;
1800
+ bottom: number;
1801
+ right: number;
1802
+ top: number;
1748
1803
  }
1749
1804
 
1750
1805
  /** @public */
1751
1806
  export declare interface ImageDefinition extends Omit<
1752
1807
  ObjectDefinition,
1753
- 'type' | 'fields' | 'options' | 'groups' | 'validation'
1808
+ "type" | "fields" | "options" | "groups" | "validation"
1754
1809
  > {
1755
- type: 'image'
1756
- fields?: FieldDefinition[]
1757
- options?: ImageOptions
1758
- validation?: ValidationBuilder<ImageRule, ImageValue>
1759
- initialValue?: InitialValueProperty<any, ImageValue>
1810
+ type: "image";
1811
+ fields?: FieldDefinition[];
1812
+ options?: ImageOptions;
1813
+ validation?: ValidationBuilder<ImageRule, ImageValue>;
1814
+ initialValue?: InitialValueProperty<any, ImageValue>;
1760
1815
  }
1761
1816
 
1762
1817
  /** @public */
1763
1818
  export declare interface ImageDimensions {
1764
- _type: 'sanity.imageDimensions'
1765
- height: number
1766
- width: number
1767
- aspectRatio: number
1819
+ _type: "sanity.imageDimensions";
1820
+ height: number;
1821
+ width: number;
1822
+ aspectRatio: number;
1768
1823
  }
1769
1824
 
1770
1825
  /** @public */
1771
1826
  export declare interface ImageHotspot {
1772
- _type?: 'sanity.imageHotspot'
1773
- width: number
1774
- height: number
1775
- x: number
1776
- y: number
1827
+ _type?: "sanity.imageHotspot";
1828
+ width: number;
1829
+ height: number;
1830
+ x: number;
1831
+ y: number;
1777
1832
  }
1778
1833
 
1779
1834
  /** @public */
1780
1835
  export declare interface ImageMetadata {
1781
- [key: string]: unknown
1782
- _type: 'sanity.imageMetadata'
1783
- dimensions: ImageDimensions
1784
- palette?: ImagePalette
1785
- lqip?: string
1786
- blurHash?: string
1787
- thumbHash?: string
1788
- hasAlpha: boolean
1789
- isOpaque: boolean
1836
+ [key: string]: unknown;
1837
+ _type: "sanity.imageMetadata";
1838
+ dimensions: ImageDimensions;
1839
+ palette?: ImagePalette;
1840
+ lqip?: string;
1841
+ blurHash?: string;
1842
+ thumbHash?: string;
1843
+ hasAlpha: boolean;
1844
+ isOpaque: boolean;
1790
1845
  }
1791
1846
 
1792
1847
  /** @public */
1793
1848
  export declare type ImageMetadataType =
1794
- | 'blurhash'
1795
- | 'thumbhash'
1796
- | 'lqip'
1797
- | 'palette'
1798
- | 'exif'
1799
- | 'image'
1800
- | 'location'
1849
+ | "blurhash"
1850
+ | "thumbhash"
1851
+ | "lqip"
1852
+ | "palette"
1853
+ | "exif"
1854
+ | "image"
1855
+ | "location";
1801
1856
 
1802
1857
  /** @public */
1803
1858
  export declare interface ImageOptions extends FileOptions {
1804
- metadata?: ImageMetadataType[]
1805
- hotspot?: boolean | HotspotOptions
1859
+ metadata?: ImageMetadataType[];
1860
+ hotspot?: boolean | HotspotOptions;
1806
1861
  }
1807
1862
 
1808
1863
  /** @public */
1809
1864
  export declare interface ImagePalette {
1810
- _type: 'sanity.imagePalette'
1811
- darkMuted?: ImageSwatch
1812
- darkVibrant?: ImageSwatch
1813
- dominant?: ImageSwatch
1814
- lightMuted?: ImageSwatch
1815
- lightVibrant?: ImageSwatch
1816
- muted?: ImageSwatch
1817
- vibrant?: ImageSwatch
1865
+ _type: "sanity.imagePalette";
1866
+ darkMuted?: ImageSwatch;
1867
+ darkVibrant?: ImageSwatch;
1868
+ dominant?: ImageSwatch;
1869
+ lightMuted?: ImageSwatch;
1870
+ lightVibrant?: ImageSwatch;
1871
+ muted?: ImageSwatch;
1872
+ vibrant?: ImageSwatch;
1818
1873
  }
1819
1874
 
1820
1875
  /** @public */
@@ -1832,44 +1887,54 @@ export declare interface ImageRule extends RuleDef<ImageRule, ImageValue> {
1832
1887
  * })
1833
1888
  * ```
1834
1889
  */
1835
- assetRequired(): ImageRule
1890
+ assetRequired(): ImageRule;
1836
1891
  }
1837
1892
 
1838
1893
  /** @public */
1839
- export declare interface ImageSchemaType extends Omit<ObjectSchemaType, 'options'> {
1840
- options?: ImageOptions
1894
+ export declare interface ImageSchemaType extends Omit<
1895
+ ObjectSchemaType,
1896
+ "options"
1897
+ > {
1898
+ options?: ImageOptions;
1841
1899
  }
1842
1900
 
1843
1901
  /** @public */
1844
1902
  export declare interface ImageSwatch {
1845
- _type: 'sanity.imagePaletteSwatch'
1846
- background: string
1847
- foreground: string
1848
- population: number
1849
- title?: string
1903
+ _type: "sanity.imagePaletteSwatch";
1904
+ background: string;
1905
+ foreground: string;
1906
+ population: number;
1907
+ title?: string;
1850
1908
  }
1851
1909
 
1852
1910
  /** @internal */
1853
- export declare type ImageUrlAutoMode = 'format'
1911
+ export declare type ImageUrlAutoMode = "format";
1854
1912
 
1855
1913
  /** @internal */
1856
1914
  export declare type ImageUrlCropMode =
1857
- | 'top'
1858
- | 'bottom'
1859
- | 'left'
1860
- | 'right'
1861
- | 'center'
1862
- | 'focalpoint'
1863
- | 'entropy'
1915
+ | "top"
1916
+ | "bottom"
1917
+ | "left"
1918
+ | "right"
1919
+ | "center"
1920
+ | "focalpoint"
1921
+ | "entropy";
1864
1922
 
1865
1923
  /** @internal */
1866
- export declare type ImageUrlFitMode = 'clip' | 'crop' | 'fill' | 'fillmax' | 'max' | 'scale' | 'min'
1924
+ export declare type ImageUrlFitMode =
1925
+ | "clip"
1926
+ | "crop"
1927
+ | "fill"
1928
+ | "fillmax"
1929
+ | "max"
1930
+ | "scale"
1931
+ | "min";
1867
1932
 
1868
1933
  /** @internal */
1869
- export declare type ImageUrlFormat = 'jpg' | 'pjpg' | 'png' | 'webp'
1934
+ export declare type ImageUrlFormat = "jpg" | "pjpg" | "png" | "webp";
1870
1935
 
1871
1936
  /** @internal */
1872
- export declare type ImageUrlOrientation = '0' | '90' | '180' | '270'
1937
+ export declare type ImageUrlOrientation = "0" | "90" | "180" | "270";
1873
1938
 
1874
1939
  /**
1875
1940
  * NOTE: These are query parameters, so they will eventually be encoded as strings.
@@ -1880,77 +1945,77 @@ export declare type ImageUrlOrientation = '0' | '90' | '180' | '270'
1880
1945
  * @internal
1881
1946
  */
1882
1947
  export declare interface ImageUrlParams {
1883
- 'bg'?: string
1884
- 'dpr'?: number | string
1885
- 'w'?: number | string
1886
- 'h'?: number | string
1887
- 'q'?: number | string
1888
- 'dl'?: string
1889
- 'dlRaw'?: string
1890
- 'fp-x'?: number | string
1891
- 'fp-y'?: number | string
1892
- 'max-w'?: number | string
1893
- 'max-h'?: number | string
1894
- 'min-w'?: number | string
1895
- 'min-h'?: number | string
1896
- 'blur'?: number | string
1897
- 'sharp'?: number | string
1898
- 'rect'?: string
1899
- 'fm'?: ImageUrlFormat
1900
- 'or'?: ImageUrlOrientation
1901
- 'fit'?: ImageUrlFitMode
1902
- 'crop'?: ImageUrlCropMode
1903
- 'auto'?: ImageUrlAutoMode
1904
- 'invert'?: 'true' | 'false'
1905
- 'quality'?: number | string
1906
- 'flip'?: 'h' | 'v' | 'hv'
1907
- 'sat'?: number | string
1908
- 'pad'?: number | string
1909
- 'colorquant'?: number | string
1910
- 'border'?: string
1948
+ bg?: string;
1949
+ dpr?: number | string;
1950
+ w?: number | string;
1951
+ h?: number | string;
1952
+ q?: number | string;
1953
+ dl?: string;
1954
+ dlRaw?: string;
1955
+ "fp-x"?: number | string;
1956
+ "fp-y"?: number | string;
1957
+ "max-w"?: number | string;
1958
+ "max-h"?: number | string;
1959
+ "min-w"?: number | string;
1960
+ "min-h"?: number | string;
1961
+ blur?: number | string;
1962
+ sharp?: number | string;
1963
+ rect?: string;
1964
+ fm?: ImageUrlFormat;
1965
+ or?: ImageUrlOrientation;
1966
+ fit?: ImageUrlFitMode;
1967
+ crop?: ImageUrlCropMode;
1968
+ auto?: ImageUrlAutoMode;
1969
+ invert?: "true" | "false";
1970
+ quality?: number | string;
1971
+ flip?: "h" | "v" | "hv";
1972
+ sat?: number | string;
1973
+ pad?: number | string;
1974
+ colorquant?: number | string;
1975
+ border?: string;
1911
1976
  }
1912
1977
 
1913
1978
  /** @public */
1914
1979
  export declare interface ImageValue extends FileValue {
1915
- crop?: ImageCrop
1916
- hotspot?: ImageHotspot
1917
- [index: string]: unknown
1980
+ crop?: ImageCrop;
1981
+ hotspot?: ImageHotspot;
1982
+ [index: string]: unknown;
1918
1983
  }
1919
1984
 
1920
1985
  /** @public */
1921
- export declare type IndexTuple = [number | '', number | '']
1986
+ export declare type IndexTuple = [number | "", number | ""];
1922
1987
 
1923
1988
  /** @public */
1924
1989
  export declare type InitialValueProperty<Params, Value> =
1925
1990
  | Value
1926
1991
  | InitialValueResolver<Params, Value>
1927
- | undefined
1992
+ | undefined;
1928
1993
 
1929
1994
  /** @public */
1930
1995
  export declare type InitialValueResolver<Params, Value> = (
1931
1996
  params: Params | undefined,
1932
1997
  context: InitialValueResolverContext,
1933
- ) => Promise<Value> | Value
1998
+ ) => Promise<Value> | Value;
1934
1999
 
1935
2000
  /** @public */
1936
2001
  export declare interface InitialValueResolverContext {
1937
- projectId: string
1938
- dataset: string
1939
- schema: Schema
1940
- currentUser: CurrentUser | null
1941
- getClient: (options: {apiVersion: string}) => SanityClient
2002
+ projectId: string;
2003
+ dataset: string;
2004
+ schema: Schema;
2005
+ currentUser: CurrentUser | null;
2006
+ getClient: (options: { apiVersion: string }) => SanityClient;
1942
2007
  }
1943
2008
 
1944
2009
  /** @public */
1945
2010
  export declare type InlineFieldDefinition = {
1946
2011
  [K in keyof IntrinsicDefinitions]: Omit<
1947
2012
  IntrinsicDefinitions[K],
1948
- 'initialValue' | 'validation'
2013
+ "initialValue" | "validation"
1949
2014
  > & {
1950
- validation?: SchemaValidationValue
1951
- initialValue?: InitialValueProperty<any, any>
1952
- }
1953
- }
2015
+ validation?: SchemaValidationValue;
2016
+ initialValue?: InitialValueProperty<any, any>;
2017
+ };
2018
+ };
1954
2019
 
1955
2020
  /** @alpha This API may change */
1956
2021
  export declare interface InsertMenuOptions {
@@ -1959,65 +2024,68 @@ export declare interface InsertMenuOptions {
1959
2024
  * `filter: 'auto'` automatically turns on filtering if there are more than 5
1960
2025
  * schema types added to the menu.
1961
2026
  */
1962
- filter?: 'auto' | boolean | undefined
2027
+ filter?: "auto" | boolean | undefined;
1963
2028
  groups?:
1964
2029
  | Array<{
1965
- name: string
1966
- title?: string
1967
- of?: Array<string>
2030
+ name: string;
2031
+ title?: string;
2032
+ of?: Array<string>;
1968
2033
  }>
1969
- | undefined
2034
+ | undefined;
1970
2035
  /** defaultValue `true` */
1971
- showIcons?: boolean | undefined
2036
+ showIcons?: boolean | undefined;
1972
2037
  /** @defaultValue `[{name: 'list'}]` */
1973
2038
  views?:
1974
2039
  | Array<
1975
2040
  | {
1976
- name: 'list'
2041
+ name: "list";
1977
2042
  }
1978
2043
  | {
1979
- name: 'grid'
1980
- previewImageUrl?: (schemaTypeName: string) => string | undefined
2044
+ name: "grid";
2045
+ previewImageUrl?: (schemaTypeName: string) => string | undefined;
1981
2046
  }
1982
2047
  >
1983
- | undefined
2048
+ | undefined;
1984
2049
  }
1985
2050
 
1986
2051
  /** @internal */
1987
2052
  export declare type InsertPatch =
1988
2053
  | {
1989
- before: string
1990
- items: unknown[]
2054
+ before: string;
2055
+ items: unknown[];
1991
2056
  }
1992
2057
  | {
1993
- after: string
1994
- items: unknown[]
2058
+ after: string;
2059
+ items: unknown[];
1995
2060
  }
1996
2061
  | {
1997
- replace: string
1998
- items: unknown[]
1999
- }
2062
+ replace: string;
2063
+ items: unknown[];
2064
+ };
2000
2065
 
2001
2066
  /** @beta */
2002
2067
  export declare type IntrinsicArrayOfBase = {
2003
- [K in keyof IntrinsicDefinitions]: Omit<ArrayOfEntry<IntrinsicDefinitions[K]>, 'preview'>
2004
- }
2068
+ [K in keyof IntrinsicDefinitions]: Omit<
2069
+ ArrayOfEntry<IntrinsicDefinitions[K]>,
2070
+ "preview"
2071
+ >;
2072
+ };
2005
2073
 
2006
2074
  /** @public */
2007
2075
  export declare type IntrinsicArrayOfDefinition = {
2008
2076
  [K in keyof IntrinsicDefinitions]: Omit<
2009
2077
  ArrayOfEntry<IntrinsicDefinitions[K]>,
2010
- 'validation' | 'initialValue'
2078
+ "validation" | "initialValue"
2011
2079
  > & {
2012
- validation?: SchemaValidationValue
2013
- initialValue?: InitialValueProperty<any, any>
2014
- }
2015
- }
2080
+ validation?: SchemaValidationValue;
2081
+ initialValue?: InitialValueProperty<any, any>;
2082
+ };
2083
+ };
2016
2084
 
2017
2085
  /** @beta */
2018
2086
  export declare type IntrinsicBase = {
2019
- [K in keyof IntrinsicDefinitions]: Omit<IntrinsicDefinitions[K], 'preview'>
2020
- }
2087
+ [K in keyof IntrinsicDefinitions]: Omit<IntrinsicDefinitions[K], "preview">;
2088
+ };
2021
2089
 
2022
2090
  /**
2023
2091
  * `IntrinsicDefinitions` is a lookup map for "predefined" schema definitions.
@@ -2035,25 +2103,25 @@ export declare type IntrinsicBase = {
2035
2103
  * @public
2036
2104
  */
2037
2105
  export declare interface IntrinsicDefinitions {
2038
- array: ArrayDefinition
2039
- block: BlockDefinition
2040
- boolean: BooleanDefinition
2041
- date: DateDefinition
2042
- datetime: DatetimeDefinition
2043
- document: DocumentDefinition
2044
- file: FileDefinition
2045
- geopoint: GeopointDefinition
2046
- image: ImageDefinition
2047
- number: NumberDefinition
2048
- object: ObjectDefinition
2049
- reference: ReferenceDefinition
2050
- crossDatasetReference: CrossDatasetReferenceDefinition
2051
- globalDocumentReference: GlobalDocumentReferenceDefinition
2052
- slug: SlugDefinition
2053
- string: StringDefinition
2054
- text: TextDefinition
2055
- url: UrlDefinition
2056
- email: EmailDefinition
2106
+ array: ArrayDefinition;
2107
+ block: BlockDefinition;
2108
+ boolean: BooleanDefinition;
2109
+ date: DateDefinition;
2110
+ datetime: DatetimeDefinition;
2111
+ document: DocumentDefinition;
2112
+ file: FileDefinition;
2113
+ geopoint: GeopointDefinition;
2114
+ image: ImageDefinition;
2115
+ number: NumberDefinition;
2116
+ object: ObjectDefinition;
2117
+ reference: ReferenceDefinition;
2118
+ crossDatasetReference: CrossDatasetReferenceDefinition;
2119
+ globalDocumentReference: GlobalDocumentReferenceDefinition;
2120
+ slug: SlugDefinition;
2121
+ string: StringDefinition;
2122
+ text: TextDefinition;
2123
+ url: UrlDefinition;
2124
+ email: EmailDefinition;
2057
2125
  }
2058
2126
 
2059
2127
  /**
@@ -2063,23 +2131,28 @@ export declare interface IntrinsicDefinitions {
2063
2131
  *
2064
2132
  * @public
2065
2133
  */
2066
- export declare type IntrinsicTypeName = IntrinsicDefinitions[keyof IntrinsicDefinitions]['type']
2134
+ export declare type IntrinsicTypeName =
2135
+ IntrinsicDefinitions[keyof IntrinsicDefinitions]["type"];
2067
2136
 
2068
2137
  /** @internal */
2069
2138
  export declare function isArrayOfBlocksSchemaType(
2070
2139
  type: unknown,
2071
- ): type is ArraySchemaType<ObjectSchemaType>
2140
+ ): type is ArraySchemaType<ObjectSchemaType>;
2072
2141
 
2073
2142
  /** @internal */
2074
2143
  export declare function isArrayOfObjectsSchemaType(
2075
2144
  type: unknown,
2076
- ): type is ArraySchemaType<ObjectSchemaType>
2145
+ ): type is ArraySchemaType<ObjectSchemaType>;
2077
2146
 
2078
2147
  /** @internal */
2079
- export declare function isArrayOfPrimitivesSchemaType(type: unknown): type is ArraySchemaType
2148
+ export declare function isArrayOfPrimitivesSchemaType(
2149
+ type: unknown,
2150
+ ): type is ArraySchemaType;
2080
2151
 
2081
2152
  /** @internal */
2082
- export declare function isArraySchemaType(type: unknown): type is ArraySchemaType
2153
+ export declare function isArraySchemaType(
2154
+ type: unknown,
2155
+ ): type is ArraySchemaType;
2083
2156
 
2084
2157
  /**
2085
2158
  * Check whether the provided value resembles a Media Library asset aspect document.
@@ -2092,70 +2165,82 @@ export declare function isArraySchemaType(type: unknown): type is ArraySchemaTyp
2092
2165
  */
2093
2166
  export declare function isAssetAspect(
2094
2167
  maybeAssetAspect: unknown,
2095
- ): maybeAssetAspect is MediaLibraryAssetAspectDocument
2168
+ ): maybeAssetAspect is MediaLibraryAssetAspectDocument;
2096
2169
 
2097
2170
  /** @internal */
2098
2171
  export declare function isBlockChildrenObjectField(
2099
2172
  field: unknown,
2100
- ): field is BlockChildrenObjectField
2173
+ ): field is BlockChildrenObjectField;
2101
2174
 
2102
2175
  /** @internal */
2103
- export declare function isBlockListObjectField(field: unknown): field is BlockListObjectField
2176
+ export declare function isBlockListObjectField(
2177
+ field: unknown,
2178
+ ): field is BlockListObjectField;
2104
2179
 
2105
2180
  /** @internal */
2106
- export declare function isBlockSchemaType(type: unknown): type is BlockSchemaType
2181
+ export declare function isBlockSchemaType(
2182
+ type: unknown,
2183
+ ): type is BlockSchemaType;
2107
2184
 
2108
2185
  /** @internal */
2109
- export declare function isBlockStyleObjectField(field: unknown): field is BlockStyleObjectField
2186
+ export declare function isBlockStyleObjectField(
2187
+ field: unknown,
2188
+ ): field is BlockStyleObjectField;
2110
2189
 
2111
2190
  /** @internal */
2112
- export declare function isBooleanSchemaType(type: unknown): type is BooleanSchemaType
2191
+ export declare function isBooleanSchemaType(
2192
+ type: unknown,
2193
+ ): type is BooleanSchemaType;
2113
2194
 
2114
2195
  /** @internal */
2115
2196
  export declare function isCreateIfNotExistsMutation(
2116
2197
  mutation: Mutation | TransactionLogMutation,
2117
- ): mutation is CreateIfNotExistsMutation
2198
+ ): mutation is CreateIfNotExistsMutation;
2118
2199
 
2119
2200
  /** @internal */
2120
2201
  export declare function isCreateMutation(
2121
2202
  mutation: Mutation | TransactionLogMutation,
2122
- ): mutation is CreateMutation
2203
+ ): mutation is CreateMutation;
2123
2204
 
2124
2205
  /** @internal */
2125
2206
  export declare function isCreateOrReplaceMutation(
2126
2207
  mutation: Mutation | TransactionLogMutation,
2127
- ): mutation is CreateOrReplaceMutation
2208
+ ): mutation is CreateOrReplaceMutation;
2128
2209
 
2129
2210
  /** @internal */
2130
2211
  export declare function isCreateSquashedMutation(
2131
2212
  mutation: Mutation | TransactionLogMutation,
2132
- ): mutation is CreateSquashedMutation
2213
+ ): mutation is CreateSquashedMutation;
2133
2214
 
2134
2215
  /** @beta */
2135
2216
  export declare function isCrossDatasetReference(
2136
2217
  reference: unknown,
2137
- ): reference is CrossDatasetReferenceValue
2218
+ ): reference is CrossDatasetReferenceValue;
2138
2219
 
2139
2220
  /** @internal */
2140
2221
  export declare function isCrossDatasetReferenceSchemaType(
2141
2222
  type: unknown,
2142
- ): type is CrossDatasetReferenceSchemaType
2223
+ ): type is CrossDatasetReferenceSchemaType;
2143
2224
 
2144
2225
  /** @internal */
2145
- export declare function isDateTimeSchemaType(type: unknown): type is StringSchemaType
2226
+ export declare function isDateTimeSchemaType(
2227
+ type: unknown,
2228
+ ): type is StringSchemaType;
2146
2229
 
2147
2230
  /** @internal */
2148
2231
  export declare function isDeleteMutation(
2149
2232
  mutation: Mutation | TransactionLogMutation,
2150
- ): mutation is DeleteMutation
2233
+ ): mutation is DeleteMutation;
2151
2234
 
2152
2235
  /** @internal */
2153
- export declare function isDeprecatedSchemaType<TSchemaType extends BaseSchemaType>(
2154
- type: TSchemaType,
2155
- ): type is DeprecatedSchemaType<TSchemaType>
2236
+ export declare function isDeprecatedSchemaType<
2237
+ TSchemaType extends BaseSchemaType,
2238
+ >(type: TSchemaType): type is DeprecatedSchemaType<TSchemaType>;
2156
2239
 
2157
2240
  /** @internal */
2158
- export declare function isDeprecationConfiguration(type: unknown): type is DeprecationConfiguration
2241
+ export declare function isDeprecationConfiguration(
2242
+ type: unknown,
2243
+ ): type is DeprecationConfiguration;
2159
2244
 
2160
2245
  /**
2161
2246
  * Returns wether or not the given type is a document type
@@ -2166,44 +2251,56 @@ export declare function isDeprecationConfiguration(type: unknown): type is Depre
2166
2251
  *
2167
2252
  * @public
2168
2253
  */
2169
- export declare function isDocumentSchemaType(type: unknown): type is ObjectSchemaType
2254
+ export declare function isDocumentSchemaType(
2255
+ type: unknown,
2256
+ ): type is ObjectSchemaType;
2170
2257
 
2171
2258
  /** @internal */
2172
- export declare function isFileSchemaType(type: unknown): type is FileSchemaType
2259
+ export declare function isFileSchemaType(type: unknown): type is FileSchemaType;
2173
2260
 
2174
2261
  /** @beta */
2175
2262
  export declare function isGlobalDocumentReference(
2176
2263
  reference: unknown,
2177
- ): reference is GlobalDocumentReferenceValue
2264
+ ): reference is GlobalDocumentReferenceValue;
2178
2265
 
2179
2266
  /** @public */
2180
- export declare function isImage(value: unknown): value is Image_2
2267
+ export declare function isImage(value: unknown): value is Image_2;
2181
2268
 
2182
2269
  /** @internal */
2183
- export declare function isImageSchemaType(type: unknown): type is ImageSchemaType
2270
+ export declare function isImageSchemaType(
2271
+ type: unknown,
2272
+ ): type is ImageSchemaType;
2184
2273
 
2185
2274
  /** @internal */
2186
- export declare function isIndexSegment(segment: PathSegment): segment is number
2275
+ export declare function isIndexSegment(segment: PathSegment): segment is number;
2187
2276
 
2188
2277
  /** @internal */
2189
- export declare function isIndexTuple(segment: PathSegment): segment is IndexTuple
2278
+ export declare function isIndexTuple(
2279
+ segment: PathSegment,
2280
+ ): segment is IndexTuple;
2190
2281
 
2191
2282
  /** @public */
2192
- export declare function isKeyedObject(obj: unknown): obj is KeyedObject
2283
+ export declare function isKeyedObject(obj: unknown): obj is KeyedObject;
2193
2284
 
2194
2285
  /** @internal */
2195
- export declare function isKeySegment(segment: PathSegment): segment is KeyedSegment
2286
+ export declare function isKeySegment(
2287
+ segment: PathSegment,
2288
+ ): segment is KeyedSegment;
2196
2289
 
2197
2290
  /** @internal */
2198
- export declare function isNumberSchemaType(type: unknown): type is NumberSchemaType
2291
+ export declare function isNumberSchemaType(
2292
+ type: unknown,
2293
+ ): type is NumberSchemaType;
2199
2294
 
2200
2295
  /** @internal */
2201
- export declare function isObjectSchemaType(type: unknown): type is ObjectSchemaType
2296
+ export declare function isObjectSchemaType(
2297
+ type: unknown,
2298
+ ): type is ObjectSchemaType;
2202
2299
 
2203
2300
  /** @internal */
2204
2301
  export declare function isPatchMutation(
2205
2302
  mutation: Mutation | TransactionLogMutation,
2206
- ): mutation is PatchMutation
2303
+ ): mutation is PatchMutation;
2207
2304
 
2208
2305
  /**
2209
2306
  * Assert that a given object is a portable-text list-text-block-type object
@@ -2215,9 +2312,9 @@ export declare function isPatchMutation(
2215
2312
  *
2216
2313
  * @alpha
2217
2314
  */
2218
- export declare function isPortableTextListBlock<T = PortableTextSpan | PortableTextObject>(
2219
- value: unknown,
2220
- ): value is PortableTextTextBlock<T>
2315
+ export declare function isPortableTextListBlock<
2316
+ T = PortableTextSpan | PortableTextObject,
2317
+ >(value: unknown): value is PortableTextTextBlock<T>;
2221
2318
 
2222
2319
  /**
2223
2320
  * Assert that a given object is a portable-text span-type object
@@ -2227,7 +2324,9 @@ export declare function isPortableTextListBlock<T = PortableTextSpan | PortableT
2227
2324
  *
2228
2325
  * @alpha
2229
2326
  */
2230
- export declare function isPortableTextSpan(value: unknown): value is PortableTextSpan
2327
+ export declare function isPortableTextSpan(
2328
+ value: unknown,
2329
+ ): value is PortableTextSpan;
2231
2330
 
2232
2331
  /**
2233
2332
  * Assert that a given object is a portable-text text-block type object
@@ -2238,30 +2337,34 @@ export declare function isPortableTextSpan(value: unknown): value is PortableTex
2238
2337
  *
2239
2338
  * @alpha
2240
2339
  */
2241
- export declare function isPortableTextTextBlock<T = PortableTextSpan | PortableTextObject>(
2242
- value: unknown,
2243
- ): value is PortableTextTextBlock<T>
2340
+ export declare function isPortableTextTextBlock<
2341
+ T = PortableTextSpan | PortableTextObject,
2342
+ >(value: unknown): value is PortableTextTextBlock<T>;
2244
2343
 
2245
2344
  /** @internal */
2246
2345
  export declare function isPrimitiveSchemaType(
2247
2346
  type: unknown,
2248
- ): type is BooleanSchemaType | StringSchemaType | NumberSchemaType
2347
+ ): type is BooleanSchemaType | StringSchemaType | NumberSchemaType;
2249
2348
 
2250
2349
  /** @internal */
2251
- export declare function isReference(reference: unknown): reference is Reference
2350
+ export declare function isReference(reference: unknown): reference is Reference;
2252
2351
 
2253
2352
  /** @internal */
2254
- export declare function isReferenceSchemaType(type: unknown): type is ReferenceSchemaType
2353
+ export declare function isReferenceSchemaType(
2354
+ type: unknown,
2355
+ ): type is ReferenceSchemaType;
2255
2356
 
2256
2357
  /** @public */
2257
- export declare function isSanityDocument(document: unknown): document is SanityDocument
2358
+ export declare function isSanityDocument(
2359
+ document: unknown,
2360
+ ): document is SanityDocument;
2258
2361
 
2259
2362
  /**
2260
2363
  * @internal
2261
2364
  */
2262
2365
  export declare function isSearchStrategy(
2263
2366
  maybeSearchStrategy: unknown,
2264
- ): maybeSearchStrategy is SearchStrategy
2367
+ ): maybeSearchStrategy is SearchStrategy;
2265
2368
 
2266
2369
  /**
2267
2370
  * Checks whether the given `thing` is a slug, eg an object with a `current` string property.
@@ -2270,68 +2373,76 @@ export declare function isSearchStrategy(
2270
2373
  * @returns True if slug, false otherwise
2271
2374
  * @public
2272
2375
  */
2273
- export declare function isSlug(thing: unknown): thing is Slug
2376
+ export declare function isSlug(thing: unknown): thing is Slug;
2274
2377
 
2275
2378
  /** @internal */
2276
- export declare function isSpanSchemaType(type: unknown): type is SpanSchemaType
2379
+ export declare function isSpanSchemaType(type: unknown): type is SpanSchemaType;
2277
2380
 
2278
2381
  /** @internal */
2279
- export declare function isStringSchemaType(type: unknown): type is StringSchemaType
2382
+ export declare function isStringSchemaType(
2383
+ type: unknown,
2384
+ ): type is StringSchemaType;
2280
2385
 
2281
2386
  /** @internal */
2282
- export declare function isTitledListValue(item: unknown): item is TitledListValue
2387
+ export declare function isTitledListValue(
2388
+ item: unknown,
2389
+ ): item is TitledListValue;
2283
2390
 
2284
2391
  /** @public */
2285
- export declare function isTypedObject(obj: unknown): obj is TypedObject
2392
+ export declare function isTypedObject(obj: unknown): obj is TypedObject;
2286
2393
 
2287
2394
  /** @internal */
2288
- export declare function isValidationError(node: FormNodeValidation): node is FormNodeValidation & {
2289
- level: 'error'
2290
- }
2395
+ export declare function isValidationError(
2396
+ node: FormNodeValidation,
2397
+ ): node is FormNodeValidation & {
2398
+ level: "error";
2399
+ };
2291
2400
 
2292
2401
  /** @internal */
2293
2402
  export declare function isValidationErrorMarker(
2294
2403
  marker: ValidationMarker,
2295
2404
  ): marker is ValidationMarker & {
2296
- level: 'error'
2297
- }
2405
+ level: "error";
2406
+ };
2298
2407
 
2299
2408
  /** @internal */
2300
- export declare function isValidationInfo(node: FormNodeValidation): node is FormNodeValidation & {
2301
- level: 'info'
2302
- }
2409
+ export declare function isValidationInfo(
2410
+ node: FormNodeValidation,
2411
+ ): node is FormNodeValidation & {
2412
+ level: "info";
2413
+ };
2303
2414
 
2304
2415
  /** @internal */
2305
2416
  export declare function isValidationInfoMarker(
2306
2417
  marker: ValidationMarker,
2307
2418
  ): marker is ValidationMarker & {
2308
- level: 'info'
2309
- }
2419
+ level: "info";
2420
+ };
2310
2421
 
2311
2422
  /** @internal */
2312
2423
  export declare function isValidationWarning(
2313
2424
  node: FormNodeValidation,
2314
2425
  ): node is FormNodeValidation & {
2315
- level: 'warning'
2316
- }
2426
+ level: "warning";
2427
+ };
2317
2428
 
2318
2429
  /** @internal */
2319
2430
  export declare function isValidationWarningMarker(
2320
2431
  marker: ValidationMarker,
2321
2432
  ): marker is ValidationMarker & {
2322
- level: 'warning'
2323
- }
2433
+ level: "warning";
2434
+ };
2324
2435
 
2325
2436
  /** @public */
2326
2437
  export declare interface KeyedObject {
2327
- [key: string]: unknown
2328
- _key: string
2438
+ [key: string]: unknown;
2439
+ _key: string;
2329
2440
  }
2330
2441
 
2331
2442
  /** @public */
2332
2443
  export declare type KeyedSegment = {
2333
- _key: string
2334
- }
2444
+ _key: string;
2445
+ };
2335
2446
 
2336
2447
  /**
2337
2448
  * Holds localized validation messages for a given field.
@@ -2346,18 +2457,19 @@ export declare type KeyedSegment = {
2346
2457
  * @public
2347
2458
  */
2348
2459
  export declare interface LocalizedValidationMessages {
2349
- [locale: string]: string
2460
+ [locale: string]: string;
2350
2461
  }
2351
2462
 
2352
2463
  /** @beta */
2353
- export declare type MaybeAllowUnknownProps<TStrict extends StrictDefinition> = TStrict extends false
2354
- ? {
2355
- options?: {
2356
- [index: string]: any
2464
+ export declare type MaybeAllowUnknownProps<TStrict extends StrictDefinition> =
2465
+ TStrict extends false
2466
+ ? {
2467
+ options?: {
2468
+ [index: string]: any;
2469
+ };
2470
+ [index: string]: any;
2357
2471
  }
2358
- [index: string]: any
2359
- }
2360
- : unknown
2472
+ : unknown;
2361
2473
 
2362
2474
  /** @beta */
2363
2475
  export declare type MaybePreview<
@@ -2368,24 +2480,25 @@ export declare type MaybePreview<
2368
2480
  ? PrepareValue extends Record<keyof Select, any>
2369
2481
  ? PreviewConfig<Select, PrepareValue>
2370
2482
  : never
2371
- : never
2483
+ : never;
2372
2484
 
2373
2485
  /**
2374
2486
  * @public
2375
2487
  */
2376
- export declare const MEDIA_LIBRARY_ASSET_ASPECT_TYPE_NAME = 'sanity.asset.aspect'
2488
+ export declare const MEDIA_LIBRARY_ASSET_ASPECT_TYPE_NAME =
2489
+ "sanity.asset.aspect";
2377
2490
 
2378
2491
  /** @public */
2379
- export declare type MediaAssetTypes = AssetInstanceDocument['_type']
2492
+ export declare type MediaAssetTypes = AssetInstanceDocument["_type"];
2380
2493
 
2381
2494
  /**
2382
2495
  * @public
2383
2496
  */
2384
2497
  export declare type MediaLibraryAssetAspectDefinition =
2385
2498
  MediaLibraryAssetAspectSupportedFieldDefinitions & {
2386
- assetType?: MediaLibraryAssetType | MediaLibraryAssetType[]
2387
- public?: boolean
2388
- }
2499
+ assetType?: MediaLibraryAssetType | MediaLibraryAssetType[];
2500
+ public?: boolean;
2501
+ };
2389
2502
 
2390
2503
  /**
2391
2504
  * A document representing a Media Library asset aspect.
@@ -2395,47 +2508,56 @@ export declare type MediaLibraryAssetAspectDefinition =
2395
2508
  * @public
2396
2509
  */
2397
2510
  export declare interface MediaLibraryAssetAspectDocument extends SanityDocumentLike {
2398
- _type: MediaLibraryAssetAspectTypeName
2511
+ _type: MediaLibraryAssetAspectTypeName;
2399
2512
  /**
2400
2513
  * Asset types the aspect can be assigned to.
2401
2514
  *
2402
2515
  * If no `assetType` is defined, the aspect may be assigned to any asset type.
2403
2516
  */
2404
- assetType?: MediaLibraryAssetType[]
2405
- definition: FieldDefinition
2406
- public?: boolean
2517
+ assetType?: MediaLibraryAssetType[];
2518
+ definition: FieldDefinition;
2519
+ public?: boolean;
2407
2520
  }
2408
2521
 
2409
2522
  /**
2410
2523
  * @public
2411
2524
  */
2412
- export declare type MediaLibraryAssetAspectSupportedFieldDefinitions = FieldDefinition<
2413
- Exclude<IntrinsicTypeName, 'document' | 'image' | 'file' | 'reference' | 'crossDatasetReference'>
2414
- >
2525
+ export declare type MediaLibraryAssetAspectSupportedFieldDefinitions =
2526
+ FieldDefinition<
2527
+ Exclude<
2528
+ IntrinsicTypeName,
2529
+ "document" | "image" | "file" | "reference" | "crossDatasetReference"
2530
+ >
2531
+ >;
2415
2532
 
2416
2533
  /**
2417
2534
  * @public
2418
2535
  */
2419
- export declare type MediaLibraryAssetAspectTypeName = typeof MEDIA_LIBRARY_ASSET_ASPECT_TYPE_NAME
2536
+ export declare type MediaLibraryAssetAspectTypeName =
2537
+ typeof MEDIA_LIBRARY_ASSET_ASPECT_TYPE_NAME;
2420
2538
 
2421
2539
  /**
2422
2540
  * @public
2423
2541
  */
2424
- export declare type MediaLibraryAssetType = ImageAsset['_type'] | FileAsset['_type']
2542
+ export declare type MediaLibraryAssetType =
2543
+ | ImageAsset["_type"]
2544
+ | FileAsset["_type"];
2425
2545
 
2426
2546
  /** @public */
2427
2547
  export declare interface MediaLibraryFilter {
2428
- name: string
2429
- query: string
2548
+ name: string;
2549
+ query: string;
2430
2550
  }
2431
2551
 
2432
2552
  /** @public */
2433
2553
  export declare interface MediaLibraryOptions {
2434
- filters?: MediaLibraryFilter[]
2554
+ filters?: MediaLibraryFilter[];
2435
2555
  }
2436
2556
 
2437
2557
  /** @public */
2438
- export declare interface MediaValidationValue<T extends MediaAssetTypes = MediaAssetTypes> {
2558
+ export declare interface MediaValidationValue<
2559
+ T extends MediaAssetTypes = MediaAssetTypes,
2560
+ > {
2439
2561
  /**
2440
2562
  * Media information
2441
2563
  */
@@ -2447,23 +2569,25 @@ export declare interface MediaValidationValue<T extends MediaAssetTypes = MediaA
2447
2569
  currentVersion: Extract<
2448
2570
  AssetInstanceDocument,
2449
2571
  {
2450
- _type: T
2572
+ _type: T;
2451
2573
  }
2452
- >
2453
- }
2454
- }
2574
+ >;
2575
+ };
2576
+ };
2455
2577
  /**
2456
2578
  * The field value which the media is used in.
2457
2579
  */
2458
- value: unknown
2580
+ value: unknown;
2459
2581
  }
2460
2582
 
2461
2583
  /** @public */
2462
- export declare interface MediaValidator<T extends MediaAssetTypes = MediaAssetTypes> {
2584
+ export declare interface MediaValidator<
2585
+ T extends MediaAssetTypes = MediaAssetTypes,
2586
+ > {
2463
2587
  (
2464
2588
  value: MediaValidationValue<T>,
2465
2589
  context: ValidationContext,
2466
- ): CustomValidatorResult | Promise<CustomValidatorResult>
2590
+ ): CustomValidatorResult | Promise<CustomValidatorResult>;
2467
2591
  }
2468
2592
 
2469
2593
  /**
@@ -2474,8 +2598,8 @@ export declare interface MediaValidator<T extends MediaAssetTypes = MediaAssetTy
2474
2598
  * @internal
2475
2599
  */
2476
2600
  export declare interface MendozaEffectPair {
2477
- apply: MendozaPatch
2478
- revert: MendozaPatch
2601
+ apply: MendozaPatch;
2602
+ revert: MendozaPatch;
2479
2603
  }
2480
2604
 
2481
2605
  /**
@@ -2485,30 +2609,30 @@ export declare interface MendozaEffectPair {
2485
2609
  *
2486
2610
  * @internal
2487
2611
  */
2488
- export declare type MendozaPatch = unknown[]
2612
+ export declare type MendozaPatch = unknown[];
2489
2613
 
2490
2614
  /** @public */
2491
2615
  export declare interface MultiFieldSet {
2492
- name: string
2493
- title?: string
2494
- description?: string
2495
- single?: false
2496
- group?: string | string[]
2616
+ name: string;
2617
+ title?: string;
2618
+ description?: string;
2619
+ single?: false;
2620
+ group?: string | string[];
2497
2621
  options?: CollapseOptions & {
2498
- columns?: number
2499
- }
2500
- fields: ObjectField[]
2501
- hidden?: ConditionalProperty
2502
- readOnly?: ConditionalProperty
2622
+ columns?: number;
2623
+ };
2624
+ fields: ObjectField[];
2625
+ hidden?: ConditionalProperty;
2626
+ readOnly?: ConditionalProperty;
2503
2627
  }
2504
2628
 
2505
2629
  /** @internal */
2506
2630
  export declare interface MultipleMutationResult {
2507
- transactionId: string
2508
- documentIds: string[]
2631
+ transactionId: string;
2632
+ documentIds: string[];
2509
2633
  results: {
2510
- id: string
2511
- }[]
2634
+ id: string;
2635
+ }[];
2512
2636
  }
2513
2637
 
2514
2638
  /** @internal */
@@ -2517,25 +2641,25 @@ export declare type Mutation =
2517
2641
  | CreateOrReplaceMutation
2518
2642
  | CreateIfNotExistsMutation
2519
2643
  | DeleteMutation
2520
- | PatchMutation
2644
+ | PatchMutation;
2521
2645
 
2522
2646
  /** @internal */
2523
2647
  export declare type MutationOperationName =
2524
- | 'create'
2525
- | 'createOrReplace'
2526
- | 'createIfNotExists'
2527
- | 'delete'
2528
- | 'patch'
2648
+ | "create"
2649
+ | "createOrReplace"
2650
+ | "createIfNotExists"
2651
+ | "delete"
2652
+ | "patch";
2529
2653
 
2530
2654
  /** @internal */
2531
2655
  export declare type MutationSelection =
2532
2656
  | {
2533
- query: string
2534
- params?: Record<string, unknown>
2657
+ query: string;
2658
+ params?: Record<string, unknown>;
2535
2659
  }
2536
2660
  | {
2537
- id: string
2538
- }
2661
+ id: string;
2662
+ };
2539
2663
 
2540
2664
  /** @beta */
2541
2665
  export declare type NarrowPreview<
@@ -2545,128 +2669,136 @@ export declare type NarrowPreview<
2545
2669
  TPrepareValue extends Record<keyof TSelect, any> | undefined,
2546
2670
  > =
2547
2671
  DefineSchemaType<TType, TAlias> extends {
2548
- preview?: Record<string, any>
2672
+ preview?: Record<string, any>;
2549
2673
  }
2550
2674
  ? {
2551
- preview?: MaybePreview<TSelect, TPrepareValue>
2675
+ preview?: MaybePreview<TSelect, TPrepareValue>;
2552
2676
  }
2553
- : unknown
2677
+ : unknown;
2554
2678
 
2555
2679
  /** @public */
2556
2680
  export declare interface NumberDefinition extends BaseSchemaDefinition {
2557
- type: 'number'
2558
- options?: NumberOptions
2559
- placeholder?: string
2560
- validation?: ValidationBuilder<NumberRule, number>
2561
- initialValue?: InitialValueProperty<any, number>
2681
+ type: "number";
2682
+ options?: NumberOptions;
2683
+ placeholder?: string;
2684
+ validation?: ValidationBuilder<NumberRule, number>;
2685
+ initialValue?: InitialValueProperty<any, number>;
2562
2686
  }
2563
2687
 
2564
2688
  /** @public */
2565
- export declare interface NumberOptions extends EnumListProps<number>, BaseSchemaTypeOptions {}
2689
+ export declare interface NumberOptions
2690
+ extends EnumListProps<number>, BaseSchemaTypeOptions {}
2566
2691
 
2567
2692
  /** @public */
2568
2693
  export declare interface NumberRule extends RuleDef<NumberRule, number> {
2569
- min: (minNumber: number | FieldReference) => NumberRule
2570
- max: (maxNumber: number | FieldReference) => NumberRule
2571
- lessThan: (limit: number | FieldReference) => NumberRule
2572
- greaterThan: (limit: number | FieldReference) => NumberRule
2573
- integer: () => NumberRule
2574
- precision: (limit: number | FieldReference) => NumberRule
2575
- positive: () => NumberRule
2576
- negative: () => NumberRule
2694
+ min: (minNumber: number | FieldReference) => NumberRule;
2695
+ max: (maxNumber: number | FieldReference) => NumberRule;
2696
+ lessThan: (limit: number | FieldReference) => NumberRule;
2697
+ greaterThan: (limit: number | FieldReference) => NumberRule;
2698
+ integer: () => NumberRule;
2699
+ precision: (limit: number | FieldReference) => NumberRule;
2700
+ positive: () => NumberRule;
2701
+ negative: () => NumberRule;
2577
2702
  }
2578
2703
 
2579
2704
  /** @public */
2580
2705
  export declare interface NumberSchemaType extends BaseSchemaType {
2581
- jsonType: 'number'
2582
- options?: NumberOptions
2583
- initialValue?: InitialValueProperty<any, number>
2706
+ jsonType: "number";
2707
+ options?: NumberOptions;
2708
+ initialValue?: InitialValueProperty<any, number>;
2584
2709
  }
2585
2710
 
2586
2711
  /** @public */
2587
2712
  export declare interface ObjectDefinition extends BaseSchemaDefinition {
2588
- type: 'object'
2713
+ type: "object";
2589
2714
  /**
2590
2715
  * Object must have at least one field. This is validated at Studio startup.
2591
2716
  */
2592
- fields: FieldDefinition[]
2593
- groups?: FieldGroupDefinition[]
2594
- fieldsets?: FieldsetDefinition[]
2595
- preview?: PreviewConfig
2596
- options?: ObjectOptions
2597
- validation?: ValidationBuilder<ObjectRule, Record<string, unknown>>
2598
- initialValue?: InitialValueProperty<any, Record<string, unknown>>
2717
+ fields: FieldDefinition[];
2718
+ groups?: FieldGroupDefinition[];
2719
+ fieldsets?: FieldsetDefinition[];
2720
+ preview?: PreviewConfig;
2721
+ options?: ObjectOptions;
2722
+ validation?: ValidationBuilder<ObjectRule, Record<string, unknown>>;
2723
+ initialValue?: InitialValueProperty<any, Record<string, unknown>>;
2599
2724
  }
2600
2725
 
2601
2726
  /** @public */
2602
2727
  export declare interface ObjectField<T extends SchemaType = SchemaType> {
2603
- name: string
2604
- fieldset?: string
2605
- group?: string | string[]
2606
- type: ObjectFieldType<T>
2728
+ name: string;
2729
+ fieldset?: string;
2730
+ group?: string | string[];
2731
+ type: ObjectFieldType<T>;
2607
2732
  }
2608
2733
 
2609
2734
  /** @public */
2610
2735
  export declare type ObjectFieldType<T extends SchemaType = SchemaType> = T & {
2611
- hidden?: ConditionalProperty
2612
- readOnly?: ConditionalProperty
2613
- }
2736
+ hidden?: ConditionalProperty;
2737
+ readOnly?: ConditionalProperty;
2738
+ };
2614
2739
 
2615
2740
  /** @public */
2616
2741
  export declare interface ObjectOptions extends BaseSchemaTypeOptions {
2617
- collapsible?: boolean
2618
- collapsed?: boolean
2619
- columns?: number
2742
+ collapsible?: boolean;
2743
+ collapsed?: boolean;
2744
+ columns?: number;
2620
2745
  modal?: {
2621
- type?: 'dialog' | 'popover'
2622
- width?: number | number[] | 'auto'
2623
- }
2746
+ type?: "dialog" | "popover";
2747
+ width?: number | number[] | "auto";
2748
+ };
2624
2749
  }
2625
2750
 
2626
2751
  /** @public */
2627
- export declare interface ObjectRule extends RuleDef<ObjectRule, Record<string, unknown>> {}
2752
+ export declare interface ObjectRule extends RuleDef<
2753
+ ObjectRule,
2754
+ Record<string, unknown>
2755
+ > {}
2628
2756
 
2629
2757
  /** @public */
2630
2758
  export declare interface ObjectSchemaType extends BaseSchemaType {
2631
- jsonType: 'object'
2632
- fields: ObjectField[]
2633
- groups?: FieldGroup[]
2634
- fieldsets?: Fieldset[]
2635
- initialValue?: InitialValueProperty<any, Record<string, unknown>>
2636
- weak?: boolean
2759
+ jsonType: "object";
2760
+ fields: ObjectField[];
2761
+ groups?: FieldGroup[];
2762
+ fieldsets?: Fieldset[];
2763
+ initialValue?: InitialValueProperty<any, Record<string, unknown>>;
2764
+ weak?: boolean;
2637
2765
  /** @deprecated Unused. Use the new field-level search config. */
2638
2766
  __experimental_search?: {
2639
- path: (string | number)[]
2640
- weight: number
2641
- mapWith?: string
2642
- }[]
2767
+ path: (string | number)[];
2768
+ weight: number;
2769
+ mapWith?: string;
2770
+ }[];
2643
2771
  /** @alpha */
2644
- __experimental_omnisearch_visibility?: boolean
2772
+ __experimental_omnisearch_visibility?: boolean;
2645
2773
  /** @alpha */
2646
- __experimental_actions?: string[]
2774
+ __experimental_actions?: string[];
2647
2775
  /** @alpha */
2648
- __experimental_formPreviewTitle?: boolean
2776
+ __experimental_formPreviewTitle?: boolean;
2649
2777
  /**
2650
2778
  * @beta
2651
2779
  */
2652
- orderings?: SortOrdering[]
2653
- options?: any
2780
+ orderings?: SortOrdering[];
2781
+ options?: any;
2654
2782
  }
2655
2783
 
2656
2784
  /** @internal */
2657
- export declare interface ObjectSchemaTypeWithOptions extends Omit<ObjectSchemaType, 'options'> {
2785
+ export declare interface ObjectSchemaTypeWithOptions extends Omit<
2786
+ ObjectSchemaType,
2787
+ "options"
2788
+ > {
2658
2789
  options?: CollapseOptions & {
2659
- columns?: number
2660
- }
2790
+ columns?: number;
2791
+ };
2661
2792
  }
2662
2793
 
2663
2794
  /** @internal */
2664
2795
  export declare interface PatchMutation {
2665
- patch: PatchMutationOperation
2796
+ patch: PatchMutationOperation;
2666
2797
  }
2667
2798
 
2668
2799
  /** @internal */
2669
- export declare type PatchMutationOperation = PatchOperations & MutationSelection
2800
+ export declare type PatchMutationOperation = PatchOperations &
2801
+ MutationSelection;
2670
2802
 
2671
2803
  /**
2672
2804
  * NOTE: this is actually incorrect/invalid, but implemented as-is for backwards compatibility
@@ -2675,76 +2807,80 @@ export declare type PatchMutationOperation = PatchOperations & MutationSelection
2675
2807
  */
2676
2808
  export declare interface PatchOperations {
2677
2809
  set?: {
2678
- [key: string]: unknown
2679
- }
2810
+ [key: string]: unknown;
2811
+ };
2680
2812
  setIfMissing?: {
2681
- [key: string]: unknown
2682
- }
2813
+ [key: string]: unknown;
2814
+ };
2683
2815
  merge?: {
2684
- [key: string]: unknown
2685
- }
2816
+ [key: string]: unknown;
2817
+ };
2686
2818
  diffMatchPatch?: {
2687
- [key: string]: string
2688
- }
2689
- unset?: string[]
2819
+ [key: string]: string;
2820
+ };
2821
+ unset?: string[];
2690
2822
  inc?: {
2691
- [key: string]: number
2692
- }
2823
+ [key: string]: number;
2824
+ };
2693
2825
  dec?: {
2694
- [key: string]: number
2695
- }
2696
- insert?: InsertPatch
2697
- ifRevisionID?: string
2826
+ [key: string]: number;
2827
+ };
2828
+ insert?: InsertPatch;
2829
+ ifRevisionID?: string;
2698
2830
  }
2699
2831
 
2700
2832
  /** @public */
2701
- export declare type Path = PathSegment[]
2833
+ export declare type Path = PathSegment[];
2702
2834
 
2703
2835
  /** @public */
2704
- export declare type PathSegment = string | number | KeyedSegment | IndexTuple
2836
+ export declare type PathSegment = string | number | KeyedSegment | IndexTuple;
2705
2837
 
2706
2838
  /** @alpha */
2707
- export declare type PortableTextBlock = PortableTextTextBlock | PortableTextObject
2839
+ export declare type PortableTextBlock =
2840
+ | PortableTextTextBlock
2841
+ | PortableTextObject;
2708
2842
 
2709
2843
  /** @alpha */
2710
- export declare type PortableTextChild = PortableTextObject | PortableTextSpan
2844
+ export declare type PortableTextChild = PortableTextObject | PortableTextSpan;
2711
2845
 
2712
2846
  /** @alpha */
2713
2847
  export declare interface PortableTextListBlock extends PortableTextTextBlock {
2714
- listItem: string
2715
- level: number
2848
+ listItem: string;
2849
+ level: number;
2716
2850
  }
2717
2851
 
2718
2852
  /** @alpha */
2719
2853
  export declare interface PortableTextObject {
2720
- _type: string
2721
- _key: string
2722
- [other: string]: unknown
2854
+ _type: string;
2855
+ _key: string;
2856
+ [other: string]: unknown;
2723
2857
  }
2724
2858
 
2725
2859
  /** @alpha */
2726
2860
  export declare interface PortableTextSpan {
2727
- _key: string
2728
- _type: 'span'
2729
- text: string
2730
- marks?: string[]
2861
+ _key: string;
2862
+ _type: "span";
2863
+ text: string;
2864
+ marks?: string[];
2731
2865
  }
2732
2866
 
2733
2867
  /** @alpha */
2734
- export declare interface PortableTextTextBlock<TChild = PortableTextSpan | PortableTextObject> {
2735
- _type: string
2736
- _key: string
2737
- children: TChild[]
2738
- markDefs?: PortableTextObject[]
2739
- listItem?: string
2740
- style?: string
2741
- level?: number
2868
+ export declare interface PortableTextTextBlock<
2869
+ TChild = PortableTextSpan | PortableTextObject,
2870
+ > {
2871
+ _type: string;
2872
+ _key: string;
2873
+ children: TChild[];
2874
+ markDefs?: PortableTextObject[];
2875
+ listItem?: string;
2876
+ style?: string;
2877
+ level?: number;
2742
2878
  }
2743
2879
 
2744
2880
  /** @public */
2745
2881
  export declare interface PrepareViewOptions {
2746
2882
  /** @beta */
2747
- ordering?: SortOrdering
2883
+ ordering?: SortOrdering;
2748
2884
  }
2749
2885
 
2750
2886
  /** @public */
@@ -2752,93 +2888,96 @@ export declare interface PreviewConfig<
2752
2888
  Select extends Record<string, string> = Record<string, string>,
2753
2889
  PrepareValue extends Record<keyof Select, any> = Record<keyof Select, any>,
2754
2890
  > {
2755
- select?: Select
2756
- prepare?: (value: PrepareValue, viewOptions?: PrepareViewOptions) => PreviewValue
2891
+ select?: Select;
2892
+ prepare?: (
2893
+ value: PrepareValue,
2894
+ viewOptions?: PrepareViewOptions,
2895
+ ) => PreviewValue;
2757
2896
  }
2758
2897
 
2759
2898
  /** @public */
2760
2899
  export declare interface PreviewValue {
2761
- _id?: string
2762
- _createdAt?: string
2763
- _updatedAt?: string
2764
- title?: string
2765
- subtitle?: string
2766
- description?: string
2767
- media?: ReactNode | ElementType
2768
- imageUrl?: string
2900
+ _id?: string;
2901
+ _createdAt?: string;
2902
+ _updatedAt?: string;
2903
+ title?: string;
2904
+ subtitle?: string;
2905
+ description?: string;
2906
+ media?: ReactNode | ElementType;
2907
+ imageUrl?: string;
2769
2908
  }
2770
2909
 
2771
2910
  /** @public */
2772
2911
  export declare interface Reference {
2773
- _type: string
2774
- _ref: string
2775
- _key?: string
2776
- _weak?: boolean
2912
+ _type: string;
2913
+ _ref: string;
2914
+ _key?: string;
2915
+ _weak?: boolean;
2777
2916
  _strengthenOnPublish?: {
2778
- type: string
2779
- weak?: boolean
2917
+ type: string;
2918
+ weak?: boolean;
2780
2919
  template?: {
2781
- id: string
2782
- params: Record<string, string | number | boolean>
2783
- }
2784
- }
2920
+ id: string;
2921
+ params: Record<string, string | number | boolean>;
2922
+ };
2923
+ };
2785
2924
  }
2786
2925
 
2787
2926
  /** @public */
2788
2927
  export declare interface ReferenceBaseOptions extends BaseSchemaTypeOptions {
2789
- disableNew?: boolean
2928
+ disableNew?: boolean;
2790
2929
  }
2791
2930
 
2792
2931
  /** @public */
2793
2932
  export declare interface ReferenceDefinition extends BaseSchemaDefinition {
2794
- type: 'reference'
2795
- to: ReferenceTo
2796
- weak?: boolean
2797
- options?: ReferenceOptions
2798
- validation?: ValidationBuilder<ReferenceRule, ReferenceValue>
2799
- initialValue?: InitialValueProperty<any, Omit<ReferenceValue, '_type'>>
2933
+ type: "reference";
2934
+ to: ReferenceTo;
2935
+ weak?: boolean;
2936
+ options?: ReferenceOptions;
2937
+ validation?: ValidationBuilder<ReferenceRule, ReferenceValue>;
2938
+ initialValue?: InitialValueProperty<any, Omit<ReferenceValue, "_type">>;
2800
2939
  }
2801
2940
 
2802
2941
  /** @public */
2803
2942
  export declare type ReferenceFilterOptions =
2804
2943
  | ReferenceFilterResolverOptions
2805
- | ReferenceFilterQueryOptions
2944
+ | ReferenceFilterQueryOptions;
2806
2945
 
2807
2946
  /** @public */
2808
2947
  export declare interface ReferenceFilterQueryOptions {
2809
- filter: string
2810
- filterParams?: Record<string, unknown>
2948
+ filter: string;
2949
+ filterParams?: Record<string, unknown>;
2811
2950
  }
2812
2951
 
2813
2952
  /** @public */
2814
2953
  export declare type ReferenceFilterResolver = (
2815
2954
  context: ReferenceFilterResolverContext,
2816
- ) => ReferenceFilterSearchOptions | Promise<ReferenceFilterSearchOptions>
2955
+ ) => ReferenceFilterSearchOptions | Promise<ReferenceFilterSearchOptions>;
2817
2956
 
2818
2957
  /** @public */
2819
2958
  export declare interface ReferenceFilterResolverContext {
2820
- document: SanityDocument
2821
- parent?: Record<string, unknown> | Record<string, unknown>[]
2822
- parentPath: Path
2823
- perspective: StackablePerspective[]
2824
- getClient: (options: {apiVersion: string}) => SanityClient
2959
+ document: SanityDocument;
2960
+ parent?: Record<string, unknown> | Record<string, unknown>[];
2961
+ parentPath: Path;
2962
+ perspective: StackablePerspective[];
2963
+ getClient: (options: { apiVersion: string }) => SanityClient;
2825
2964
  }
2826
2965
 
2827
2966
  /** @public */
2828
2967
  export declare interface ReferenceFilterResolverOptions {
2829
- filter?: ReferenceFilterResolver
2830
- filterParams?: never
2968
+ filter?: ReferenceFilterResolver;
2969
+ filterParams?: never;
2831
2970
  }
2832
2971
 
2833
2972
  /** @public */
2834
2973
  export declare type ReferenceFilterSearchOptions = {
2835
- filter?: string
2836
- params?: Record<string, unknown>
2837
- tag?: string
2838
- maxFieldDepth?: number
2839
- strategy?: SearchStrategy
2840
- perspective?: Exclude<ClientPerspective, 'raw' | 'previewDrafts'>
2841
- }
2974
+ filter?: string;
2975
+ params?: Record<string, unknown>;
2976
+ tag?: string;
2977
+ maxFieldDepth?: number;
2978
+ strategy?: SearchStrategy;
2979
+ perspective?: Exclude<ClientPerspective, "raw" | "previewDrafts">;
2980
+ };
2842
2981
 
2843
2982
  /**
2844
2983
  * Types are closed for extension. To add properties via declaration merging to this type,
@@ -2850,33 +2989,40 @@ export declare type ReferenceFilterSearchOptions = {
2850
2989
  *
2851
2990
  * @public
2852
2991
  */
2853
- export declare type ReferenceOptions = ReferenceBaseOptions & ReferenceFilterOptions
2992
+ export declare type ReferenceOptions = ReferenceBaseOptions &
2993
+ ReferenceFilterOptions;
2854
2994
 
2855
2995
  /** @public */
2856
- export declare interface ReferenceRule extends RuleDef<ReferenceRule, ReferenceValue> {}
2996
+ export declare interface ReferenceRule extends RuleDef<
2997
+ ReferenceRule,
2998
+ ReferenceValue
2999
+ > {}
2857
3000
 
2858
3001
  /** @public */
2859
- export declare interface ReferenceSchemaType extends Omit<ObjectSchemaType, 'options'> {
2860
- jsonType: 'object'
2861
- to: ObjectSchemaType[]
2862
- weak?: boolean
2863
- options?: ReferenceOptions
3002
+ export declare interface ReferenceSchemaType extends Omit<
3003
+ ObjectSchemaType,
3004
+ "options"
3005
+ > {
3006
+ jsonType: "object";
3007
+ to: ObjectSchemaType[];
3008
+ weak?: boolean;
3009
+ options?: ReferenceOptions;
2864
3010
  }
2865
3011
 
2866
3012
  /** @public */
2867
3013
  export declare type ReferenceTo =
2868
3014
  | SchemaTypeDefinition
2869
3015
  | TypeReference
2870
- | Array<SchemaTypeDefinition | TypeReference>
3016
+ | Array<SchemaTypeDefinition | TypeReference>;
2871
3017
 
2872
3018
  /** @public */
2873
- export declare type ReferenceValue = Reference
3019
+ export declare type ReferenceValue = Reference;
2874
3020
 
2875
3021
  /** @public */
2876
3022
  export declare interface Role {
2877
- name: string
2878
- title: string
2879
- description?: string
3023
+ name: string;
3024
+ title: string;
3025
+ description?: string;
2880
3026
  }
2881
3027
 
2882
3028
  /** @public */
@@ -2885,37 +3031,37 @@ export declare interface Rule {
2885
3031
  * @internal
2886
3032
  * @deprecated internal use only
2887
3033
  */
2888
- _type: RuleTypeConstraint | undefined
3034
+ _type: RuleTypeConstraint | undefined;
2889
3035
  /**
2890
3036
  * @internal
2891
3037
  * @deprecated internal use only
2892
3038
  */
2893
- _level: 'error' | 'warning' | 'info' | undefined
3039
+ _level: "error" | "warning" | "info" | undefined;
2894
3040
  /**
2895
3041
  * @internal
2896
3042
  * @deprecated internal use only
2897
3043
  */
2898
- _required: 'required' | 'optional' | undefined
3044
+ _required: "required" | "optional" | undefined;
2899
3045
  /**
2900
3046
  * @internal
2901
3047
  * @deprecated internal use only
2902
3048
  */
2903
- _typeDef: SchemaType | undefined
3049
+ _typeDef: SchemaType | undefined;
2904
3050
  /**
2905
3051
  * @internal
2906
3052
  * @deprecated internal use only
2907
3053
  */
2908
- _message: string | LocalizedValidationMessages | undefined
3054
+ _message: string | LocalizedValidationMessages | undefined;
2909
3055
  /**
2910
3056
  * @internal
2911
3057
  * @deprecated internal use only
2912
3058
  */
2913
- _rules: RuleSpec[]
3059
+ _rules: RuleSpec[];
2914
3060
  /**
2915
3061
  * @internal
2916
3062
  * @deprecated internal use only
2917
3063
  */
2918
- _fieldRules: FieldRules | undefined
3064
+ _fieldRules: FieldRules | undefined;
2919
3065
  /**
2920
3066
  * Takes in a path and returns an object with a symbol.
2921
3067
  *
@@ -2938,62 +3084,64 @@ export declare interface Rule {
2938
3084
  * ]
2939
3085
  * ```
2940
3086
  */
2941
- valueOfField: (path: string | string[]) => FieldReference
2942
- error(message?: string | LocalizedValidationMessages): Rule
2943
- warning(message?: string | LocalizedValidationMessages): Rule
2944
- info(message?: string | LocalizedValidationMessages): Rule
2945
- reset(): this
2946
- isRequired(): boolean
2947
- clone(): Rule
2948
- cloneWithRules(rules: RuleSpec[]): Rule
2949
- merge(rule: Rule): Rule
2950
- type(targetType: RuleTypeConstraint | Lowercase<RuleTypeConstraint>): Rule
2951
- all(children: Rule[]): Rule
2952
- either(children: Rule[]): Rule
2953
- optional(): Rule
2954
- required(): Rule
3087
+ valueOfField: (path: string | string[]) => FieldReference;
3088
+ error(message?: string | LocalizedValidationMessages): Rule;
3089
+ warning(message?: string | LocalizedValidationMessages): Rule;
3090
+ info(message?: string | LocalizedValidationMessages): Rule;
3091
+ reset(): this;
3092
+ isRequired(): boolean;
3093
+ clone(): Rule;
3094
+ cloneWithRules(rules: RuleSpec[]): Rule;
3095
+ merge(rule: Rule): Rule;
3096
+ type(targetType: RuleTypeConstraint | Lowercase<RuleTypeConstraint>): Rule;
3097
+ all(children: Rule[]): Rule;
3098
+ either(children: Rule[]): Rule;
3099
+ optional(): Rule;
3100
+ required(): Rule;
2955
3101
  custom<T = unknown>(
2956
3102
  fn: CustomValidator<T>,
2957
3103
  options?: {
2958
- bypassConcurrencyLimit?: boolean
3104
+ bypassConcurrencyLimit?: boolean;
2959
3105
  },
2960
- ): Rule
2961
- media<T extends MediaAssetTypes = MediaAssetTypes>(fn: MediaValidator<T>): Rule
2962
- min(len: number | string | FieldReference): Rule
2963
- max(len: number | string | FieldReference): Rule
2964
- length(len: number | FieldReference): Rule
2965
- valid(value: unknown | unknown[]): Rule
2966
- integer(): Rule
2967
- precision(limit: number | FieldReference): Rule
2968
- positive(): Rule
2969
- negative(): Rule
2970
- greaterThan(num: number | FieldReference): Rule
2971
- lessThan(num: number | FieldReference): Rule
2972
- uppercase(): Rule
2973
- lowercase(): Rule
3106
+ ): Rule;
3107
+ media<T extends MediaAssetTypes = MediaAssetTypes>(
3108
+ fn: MediaValidator<T>,
3109
+ ): Rule;
3110
+ min(len: number | string | FieldReference): Rule;
3111
+ max(len: number | string | FieldReference): Rule;
3112
+ length(len: number | FieldReference): Rule;
3113
+ valid(value: unknown | unknown[]): Rule;
3114
+ integer(): Rule;
3115
+ precision(limit: number | FieldReference): Rule;
3116
+ positive(): Rule;
3117
+ negative(): Rule;
3118
+ greaterThan(num: number | FieldReference): Rule;
3119
+ lessThan(num: number | FieldReference): Rule;
3120
+ uppercase(): Rule;
3121
+ lowercase(): Rule;
2974
3122
  regex(
2975
3123
  pattern: RegExp,
2976
3124
  name: string,
2977
3125
  options: {
2978
- name?: string
2979
- invert?: boolean
3126
+ name?: string;
3127
+ invert?: boolean;
2980
3128
  },
2981
- ): Rule
3129
+ ): Rule;
2982
3130
  regex(
2983
3131
  pattern: RegExp,
2984
3132
  options: {
2985
- name?: string
2986
- invert?: boolean
3133
+ name?: string;
3134
+ invert?: boolean;
2987
3135
  },
2988
- ): Rule
2989
- regex(pattern: RegExp, name: string): Rule
2990
- regex(pattern: RegExp): Rule
2991
- email(): Rule
2992
- uri(options?: UriValidationOptions): Rule
2993
- unique(): Rule
2994
- reference(): Rule
2995
- fields(rules: FieldRules): Rule
2996
- assetRequired(): Rule
3136
+ ): Rule;
3137
+ regex(pattern: RegExp, name: string): Rule;
3138
+ regex(pattern: RegExp): Rule;
3139
+ email(): Rule;
3140
+ uri(options?: UriValidationOptions): Rule;
3141
+ unique(): Rule;
3142
+ reference(): Rule;
3143
+ fields(rules: FieldRules): Rule;
3144
+ assetRequired(): Rule;
2997
3145
  validate(
2998
3146
  value: unknown,
2999
3147
  options: ValidationContext & {
@@ -3003,16 +3151,19 @@ export declare interface Rule {
3003
3151
  */
3004
3152
  __internal?: {
3005
3153
  customValidationConcurrencyLimiter?: {
3006
- ready: () => Promise<void>
3007
- release: () => void
3008
- }
3009
- }
3154
+ ready: () => Promise<void>;
3155
+ release: () => void;
3156
+ };
3157
+ };
3010
3158
  },
3011
- ): Promise<ValidationMarker[]>
3159
+ ): Promise<ValidationMarker[]>;
3012
3160
  }
3013
3161
 
3014
3162
  /** @public */
3015
- export declare type RuleBuilder<T extends RuleDef<T, FieldValue>, FieldValue = unknown> = T | T[]
3163
+ export declare type RuleBuilder<
3164
+ T extends RuleDef<T, FieldValue>,
3165
+ FieldValue = unknown,
3166
+ > = T | T[];
3016
3167
 
3017
3168
  /**
3018
3169
  * Note: `RuleClass` and `Rule` are split to fit the current `@sanity/types`
@@ -3031,144 +3182,145 @@ export declare type RuleBuilder<T extends RuleDef<T, FieldValue>, FieldValue = u
3031
3182
  * @internal
3032
3183
  */
3033
3184
  export declare interface RuleClass {
3034
- FIELD_REF: symbol
3035
- array: (def?: SchemaType) => Rule
3036
- object: (def?: SchemaType) => Rule
3037
- string: (def?: SchemaType) => Rule
3038
- number: (def?: SchemaType) => Rule
3039
- boolean: (def?: SchemaType) => Rule
3040
- dateTime: (def?: SchemaType) => Rule
3041
- valueOfField: Rule['valueOfField']
3042
- new (typeDef?: SchemaType): Rule
3185
+ FIELD_REF: symbol;
3186
+ array: (def?: SchemaType) => Rule;
3187
+ object: (def?: SchemaType) => Rule;
3188
+ string: (def?: SchemaType) => Rule;
3189
+ number: (def?: SchemaType) => Rule;
3190
+ boolean: (def?: SchemaType) => Rule;
3191
+ dateTime: (def?: SchemaType) => Rule;
3192
+ valueOfField: Rule["valueOfField"];
3193
+ new (typeDef?: SchemaType): Rule;
3043
3194
  }
3044
3195
 
3045
3196
  /** @public */
3046
3197
  export declare interface RuleDef<T, FieldValue = unknown> {
3047
- required: () => T
3198
+ required: () => T;
3048
3199
  custom: <LenientFieldValue extends FieldValue>(
3049
3200
  fn: CustomValidator<LenientFieldValue | undefined>,
3050
- ) => T
3051
- info: (message?: string | LocalizedValidationMessages) => T
3052
- error: (message?: string | LocalizedValidationMessages) => T
3053
- warning: (message?: string | LocalizedValidationMessages) => T
3054
- valueOfField: (path: string | string[]) => FieldReference
3201
+ ) => T;
3202
+ info: (message?: string | LocalizedValidationMessages) => T;
3203
+ error: (message?: string | LocalizedValidationMessages) => T;
3204
+ warning: (message?: string | LocalizedValidationMessages) => T;
3205
+ valueOfField: (path: string | string[]) => FieldReference;
3055
3206
  }
3056
3207
 
3057
3208
  /** @public */
3058
3209
  export declare type RuleSpec =
3059
3210
  | {
3060
- flag: 'integer'
3211
+ flag: "integer";
3061
3212
  }
3062
3213
  | {
3063
- flag: 'email'
3214
+ flag: "email";
3064
3215
  }
3065
3216
  | {
3066
- flag: 'unique'
3217
+ flag: "unique";
3067
3218
  }
3068
3219
  | {
3069
- flag: 'reference'
3220
+ flag: "reference";
3070
3221
  }
3071
3222
  | {
3072
- flag: 'type'
3073
- constraint: RuleTypeConstraint
3223
+ flag: "type";
3224
+ constraint: RuleTypeConstraint;
3074
3225
  }
3075
3226
  | {
3076
- flag: 'all'
3077
- constraint: Rule[]
3227
+ flag: "all";
3228
+ constraint: Rule[];
3078
3229
  }
3079
3230
  | {
3080
- flag: 'either'
3081
- constraint: Rule[]
3231
+ flag: "either";
3232
+ constraint: Rule[];
3082
3233
  }
3083
3234
  | {
3084
- flag: 'presence'
3085
- constraint: 'optional' | 'required'
3235
+ flag: "presence";
3236
+ constraint: "optional" | "required";
3086
3237
  }
3087
3238
  | {
3088
- flag: 'custom'
3089
- constraint: CustomValidator
3239
+ flag: "custom";
3240
+ constraint: CustomValidator;
3090
3241
  }
3091
3242
  | {
3092
- flag: 'min'
3093
- constraint: number | string | FieldReference
3243
+ flag: "min";
3244
+ constraint: number | string | FieldReference;
3094
3245
  }
3095
3246
  | {
3096
- flag: 'max'
3097
- constraint: number | string | FieldReference
3247
+ flag: "max";
3248
+ constraint: number | string | FieldReference;
3098
3249
  }
3099
3250
  | {
3100
- flag: 'length'
3101
- constraint: number | FieldReference
3251
+ flag: "length";
3252
+ constraint: number | FieldReference;
3102
3253
  }
3103
3254
  | {
3104
- flag: 'valid'
3105
- constraint: unknown[]
3255
+ flag: "valid";
3256
+ constraint: unknown[];
3106
3257
  }
3107
3258
  | {
3108
- flag: 'precision'
3109
- constraint: number | FieldReference
3259
+ flag: "precision";
3260
+ constraint: number | FieldReference;
3110
3261
  }
3111
3262
  | {
3112
- flag: 'lessThan'
3113
- constraint: number | FieldReference
3263
+ flag: "lessThan";
3264
+ constraint: number | FieldReference;
3114
3265
  }
3115
3266
  | {
3116
- flag: 'greaterThan'
3117
- constraint: number | FieldReference
3267
+ flag: "greaterThan";
3268
+ constraint: number | FieldReference;
3118
3269
  }
3119
3270
  | {
3120
- flag: 'stringCasing'
3121
- constraint: 'uppercase' | 'lowercase'
3271
+ flag: "stringCasing";
3272
+ constraint: "uppercase" | "lowercase";
3122
3273
  }
3123
3274
  | {
3124
- flag: 'assetRequired'
3275
+ flag: "assetRequired";
3125
3276
  constraint: {
3126
- assetType: 'asset' | 'image' | 'file'
3127
- }
3277
+ assetType: "asset" | "image" | "file";
3278
+ };
3128
3279
  }
3129
3280
  | {
3130
- flag: 'media'
3131
- constraint: MediaValidator<any>
3281
+ flag: "media";
3282
+ constraint: MediaValidator<any>;
3132
3283
  }
3133
3284
  | {
3134
- flag: 'regex'
3285
+ flag: "regex";
3135
3286
  constraint: {
3136
- pattern: RegExp
3137
- name?: string
3138
- invert: boolean
3139
- }
3287
+ pattern: RegExp;
3288
+ name?: string;
3289
+ invert: boolean;
3290
+ };
3140
3291
  }
3141
3292
  | {
3142
- flag: 'uri'
3293
+ flag: "uri";
3143
3294
  constraint: {
3144
3295
  options: {
3145
- scheme: RegExp[]
3146
- allowRelative: boolean
3147
- relativeOnly: boolean
3148
- allowCredentials: boolean
3149
- }
3150
- }
3151
- }
3296
+ scheme: RegExp[];
3297
+ allowRelative: boolean;
3298
+ relativeOnly: boolean;
3299
+ allowCredentials: boolean;
3300
+ };
3301
+ };
3302
+ };
3152
3303
 
3153
3304
  /** @internal */
3154
- export declare type RuleSpecConstraint<T extends RuleSpec['flag']> = ConditionalIndexAccess<
3155
- Extract<
3156
- RuleSpec,
3157
- {
3158
- flag: T
3159
- }
3160
- >,
3161
- 'constraint'
3162
- >
3305
+ export declare type RuleSpecConstraint<T extends RuleSpec["flag"]> =
3306
+ ConditionalIndexAccess<
3307
+ Extract<
3308
+ RuleSpec,
3309
+ {
3310
+ flag: T;
3311
+ }
3312
+ >,
3313
+ "constraint"
3314
+ >;
3163
3315
 
3164
3316
  /** @public */
3165
3317
  export declare type RuleTypeConstraint =
3166
- | 'Array'
3167
- | 'Boolean'
3168
- | 'Date'
3169
- | 'Number'
3170
- | 'Object'
3171
- | 'String'
3318
+ | "Array"
3319
+ | "Boolean"
3320
+ | "Date"
3321
+ | "Number"
3322
+ | "Object"
3323
+ | "String";
3172
3324
 
3173
3325
  /**
3174
3326
  * Options for configuring how Sanity Create interfaces with the type or field.
@@ -3177,22 +3329,22 @@ export declare type RuleTypeConstraint =
3177
3329
  */
3178
3330
  export declare interface SanityCreateOptions {
3179
3331
  /** Set to true to exclude a type or field from appearing in Sanity Create */
3180
- exclude?: boolean
3332
+ exclude?: boolean;
3181
3333
  /**
3182
3334
  * A short description of what the type or field is used for.
3183
3335
  * Purpose can be used to improve how and when content mapping uses the field.
3184
3336
  * */
3185
- purpose?: string
3337
+ purpose?: string;
3186
3338
  }
3187
3339
 
3188
3340
  /** @public */
3189
3341
  export declare interface SanityDocument {
3190
- _id: string
3191
- _type: string
3192
- _createdAt: string
3193
- _updatedAt: string
3194
- _rev: string
3195
- [key: string]: unknown
3342
+ _id: string;
3343
+ _type: string;
3344
+ _createdAt: string;
3345
+ _updatedAt: string;
3346
+ _rev: string;
3347
+ [key: string]: unknown;
3196
3348
  }
3197
3349
 
3198
3350
  /**
@@ -3203,43 +3355,43 @@ export declare interface SanityDocument {
3203
3355
  * @public
3204
3356
  */
3205
3357
  export declare interface SanityDocumentLike {
3206
- _id: string
3207
- _type: string
3208
- _createdAt?: string
3209
- _updatedAt?: string
3210
- _rev?: string
3358
+ _id: string;
3359
+ _type: string;
3360
+ _createdAt?: string;
3361
+ _updatedAt?: string;
3362
+ _rev?: string;
3211
3363
  _system?: {
3212
- delete?: boolean
3213
- }
3214
- [key: string]: unknown
3364
+ delete?: boolean;
3365
+ };
3366
+ [key: string]: unknown;
3215
3367
  }
3216
3368
 
3217
3369
  /** @public */
3218
3370
  export declare interface Schema {
3219
3371
  /** @internal */
3220
3372
  _original?: {
3221
- name: string
3222
- types: SchemaTypeDefinition[]
3223
- }
3373
+ name: string;
3374
+ types: SchemaTypeDefinition[];
3375
+ };
3224
3376
  /** @internal */
3225
3377
  _registry: {
3226
- [typeName: string]: any
3227
- }
3378
+ [typeName: string]: any;
3379
+ };
3228
3380
  /** @internal */
3229
- _validation?: SchemaValidationProblemGroup[]
3230
- name: string
3231
- get: (name: string) => SchemaType | undefined
3232
- has: (name: string) => boolean
3233
- getTypeNames: () => string[]
3381
+ _validation?: SchemaValidationProblemGroup[];
3382
+ name: string;
3383
+ get: (name: string) => SchemaType | undefined;
3384
+ has: (name: string) => boolean;
3385
+ getTypeNames: () => string[];
3234
3386
  /**
3235
3387
  * Returns the types which were explicitly defined in this schema,
3236
3388
  * as opposed to the types which were inherited from the parent.
3237
3389
  */
3238
- getLocalTypeNames: () => string[]
3390
+ getLocalTypeNames: () => string[];
3239
3391
  /**
3240
3392
  * Returns the parent schema.
3241
3393
  */
3242
- parent?: Schema
3394
+ parent?: Schema;
3243
3395
  }
3244
3396
 
3245
3397
  /**
@@ -3255,7 +3407,7 @@ export declare type SchemaType =
3255
3407
  | NumberSchemaType
3256
3408
  | ObjectSchemaType
3257
3409
  | StringSchemaType
3258
- | ReferenceSchemaType
3410
+ | ReferenceSchemaType;
3259
3411
 
3260
3412
  /**
3261
3413
  * Represents a Sanity schema type definition with an optional type parameter.
@@ -3267,38 +3419,42 @@ export declare type SchemaType =
3267
3419
  *
3268
3420
  * @public
3269
3421
  */
3270
- export declare type SchemaTypeDefinition<TType extends IntrinsicTypeName = IntrinsicTypeName> =
3422
+ export declare type SchemaTypeDefinition<
3423
+ TType extends IntrinsicTypeName = IntrinsicTypeName,
3424
+ > =
3271
3425
  | IntrinsicDefinitions[IntrinsicTypeName]
3272
- | TypeAliasDefinition<string, TType>
3426
+ | TypeAliasDefinition<string, TType>;
3273
3427
 
3274
3428
  /** @public */
3275
3429
  export declare interface SchemaValidationError {
3276
- helpId?: string
3277
- message: string
3278
- severity: 'error'
3430
+ helpId?: string;
3431
+ message: string;
3432
+ severity: "error";
3279
3433
  }
3280
3434
 
3281
3435
  /** @internal */
3282
- export declare type SchemaValidationProblem = SchemaValidationError | SchemaValidationWarning
3436
+ export declare type SchemaValidationProblem =
3437
+ | SchemaValidationError
3438
+ | SchemaValidationWarning;
3283
3439
 
3284
3440
  /** @internal */
3285
3441
  export declare interface SchemaValidationProblemGroup {
3286
- path: SchemaValidationProblemPath
3287
- problems: SchemaValidationProblem[]
3442
+ path: SchemaValidationProblemPath;
3443
+ problems: SchemaValidationProblem[];
3288
3444
  }
3289
3445
 
3290
3446
  /** @internal */
3291
3447
  export declare type SchemaValidationProblemPath = Array<
3292
3448
  | {
3293
- kind: 'type'
3294
- type: string
3295
- name?: string
3449
+ kind: "type";
3450
+ type: string;
3451
+ name?: string;
3296
3452
  }
3297
3453
  | {
3298
- kind: 'property'
3299
- name: string
3454
+ kind: "property";
3455
+ name: string;
3300
3456
  }
3301
- >
3457
+ >;
3302
3458
 
3303
3459
  /**
3304
3460
  * Represents the possible values of a schema type's `validation` field.
@@ -3330,13 +3486,13 @@ export declare type SchemaValidationValue =
3330
3486
  | undefined
3331
3487
  | Rule
3332
3488
  | SchemaValidationValue[]
3333
- | ((rule: Rule) => SchemaValidationValue)
3489
+ | ((rule: Rule) => SchemaValidationValue);
3334
3490
 
3335
3491
  /** @internal */
3336
3492
  export declare interface SchemaValidationWarning {
3337
- helpId?: string
3338
- message: string
3339
- severity: 'warning'
3493
+ helpId?: string;
3494
+ message: string;
3495
+ severity: "warning";
3340
3496
  }
3341
3497
 
3342
3498
  /** @public */
@@ -3356,36 +3512,36 @@ export declare interface SearchConfiguration {
3356
3512
  * Note: Search weight configuration is currently supported only for fields
3357
3513
  * of type string or portable text arrays.
3358
3514
  */
3359
- weight?: number
3360
- }
3515
+ weight?: number;
3516
+ };
3361
3517
  }
3362
3518
 
3363
3519
  /**
3364
3520
  * @public
3365
3521
  */
3366
- export declare const searchStrategies: readonly ['groqLegacy', 'groq2024']
3522
+ export declare const searchStrategies: readonly ["groqLegacy", "groq2024"];
3367
3523
 
3368
3524
  /**
3369
3525
  * @public
3370
3526
  */
3371
- export declare type SearchStrategy = (typeof searchStrategies)[number]
3527
+ export declare type SearchStrategy = (typeof searchStrategies)[number];
3372
3528
 
3373
3529
  /** @public */
3374
3530
  export declare interface SingleFieldSet {
3375
- single: true
3376
- field: ObjectField
3377
- hidden?: ConditionalProperty
3378
- readOnly?: ConditionalProperty
3379
- group?: string | string[]
3531
+ single: true;
3532
+ field: ObjectField;
3533
+ hidden?: ConditionalProperty;
3534
+ readOnly?: ConditionalProperty;
3535
+ group?: string | string[];
3380
3536
  }
3381
3537
 
3382
3538
  /** @internal */
3383
3539
  export declare interface SingleMutationResult {
3384
- transactionId: string
3385
- documentId: string
3540
+ transactionId: string;
3541
+ documentId: string;
3386
3542
  results: {
3387
- id: string
3388
- }[]
3543
+ id: string;
3544
+ }[];
3389
3545
  }
3390
3546
 
3391
3547
  /**
@@ -3396,16 +3552,16 @@ export declare interface SingleMutationResult {
3396
3552
  * @public
3397
3553
  */
3398
3554
  export declare interface Slug {
3399
- _type: 'slug'
3400
- current: string
3555
+ _type: "slug";
3556
+ current: string;
3401
3557
  }
3402
3558
 
3403
3559
  /** @public */
3404
3560
  export declare interface SlugDefinition extends BaseSchemaDefinition {
3405
- type: 'slug'
3406
- options?: SlugOptions
3407
- validation?: ValidationBuilder<SlugRule, SlugValue>
3408
- initialValue?: InitialValueProperty<any, Omit<SlugValue, '_type'>>
3561
+ type: "slug";
3562
+ options?: SlugOptions;
3563
+ validation?: ValidationBuilder<SlugRule, SlugValue>;
3564
+ initialValue?: InitialValueProperty<any, Omit<SlugValue, "_type">>;
3409
3565
  }
3410
3566
 
3411
3567
  /** @public */
@@ -3413,77 +3569,80 @@ export declare type SlugifierFn = (
3413
3569
  source: string,
3414
3570
  schemaType: SlugSchemaType,
3415
3571
  context: SlugSourceContext,
3416
- ) => string | Promise<string>
3572
+ ) => string | Promise<string>;
3417
3573
 
3418
3574
  /** @public */
3419
3575
  export declare type SlugIsUniqueValidator = (
3420
3576
  slug: string,
3421
3577
  context: SlugValidationContext,
3422
- ) => boolean | Promise<boolean>
3578
+ ) => boolean | Promise<boolean>;
3423
3579
 
3424
3580
  /** @public */
3425
- export declare interface SlugOptions extends SearchConfiguration, BaseSchemaTypeOptions {
3426
- source?: string | Path | SlugSourceFn
3427
- maxLength?: number
3428
- slugify?: SlugifierFn
3429
- isUnique?: SlugIsUniqueValidator
3430
- disableArrayWarning?: boolean
3581
+ export declare interface SlugOptions
3582
+ extends SearchConfiguration, BaseSchemaTypeOptions {
3583
+ source?: string | Path | SlugSourceFn;
3584
+ maxLength?: number;
3585
+ slugify?: SlugifierFn;
3586
+ isUnique?: SlugIsUniqueValidator;
3587
+ disableArrayWarning?: boolean;
3431
3588
  }
3432
3589
 
3433
3590
  /** @public */
3434
- export declare type SlugParent = Record<string, unknown> | Record<string, unknown>[]
3591
+ export declare type SlugParent =
3592
+ | Record<string, unknown>
3593
+ | Record<string, unknown>[];
3435
3594
 
3436
3595
  /** @public */
3437
3596
  export declare interface SlugRule extends RuleDef<SlugRule, SlugValue> {}
3438
3597
 
3439
3598
  /** @public */
3440
3599
  export declare interface SlugSchemaType extends ObjectSchemaType {
3441
- jsonType: 'object'
3442
- options?: SlugOptions
3600
+ jsonType: "object";
3601
+ options?: SlugOptions;
3443
3602
  }
3444
3603
 
3445
3604
  /** @public */
3446
3605
  export declare interface SlugSourceContext {
3447
- parentPath: Path
3448
- parent: SlugParent
3449
- projectId: string
3450
- dataset: string
3451
- schema: Schema
3452
- currentUser: CurrentUser | null
3453
- getClient: (options: {apiVersion: string}) => SanityClient
3606
+ parentPath: Path;
3607
+ parent: SlugParent;
3608
+ projectId: string;
3609
+ dataset: string;
3610
+ schema: Schema;
3611
+ currentUser: CurrentUser | null;
3612
+ getClient: (options: { apiVersion: string }) => SanityClient;
3454
3613
  }
3455
3614
 
3456
3615
  /** @public */
3457
3616
  export declare type SlugSourceFn = (
3458
3617
  document: SanityDocument,
3459
3618
  context: SlugSourceContext,
3460
- ) => string | Promise<string>
3619
+ ) => string | Promise<string>;
3461
3620
 
3462
3621
  /** @public */
3463
3622
  export declare interface SlugValidationContext extends ValidationContext {
3464
- parent: SlugParent
3465
- type: SlugSchemaType
3466
- defaultIsUnique: SlugIsUniqueValidator
3623
+ parent: SlugParent;
3624
+ type: SlugSchemaType;
3625
+ defaultIsUnique: SlugIsUniqueValidator;
3467
3626
  }
3468
3627
 
3469
3628
  /** @public */
3470
3629
  export declare interface SlugValue {
3471
- _type: 'slug'
3472
- current?: string
3630
+ _type: "slug";
3631
+ current?: string;
3473
3632
  }
3474
3633
 
3475
3634
  /** @beta */
3476
3635
  export declare type SortOrdering = {
3477
- title: string
3478
- i18n?: I18nTextRecord<'title'>
3479
- name: string
3480
- by: SortOrderingItem[]
3481
- }
3636
+ title: string;
3637
+ i18n?: I18nTextRecord<"title">;
3638
+ name: string;
3639
+ by: SortOrderingItem[];
3640
+ };
3482
3641
 
3483
3642
  /** @beta */
3484
3643
  export declare interface SortOrderingItem {
3485
- field: string
3486
- direction: 'asc' | 'desc'
3644
+ field: string;
3645
+ direction: "asc" | "desc";
3487
3646
  }
3488
3647
 
3489
3648
  /**
@@ -3493,8 +3652,8 @@ export declare interface SortOrderingItem {
3493
3652
  * @internal
3494
3653
  */
3495
3654
  export declare type SpanMarksObjectField = {
3496
- name: 'marks'
3497
- } & ObjectField<ArraySchemaTypeOf<StringSchemaType>>
3655
+ name: "marks";
3656
+ } & ObjectField<ArraySchemaTypeOf<StringSchemaType>>;
3498
3657
 
3499
3658
  /**
3500
3659
  * Represents the compiled schema shape for `span`s for portable text.
@@ -3503,15 +3662,18 @@ export declare type SpanMarksObjectField = {
3503
3662
  *
3504
3663
  * @internal
3505
3664
  */
3506
- export declare interface SpanSchemaType extends Omit<ObjectSchemaType, 'fields'> {
3665
+ export declare interface SpanSchemaType extends Omit<
3666
+ ObjectSchemaType,
3667
+ "fields"
3668
+ > {
3507
3669
  annotations: (ObjectSchemaType & {
3508
- icon?: string | ComponentType
3670
+ icon?: string | ComponentType;
3509
3671
  components?: {
3510
- item?: ComponentType
3511
- }
3512
- })[]
3513
- decorators: BlockDecoratorDefinition[]
3514
- fields: [SpanMarksObjectField, SpanTextObjectField]
3672
+ item?: ComponentType;
3673
+ };
3674
+ })[];
3675
+ decorators: BlockDecoratorDefinition[];
3676
+ fields: [SpanMarksObjectField, SpanTextObjectField];
3515
3677
  }
3516
3678
 
3517
3679
  /**
@@ -3521,11 +3683,11 @@ export declare interface SpanSchemaType extends Omit<ObjectSchemaType, 'fields'>
3521
3683
  * @internal
3522
3684
  */
3523
3685
  export declare type SpanTextObjectField = {
3524
- name: 'text'
3525
- } & ObjectField<TextSchemaType>
3686
+ name: "text";
3687
+ } & ObjectField<TextSchemaType>;
3526
3688
 
3527
3689
  /** @beta */
3528
- export declare type StrictDefinition = boolean | undefined
3690
+ export declare type StrictDefinition = boolean | undefined;
3529
3691
 
3530
3692
  /**
3531
3693
  * @internal
@@ -3547,16 +3709,16 @@ export declare interface StrictVersionLayeringOptions {
3547
3709
  * **Cross-version layering is only effective for scheduled versions, with all other
3548
3710
  * versions being layered directly onto the published version (if it exists).**
3549
3711
  */
3550
- strict?: boolean
3712
+ strict?: boolean;
3551
3713
  }
3552
3714
 
3553
3715
  /** @public */
3554
3716
  export declare interface StringDefinition extends BaseSchemaDefinition {
3555
- type: 'string'
3556
- options?: StringOptions
3557
- placeholder?: string
3558
- validation?: ValidationBuilder<StringRule, string>
3559
- initialValue?: InitialValueProperty<any, string>
3717
+ type: "string";
3718
+ options?: StringOptions;
3719
+ placeholder?: string;
3720
+ validation?: ValidationBuilder<StringRule, string>;
3721
+ initialValue?: InitialValueProperty<any, string>;
3560
3722
  }
3561
3723
 
3562
3724
  /** @public */
@@ -3565,29 +3727,29 @@ export declare interface StringOptions
3565
3727
 
3566
3728
  /** @public */
3567
3729
  export declare interface StringRule extends RuleDef<StringRule, string> {
3568
- min: (minNumber: number | FieldReference) => StringRule
3569
- max: (maxNumber: number | FieldReference) => StringRule
3570
- length: (exactLength: number | FieldReference) => StringRule
3571
- uppercase: () => StringRule
3572
- lowercase: () => StringRule
3730
+ min: (minNumber: number | FieldReference) => StringRule;
3731
+ max: (maxNumber: number | FieldReference) => StringRule;
3732
+ length: (exactLength: number | FieldReference) => StringRule;
3733
+ uppercase: () => StringRule;
3734
+ lowercase: () => StringRule;
3573
3735
  regex(
3574
3736
  pattern: RegExp,
3575
3737
  name: string,
3576
3738
  options: {
3577
- name?: string
3578
- invert?: boolean
3739
+ name?: string;
3740
+ invert?: boolean;
3579
3741
  },
3580
- ): StringRule
3742
+ ): StringRule;
3581
3743
  regex(
3582
3744
  pattern: RegExp,
3583
3745
  options: {
3584
- name?: string
3585
- invert?: boolean
3746
+ name?: string;
3747
+ invert?: boolean;
3586
3748
  },
3587
- ): StringRule
3588
- regex(pattern: RegExp, name: string): StringRule
3589
- regex(pattern: RegExp): StringRule
3590
- email(): StringRule
3749
+ ): StringRule;
3750
+ regex(pattern: RegExp, name: string): StringRule;
3751
+ regex(pattern: RegExp): StringRule;
3752
+ email(): StringRule;
3591
3753
  }
3592
3754
 
3593
3755
  /**
@@ -3597,9 +3759,9 @@ export declare interface StringRule extends RuleDef<StringRule, string> {
3597
3759
  * @public
3598
3760
  */
3599
3761
  export declare interface StringSchemaType extends BaseSchemaType {
3600
- jsonType: 'string'
3601
- options?: StringOptions & TextOptions & DateOptions & DatetimeOptions
3602
- initialValue?: InitialValueProperty<any, string>
3762
+ jsonType: "string";
3763
+ options?: StringOptions & TextOptions & DateOptions & DatetimeOptions;
3764
+ initialValue?: InitialValueProperty<any, string>;
3603
3765
  }
3604
3766
 
3605
3767
  /**
@@ -3607,33 +3769,33 @@ export declare interface StringSchemaType extends BaseSchemaType {
3607
3769
  * Payload that will be passed by the comments backend to our notifications system to display the notification in dashboard.
3608
3770
  * */
3609
3771
  export declare interface StudioNotificationPayload extends DashboardNotificationPayload {
3610
- applicationType: 'studio'
3611
- applicationId: string | undefined
3612
- workspaceName: string | undefined
3772
+ applicationType: "studio";
3773
+ applicationId: string | undefined;
3774
+ workspaceName: string | undefined;
3613
3775
  link: {
3614
- type: 'url'
3615
- url: string
3616
- }
3776
+ type: "url";
3777
+ url: string;
3778
+ };
3617
3779
  }
3618
3780
 
3619
3781
  /** @public */
3620
3782
  export declare type SwatchName =
3621
- | 'darkMuted'
3622
- | 'darkVibrant'
3623
- | 'dominant'
3624
- | 'lightMuted'
3625
- | 'lightVibrant'
3626
- | 'muted'
3627
- | 'vibrant'
3783
+ | "darkMuted"
3784
+ | "darkVibrant"
3785
+ | "dominant"
3786
+ | "lightMuted"
3787
+ | "lightVibrant"
3788
+ | "muted"
3789
+ | "vibrant";
3628
3790
 
3629
3791
  /** @public */
3630
3792
  export declare interface TextDefinition extends BaseSchemaDefinition {
3631
- type: 'text'
3632
- rows?: number
3633
- options?: TextOptions
3634
- placeholder?: string
3635
- validation?: ValidationBuilder<TextRule, string>
3636
- initialValue?: InitialValueProperty<any, string>
3793
+ type: "text";
3794
+ rows?: number;
3795
+ options?: TextOptions;
3796
+ placeholder?: string;
3797
+ validation?: ValidationBuilder<TextRule, string>;
3798
+ initialValue?: InitialValueProperty<any, string>;
3637
3799
  }
3638
3800
 
3639
3801
  /** @public */
@@ -3644,14 +3806,14 @@ export declare interface TextRule extends StringRule {}
3644
3806
 
3645
3807
  /** @public */
3646
3808
  export declare interface TextSchemaType extends StringSchemaType {
3647
- rows?: number
3809
+ rows?: number;
3648
3810
  }
3649
3811
 
3650
3812
  /** @public */
3651
3813
  export declare interface TitledListValue<V = unknown> {
3652
- _key?: string
3653
- title: string
3654
- value?: V
3814
+ _key?: string;
3815
+ title: string;
3816
+ value?: V;
3655
3817
  }
3656
3818
 
3657
3819
  /**
@@ -3663,19 +3825,19 @@ export declare interface TransactionLogEvent {
3663
3825
  /**
3664
3826
  * ID of transaction
3665
3827
  */
3666
- id: string
3828
+ id: string;
3667
3829
  /**
3668
3830
  * ISO-formatted timestamp (zulu-time) of when the transaction happened
3669
3831
  */
3670
- timestamp: string
3832
+ timestamp: string;
3671
3833
  /**
3672
3834
  * User ID of the user who performed the transaction
3673
3835
  */
3674
- author: string
3836
+ author: string;
3675
3837
  /**
3676
3838
  * Document IDs involved in this transaction
3677
3839
  */
3678
- documentIDs: string[]
3840
+ documentIDs: string[];
3679
3841
  }
3680
3842
 
3681
3843
  /**
@@ -3690,7 +3852,7 @@ export declare interface TransactionLogEventWithEffects extends TransactionLogEv
3690
3852
  * Object of effects, where the key is the document ID affected and the value
3691
3853
  * is the effect pair, eg `{apply: MendozaPatch, revert: MendozaPatch}`
3692
3854
  */
3693
- effects: Record<string, MendozaEffectPair | undefined>
3855
+ effects: Record<string, MendozaEffectPair | undefined>;
3694
3856
  }
3695
3857
 
3696
3858
  /**
@@ -3706,7 +3868,7 @@ export declare interface TransactionLogEventWithMutations extends TransactionLog
3706
3868
  * log has an additional mutation type not typically seen in other APIs;
3707
3869
  * `createSquashed` ({@link CreateSquashedMutation}).
3708
3870
  */
3709
- mutations: TransactionLogMutation[]
3871
+ mutations: TransactionLogMutation[];
3710
3872
  }
3711
3873
 
3712
3874
  /**
@@ -3715,7 +3877,7 @@ export declare interface TransactionLogEventWithMutations extends TransactionLog
3715
3877
  *
3716
3878
  * @internal
3717
3879
  */
3718
- export declare type TransactionLogMutation = Mutation | CreateSquashedMutation
3880
+ export declare type TransactionLogMutation = Mutation | CreateSquashedMutation;
3719
3881
 
3720
3882
  /**
3721
3883
  * Represents a type definition that is an alias/extension of an existing type
@@ -3729,21 +3891,23 @@ export declare interface TypeAliasDefinition<
3729
3891
  TType extends string,
3730
3892
  TAlias extends IntrinsicTypeName | undefined,
3731
3893
  > extends BaseSchemaDefinition {
3732
- type: TType
3733
- options?: TAlias extends IntrinsicTypeName ? IntrinsicDefinitions[TAlias]['options'] : unknown
3734
- validation?: SchemaValidationValue
3735
- initialValue?: InitialValueProperty<any, any>
3736
- preview?: PreviewConfig
3894
+ type: TType;
3895
+ options?: TAlias extends IntrinsicTypeName
3896
+ ? IntrinsicDefinitions[TAlias]["options"]
3897
+ : unknown;
3898
+ validation?: SchemaValidationValue;
3899
+ initialValue?: InitialValueProperty<any, any>;
3900
+ preview?: PreviewConfig;
3737
3901
  components?: {
3738
- annotation?: ComponentType<any>
3739
- block?: ComponentType<any>
3740
- inlineBlock?: ComponentType<any>
3741
- diff?: ComponentType<any>
3742
- field?: ComponentType<any>
3743
- input?: ComponentType<any>
3744
- item?: ComponentType<any>
3745
- preview?: ComponentType<any>
3746
- }
3902
+ annotation?: ComponentType<any>;
3903
+ block?: ComponentType<any>;
3904
+ inlineBlock?: ComponentType<any>;
3905
+ diff?: ComponentType<any>;
3906
+ field?: ComponentType<any>;
3907
+ input?: ComponentType<any>;
3908
+ item?: ComponentType<any>;
3909
+ preview?: ComponentType<any>;
3910
+ };
3747
3911
  }
3748
3912
 
3749
3913
  /**
@@ -3771,12 +3935,12 @@ export declare interface TypeAliasDefinition<
3771
3935
  *
3772
3936
  * @internal
3773
3937
  */
3774
- export declare function typed<T>(input: T): T
3938
+ export declare function typed<T>(input: T): T;
3775
3939
 
3776
3940
  /** @public */
3777
3941
  export declare interface TypedObject {
3778
- [key: string]: unknown
3779
- _type: string
3942
+ [key: string]: unknown;
3943
+ _type: string;
3780
3944
  }
3781
3945
 
3782
3946
  /**
@@ -3785,45 +3949,45 @@ export declare interface TypedObject {
3785
3949
  * @public
3786
3950
  */
3787
3951
  export declare interface TypeReference {
3788
- type: string
3789
- name?: string
3790
- icon?: ComponentType | ReactNode
3952
+ type: string;
3953
+ name?: string;
3954
+ icon?: ComponentType | ReactNode;
3791
3955
  options?: {
3792
- [key: string]: unknown
3793
- }
3956
+ [key: string]: unknown;
3957
+ };
3794
3958
  }
3795
3959
 
3796
3960
  /** @internal */
3797
3961
  export declare interface UploadState {
3798
- progress: number
3962
+ progress: number;
3799
3963
  /** @deprecated use createdAt instead */
3800
- initiated?: string
3964
+ initiated?: string;
3801
3965
  /** @deprecated use updatedAt instead */
3802
- updated?: string
3803
- createdAt: string
3804
- updatedAt: string
3966
+ updated?: string;
3967
+ createdAt: string;
3968
+ updatedAt: string;
3805
3969
  file: {
3806
- name: string
3807
- type: string
3808
- }
3809
- previewImage?: string
3970
+ name: string;
3971
+ type: string;
3972
+ };
3973
+ previewImage?: string;
3810
3974
  }
3811
3975
 
3812
3976
  /** @public */
3813
3977
  export declare interface UriValidationOptions {
3814
- scheme?: (string | RegExp) | Array<string | RegExp>
3815
- allowRelative?: boolean
3816
- relativeOnly?: boolean
3817
- allowCredentials?: boolean
3978
+ scheme?: (string | RegExp) | Array<string | RegExp>;
3979
+ allowRelative?: boolean;
3980
+ relativeOnly?: boolean;
3981
+ allowCredentials?: boolean;
3818
3982
  }
3819
3983
 
3820
3984
  /** @public */
3821
3985
  export declare interface UrlDefinition extends BaseSchemaDefinition {
3822
- type: 'url'
3823
- options?: UrlOptions
3824
- placeholder?: string
3825
- validation?: ValidationBuilder<UrlRule, string>
3826
- initialValue?: InitialValueProperty<any, string>
3986
+ type: "url";
3987
+ options?: UrlOptions;
3988
+ placeholder?: string;
3989
+ validation?: ValidationBuilder<UrlRule, string>;
3990
+ initialValue?: InitialValueProperty<any, string>;
3827
3991
  }
3828
3992
 
3829
3993
  /** @public */
@@ -3831,21 +3995,22 @@ export declare interface UrlOptions extends BaseSchemaTypeOptions {}
3831
3995
 
3832
3996
  /** @public */
3833
3997
  export declare interface UrlRule extends RuleDef<UrlRule, string> {
3834
- uri(options: UriValidationOptions): UrlRule
3998
+ uri(options: UriValidationOptions): UrlRule;
3835
3999
  }
3836
4000
 
3837
4001
  /** @public */
3838
4002
  export declare interface User {
3839
- id: string
3840
- displayName?: string
3841
- imageUrl?: string
3842
- email?: string
4003
+ id: string;
4004
+ displayName?: string;
4005
+ imageUrl?: string;
4006
+ email?: string;
3843
4007
  }
3844
4008
 
3845
4009
  /** @public */
3846
- export declare type ValidationBuilder<T extends RuleDef<T, FieldValue>, FieldValue = unknown> = (
3847
- rule: T,
3848
- ) => RuleBuilder<T, FieldValue>
4010
+ export declare type ValidationBuilder<
4011
+ T extends RuleDef<T, FieldValue>,
4012
+ FieldValue = unknown,
4013
+ > = (rule: T) => RuleBuilder<T, FieldValue>;
3849
4014
 
3850
4015
  /**
3851
4016
  * A context object passed around during validation. This includes the
@@ -3862,14 +4027,14 @@ export declare type ValidationBuilder<T extends RuleDef<T, FieldValue>, FieldVal
3862
4027
  * @public
3863
4028
  */
3864
4029
  export declare interface ValidationContext {
3865
- getClient: (options: {apiVersion: string}) => SanityClient
3866
- schema: Schema
3867
- parent?: unknown
3868
- type?: SchemaType
3869
- document?: SanityDocument
3870
- path?: Path
3871
- getDocumentExists?: (options: {id: string}) => Promise<boolean>
3872
- environment: 'cli' | 'studio'
4030
+ getClient: (options: { apiVersion: string }) => SanityClient;
4031
+ schema: Schema;
4032
+ parent?: unknown;
4033
+ type?: SchemaType;
4034
+ document?: SanityDocument;
4035
+ path?: Path;
4036
+ getDocumentExists?: (options: { id: string }) => Promise<boolean>;
4037
+ environment: "cli" | "studio";
3873
4038
  }
3874
4039
 
3875
4040
  /**
@@ -3885,7 +4050,7 @@ export declare interface ValidationError {
3885
4050
  * The message describing why the value is not valid. This message will be
3886
4051
  * included in the validation markers after validation has finished running.
3887
4052
  */
3888
- message: string
4053
+ message: string;
3889
4054
  /**
3890
4055
  * If writing a custom validator, you can return validation messages to
3891
4056
  * specific path inside of the current value (object or array) by populating
@@ -3894,14 +4059,14 @@ export declare interface ValidationError {
3894
4059
  * NOTE: This path is relative to the current value and _not_ relative to
3895
4060
  * the document.
3896
4061
  */
3897
- path?: Path
4062
+ path?: Path;
3898
4063
  /**
3899
4064
  * Extra metadata for the validation error. Currently used by the Media Library asset source to ignore
3900
4065
  * certain validation markers when validating asset source media library assets.
3901
4066
  *
3902
4067
  * @internal
3903
4068
  */
3904
- __internal_metadata?: unknown
4069
+ __internal_metadata?: unknown;
3905
4070
  /**
3906
4071
  * Same as `path` but allows more than one value. If provided, the same
3907
4072
  * message will create two markers from each path with the same message
@@ -3909,19 +4074,19 @@ export declare interface ValidationError {
3909
4074
  *
3910
4075
  * @deprecated prefer `path`
3911
4076
  */
3912
- paths?: Path[]
4077
+ paths?: Path[];
3913
4078
  /**
3914
4079
  * @deprecated Unused. Was used to store the results from `.either()` /`.all()`
3915
4080
  */
3916
- children?: ValidationMarker[]
4081
+ children?: ValidationMarker[];
3917
4082
  /**
3918
4083
  * @deprecated Unused. Was used to signal if this error came from an `.either()`/`.all()`.
3919
4084
  */
3920
- operation?: 'AND' | 'OR'
4085
+ operation?: "AND" | "OR";
3921
4086
  /**
3922
4087
  * @deprecated Unused. Was relevant when validation error was used as a class.
3923
4088
  */
3924
- cloneWithMessage?(message: string): ValidationError
4089
+ cloneWithMessage?(message: string): ValidationError;
3925
4090
  }
3926
4091
 
3927
4092
  /**
@@ -3933,27 +4098,27 @@ export declare interface ValidationError {
3933
4098
  * @internal
3934
4099
  */
3935
4100
  export declare interface ValidationErrorClass {
3936
- new (message: string, options?: ValidationErrorOptions): ValidationError
4101
+ new (message: string, options?: ValidationErrorOptions): ValidationError;
3937
4102
  }
3938
4103
 
3939
4104
  /** @internal */
3940
4105
  export declare interface ValidationErrorOptions {
3941
- paths?: Path[]
3942
- children?: ValidationMarker[]
3943
- operation?: 'AND' | 'OR'
4106
+ paths?: Path[];
4107
+ children?: ValidationMarker[];
4108
+ operation?: "AND" | "OR";
3944
4109
  }
3945
4110
 
3946
4111
  /** @public */
3947
4112
  export declare interface ValidationMarker {
3948
- level: 'error' | 'warning' | 'info'
4113
+ level: "error" | "warning" | "info";
3949
4114
  /**
3950
4115
  * The validation message for this marker. E.g. "Must be greater than 0"
3951
4116
  */
3952
- message: string
4117
+ message: string;
3953
4118
  /**
3954
4119
  * @deprecated use `message` instead
3955
4120
  */
3956
- item?: ValidationError
4121
+ item?: ValidationError;
3957
4122
  /**
3958
4123
  * The sanity path _relative to the root of the current document_ to this
3959
4124
  * marker.
@@ -3961,14 +4126,14 @@ export declare interface ValidationMarker {
3961
4126
  * NOTE: Sanity paths may contain keyed segments (i.e. `{_key: string}`) that
3962
4127
  * are not compatible with deep getters like lodash/get
3963
4128
  */
3964
- path: Path
4129
+ path: Path;
3965
4130
  /**
3966
4131
  * Extra metadata for the validation marker. Currently used by the Media Library asset source to ignore
3967
4132
  * certain validation markers when validating asset source media library assets.
3968
4133
  *
3969
4134
  * @internal
3970
4135
  */
3971
- __internal_metadata?: unknown
4136
+ __internal_metadata?: unknown;
3972
4137
  }
3973
4138
 
3974
4139
  /**
@@ -3990,7 +4155,7 @@ export declare type Validator<T = any, Value = any> = (
3990
4155
  | ValidationError
3991
4156
  | string
3992
4157
  | true
3993
- | Promise<ValidationError[] | ValidationError | string | true>
4158
+ | Promise<ValidationError[] | ValidationError | string | true>;
3994
4159
 
3995
4160
  /**
3996
4161
  * A type helper used to define a group of validators. The type of the
@@ -4012,45 +4177,45 @@ export declare type Validator<T = any, Value = any> = (
4012
4177
  * @internal
4013
4178
  */
4014
4179
  export declare type Validators = Partial<{
4015
- [P in RuleSpec['flag']]: Validator<
4180
+ [P in RuleSpec["flag"]]: Validator<
4016
4181
  Exclude<
4017
4182
  ConditionalIndexAccess<
4018
4183
  Extract<
4019
4184
  RuleSpec,
4020
4185
  {
4021
- flag: P
4186
+ flag: P;
4022
4187
  }
4023
4188
  >,
4024
- 'constraint'
4189
+ "constraint"
4025
4190
  >,
4026
4191
  FieldReference
4027
4192
  >
4028
- >
4029
- }>
4193
+ >;
4194
+ }>;
4030
4195
 
4031
4196
  /** @beta */
4032
4197
  export declare interface WeakCrossDatasetReferenceValue extends CrossDatasetReferenceValue {
4033
- _weak: true
4198
+ _weak: true;
4034
4199
  }
4035
4200
 
4036
4201
  /** @beta */
4037
4202
  export declare interface WeakGlobalDocumentReferenceValue extends GlobalDocumentReferenceValue {
4038
- _weak: true
4203
+ _weak: true;
4039
4204
  }
4040
4205
 
4041
4206
  /** @internal */
4042
4207
  export declare interface WeakReference extends Reference {
4043
- _weak: true
4208
+ _weak: true;
4044
4209
  }
4045
4210
 
4046
4211
  /** @beta */
4047
4212
  export declare interface WidenInitialValue {
4048
- initialValue?: InitialValueProperty<any, any>
4213
+ initialValue?: InitialValueProperty<any, any>;
4049
4214
  }
4050
4215
 
4051
4216
  /** @beta */
4052
4217
  export declare interface WidenValidation {
4053
- validation?: SchemaValidationValue
4218
+ validation?: SchemaValidationValue;
4054
4219
  }
4055
4220
 
4056
- export {}
4221
+ export {};