import { ComponentType, ElementType, ReactNode } from "react"; import { ClientPerspective, SanityClient, StackablePerspective } from "@sanity/client"; import { Asset as Asset$1, AssetInstanceDocument } from "@sanity/media-library-types"; /** @public */ interface SanityDocument { _id: string; _type: string; _createdAt: string; _updatedAt: string; _rev: string; [key: string]: unknown; } /** * Similar to `SanityDocument` but only requires the `_id` and `_type` * * @see SanityDocument * * @public */ interface SanityDocumentLike { _id: string; _type: string; _createdAt?: string; _updatedAt?: string; _rev?: string; _system?: { delete?: boolean; }; [key: string]: unknown; } /** @public */ interface TypedObject { [key: string]: unknown; _type: string; } /** @public */ interface KeyedObject { [key: string]: unknown; _key: string; } /** * @internal */ interface StrictVersionLayeringOptions { /** * By default, version layering includes all document versions, regardless of their expected * publication time—or lack thereof. For example, it includes all ASAP and undecided versions, * despite ASAP and undecided versions having no fixed chronology. There is no way to determine * which ASAP or undecided version is expected to be published before another. * * It also includes any existing draft, which has no fixed chronology, either. * * This functionality is useful for listing all document versions in a deterministic order, but * doesn't accurately portray the upstream and downstream versions based on expected publication * time. * * In strict mode, version layering instead only includes versions that have a fixed chronology. * **Cross-version layering is only effective for scheduled versions, with all other * versions being layered directly onto the published version (if it exists).** */ strict?: boolean; } /** @public */ declare function isSanityDocument(document: unknown): document is SanityDocument; /** @public */ declare function isTypedObject(obj: unknown): obj is TypedObject; /** @public */ declare function isKeyedObject(obj: unknown): obj is KeyedObject; /** @public */ type KeyedSegment = { _key: string; }; /** @public */ type IndexTuple = [number | '', number | '']; /** @public */ type PathSegment = string | number | KeyedSegment | IndexTuple; /** @public */ type Path = PathSegment[]; /** @internal */ declare function isIndexSegment(segment: PathSegment): segment is number; /** @internal */ declare function isKeySegment(segment: PathSegment): segment is KeyedSegment; /** @internal */ declare function isIndexTuple(segment: PathSegment): segment is IndexTuple; /** @beta */ interface CrossDatasetReferenceValue { _type: string; _dataset: string; _projectId: string; _ref: string; _key?: string; _weak?: boolean; } /** @beta */ interface WeakCrossDatasetReferenceValue extends CrossDatasetReferenceValue { _weak: true; } /** @beta */ type CrossDatasetReferenceFilterSearchOptions = { filter?: string; params?: Record; tag?: string; }; /** @beta */ type CrossDatasetReferenceFilterResolver = (options: { document: SanityDocument; parent?: Record | Record[]; parentPath: Path; }) => CrossDatasetReferenceFilterSearchOptions | Promise; /** @beta */ interface CrossDatasetType { type: string; title?: string; icon: ComponentType; preview: PreviewConfig; /** @deprecated Unused. Configuring search is no longer supported for cross-dataset references. */ __experimental_search?: ObjectSchemaType['__experimental_search']; } /** @beta */ interface CrossDatasetReferenceSchemaType extends Omit { jsonType: 'object'; to: CrossDatasetType[]; dataset: string; studioUrl?: (document: { id: string; type?: string; }) => string | null; weak?: boolean; options?: ReferenceFilterOptions; } /** @beta */ declare function isCrossDatasetReference(reference: unknown): reference is CrossDatasetReferenceValue; /** @public */ interface Role { name: string; title: string; description?: string; } /** @public */ interface CurrentUser { id: string; name: string; email: string; profileImage?: string; provider?: string; /** @deprecated use `roles` instead */ role: string; roles: Role[]; } /** @public */ interface User { id: string; displayName?: string; imageUrl?: string; email?: string; } /** @public */ interface ValidationMarker { level: 'error' | 'warning' | 'info'; /** * The validation message for this marker. E.g. "Must be greater than 0" */ message: string; /** * @deprecated use `message` instead */ item?: ValidationError; /** * The sanity path _relative to the root of the current document_ to this * marker. * * NOTE: Sanity paths may contain keyed segments (i.e. `{_key: string}`) that * are not compatible with deep getters like lodash/get */ path: Path; /** * Extra metadata for the validation marker. Currently used by the Media Library asset source to ignore * certain validation markers when validating asset source media library assets. * * @internal */ __internal_metadata?: unknown; } /** @internal */ declare function isValidationErrorMarker(marker: ValidationMarker): marker is ValidationMarker & { level: 'error'; }; /** @internal */ declare function isValidationWarningMarker(marker: ValidationMarker): marker is ValidationMarker & { level: 'warning'; }; /** @internal */ declare function isValidationInfoMarker(marker: ValidationMarker): marker is ValidationMarker & { level: 'info'; }; /** * A slug object, currently holding a `current` property * * In the future, this may be extended with a `history` property * * @public */ interface Slug { _type: 'slug'; current: string; } /** @public */ type SlugParent = Record | Record[]; /** @public */ interface SlugSourceContext { parentPath: Path; parent: SlugParent; projectId: string; dataset: string; schema: Schema; currentUser: CurrentUser | null; getClient: (options: { apiVersion: string; }) => SanityClient; } /** @public */ type SlugSourceFn = (document: SanityDocument, context: SlugSourceContext) => string | Promise; /** @public */ type SlugifierFn = (source: string, schemaType: SlugSchemaType, context: SlugSourceContext) => string | Promise; /** * Checks whether the given `thing` is a slug, eg an object with a `current` string property. * * @param thing - The thing to check * @returns True if slug, false otherwise * @public */ declare function isSlug(thing: unknown): thing is Slug; /** @public */ type RuleTypeConstraint = 'Array' | 'Boolean' | 'Date' | 'Number' | 'Object' | 'String'; /** @public */ type FieldRules = { [fieldKey: string]: SchemaValidationValue; }; /** * Holds localized validation messages for a given field. * * @example Custom message for English (US) and Norwegian (Bokmål): * ``` * { * 'en-US': 'Needs to start with a capital letter', * 'no-NB': 'Må starte med stor bokstav', * } * ``` * @public */ interface LocalizedValidationMessages { [locale: string]: string; } /** * Note: `RuleClass` and `Rule` are split to fit the current `@sanity/types` * setup. Classes are a bit weird in the `@sanity/types` package because classes * create an actual javascript class while simultaneously creating a type * definition. * * This implicitly creates two types: * 1. the instance type — `Rule` and * 2. the static/class type - `RuleClass` * * The `RuleClass` type contains the static methods and the `Rule` instance * contains the instance methods. Downstream in the validation package, the Rule * implementation asserts the class declaration is of this type. * * @internal */ interface RuleClass { FIELD_REF: symbol; array: (def?: SchemaType) => Rule; object: (def?: SchemaType) => Rule; string: (def?: SchemaType) => Rule; number: (def?: SchemaType) => Rule; boolean: (def?: SchemaType) => Rule; dateTime: (def?: SchemaType) => Rule; valueOfField: Rule['valueOfField']; new (typeDef?: SchemaType): Rule; } /** * Holds a reference to a different field * NOTE: Only use this through {@link Rule.valueOfField} * * @public */ interface FieldReference { type: symbol; path: string | string[]; } /** @public */ interface UriValidationOptions { scheme?: (string | RegExp) | Array; allowRelative?: boolean; relativeOnly?: boolean; allowCredentials?: boolean; } /** @public */ interface Rule { /** * @internal * @deprecated internal use only */ _type: RuleTypeConstraint | undefined; /** * @internal * @deprecated internal use only */ _level: 'error' | 'warning' | 'info' | undefined; /** * @internal * @deprecated internal use only */ _required: 'required' | 'optional' | undefined; /** * @internal * @deprecated internal use only */ _typeDef: SchemaType | undefined; /** * @internal * @deprecated internal use only */ _message: string | LocalizedValidationMessages | undefined; /** * @internal * @deprecated internal use only */ _rules: RuleSpec[]; /** * @internal * @deprecated internal use only */ _fieldRules: FieldRules | undefined; /** * Takes in a path and returns an object with a symbol. * * When the validation lib sees this symbol, it will use the provided path to * get a value from the current field's parent and use that value as the input * to the Rule. * * The path that's given is forwarded to `lodash/get` * * ```js * fields: [ * // ... * { * // ... * name: 'highestTemperature', * type: 'number', * validation: (Rule) => Rule.positive().min(Rule.valueOfField('lowestTemperature')), * // ... * }, * ] * ``` */ valueOfField: (path: string | string[]) => FieldReference; error(message?: string | LocalizedValidationMessages): Rule; warning(message?: string | LocalizedValidationMessages): Rule; info(message?: string | LocalizedValidationMessages): Rule; reset(): this; isRequired(): boolean; clone(): Rule; cloneWithRules(rules: RuleSpec[]): Rule; merge(rule: Rule): Rule; type(targetType: RuleTypeConstraint | Lowercase): Rule; all(children: Rule[]): Rule; either(children: Rule[]): Rule; optional(): Rule; required(): Rule; skip(): Rule; custom(fn: CustomValidator, options?: { bypassConcurrencyLimit?: boolean; }): Rule; media(fn: MediaValidator): Rule; min(len: number | string | FieldReference): Rule; max(len: number | string | FieldReference): Rule; length(len: number | FieldReference): Rule; valid(value: unknown | unknown[]): Rule; integer(): Rule; precision(limit: number | FieldReference): Rule; positive(): Rule; negative(): Rule; greaterThan(num: number | FieldReference): Rule; lessThan(num: number | FieldReference): Rule; uppercase(): Rule; lowercase(): Rule; regex(pattern: RegExp, name: string, options: { name?: string; invert?: boolean; }): Rule; regex(pattern: RegExp, options: { name?: string; invert?: boolean; }): Rule; regex(pattern: RegExp, name: string): Rule; regex(pattern: RegExp): Rule; email(): Rule; uri(options?: UriValidationOptions): Rule; unique(): Rule; reference(): Rule; fields(rules: FieldRules): Rule; assetRequired(): Rule; validate(value: unknown, options: ValidationContext & { /** * @deprecated Internal use only * @internal */ __internal?: { customValidationConcurrencyLimiter?: { ready: () => Promise; release: () => void; }; }; }): Promise; } /** @public */ type RuleSpec = { flag: 'integer'; } | { flag: 'email'; } | { flag: 'unique'; } | { flag: 'reference'; } | { flag: 'type'; constraint: RuleTypeConstraint; } | { flag: 'all'; constraint: Rule[]; } | { flag: 'either'; constraint: Rule[]; } | { flag: 'presence'; constraint: 'optional' | 'required'; } | { flag: 'custom'; constraint: CustomValidator; } | { flag: 'min'; constraint: number | string | FieldReference; } | { flag: 'max'; constraint: number | string | FieldReference; } | { flag: 'length'; constraint: number | FieldReference; } | { flag: 'valid'; constraint: unknown[]; } | { flag: 'precision'; constraint: number | FieldReference; } | { flag: 'lessThan'; constraint: number | FieldReference; } | { flag: 'greaterThan'; constraint: number | FieldReference; } | { flag: 'stringCasing'; constraint: 'uppercase' | 'lowercase'; } | { flag: 'assetRequired'; constraint: { assetType: 'asset' | 'image' | 'file'; }; } | { flag: 'media'; constraint: MediaValidator; } | { flag: 'regex'; constraint: { pattern: RegExp; name?: string; invert: boolean; }; } | { flag: 'uri'; constraint: { options: { scheme: RegExp[]; allowRelative: boolean; relativeOnly: boolean; allowCredentials: boolean; }; }; }; /** * this is used to get allow index access (e.g. `RuleSpec['constraint']`) to * constraint when a rule spec might not have a `constraint` prop * * @internal */ type ConditionalIndexAccess = U extends keyof T ? T[U] : undefined; /** @internal */ type RuleSpecConstraint = ConditionalIndexAccess, 'constraint'>; /** * A context object passed around during validation. This includes the * `Rule.custom` context. * * e.g. * * ```js * Rule.custom((_, validationContext) => { * // ... * })` * ``` * * @public */ interface ValidationContext { getClient: (options: { apiVersion: string; }) => SanityClient; schema: Schema; parent?: unknown; type?: SchemaType; document?: SanityDocument; path?: Path; getDocumentExists?: (options: { id: string; }) => Promise; environment: 'cli' | 'studio'; /** * Whether this field is hidden for any reason (either itself or any of its ancestors). */ hidden?: boolean; } /** * The base type for all validators in the validation library. Takes in a * `RuleSpec`'s constraint, the value to check, an optional override message, * and the validation context. * * @see Rule.validate from `sanity/src/core/validation/Rule` * * @internal */ type Validator = (constraint: T, value: Value, message: string | undefined, context: ValidationContext) => ValidationError[] | ValidationError | string | true | Promise; /** * A type helper used to define a group of validators. The type of the * `RuleSpec` constraint is inferred via the key. * * E.g. * * ```ts * const booleanValidators: Validators = { * ...genericValidator, * * presence: (v, value, message) => { * if (v === 'required' && typeof value !== 'boolean') return message || 'Required' * return true * }, * } * ``` * * @internal */ type Validators = Partial<{ [P in RuleSpec['flag']]: Validator, 'constraint'>, FieldReference>> }>; /** @internal */ interface ValidationErrorOptions { paths?: Path[]; children?: ValidationMarker[]; operation?: 'AND' | 'OR'; } /** * This follows the same pattern as `RuleClass` and `Rule` above * Note: this class does not actually extend `Error` since it's never thrown * within the validation library * * @deprecated It is preferred to a plain object that adheres to `ValidationError` * @internal */ interface ValidationErrorClass { new (message: string, options?: ValidationErrorOptions): ValidationError; } /** * The shape that can be returned from a custom validator to be converted into * a validation marker by the validation logic. Inside of a custom validator, * you can return an array of these in order to specify multiple paths within * an object or array. * * @public */ interface ValidationError { /** * The message describing why the value is not valid. This message will be * included in the validation markers after validation has finished running. */ message: string; /** * If writing a custom validator, you can return validation messages to * specific path inside of the current value (object or array) by populating * this `path` prop. * * NOTE: This path is relative to the current value and _not_ relative to * the document. */ path?: Path; /** * Extra metadata for the validation error. Currently used by the Media Library asset source to ignore * certain validation markers when validating asset source media library assets. * * @internal */ __internal_metadata?: unknown; /** * Same as `path` but allows more than one value. If provided, the same * message will create two markers from each path with the same message * provided. * * @deprecated prefer `path` */ paths?: Path[]; /** * @deprecated Unused. Was used to store the results from `.either()` /`.all()` */ children?: ValidationMarker[]; /** * @deprecated Unused. Was used to signal if this error came from an `.either()`/`.all()`. */ operation?: 'AND' | 'OR'; /** * @deprecated Unused. Was relevant when validation error was used as a class. */ cloneWithMessage?(message: string): ValidationError; } /** @public */ type CustomValidatorResult = true | string | ValidationError | ValidationError[] | LocalizedValidationMessages; /** @public */ interface CustomValidator { (value: T, context: ValidationContext): CustomValidatorResult | Promise; bypassConcurrencyLimit?: boolean; } /** @public */ type MediaAssetTypes = AssetInstanceDocument['_type']; /** @public */ interface MediaValidator { (value: MediaValidationValue, context: ValidationContext): CustomValidatorResult | Promise; } /** @public */ interface MediaValidationValue { /** * Media information */ media: { /** * The Media Library Asset. */ asset: Asset$1 & { currentVersion: Extract; }; }; /** * The field value which the media is used in. */ value: unknown; } /** @public */ interface SlugValidationContext extends ValidationContext { parent: SlugParent; type: SlugSchemaType; defaultIsUnique: SlugIsUniqueValidator; } /** @public */ type SlugIsUniqueValidator = (slug: string, context: SlugValidationContext) => boolean | Promise; /** @public */ interface FormNodeValidation { level: 'error' | 'warning' | 'info'; message: string; path: Path; } /** @internal */ declare function isValidationError(node: FormNodeValidation): node is FormNodeValidation & { level: 'error'; }; /** @internal */ declare function isValidationWarning(node: FormNodeValidation): node is FormNodeValidation & { level: 'warning'; }; /** @internal */ declare function isValidationInfo(node: FormNodeValidation): node is FormNodeValidation & { level: 'info'; }; /** @alpha This API may change */ declare interface InsertMenuOptions { /** * @defaultValue `'auto'` * `filter: 'auto'` automatically turns on filtering if there are more than 5 * schema types added to the menu. */ filter?: "auto" | boolean | undefined; groups?: Array<{ name: string; title?: string; of?: Array; }> | undefined; /** defaultValue `true` */ showIcons?: boolean | undefined; /** @defaultValue `[{name: 'list'}]` */ views?: Array<{ name: "list"; } | { name: "grid"; previewImageUrl?: (schemaTypeName: string) => string | undefined; }> | undefined; } /** @public */ interface RuleDef { required: () => T; skip: () => T; custom: (fn: CustomValidator) => T; info: (message?: string | LocalizedValidationMessages) => T; error: (message?: string | LocalizedValidationMessages) => T; warning: (message?: string | LocalizedValidationMessages) => T; valueOfField: (path: string | string[]) => FieldReference; } /** @public */ type RuleBuilder, FieldValue = unknown> = T | T[]; /** @public */ type ValidationBuilder, FieldValue = unknown> = (rule: T, context?: ValidationContext) => RuleBuilder; /** @public */ interface ObjectOptions extends BaseSchemaTypeOptions { collapsible?: boolean; collapsed?: boolean; columns?: number; modal?: { type?: 'dialog' | 'popover'; width?: number | number[] | 'auto'; }; } /** @public */ interface ObjectRule extends RuleDef> {} /** @public */ interface ObjectDefinition extends BaseSchemaDefinition { type: 'object'; /** * Object must have at least one field. This is validated at Studio startup. */ fields: FieldDefinition[]; groups?: FieldGroupDefinition[]; fieldsets?: FieldsetDefinition[]; preview?: PreviewConfig; options?: ObjectOptions; validation?: ValidationBuilder>; initialValue?: InitialValueProperty>; } /** @public */ interface FieldsetDefinition { name: string; title?: string; description?: string; group?: string; hidden?: ConditionalProperty; readOnly?: ConditionalProperty; options?: ObjectOptions; } /** @public */ type FieldGroupDefinition = { name: string; title?: string; hidden?: ConditionalProperty; icon?: ComponentType; default?: boolean; i18n?: I18nTextRecord<'title'>; }; /** * Options for configuring how Sanity Create interfaces with the type or field. * * @public */ interface SanityCreateOptions { /** Set to true to exclude a type or field from appearing in Sanity Create */ exclude?: boolean; /** * A short description of what the type or field is used for. * Purpose can be used to improve how and when content mapping uses the field. * */ purpose?: string; } /** * Options for configuring how Canvas app interfaces with the type or field. * * @public */ interface CanvasAppOptions { /** Set to true to exclude a type or field from appearing in Canvas */ exclude?: boolean; /** * A short description of what the type or field is used for. * Purpose can be used to improve how and when content mapping uses the field. * */ purpose?: string; } /** * `BaseOptions` applies to all type options. * * It can be extended by interface declaration merging in plugins to provide generic options to all types and fields. * * @public * */ interface BaseSchemaTypeOptions { sanityCreate?: SanityCreateOptions; canvasApp?: CanvasAppOptions; } /** @public */ interface BaseSchemaDefinition { name: string; title?: string; description?: string | React.JSX.Element; hidden?: ConditionalProperty; readOnly?: ConditionalProperty; icon?: ComponentType | ReactNode; validation?: unknown; initialValue?: unknown; deprecated?: DeprecatedProperty; } /** @public */ interface TitledListValue { _key?: string; title: string; value?: V; } /** @public */ interface I18nTitledListValue { _key?: string; title: string; i18nTitleKey?: string; value?: V; } /** @public */ interface EnumListProps { list?: Array | V>; layout?: 'radio' | 'dropdown'; direction?: 'horizontal' | 'vertical'; } /** @public */ interface SearchConfiguration { search?: { /** * Defines a search weight for this field to prioritize its importance * during search operations in the Studio. This setting allows the specified * field to be ranked higher in search results compared to other fields. * * By default, all fields are assigned a weight of 1. However, if a field is * chosen as the `title` in the preview configuration's `select` option, it * will automatically receive a default weight of 10. Similarly, if selected * as the `subtitle`, the default weight is 5. Fields marked as * `hidden: true` (no function) are assigned a weight of 0 by default. * * Note: Search weight configuration is currently supported only for fields * of type string or portable text arrays. */ weight?: number; }; } /** * Types of array actions that can be performed * @beta */ type ArrayActionName = /** * Add any item to the array at any position */ 'add' /** * Add item after an existing item */ | 'addBefore' /** * Add item after an existing item */ | 'addAfter' /** * Remove any item */ | 'remove' /** * Duplicate item */ | 'duplicate' /** * Copy item */ | 'copy'; /** @public */ interface ArrayOptions extends SearchConfiguration, BaseSchemaTypeOptions { list?: TitledListValue[] | V[]; layout?: 'list' | 'tags' | 'grid'; /** @deprecated This option does not have any effect anymore */ direction?: 'horizontal' | 'vertical'; sortable?: boolean; modal?: { type?: 'dialog' | 'popover'; width?: number | 'auto'; }; /** @alpha This API may change */ insertMenu?: InsertMenuOptions; /** * A boolean flag to enable or disable tree editing for the array. * If there are any nested arrays, they will inherit this value. * @deprecated tree editing beta feature has been disabled */ treeEditing?: boolean; /** * A list of array actions to disable * Possible options are defined by {@link ArrayActionName} * @beta */ disableActions?: ArrayActionName[]; } /** @public */ interface ArrayRule extends RuleDef, Value> { min: (length: number | FieldReference) => ArrayRule; max: (length: number | FieldReference) => ArrayRule; length: (length: number | FieldReference) => ArrayRule; unique: () => ArrayRule; } /** @public */ type ArrayOfEntry = Omit & { name?: string; }; /** @public */ type IntrinsicArrayOfDefinition = { [K in keyof IntrinsicDefinitions]: Omit, 'validation' | 'initialValue'> & { validation?: SchemaValidationValue; initialValue?: InitialValueProperty; } }; /** @public */ type ArrayOfType = IntrinsicArrayOfDefinition[TType] | ArrayOfEntry>; /** @public */ interface ArrayDefinition extends BaseSchemaDefinition { type: 'array'; of: ArrayOfType[]; initialValue?: InitialValueProperty; validation?: ValidationBuilder, unknown[]>; options?: ArrayOptions; } /** @public */ type PortableTextBlock = PortableTextTextBlock | PortableTextObject; /** @public */ interface PortableTextTextBlock { _type: string; _key: string; children: TChild[]; markDefs?: PortableTextObject[]; listItem?: string; style?: string; level?: number; } /** @public */ interface PortableTextObject { _type: string; _key: string; [other: string]: unknown; } /** @public */ interface PortableTextSpan { _key: string; _type: 'span'; text: string; marks?: string[]; } /** @public */ type PortableTextChild = PortableTextObject | PortableTextSpan; /** @public */ interface PortableTextListBlock extends PortableTextTextBlock { listItem: string; level: number; } /** * Assert that a given object is a portable-text text-block type object * * @remarks * * The `markDefs` and `style` property of a block is optional. * * Block types can be named, so expect anything of the _type property. * * @alpha */ declare function isPortableTextTextBlock(value: unknown): value is PortableTextTextBlock; /** * Assert that a given object is a portable-text span-type object * * @remarks * The `marks` property of a block is optional. * * @alpha */ declare function isPortableTextSpan(value: unknown): value is PortableTextSpan; /** * Assert that a given object is a portable-text list-text-block-type object * * @remarks * Uses `isPortableTextTextBlock` and checks for `listItem` and `level` * * @see isPortableTextTextBlock * * @alpha */ declare function isPortableTextListBlock(value: unknown): value is PortableTextTextBlock; /** * Schema options for a Block schema definition * @public */ interface BlockOptions extends BaseSchemaTypeOptions { /** * Turn on or off the builtin browser spellchecking. Default is on. */ spellCheck?: boolean; unstable_whitespaceOnPasteMode?: 'preserve' | 'normalize' | 'remove'; /** * When enabled, the editor will restrict all line breaks and soft breaks, * forcing content to remain on a single line. This will also update * the styling of the editor to reflect the single-line constraint. * * Pasting content that is on multiple lines will be normalized to a single line, if possible. * * @defaultValue false */ oneLine?: boolean; } /** @public */ interface BlockRule extends RuleDef {} /** * Schema definition for text block decorators. * * @public * @example The default set of decorators * ```ts * { * name: 'blockContent', * title: 'Content', * type: 'array', * of: [ * { * type: 'block', * marks: { * decorators: [ * {title: 'Strong', value: 'strong'}, * {title: 'Emphasis', value: 'em'}, * {title: 'Underline', value: 'underline'}, * {title: 'Strike', value: 'strike-through'}, * {title: 'Code', value: 'code'}, * ] * } * } * ] * } * ``` */ interface BlockDecoratorDefinition { title: string; i18nTitleKey?: string; value: string; icon?: ReactNode | ComponentType; } /** * Schema definition for a text block style. * A text block may have a block style like 'header', 'normal', 'lead' * attached to it, which is stored on the `.style` property for that block. * * @public * @remarks The first defined style will become the default style.´´ * @example The default set of styles * ```ts * { * name: 'blockContent', * title: 'Content', * type: 'array', * of: [ * { * type: 'block', * styles: [ * {title: 'Normal', value: 'normal'}, * {title: 'H1', value: 'h1'}, * {title: 'H2', value: 'h2'}, * {title: 'H3', value: 'h3'}, * {title: 'H4', value: 'h4'}, * {title: 'H5', value: 'h5'}, * {title: 'H6', value: 'h6'}, * {title: 'Quote', value: 'blockquote'} * ] * } * ] * } * ``` * @example Example of defining a block type with custom styles and render components. * ```ts * defineArrayMember({ * type: 'block', * styles: [ * { * title: 'Paragraph', * value: 'paragraph', * component: ParagraphStyle, * }, * { * title: 'Lead', * value: 'lead', * component: LeadStyle, * }, * { * title: 'Heading', * value: 'heading', * component: HeadingStyle, * }, * ], * }) * ``` */ interface BlockStyleDefinition { title: string; value: string; i18nTitleKey?: string; icon?: ReactNode | ComponentType; } /** * Schema definition for a text block list style. * * @public * @example The defaults lists * ```ts * { * name: 'blockContent', * title: 'Content', * type: 'array', * of: [ * { * type: 'block', * lists: [ * {title: 'Bullet', value: 'bullet'}, * {title: 'Number', value: 'number'}, * ] * } * ] * } * ``` */ interface BlockListDefinition { title: string; i18nTitleKey?: string; value: string; icon?: ReactNode | ComponentType; } /** * Schema definition for a text block annotation object. * * @public * @example The default link annotation * ```ts * { * name: 'blockContent', * title: 'Content', * type: 'array', * of: [ * { * type: 'block', * marks: { * annotations: [ * { * type: 'object', * name: 'link', * fields: [ * { * type: 'string', * name: 'href', * }, * ], * }, * ] * }, * } * ] * } * ``` */ interface BlockAnnotationDefinition extends ObjectDefinition { icon?: ReactNode | ComponentType; } /** * Schema definition for text block marks (decorators and annotations). * * @public */ interface BlockMarksDefinition { decorators?: BlockDecoratorDefinition[]; annotations?: ArrayOfType<'object' | 'reference'>[]; } /** * Schema definition for text blocks. * * @public * @example the default block definition * ```ts * { * name: 'blockContent', * title: 'Content', * type: 'array', * of: [ * { * type: 'block', * marks: { * decorators: [ * {title: 'Strong', value: 'strong'}, * {title: 'Emphasis', value: 'em'}, * {title: 'Underline', value: 'underline'}, * {title: 'Strike', value: 'strike-through'}, * {title: 'Code', value: 'code'}, * ], * annotations: [ * { * type: 'object', * name: 'link', * fields: [ * { * type: 'string', * name: 'href', * }, * ], * }, * ] * }, * styles: [ * {title: 'Normal', value: 'normal'}, * {title: 'H1', value: 'h1'}, * {title: 'H2', value: 'h2'}, * {title: 'H3', value: 'h3'}, * {title: 'H4', value: 'h4'}, * {title: 'H5', value: 'h5'}, * {title: 'H6', value: 'h6'}, * {title: 'Quote', value: 'blockquote'} * ], * lists: [ * {title: 'Bullet', value: 'bullet'}, * {title: 'Number', value: 'number'}, * ], * }, * ] * } * ``` */ interface BlockDefinition extends BaseSchemaDefinition { type: 'block'; styles?: BlockStyleDefinition[]; lists?: BlockListDefinition[]; marks?: BlockMarksDefinition; of?: ArrayOfType<'object' | 'reference'>[]; /** Block types do not support initialValue - the runtime schema validation rejects it. */ initialValue?: never; options?: BlockOptions; validation?: ValidationBuilder; } /** @public */ interface BooleanOptions extends BaseSchemaTypeOptions { layout?: 'switch' | 'checkbox'; } /** @public */ interface BooleanRule extends RuleDef {} /** @public */ interface BooleanDefinition extends BaseSchemaDefinition { type: 'boolean'; options?: BooleanOptions; initialValue?: InitialValueProperty; validation?: ValidationBuilder; } /** @public */ type ReferenceValue = Reference; /** @public */ interface ReferenceRule extends RuleDef {} /** @public */ type ReferenceTo = SchemaTypeDefinition | TypeReference | Array; /** * Types are closed for extension. To add properties via declaration merging to this type, * redeclare and add the properties to the interfaces that make up ReferenceOptions type. * * @see ReferenceFilterOptions * @see ReferenceFilterResolverOptions * @see ReferenceBaseOptions * * @public */ type ReferenceOptions = ReferenceBaseOptions & ReferenceFilterOptions; /** @public */ interface ReferenceDefinition extends BaseSchemaDefinition { type: 'reference'; to: ReferenceTo; weak?: boolean; options?: ReferenceOptions; validation?: ValidationBuilder; initialValue?: InitialValueProperty>; } /** @public */ interface CrossDatasetReferenceDefinition extends BaseSchemaDefinition { type: 'crossDatasetReference'; weak?: boolean; to: { type: string; title?: string; icon?: ComponentType; preview?: PreviewConfig; /** * @deprecated Unused. Configuring search is no longer supported. */ __experimental_search?: { path: string | string[]; weight?: number; mapWith?: string; }[]; }[]; dataset: string; studioUrl?: (document: { id: string; type?: string; }) => string | null; tokenId?: string; options?: ReferenceOptions; /** * @deprecated Cross-project references are no longer supported, only cross-dataset */ projectId?: string; } /** @public */ interface DateOptions extends BaseSchemaTypeOptions { dateFormat?: string; } /** @public */ interface DateRule extends RuleDef { /** * @param minDate - Minimum date (inclusive). minDate should be in ISO 8601 format. */ min: (minDate: string | FieldReference) => DateRule; /** * @param maxDate - Maximum date (inclusive). maxDate should be in ISO 8601 format. */ max: (maxDate: string | FieldReference) => DateRule; } /** @public */ interface DateDefinition extends BaseSchemaDefinition { type: 'date'; options?: DateOptions; placeholder?: string; validation?: ValidationBuilder; initialValue?: InitialValueProperty; } /** @public */ interface DatetimeOptions extends BaseSchemaTypeOptions { dateFormat?: string; timeFormat?: string; timeStep?: number; displayTimeZone?: string; allowTimeZoneSwitch?: boolean; } /** @public */ interface DatetimeRule extends RuleDef { /** * @param minDate - Minimum date (inclusive). minDate should be in ISO 8601 format. */ min: (minDate: string | FieldReference) => DatetimeRule; /** * @param maxDate - Maximum date (inclusive). maxDate should be in ISO 8601 format. */ max: (maxDate: string | FieldReference) => DatetimeRule; } /** @public */ interface DatetimeDefinition extends BaseSchemaDefinition { type: 'datetime'; options?: DatetimeOptions; placeholder?: string; validation?: ValidationBuilder; initialValue?: InitialValueProperty; } /** * This exists only to allow for extensions using declaration-merging. * * @public */ interface DocumentOptions extends BaseSchemaTypeOptions {} /** @public */ interface DocumentRule extends RuleDef {} /** @public */ interface DocumentDefinition extends Omit { type: 'document'; liveEdit?: boolean; /** @beta */ orderings?: SortOrdering[]; options?: DocumentOptions; validation?: ValidationBuilder; initialValue?: InitialValueProperty>; /** @deprecated Unused. Use the new field-level search config. */ __experimental_search?: { path: string; weight: number; mapWith?: string; }[]; /** @alpha */ __experimental_omnisearch_visibility?: boolean; /** * Determines whether the large preview title is displayed in the document pane form * @alpha * */ __experimental_formPreviewTitle?: boolean; } /** @public */ interface EmailRule extends RuleDef {} /** @public */ interface EmailOptions extends BaseSchemaTypeOptions {} /** @public */ interface EmailDefinition extends BaseSchemaDefinition { type: 'email'; options?: EmailOptions; placeholder?: string; validation?: ValidationBuilder; initialValue?: InitialValueProperty; } /** @public */ interface MediaLibraryFilter { name: string; query: string; } /** @public */ interface MediaLibraryOptions { filters?: MediaLibraryFilter[]; } /** @public */ interface FileOptions extends ObjectOptions { storeOriginalFilename?: boolean; accept?: string; sources?: AssetSource[]; mediaLibrary?: MediaLibraryOptions; /** * When set to `true`, hides the upload UI, only allowing selection of existing assets from the media library. * Useful for centralized asset management workflows where ad-hoc uploads should be prevented. */ disableNew?: boolean; } /** @public */ interface FileRule extends RuleDef { /** * Require a file field has an asset. * * @example * ```ts * defineField({ * name: 'file', * title: 'File', * type: 'file', * validation: (Rule) => Rule.required().assetRequired(), * }) * ``` */ assetRequired(): FileRule; } /** @public */ interface FileValue { asset?: Reference; [index: string]: unknown; } /** @public */ interface FileDefinition extends Omit { type: 'file'; fields?: ObjectDefinition['fields']; options?: FileOptions; validation?: ValidationBuilder; initialValue?: InitialValueProperty; } /** * Geographical point representing a pair of latitude and longitude coordinates, * stored as degrees, in the World Geodetic System 1984 (WGS 84) format. Also * includes an optional `alt` property representing the altitude in meters. * * @public */ interface GeopointValue { /** * Type of the object. Must be `geopoint`. */ _type: 'geopoint'; /** * Latitude in degrees */ lat: number; /** * Longitude in degrees */ lng: number; /** * Altitude in meters */ alt?: number; } /** @public */ interface GeopointRule extends RuleDef {} /** @public */ interface GeopointOptions extends BaseSchemaTypeOptions {} /** @public */ interface GeopointDefinition extends BaseSchemaDefinition { type: 'geopoint'; options?: GeopointOptions; validation?: ValidationBuilder; initialValue?: InitialValueProperty>; } /** @public */ interface GlobalDocumentReferenceDefinition extends BaseSchemaDefinition { type: 'globalDocumentReference'; weak?: boolean; to: { type: string; title?: string; icon?: ComponentType; preview?: PreviewConfig; }[]; resourceType: string; resourceId: string; options?: ReferenceOptions; studioUrl?: string | ((document: { id: string; type?: string; }) => string | null); } /** @public */ type ImageMetadataType = 'blurhash' | 'thumbhash' | 'lqip' | 'palette' | 'exif' | 'image' | 'location'; /** @public */ interface HotspotPreview { title: string; aspectRatio: number; } /** @public */ interface HotspotOptions { previews?: HotspotPreview[]; } /** @public */ interface ImageOptions extends FileOptions { metadata?: ImageMetadataType[]; hotspot?: boolean | HotspotOptions; } /** @public */ interface ImageValue extends FileValue { crop?: ImageCrop; hotspot?: ImageHotspot; [index: string]: unknown; } /** @public */ interface ImageRule extends RuleDef { /** * Require an image field has an asset. * * @example * ```ts * defineField({ * name: 'image', * title: 'Image', * type: 'image', * validation: (Rule) => Rule.required().assetRequired(), * }) * ``` */ assetRequired(): ImageRule; } /** @public */ interface ImageDefinition extends Omit { type: 'image'; fields?: FieldDefinition[]; options?: ImageOptions; validation?: ValidationBuilder; initialValue?: InitialValueProperty; } /** @public */ interface NumberOptions extends EnumListProps, BaseSchemaTypeOptions {} /** @public */ interface NumberRule extends RuleDef { min: (minNumber: number | FieldReference) => NumberRule; max: (maxNumber: number | FieldReference) => NumberRule; lessThan: (limit: number | FieldReference) => NumberRule; greaterThan: (limit: number | FieldReference) => NumberRule; integer: () => NumberRule; precision: (limit: number | FieldReference) => NumberRule; positive: () => NumberRule; negative: () => NumberRule; } /** @public */ interface NumberDefinition extends BaseSchemaDefinition { type: 'number'; options?: NumberOptions; placeholder?: string; validation?: ValidationBuilder; initialValue?: InitialValueProperty; } /** @public */ interface SlugValue { _type: 'slug'; current?: string; } /** @public */ interface SlugRule extends RuleDef {} /** @public */ interface SlugOptions extends SearchConfiguration, BaseSchemaTypeOptions { source?: string | Path | SlugSourceFn; maxLength?: number; slugify?: SlugifierFn; isUnique?: SlugIsUniqueValidator; disableArrayWarning?: boolean; } /** @public */ interface SlugDefinition extends BaseSchemaDefinition { type: 'slug'; options?: SlugOptions; validation?: ValidationBuilder; initialValue?: InitialValueProperty>; } /** @public */ interface StringOptions extends EnumListProps, SearchConfiguration, BaseSchemaTypeOptions {} /** @public */ interface StringRule extends RuleDef { min: (minNumber: number | FieldReference) => StringRule; max: (maxNumber: number | FieldReference) => StringRule; length: (exactLength: number | FieldReference) => StringRule; uppercase: () => StringRule; lowercase: () => StringRule; regex(pattern: RegExp, name: string, options: { name?: string; invert?: boolean; }): StringRule; regex(pattern: RegExp, options: { name?: string; invert?: boolean; }): StringRule; regex(pattern: RegExp, name: string): StringRule; regex(pattern: RegExp): StringRule; email(): StringRule; } /** @public */ interface StringDefinition extends BaseSchemaDefinition { type: 'string'; options?: StringOptions; placeholder?: string; validation?: ValidationBuilder; initialValue?: InitialValueProperty; } /** @public */ interface TextRule extends StringRule {} /** @public */ interface TextOptions extends StringOptions {} /** @public */ interface TextDefinition extends BaseSchemaDefinition { type: 'text'; rows?: number; options?: TextOptions; placeholder?: string; validation?: ValidationBuilder; initialValue?: InitialValueProperty; } /** @public */ interface UrlRule extends RuleDef { uri(options: UriValidationOptions): UrlRule; } /** @public */ interface UrlOptions extends BaseSchemaTypeOptions {} /** @public */ interface UrlDefinition extends BaseSchemaDefinition { type: 'url'; options?: UrlOptions; placeholder?: string; validation?: ValidationBuilder; initialValue?: InitialValueProperty; } /** @beta */ interface DefineSchemaOptions { /** * `strict: false` allows unknown properties in the schema. * Use this when adding customizations to the schema that are not part of sanity core. * * If you want to extend the Sanity Schema types with your own properties or options to make them typesafe, * you can use [TypeScript declaration merging](https://www.typescriptlang.org/docs/handbook/declaration-merging.html). * * See {@link defineType} for more. * * @see defineType */ strict?: TStrict; /** Should be provided when type is a non-intrinsic type, ie type is a type alias */ aliasFor?: TAlias extends IntrinsicTypeName ? TAlias : never; } /** @beta */ type IntrinsicBase = { [K in keyof IntrinsicDefinitions]: Omit }; /** @beta */ type IntrinsicArrayOfBase = { [K in keyof IntrinsicDefinitions]: Omit, 'preview'> }; /** @beta */ type DefineSchemaBase = TType extends IntrinsicTypeName ? IntrinsicBase[TType] : TypeAliasDefinition; /** @beta */ type DefineSchemaType = TType extends IntrinsicTypeName ? IntrinsicDefinitions[TType] : TypeAliasDefinition; /** @beta */ type DefineArrayMemberBase = TType extends IntrinsicTypeName ? IntrinsicArrayOfBase[TType] : ArrayOfEntry>; /** @beta */ type StrictDefinition = boolean | undefined; /** @beta */ type MaybeAllowUnknownProps = TStrict extends false ? { options?: { [index: string]: any; }; [index: string]: any; } : unknown; /** @beta */ type MaybePreview = Record, PrepareValue extends Record = Record> { select?: Select; prepare?: (value: PrepareValue, viewOptions?: PrepareViewOptions) => PreviewValue; } /** * `IntrinsicDefinitions` is a lookup map for "predefined" schema definitions. * Schema types in `IntrinsicDefinitions` will have good type-completion and type-safety in {@link defineType}, * {@link defineField} and {@link defineArrayMember} once the `type` property is provided. * * By default, `IntrinsicDefinitions` contains all standard Sanity schema types (`array`, `string`, `number` ect), * but it is an interface and as such, open for extension. * * This type can be extended using declaration merging; this way new entries can be added. * See {@link defineType} for examples on how this can be accomplished. * * @see defineType * * @public */ interface IntrinsicDefinitions { array: ArrayDefinition; block: BlockDefinition; boolean: BooleanDefinition; date: DateDefinition; datetime: DatetimeDefinition; document: DocumentDefinition; file: FileDefinition; geopoint: GeopointDefinition; image: ImageDefinition; number: NumberDefinition; object: ObjectDefinition; reference: ReferenceDefinition; crossDatasetReference: CrossDatasetReferenceDefinition; globalDocumentReference: GlobalDocumentReferenceDefinition; slug: SlugDefinition; string: StringDefinition; text: TextDefinition; url: UrlDefinition; email: EmailDefinition; } /** * A union of all intrinsic types allowed natively in the schema. * * @see IntrinsicDefinitions * * @public */ type IntrinsicTypeName = IntrinsicDefinitions[keyof IntrinsicDefinitions]['type']; /** * Represents a Sanity schema type definition with an optional type parameter. * * It's recommend to use the `defineType` helper instead of this type by * itself. * * @see defineType * * @public */ type SchemaTypeDefinition = IntrinsicDefinitions[IntrinsicTypeName] | TypeAliasDefinition; /** * Represents a reference to another type registered top-level in your schema. * * @public */ interface TypeReference { type: string; name?: string; icon?: ComponentType | ReactNode; options?: { [key: string]: unknown; }; } /** * Represents a type definition that is an alias/extension of an existing type * in your schema. Creating a type alias will re-register that existing type * under a different name. You can also override the default type options with * a type alias definition. * * @public */ interface TypeAliasDefinition extends BaseSchemaDefinition { type: TType; options?: TAlias extends IntrinsicTypeName ? IntrinsicDefinitions[TAlias]['options'] : unknown; validation?: SchemaValidationValue; initialValue?: InitialValueProperty; preview?: PreviewConfig; components?: { annotation?: ComponentType; block?: ComponentType; inlineBlock?: ComponentType; diff?: ComponentType; field?: ComponentType; input?: ComponentType; item?: ComponentType; preview?: ComponentType; }; } /** @public */ interface FieldDefinitionBase { fieldset?: string; group?: string | string[]; } /** @public */ type InlineFieldDefinition = { [K in keyof IntrinsicDefinitions]: Omit & { validation?: SchemaValidationValue; initialValue?: InitialValueProperty; } }; /** * The shape of a field definition. Note, it's recommended to use the * `defineField` function instead of using this type directly. * * Where `defineField` infers the exact field type, * FieldDefinition is a compromise union of all types a field can have. * * A field definition can be a reference to another registered top-level type * or a inline type definition. * * @public */ type FieldDefinition = (InlineFieldDefinition[TType] | TypeAliasDefinition) & FieldDefinitionBase; /** * Returns wether or not the given type is a document type * (eg that it was defined as `type: 'document'`) * * @param type - Schema type to test * @returns True if type is a document type, false otherwise * * @public */ declare function isDocumentSchemaType(type: unknown): type is ObjectSchemaType; /** @internal */ declare function isObjectSchemaType(type: unknown): type is ObjectSchemaType; /** @internal */ declare function isArraySchemaType(type: unknown): type is ArraySchemaType; /** @internal */ declare function isArrayOfBlocksSchemaType(type: unknown): type is ArraySchemaType; /** @internal */ declare function isArrayOfObjectsSchemaType(type: unknown): type is ArraySchemaType; /** @internal */ declare function isArrayOfPrimitivesSchemaType(type: unknown): type is ArraySchemaType; /** @internal */ declare function isArrayOfStringsSchemaType(type: unknown): type is ArraySchemaType; /** @internal */ declare function isBooleanSchemaType(type: unknown): type is BooleanSchemaType; /** @internal */ declare function isStringSchemaType(type: unknown): type is StringSchemaType; /** @internal */ declare function isDateTimeSchemaType(type: unknown): type is StringSchemaType; /** @internal */ declare function isNumberSchemaType(type: unknown): type is NumberSchemaType; /** @internal */ declare function isPrimitiveSchemaType(type: unknown): type is BooleanSchemaType | StringSchemaType | NumberSchemaType; /** @internal */ declare function isReferenceSchemaType(type: unknown): type is ReferenceSchemaType; /** @internal */ declare function isImageSchemaType(type: unknown): type is ImageSchemaType; /** @internal */ declare function isFileSchemaType(type: unknown): type is FileSchemaType; /** @internal */ declare function isDeprecatedSchemaType(type: TSchemaType): type is DeprecatedSchemaType; /** @internal */ declare function isDeprecationConfiguration(type: unknown): type is DeprecationConfiguration; /** @internal */ declare function isCrossDatasetReferenceSchemaType(type: unknown): type is CrossDatasetReferenceSchemaType; /** @internal */ declare function isTitledListValue(item: unknown): item is TitledListValue; /** @internal */ declare function isSpanSchemaType(type: unknown): type is SpanSchemaType; /** @internal */ declare function isBlockSchemaType(type: unknown): type is BlockSchemaType; /** @internal */ declare function isBlockStyleObjectField(field: unknown): field is BlockStyleObjectField; /** @internal */ declare function isBlockListObjectField(field: unknown): field is BlockListObjectField; /** @internal */ declare function isBlockChildrenObjectField(field: unknown): field is BlockChildrenObjectField; /** * @public */ declare const searchStrategies: readonly ['groqLegacy', 'groq2024']; /** * @public */ type SearchStrategy = (typeof searchStrategies)[number]; /** @public */ interface Reference { _type: string; _ref: string; _key?: string; _weak?: boolean; _strengthenOnPublish?: { type: string; weak?: boolean; template?: { id: string; params: Record; }; }; } /** @internal */ interface WeakReference extends Reference { _weak: true; } /** @public */ type ReferenceFilterSearchOptions = { filter?: string; params?: Record; tag?: string; maxFieldDepth?: number; strategy?: SearchStrategy; perspective?: Exclude; }; /** @public */ interface ReferenceFilterResolverContext { document: SanityDocument; parent?: Record | Record[]; parentPath: Path; perspective: StackablePerspective[]; getClient: (options: { apiVersion: string; }) => SanityClient; } /** @public */ type ReferenceFilterResolver = (context: ReferenceFilterResolverContext) => ReferenceFilterSearchOptions | Promise; /** @public */ interface ReferenceTypeOption { type: string; } /** * Context object passed to the creationTypeFilter callback. * * @public */ interface ReferenceTypeFilterContext { /** The current document being edited */ document: SanityDocument; /** The parent value containing this reference field */ parent?: Record | Record[]; /** The path to the parent value in the document */ parentPath: Path; } /** * Function type for filtering which document types can be created from a reference field. * * The `creationTypeFilter` specifically controls the types * available when clicking "Create new" in the reference input. * * This is distinct from the `filter` option, which controls which existing documents appear in search results. * * @param context - Information about the current document and field location * @param toTypes - Array of type options from the reference field's `to` configuration * @returns Filtered array of type options that should be available for creation * * @public */ type ReferenceTypeFilter = (context: ReferenceTypeFilterContext, toTypes: ReferenceTypeOption[]) => ReferenceTypeOption[]; /** @public */ interface ReferenceFilterResolverOptions { filter?: ReferenceFilterResolver; filterParams?: never; } /** @public */ interface ReferenceFilterQueryOptions { filter: string; filterParams?: Record; } /** @public */ interface ReferenceBaseOptions extends BaseSchemaTypeOptions { /** * When `true`, hides the "Create new" button in the reference input, * preventing users from creating new documents from this field. * * For more granular control (e.g., allowing creation of only specific types, * or conditionally hiding the button based on document state), use the * `creationTypeFilter` option instead. */ disableNew?: boolean; /** * Callback function to dynamically filter which document types can be created * from this reference field based on the current document state. * * This allows you to conditionally restrict the types available in the * "Create new" dropdown based on other field values in the document. * * **Important**: This only affects document creation, not which existing documents * appear in search results. To filter search results, use the `filter` option instead. * * @param context - Contains the current document, parent value, and field path * @param toTypes - Array of all types configured in the reference field's `to` property * @returns Array of type options that should be available for creation. Return the * original `toTypes` array to allow all types, a filtered subset to restrict * available types, or an empty array `[]` to hide the "Create new" button entirely. */ creationTypeFilter?: ReferenceTypeFilter; } /** @public */ type ReferenceFilterOptions = ReferenceFilterResolverOptions | ReferenceFilterQueryOptions; /** @internal */ declare function isReference(reference: unknown): reference is Reference; /** @public */ interface EmptyProps {} /** @public */ interface File { [key: string]: unknown; asset?: Reference; } /** @public */ interface Image { [key: string]: unknown; asset?: Reference; crop?: ImageCrop; hotspot?: ImageHotspot; } /** @public */ interface Asset extends SanityDocument { url: string; path: string; assetId: string; extension: string; mimeType: string; sha1hash: string; size: number; originalFilename?: string; label?: string; title?: string; description?: string; creditLine?: string; source?: AssetSourceSpec; } /** @public */ interface ImageAsset extends Asset { _type: 'sanity.imageAsset'; metadata: ImageMetadata; } /** @public */ interface FileAsset extends Asset { _type: 'sanity.fileAsset'; metadata: Record; } /** @public */ interface ImageMetadata { [key: string]: unknown; _type: 'sanity.imageMetadata'; dimensions: ImageDimensions; palette?: ImagePalette; lqip?: string; blurHash?: string; thumbHash?: string; hasAlpha: boolean; isOpaque: boolean; } /** @public */ interface ImageDimensions { _type: 'sanity.imageDimensions'; height: number; width: number; aspectRatio: number; } /** @public */ interface ImageCrop { _type?: 'sanity.imageCrop'; left: number; bottom: number; right: number; top: number; } /** @public */ interface ImageHotspot { _type?: 'sanity.imageHotspot'; width: number; height: number; x: number; y: number; } /** @public */ interface ImagePalette { _type: 'sanity.imagePalette'; darkMuted?: ImageSwatch; darkVibrant?: ImageSwatch; dominant?: ImageSwatch; lightMuted?: ImageSwatch; lightVibrant?: ImageSwatch; muted?: ImageSwatch; vibrant?: ImageSwatch; } /** @public */ interface ImageSwatch { _type: 'sanity.imagePaletteSwatch'; background: string; foreground: string; population: number; title?: string; } /** @public */ type SwatchName = 'darkMuted' | 'darkVibrant' | 'dominant' | 'lightMuted' | 'lightVibrant' | 'muted' | 'vibrant'; /** @public */ interface AssetSourceSpec { id: string; name: string; url?: string; } /** @public */ type AssetFromSource = { kind: 'assetDocumentId' | 'file' | 'base64' | 'url'; value: string | File; assetDocumentProps?: ImageAsset; mediaLibraryProps?: { mediaLibraryId: string; assetId: string; assetInstanceId: string; }; }; /** @public */ type AssetSourceComponentAction = 'select' | 'upload' | 'openInSource'; /** @public */ interface AssetSourceComponentProps { action?: AssetSourceComponentAction; assetSource: AssetSource; assetType?: 'file' | 'image' | 'sanity.video'; accept: string; selectionType: 'single'; dialogHeaderTitle?: React.ReactNode; selectedAssets: Asset[]; onClose: () => void; onSelect: (assetFromSource: AssetFromSource[]) => void; onChangeAction?: (action: AssetSourceComponentAction) => void; schemaType?: ImageSchemaType | FileSchemaType; /** * The uploader instance for tracking upload progress. * * When `action` is `'upload'`: * - If `uploader` is provided: Picker mode. Files are available via * `uploader.getFiles()`. The source should upload these files and report * progress via the uploader. * - If `uploader` is undefined: Component mode. The source should show its * own file selection UI, handle uploads internally, and call `onSelect` * when complete. * * @beta */ uploader?: AssetSourceUploader; /** * The asset to open in source. Only provided when action is 'openInSource'. * @beta */ assetToOpen?: Asset; } /** @public */ type AssetMetadataType = 'location' | 'exif' | 'image' | 'palette' | 'lqip' | 'blurhash' | 'thumbhash' | 'none'; /** @beta */ type AssetSourceUploaderClass = new (...args: any[]) => AssetSourceUploader; /** * The result of calling `AssetSource.openInSource`. * @beta */ type AssetSourceOpenInSourceResult = { type: 'url'; url: string; target?: '_blank' | '_self'; } | { type: 'component'; } | false | undefined; /** @public */ interface AssetSource { name: string; /** @deprecated provide `i18nKey` instead */ title?: string; i18nKey?: string; component: ComponentType; icon?: ComponentType; /** @beta */ Uploader?: AssetSourceUploaderClass; /** * Specifies how uploads should be initiated for this source. * * - `'picker'` (default): The studio opens a native file picker first, * then passes the selected files to the source via the `uploader` prop. * Progress is tracked via the uploader and shown in the studio UI. * * - `'component'`: The studio renders the source component directly with * `action: 'upload'`. The source provides its own UI for selecting and * uploading files, and tracks progress internally. When complete, the * source calls `onSelect` with the uploaded assets. * * @beta */ uploadMode?: 'picker' | 'component'; /** * Resolve how to open an asset in its original source. * * This function is called for each AssetSource when determining if * "Open in Source" should be available. The plugin should check * `asset.source.name` to determine if it can handle this asset. * * Return values: * - `{ type: 'url', url: string }` - Open the URL (in new window by default) * - `{ type: 'component' }` - Render the asset source component with action='openInSource' * - `false` or `undefined` - This plugin cannot handle this asset * * @beta */ openInSource?: (asset: Asset) => AssetSourceOpenInSourceResult; } /** @beta */ interface AssetSourceUploadFile { id: string; file: globalThis.File; progress: number; status: 'pending' | 'uploading' | 'complete' | 'error' | 'aborted' | 'alreadyExists'; error?: Error; result?: unknown; } /** @beta */ interface AssetSourceUploader { upload(files: globalThis.File[], options?: { /** * The schema type of the field the asset is being uploaded to. * May be of interest to the uploader to read file and image options. */ schemaType?: SchemaType; /** * The uploader may send patches directly to the field * Typed 'unknown' as we don't have patch definitions in sanity/types yet. */ onChange?: (patch: unknown) => void; }): AssetSourceUploadFile[]; /** * Abort the upload of a file */ abort(file?: AssetSourceUploadFile): void; /** * Get the files that are currently being uploaded */ getFiles(): AssetSourceUploadFile[]; /** * Subscribe to upload events from the uploader */ subscribe(subscriber: (event: AssetSourceUploadEvent) => void): () => void; /** * Update the status of a file. Will be emitted to subscribers. */ updateFile(fileId: string, data: { progress?: number; status?: string; error?: Error; }): void; /** * Reset the uploader (clear files). Should be called by the uploader when all files are done. */ reset(): void; } /** * Emitted when a file upload is progressing * @beta */ type AssetSourceUploadEventProgress = { type: 'progress'; file: AssetSourceUploadFile; progress: number; }; /** * Emitted when a file upload is changing status * @beta */ type AssetSourceUploadEventStatus = { type: 'status'; file: AssetSourceUploadFile; status: AssetSourceUploadFile['status']; }; /** * Emitted when all files are done, either successfully, aborted or with errors * @beta */ type AssetSourceUploadEventAllComplete = { type: 'all-complete'; files: AssetSourceUploadFile[]; }; /** * Emitted when all files are done, either successfully, aborted or with errors * @beta */ type AssetSourceUploadEventError = { type: 'error'; /** * Files errored */ files: AssetSourceUploadFile[]; }; /** * Emitted when all files are done, either successfully, aborted or with errors * @beta */ type AssetSourceUploadEventAbort = { type: 'abort'; /** * Files aborted */ files: AssetSourceUploadFile[]; }; /** @beta */ type AssetSourceUploadEvent = AssetSourceUploadEventProgress | AssetSourceUploadEventStatus | AssetSourceUploadEventAllComplete | AssetSourceUploadEventError | AssetSourceUploadEventAbort; /** @beta */ type AssetSourceUploadSubscriber = (event: AssetSourceUploadEvent) => void; /** @public */ declare function isImage(value: unknown): value is Image; /** @beta */ interface GlobalDocumentReferenceValue { _type: string; /** The reference to the document. This is a string of the form `a:b:c`, * where: * - `a` is the resource type, for example `dataset` or `media-library` * - `b` is the resource ID, for example data set name or media library ID * - `c` is the document ID */ _ref: `${string}:${string}:${string}`; _key?: string; _weak?: boolean; } /** @beta */ interface WeakGlobalDocumentReferenceValue extends GlobalDocumentReferenceValue { _weak: true; } /** @beta */ type GlobalDocumentReferenceFilterSearchOptions = { filter?: string; params?: Record; tag?: string; }; /** @beta */ type GlobalDocumentReferenceFilterResolver = (options: { document: SanityDocument; parent?: Record | Record[]; parentPath: Path; }) => GlobalDocumentReferenceFilterSearchOptions | Promise; /** @beta */ interface GlobalDocumentReferenceType { type: string; title?: string; icon: ComponentType; preview: PreviewConfig; /** @deprecated Unused. It's only here for the type to be compatible with createSearchQuery.ts */ __experimental_search: never; } /** @beta */ interface GlobalDocumentReferenceSchemaType extends Omit { jsonType: 'object'; to: GlobalDocumentReferenceType[]; resourceType: string; resourceId: string; studioUrl?: string | ((document: { id: string; type?: string; }) => string | null); weak?: boolean; options?: ReferenceFilterOptions; } /** @beta */ declare function isGlobalDocumentReference(reference: unknown): reference is GlobalDocumentReferenceValue; /** * NOTE: These are query parameters, so they will eventually be encoded as strings. * However, since most/all query parameter encoders will accept numbers and encode * them as strings, we'll use `string| number` where applicable, as it makes it easier * to use in places that do calculations and such. * * @internal */ interface ImageUrlParams { 'bg'?: string; 'dpr'?: number | string; 'w'?: number | string; 'h'?: number | string; 'q'?: number | string; 'dl'?: string; 'dlRaw'?: string; 'fp-x'?: number | string; 'fp-y'?: number | string; 'max-w'?: number | string; 'max-h'?: number | string; 'min-w'?: number | string; 'min-h'?: number | string; 'blur'?: number | string; 'sharp'?: number | string; 'rect'?: string; 'fm'?: ImageUrlFormat; 'or'?: ImageUrlOrientation; 'fit'?: ImageUrlFitMode; 'crop'?: ImageUrlCropMode; 'auto'?: ImageUrlAutoMode; 'invert'?: 'true' | 'false'; 'quality'?: number | string; 'flip'?: 'h' | 'v' | 'hv'; 'sat'?: number | string; 'pad'?: number | string; 'colorquant'?: number | string; 'border'?: string; } /** @internal */ type ImageUrlFormat = 'jpg' | 'pjpg' | 'png' | 'webp'; /** @internal */ type ImageUrlFitMode = 'clip' | 'crop' | 'fill' | 'fillmax' | 'max' | 'scale' | 'min'; /** @internal */ type ImageUrlCropMode = 'top' | 'bottom' | 'left' | 'right' | 'center' | 'focalpoint' | 'entropy'; /** @internal */ type ImageUrlAutoMode = 'format'; /** @internal */ type ImageUrlOrientation = '0' | '90' | '180' | '270'; /** * @public */ type MediaLibraryAssetAspectSupportedFieldDefinitions = FieldDefinition>; /** * @public */ type MediaLibraryAssetAspectDefinition = MediaLibraryAssetAspectSupportedFieldDefinitions & { assetType?: MediaLibraryAssetType | MediaLibraryAssetType[]; public?: boolean; }; /** * @public */ declare const MEDIA_LIBRARY_ASSET_ASPECT_TYPE_NAME = "sanity.asset.aspect"; /** * @public */ type MediaLibraryAssetAspectTypeName = typeof MEDIA_LIBRARY_ASSET_ASPECT_TYPE_NAME; /** * @public */ type MediaLibraryAssetType = ImageAsset['_type'] | FileAsset['_type']; /** * A document representing a Media Library asset aspect. * * Each aspect provides a schema describing custom data that can be assigned to assets. * * @public */ interface MediaLibraryAssetAspectDocument extends SanityDocumentLike { _type: MediaLibraryAssetAspectTypeName; /** * Asset types the aspect can be assigned to. * * If no `assetType` is defined, the aspect may be assigned to any asset type. */ assetType?: MediaLibraryAssetType[]; definition: FieldDefinition; public?: boolean; } /** * Check whether the provided value resembles a Media Library asset aspect document. * * Note: This function does not perform a comprehensive check. * * @see validateMediaLibraryAssetAspect * * @internal */ declare function isAssetAspect(maybeAssetAspect: unknown): maybeAssetAspect is MediaLibraryAssetAspectDocument; /** * Define a Media Library asset aspect. * * Aspects can be deployed using the `sanity media deploy-aspect` CLI command. * * @public * @beta */ declare function defineAssetAspect(definition: MediaLibraryAssetAspectDefinition): MediaLibraryAssetAspectDocument; /** * An entry in the transaction log * * @internal */ interface TransactionLogEvent { /** * ID of transaction */ id: string; /** * ISO-formatted timestamp (zulu-time) of when the transaction happened */ timestamp: string; /** * User ID of the user who performed the transaction */ author: string; /** * Document IDs involved in this transaction */ documentIDs: string[]; } /** * An entry in the transaction log that includes the effects of the transaction. * Used when asking the transaction log to include effects in mendoza format, * eg `?effectFormat=mendoza` * * @internal */ interface TransactionLogEventWithEffects extends TransactionLogEvent { /** * Object of effects, where the key is the document ID affected and the value * is the effect pair, eg `{apply: MendozaPatch, revert: MendozaPatch}` */ effects: Record; } /** * An entry in the transaction log that includes the mutations that were performed. * Used when asking the transaction log not to exclude the mutations, * eg `excludeMutations=false` * * @internal */ interface TransactionLogEventWithMutations extends TransactionLogEvent { /** * Array of mutations that occurred in this transaction. Note that the transaction * log has an additional mutation type not typically seen in other APIs; * `createSquashed` ({@link CreateSquashedMutation}). */ mutations: TransactionLogMutation[]; } /** * Mutation type used when the document has passed the threshold of the * "history retention" - any transactions done prior to the threshold gets "squashed" * into a single "create" transaction. * * @internal */ interface CreateSquashedMutation { createSquashed: { /** * The user IDs of all the users who contributed to the document prior to the squashing */ authors: string[]; /** * User ID of the person who initially created the document */ createdBy: string; /** * ISO-formatted timestamp (zulu-time) of when the document as initially created */ createdAt: string; /** * The document as it exists after squashing has occurred */ document: { _id: string; _type: string; [key: string]: unknown; }; }; } /** * A mutation that can occur in the transaction log, which includes the * {@link CreateSquashedMutation} mutation type. * * @internal */ type TransactionLogMutation = Mutation | CreateSquashedMutation; /** * A mendoza patch. These are not human-readable patches, but are optimized to * take as little space as possible, while still being represented by plain JSON. * See {@link https://www.sanity.io/blog/mendoza} * * @internal */ type MendozaPatch = unknown[]; /** * A pair of mendoza patches that can either be _applied_ (to perform the effect), * or _reverted_ (to undo the effect). Requires the exact, previous version of the * document when applying - any difference might have unexpected consequences. * * @internal */ interface MendozaEffectPair { apply: MendozaPatch; revert: MendozaPatch; } /** @internal */ declare function isCreateSquashedMutation(mutation: Mutation | TransactionLogMutation): mutation is CreateSquashedMutation; /** @internal */ type InsertPatch = { before: string; items: unknown[]; } | { after: string; items: unknown[]; } | { replace: string; items: unknown[]; }; /** * NOTE: this is actually incorrect/invalid, but implemented as-is for backwards compatibility * * @internal */ interface PatchOperations { set?: { [key: string]: unknown; }; setIfMissing?: { [key: string]: unknown; }; merge?: { [key: string]: unknown; }; diffMatchPatch?: { [key: string]: string; }; unset?: string[]; inc?: { [key: string]: number; }; dec?: { [key: string]: number; }; insert?: InsertPatch; ifRevisionID?: string; } /** @internal */ type MutationSelection = { query: string; params?: Record; } | { id: string; }; /** @internal */ type PatchMutationOperation = PatchOperations & MutationSelection; /** @internal */ interface CreateMutation { create: { _id?: string; _type: string; [key: string]: unknown; }; } /** @internal */ interface CreateOrReplaceMutation { createOrReplace: { _id: string; _type: string; [key: string]: unknown; }; } /** @internal */ interface CreateIfNotExistsMutation { createIfNotExists: { _id: string; _type: string; [key: string]: unknown; }; } /** @internal */ interface DeleteMutation { delete: MutationSelection; } /** @internal */ interface PatchMutation { patch: PatchMutationOperation; } /** @internal */ type Mutation = CreateMutation | CreateOrReplaceMutation | CreateIfNotExistsMutation | DeleteMutation | PatchMutation; /** @internal */ type MutationOperationName = 'create' | 'createOrReplace' | 'createIfNotExists' | 'delete' | 'patch'; /** @internal */ interface SingleMutationResult { transactionId: string; documentId: string; results: { id: string; }[]; } /** @internal */ interface MultipleMutationResult { transactionId: string; documentIds: string[]; results: { id: string; }[]; } /** @internal */ declare function isCreateMutation(mutation: Mutation | TransactionLogMutation): mutation is CreateMutation; /** @internal */ declare function isCreateIfNotExistsMutation(mutation: Mutation | TransactionLogMutation): mutation is CreateIfNotExistsMutation; /** @internal */ declare function isCreateOrReplaceMutation(mutation: Mutation | TransactionLogMutation): mutation is CreateOrReplaceMutation; /** @internal */ declare function isDeleteMutation(mutation: Mutation | TransactionLogMutation): mutation is DeleteMutation; /** @internal */ declare function isPatchMutation(mutation: Mutation | TransactionLogMutation): mutation is PatchMutation; /** * @internal * Payload that will be passed by the comments backend to our notifications system to display the notification in dashboard. * */ interface StudioNotificationPayload extends DashboardNotificationPayload { applicationType: 'studio'; applicationId: string | undefined; workspaceName: string | undefined; link: { type: 'url'; url: string; }; } /** * @internal * Payload that will be passed by canvas to our notifications system to display the notification in canvas. * */ interface CanvasNotificationPayload extends DashboardNotificationPayload { applicationType: 'canvas'; link: { type: 'dashboard'; path: string; }; } /** * @internal * Payload notifications have to provide to the notification system in order to display correctly in dashboard */ interface DashboardNotificationPayload { version: '1.0.0'; applicationType: string; createdAt: string; /** * The user who took the action which triggered the notification. */ actor: User; title: PortableTextBlock[]; body: PortableTextBlock[] | undefined; organizationId: string; applicationId?: string; workspaceName?: string; link: { type: 'url'; url: string; } | { type: 'dashboard'; path: string; }; } /** * @internal */ declare function isSearchStrategy(maybeSearchStrategy: unknown): maybeSearchStrategy is SearchStrategy; /** @internal */ interface UploadState { progress: number; /** @deprecated use createdAt instead */ initiated?: string; /** @deprecated use updatedAt instead */ updated?: string; createdAt: string; updatedAt: string; file: { name: string; type: string; }; previewImage?: string; } export { ArrayActionName, ArrayDefinition, ArrayOfEntry, ArrayOfType, ArrayOptions, ArrayRule, ArraySchemaType, ArraySchemaTypeOf, Asset, AssetFromSource, AssetMetadataType, AssetSchemaTypeOptions, AssetSource, AssetSourceComponentAction, AssetSourceComponentProps, AssetSourceOpenInSourceResult, AssetSourceSpec, AssetSourceUploadEvent, AssetSourceUploadEventAbort, AssetSourceUploadEventAllComplete, AssetSourceUploadEventError, AssetSourceUploadEventProgress, AssetSourceUploadEventStatus, AssetSourceUploadFile, AssetSourceUploadSubscriber, AssetSourceUploader, AssetSourceUploaderClass, AutocompleteString, BaseSchemaDefinition, BaseSchemaType, BaseSchemaTypeOptions, BlockAnnotationDefinition, BlockChildrenObjectField, BlockDecoratorDefinition, BlockDefinition, BlockListDefinition, BlockListObjectField, BlockMarksDefinition, BlockOptions, BlockRule, BlockSchemaType, BlockStyleDefinition, BlockStyleObjectField, BooleanDefinition, BooleanOptions, BooleanRule, BooleanSchemaType, CanvasAppOptions, CanvasNotificationPayload, CollapseOptions, ConditionalIndexAccess, ConditionalProperty, ConditionalPropertyCallback, ConditionalPropertyCallbackContext, CreateIfNotExistsMutation, CreateMutation, CreateOrReplaceMutation, CreateSquashedMutation, CrossDatasetReferenceDefinition, CrossDatasetReferenceFilterResolver, CrossDatasetReferenceFilterSearchOptions, CrossDatasetReferenceSchemaType, CrossDatasetReferenceValue, CrossDatasetType, CurrentUser, CustomValidator, CustomValidatorResult, DashboardNotificationPayload, DateDefinition, DateOptions, DateRule, DatetimeDefinition, DatetimeOptions, DatetimeRule, DefineArrayMemberBase, DefineSchemaBase, DefineSchemaOptions, DefineSchemaType, DeleteMutation, DeprecatedProperty, DeprecatedSchemaType, DeprecationConfiguration, DocumentDefinition, DocumentOptions, DocumentRule, EmailDefinition, EmailOptions, EmailRule, EmptyProps, EnumListProps, FieldDefinition, FieldDefinitionBase, FieldGroup, FieldGroupDefinition, FieldReference, FieldRules, Fieldset, FieldsetDefinition, File, FileAsset, FileDefinition, FileOptions, FileRule, FileSchemaType, FileValue, FormNodeValidation, GeopointDefinition, GeopointOptions, GeopointRule, GeopointValue, GlobalDocumentReferenceDefinition, GlobalDocumentReferenceFilterResolver, GlobalDocumentReferenceFilterSearchOptions, GlobalDocumentReferenceSchemaType, GlobalDocumentReferenceType, GlobalDocumentReferenceValue, HotspotOptions, HotspotPreview, I18nTextRecord, I18nTitledListValue, Image, ImageAsset, ImageCrop, ImageDefinition, ImageDimensions, ImageHotspot, ImageMetadata, ImageMetadataType, ImageOptions, ImagePalette, ImageRule, ImageSchemaType, ImageSwatch, ImageUrlAutoMode, ImageUrlCropMode, ImageUrlFitMode, ImageUrlFormat, ImageUrlOrientation, ImageUrlParams, ImageValue, IndexTuple, InitialValueProperty, InitialValueResolver, InitialValueResolverContext, InlineFieldDefinition, type InsertMenuOptions, InsertPatch, IntrinsicArrayOfBase, IntrinsicArrayOfDefinition, IntrinsicBase, IntrinsicDefinitions, IntrinsicTypeName, KeyedObject, KeyedSegment, LocalizedValidationMessages, MEDIA_LIBRARY_ASSET_ASPECT_TYPE_NAME, MaybeAllowUnknownProps, MaybePreview, MediaAssetTypes, MediaLibraryAssetAspectDefinition, MediaLibraryAssetAspectDocument, MediaLibraryAssetAspectSupportedFieldDefinitions, MediaLibraryAssetAspectTypeName, MediaLibraryAssetType, MediaLibraryFilter, MediaLibraryOptions, MediaValidationValue, MediaValidator, MendozaEffectPair, MendozaPatch, MultiFieldSet, MultipleMutationResult, Mutation, MutationOperationName, MutationSelection, NarrowPreview, NumberDefinition, NumberOptions, NumberRule, NumberSchemaType, ObjectDefinition, ObjectField, ObjectFieldType, ObjectOptions, ObjectRule, ObjectSchemaType, ObjectSchemaTypeWithOptions, PatchMutation, PatchMutationOperation, PatchOperations, Path, PathSegment, PortableTextBlock, PortableTextChild, PortableTextListBlock, PortableTextObject, PortableTextSpan, PortableTextTextBlock, PrepareViewOptions, PreviewConfig, PreviewValue, Reference, ReferenceBaseOptions, ReferenceDefinition, ReferenceFilterOptions, ReferenceFilterQueryOptions, ReferenceFilterResolver, ReferenceFilterResolverContext, ReferenceFilterResolverOptions, ReferenceFilterSearchOptions, ReferenceOptions, ReferenceRule, ReferenceSchemaType, ReferenceTo, ReferenceTypeFilter, ReferenceTypeFilterContext, ReferenceTypeOption, ReferenceValue, Role, Rule, RuleBuilder, RuleClass, RuleDef, RuleSpec, RuleSpecConstraint, RuleTypeConstraint, SanityCreateOptions, SanityDocument, SanityDocumentLike, Schema, SchemaType, SchemaTypeDefinition, SchemaValidationError, SchemaValidationProblem, SchemaValidationProblemGroup, SchemaValidationProblemPath, SchemaValidationValue, SchemaValidationWarning, SearchConfiguration, SearchStrategy, SingleFieldSet, SingleMutationResult, Slug, SlugDefinition, SlugIsUniqueValidator, SlugOptions, SlugParent, SlugRule, SlugSchemaType, SlugSourceContext, SlugSourceFn, SlugValidationContext, SlugValue, SlugifierFn, SortOrdering, SortOrderingItem, SpanMarksObjectField, SpanSchemaType, SpanTextObjectField, StrictDefinition, StrictVersionLayeringOptions, StringDefinition, StringOptions, StringRule, StringSchemaType, StudioNotificationPayload, SwatchName, TextDefinition, TextOptions, TextRule, TextSchemaType, TitledListValue, TransactionLogEvent, TransactionLogEventWithEffects, TransactionLogEventWithMutations, TransactionLogMutation, TypeAliasDefinition, TypeReference, TypedObject, UploadState, UriValidationOptions, UrlDefinition, UrlOptions, UrlRule, User, ValidationBuilder, ValidationContext, ValidationError, ValidationErrorClass, ValidationErrorOptions, ValidationMarker, Validator, Validators, WeakCrossDatasetReferenceValue, WeakGlobalDocumentReferenceValue, WeakReference, WidenInitialValue, WidenValidation, defineArrayMember, defineAssetAspect, defineField, defineType, isArrayOfBlocksSchemaType, isArrayOfObjectsSchemaType, isArrayOfPrimitivesSchemaType, isArrayOfStringsSchemaType, isArraySchemaType, isAssetAspect, isBlockChildrenObjectField, isBlockListObjectField, isBlockSchemaType, isBlockStyleObjectField, isBooleanSchemaType, isCreateIfNotExistsMutation, isCreateMutation, isCreateOrReplaceMutation, isCreateSquashedMutation, isCrossDatasetReference, isCrossDatasetReferenceSchemaType, isDateTimeSchemaType, isDeleteMutation, isDeprecatedSchemaType, isDeprecationConfiguration, isDocumentSchemaType, isFileSchemaType, isGlobalDocumentReference, isImage, isImageSchemaType, isIndexSegment, isIndexTuple, isKeySegment, isKeyedObject, isNumberSchemaType, isObjectSchemaType, isPatchMutation, isPortableTextListBlock, isPortableTextSpan, isPortableTextTextBlock, isPrimitiveSchemaType, isReference, isReferenceSchemaType, isSanityDocument, isSearchStrategy, isSlug, isSpanSchemaType, isStringSchemaType, isTitledListValue, isTypedObject, isValidationError, isValidationErrorMarker, isValidationInfo, isValidationInfoMarker, isValidationWarning, isValidationWarningMarker, searchStrategies, typed };