/// <reference types="react" />

import {$Tuple} from 'react-i18next/helpers'
import {ArrayDiff as ArrayDiff_2} from '@sanity/diff'
import {ArraySchemaType} from '@sanity/types'
import {AssetMetadataType} from '@sanity/types'
import {AssetSource} from '@sanity/types'
import {AssetSourceSpec} from '@sanity/types'
import {AvatarPosition} from '@sanity/ui'
import {AvatarProps} from '@sanity/ui'
import {AvatarSize} from '@sanity/ui'
import {AvatarStatus} from '@sanity/ui'
import {BadgeProps} from '@sanity/ui'
import {BifurClient} from '@sanity/bifur-client'
import {BlockDecoratorDefinition} from '@sanity/types'
import {BlockListDefinition} from '@sanity/types'
import {BlockStyleDefinition} from '@sanity/types'
import {BooleanDiff as BooleanDiff_2} from '@sanity/diff'
import {BooleanSchemaType} from '@sanity/types'
import {BoxProps} from '@sanity/ui'
import {BrowserHistory} from 'history'
import {ButtonProps as ButtonProps_2} from '@sanity/ui'
import {ButtonTone} from '@sanity/ui'
import {CardProps} from '@sanity/ui'
import {ClientConfig} from '@sanity/client'
import {ClientPerspective} from '@sanity/client'
import {ColorHueKey} from '@sanity/color'
import {ColorTintKey} from '@sanity/color'
import {ColorTints} from '@sanity/color'
import {Component} from 'react'
import {ComponentProps} from 'react'
import {ComponentType} from 'react'
import {ConditionalProperty} from '@sanity/types'
import {Context} from 'react'
import {CrossDatasetReferenceSchemaType} from '@sanity/types'
import {CrossDatasetReferenceValue} from '@sanity/types'
import {CrossDatasetType} from '@sanity/types'
import {CSSProperties} from 'react'
import {CurrentUser} from '@sanity/types'
import {DefinedTelemetryLog} from '@sanity/telemetry'
import {DeprecatedProperty} from '@sanity/types'
import {DialogProps} from '@sanity/ui'
import {Diff as Diff_2} from '@sanity/diff'
import {Dispatch} from 'react'
import {EditorChange} from '@sanity/portable-text-editor'
import {ElementType} from 'react'
import {ExecutionProps} from 'styled-components'
import {FallbackNs} from 'react-i18next'
import {File as File_2} from '@sanity/types'
import {FileAsset} from '@sanity/types'
import {FileSchemaType} from '@sanity/types'
import {FileValue} from '@sanity/types'
import {FlatNamespace} from 'i18next'
import {FocusEvent as FocusEvent_2} from 'react'
import {FocusEventHandler} from 'react'
import {FormEventHandler} from 'react'
import {FormNodeValidation} from '@sanity/types'
import {ForwardRefExoticComponent} from 'react'
import {GeopointValue} from '@sanity/types'
import {HashHistory} from 'history'
import {History as History_2} from 'history'
import {HotkeyOptions} from '@sanity/portable-text-editor'
import {HotkeysProps as HotkeysProps_2} from '@sanity/ui'
import {HTMLAttributes} from 'react'
import {HTMLProps} from 'react'
import {i18n} from 'i18next'
import {I18nTextRecord} from '@sanity/types'
import {Image as Image_2} from '@sanity/types'
import {ImageAsset} from '@sanity/types'
import {ImageSchemaType} from '@sanity/types'
import type imageUrlBuilder from '@sanity/image-url'
import {ImageUrlFitMode} from '@sanity/types'
import {ImageValue} from '@sanity/types'
import {IndexTuple} from '@sanity/types'
import {InitialValueProperty} from '@sanity/types'
import {InitialValueResolverContext} from '@sanity/types'
import {IntrinsicTypeName} from '@sanity/types'
import {ItemDiff as ItemDiff_2} from '@sanity/diff'
import {JSX as JSX_2} from 'react/jsx-runtime'
import {JSXElementConstructor} from 'react'
import {KeyedSegment} from '@sanity/types'
import {KeyPrefix} from 'i18next'
import {MemoizedFunction} from 'lodash'
import {MemoryHistory} from 'history'
import {MendozaEffectPair} from '@sanity/types'
import {MenuButtonProps as MenuButtonProps_2} from '@sanity/ui'
import {MutableRefObject} from 'react'
import {Mutation} from '@sanity/mutator'
import {NamedExoticComponent} from 'react'
import {Namespace} from 'i18next'
import {NullDiff as NullDiff_2} from '@sanity/diff'
import {NumberDiff as NumberDiff_2} from '@sanity/diff'
import {NumberSchemaType} from '@sanity/types'
import {ObjectDiff as ObjectDiff_2} from '@sanity/diff'
import {ObjectField} from '@sanity/types'
import {ObjectFieldType} from '@sanity/types'
import {ObjectSchemaType} from '@sanity/types'
import {Observable} from 'rxjs'
import {OnCopyFn} from '@sanity/portable-text-editor'
import {OnPasteFn} from '@sanity/portable-text-editor'
import {OperatorFunction} from 'rxjs'
import {PatchOperations} from '@sanity/types'
import {Path} from '@sanity/types'
import {PathSegment} from '@sanity/types'
import {Placement} from '@sanity/ui'
import {PopoverProps as PopoverProps_2} from '@sanity/ui'
import {PortableTextBlock} from '@sanity/types'
import {PortableTextEditor} from '@sanity/portable-text-editor'
import {PortableTextObject} from '@sanity/types'
import {PortableTextTextBlock} from '@sanity/types'
import {PrepareViewOptions} from '@sanity/types'
import {PreviewConfig} from '@sanity/types'
import {PreviewValue} from '@sanity/types'
import {PropsWithChildren} from 'react'
import {PureComponent} from 'react'
import {RangeDecoration} from '@sanity/portable-text-editor'
import {ReactChild} from 'react'
import {ReactElement} from 'react'
import {ReactNode} from 'react'
import {RefAttributes} from 'react'
import {Reference} from '@sanity/types'
import {ReferenceSchemaType} from '@sanity/types'
import {ReferenceValue} from '@sanity/types'
import {ResizeObserverEntry as ResizeObserverEntry_2} from '@juggle/resize-observer'
import {ResponsivePaddingProps} from '@sanity/ui'
import {ResponsiveWidthProps} from '@sanity/ui'
import {Role} from '@sanity/types'
import {RootTheme} from '@sanity/ui/theme'
import {SanityClient} from '@sanity/client'
import {SanityDocument} from '@sanity/types'
import {SanityDocument as SanityDocument_2} from '@sanity/client'
import {SanityDocumentLike} from '@sanity/types'
import {Schema} from '@sanity/types'
import {SchemaType} from '@sanity/types'
import {SchemaTypeDefinition} from '@sanity/types'
import {ScrollToOptions as ScrollToOptions_2} from '@tanstack/react-virtual'
import {SetStateAction} from 'react'
import {SlugSchemaType} from '@sanity/types'
import {SlugValue} from '@sanity/types'
import {SortOrdering} from '@sanity/types'
import {StringDiff as StringDiff_2} from '@sanity/diff'
import {StringSchemaType} from '@sanity/types'
import {StringSegmentChanged as StringSegmentChanged_2} from '@sanity/diff'
import {StringSegmentUnchanged as StringSegmentUnchanged_2} from '@sanity/diff'
import {Subject} from 'rxjs'
import {Subscriber} from 'nano-pubsub'
import {SVGProps} from 'react'
import {Text as Text_2} from '@sanity/ui'
import {TextProps} from '@sanity/ui'
import {TextSchemaType} from '@sanity/types'
import {TFunction} from 'i18next'
import {ThemeColorSchemeKey} from '@sanity/ui/theme'
import {ThemeColorSchemeKey as ThemeColorSchemeKey_2} from '@sanity/ui'
import {ThrottleSettings} from 'lodash'
import {TooltipProps as TooltipProps_2} from '@sanity/ui'
import {TransactionLogEventWithEffects} from '@sanity/types'
import {TransactionLogEventWithMutations} from '@sanity/types'
import {TypeChangeDiff as TypeChangeDiff_2} from '@sanity/diff'
import {UploadState} from '@sanity/types'
import {User} from '@sanity/types'
import {ValidationMarker} from '@sanity/types'

/** @internal */
export declare function __tmp_wrap_presenceStore(context: {
  bifur: BifurClient
  connectionStatusStore: ConnectionStatusStore
  userStore: UserStore
}): PresenceStore

/**
 * @hidden
 * @beta */
export declare interface ActionComponent<ActionProps> {
  (props: ActionProps): DocumentActionDescription | null
}

/** @internal */
export declare type ActionHook<T, K> = (args: T) => K | null

/**
 * @hidden
 * @beta */
export declare interface ActiveToolLayoutProps {
  renderDefault: (props: ActiveToolLayoutProps) => React.ReactElement
  activeTool: Tool
}

/** @internal */
export declare function ActiveWorkspaceMatcher({
  children,
  LoadingComponent,
  NotFoundComponent,
  unstable_history: historyProp,
}: ActiveWorkspaceMatcherProps): JSX_2.Element

/** @internal */
export declare const ActiveWorkspaceMatcherContext: Context<ActiveWorkspaceMatcherContextValue | null>

/** @internal */
export declare interface ActiveWorkspaceMatcherContextValue {
  activeWorkspace: WorkspaceSummary
  setActiveWorkspace: (workspaceName: string) => void
}

/** @internal */
export declare interface ActiveWorkspaceMatcherProps {
  children: ReactNode
  unstable_history?: RouterHistory
  NotFoundComponent: ComponentType<{
    onNavigateToDefaultWorkspace: () => void
  }>
  LoadingComponent: ComponentType
}

/**
 * @beta
 * @hidden
 */
export declare const AddonDatasetContext: Context<AddonDatasetContextValue | null>

/**
 * @beta
 * @hidden
 */
export declare interface AddonDatasetContextValue {
  /**
   * Addon dataset client, currently called `comments` dataset.
   */
  client: SanityClient | null
  isCreatingDataset: boolean
  /**
   * Function to create the addon dataset if it does not exist.
   */
  createAddonDataset: () => Promise<SanityClient | null>
  ready: boolean
}

/**
 * This provider sets the addon dataset client, currently called `comments` dataset.
 * It also exposes a `createAddonDataset` function that can be used to create the addon dataset if it does not exist.
 * @beta
 * @hidden
 */
export declare function AddonDatasetProvider(props: AddonDatasetSetupProviderProps): JSX_2.Element

declare interface AddonDatasetSetupProviderProps {
  children: React.ReactNode
}

/**
 * @hidden
 * @beta */
export declare type Annotation = AnnotationDetails | null

/**
 * Annotation connected to a change
 *
 *
 * @hidden
 * @beta
 */
export declare type AnnotationDetails = {
  chunk: Chunk
  timestamp: string
  author: string
}

/**
 * @hidden
 * @beta */
export declare interface ApiConfig {
  projectId: string
  dataset: string
}

/** @internal */
export declare type ArrayDiff<V = unknown> = ArrayDiff_2<Annotation, V>

/**
 * @hidden
 * @public */
export declare interface ArrayFieldProps extends BaseFieldProps {
  schemaType: ArraySchemaType
  value: unknown[] | undefined
  collapsed?: boolean
  collapsible?: boolean
  onCollapse: () => void
  onExpand: () => void
  inputProps: ArrayOfObjectsInputProps
}

/**
 * These are the props an implementation of the ArrayFunctions component will receive
 *
 *
 * @hidden
 * @beta
 */
export declare interface ArrayInputFunctionsProps<Item, SchemaType extends ArraySchemaType> {
  children?: ReactNode
  onItemAppend: (itemValue: Item) => void
  onChange: (event: PatchEvent) => void
  onValueCreate: (type: SchemaType) => Item
  onItemPrepend: (itemValue: Item) => void
  readOnly?: boolean
  schemaType: SchemaType
  value?: Item[]
}

/**
 * @hidden
 * @beta */
export declare interface ArrayInputInsertEvent<Item> {
  items: Item[]
  position: 'before' | 'after'
  referenceItem: KeyedSegment | number
  skipInitialValue?: boolean
  open?: boolean
}

/**
 * @hidden
 * @beta */
export declare interface ArrayInputMoveItemEvent {
  fromIndex: number
  toIndex: number
}

/**
 * @hidden
 * @beta */
export declare interface ArrayItemError {
  kind: 'error'
  key: string
  index: number
  error: InvalidItemTypeError
}

/**
 * Diff extensions for presentational concerns
 *
 * @internal
 */
export declare interface ArrayItemMetadata {
  fromType?: SchemaType
  toType?: SchemaType
}

/**
 * @hidden
 * Array of predefined object options input
 * Note: this input can handle only object values
 *
 *
 * @hidden
 * @beta
 */
export declare function ArrayOfObjectOptionsInput(props: ArrayOfObjectsInputProps): JSX_2.Element

/**
 *
 * @hidden
 * @beta
 */
export declare interface ArrayOfObjectsComponents {
  annotation?: ComponentType<BlockAnnotationProps>
  block?: ComponentType<BlockProps>
  diff?: ComponentType<any>
  field?: ComponentType<ArrayFieldProps>
  inlineBlock?: ComponentType<BlockProps>
  input?: ComponentType<ArrayOfObjectsInputProps>
  item?: ComponentType<ObjectItemProps>
  preview?: ComponentType<PreviewProps>
}

/** @public */
export declare interface ArrayOfObjectsFormNode<
  T extends any[] = unknown[],
  S extends ArraySchemaType = ArraySchemaType,
> extends BaseFormNode<T, S> {
  /** The focus path of the form node. */
  focusPath: Path
  /**
   * @hidden
   * @beta */
  members: ArrayOfObjectsMember[]
}

/**
 * @hidden
 * @beta */
export declare function ArrayOfObjectsFunctions<
  Item extends ObjectItem,
  SchemaType extends ArraySchemaType,
>(props: ArrayInputFunctionsProps<Item, SchemaType>): JSX_2.Element

/**
 *
 * @hidden
 * @beta
 */
export declare function ArrayOfObjectsInput(props: ArrayOfObjectsInputProps): JSX_2.Element

/**
 * Convenience component for rendering an "array of objects"-item
 * @internal
 */
export declare function ArrayOfObjectsInputMember(
  props: ArrayOfObjectsMemberProps,
): JSX_2.Element | null

/**
 * Convenience component for wrapping an array of objects
 * @internal
 */
export declare function ArrayOfObjectsInputMembers(
  props: ArrayOfObjectsInputMembersProps,
): JSX_2.Element

/** @internal */
export declare interface ArrayOfObjectsInputMembersProps {
  members: ArrayOfObjectsMember[]
  renderAnnotation?: RenderAnnotationCallback
  renderBlock?: RenderBlockCallback
  renderInlineBlock?: RenderBlockCallback
  renderInput: RenderInputCallback
  renderField: RenderFieldCallback
  renderItem: RenderArrayOfObjectsItemCallback
  renderPreview: RenderPreviewCallback
}

/**
 * @hidden
 * @public */
export declare interface ArrayOfObjectsInputProps<
  T extends {
    _key: string
  } = {
    _key: string
  },
  S extends ArraySchemaType = ArraySchemaType,
> extends BaseInputProps,
    ArrayOfObjectsFormNode<T[], S> {
  /**
   * @hidden
   * @beta */
  arrayFunctions?: ComponentType<ArrayInputFunctionsProps<T, S>>
  /**
   * @hidden
   * @beta */
  onChange: (patch: FormPatch | FormPatch[] | PatchEvent) => void
  /**
   * @hidden
   * @beta */
  onItemAppend: (item: T) => void
  /**
   * @hidden
   * @beta */
  onItemPrepend: (item: T) => void
  /**
   * @hidden
   * @beta */
  onItemRemove: (itemKey: string) => void
  /**
   * @hidden
   * @beta */
  onItemMove: (event: ArrayInputMoveItemEvent) => void
  /**
   * @hidden
   * @beta */
  onInsert: (event: ArrayInputInsertEvent<T>) => void
  /**
   * @hidden
   * @beta */
  resolveInitialValue: (type: SchemaType, params: Record<string, unknown>) => Promise<T>
  /**
   * @hidden
   * @beta */
  resolveUploader: UploaderResolver<ObjectSchemaType>
  /**
   * @hidden
   * @beta */
  onUpload: (event: UploadEvent) => void
  /**
   * @hidden
   * @beta */
  onPathFocus: (path: Path) => void
  /**
   * for array inputs using expand/collapse semantics for items
   *
   * @hidden
   * @beta
   */
  onItemCollapse: (itemKey: string) => void
  /**
   * @hidden
   * @beta */
  onItemExpand: (itemKey: string) => void
  /**
   * for array inputs using modal open/close semantics for items
   *
   * @hidden
   * @beta
   */
  onItemOpen: (path: Path) => void
  /**
   * @hidden
   * @beta */
  onItemClose: () => void
  /**
   * @hidden
   * @beta */
  renderAnnotation?: RenderAnnotationCallback
  /**
   * @hidden
   * @beta */
  renderBlock?: RenderBlockCallback
  /**
   * @hidden
   * @beta */
  renderInlineBlock?: RenderBlockCallback
  /**
   * @hidden
   * @beta */
  renderField: RenderFieldCallback
  /**
   * @hidden
   * @beta */
  renderInput: RenderInputCallback
  /**
   * @hidden
   * @beta */
  renderItem: RenderArrayOfObjectsItemCallback
  /**
   * @hidden
   * @beta */
  renderPreview: RenderPreviewCallback
  /**
   * @hidden
   * @beta */
  elementProps: ComplexElementProps
}

/**
 *
 * @hidden
 * @beta
 */
export declare function ArrayOfObjectsItem(props: MemberItemProps): JSX_2.Element

/**
 * @hidden
 * @beta */
export declare interface ArrayOfObjectsItemMember<
  Node extends ObjectArrayFormNode = ObjectArrayFormNode,
> {
  kind: 'item'
  key: string
  index: number
  collapsed: boolean | undefined
  collapsible: boolean | undefined
  open: boolean
  parentSchemaType: ArraySchemaType
  /**
   * @hidden
   * @beta */
  item: Node
}

/**
 * @hidden
 * @beta */
export declare type ArrayOfObjectsMember = ArrayOfObjectsItemMember | ArrayItemError

/** @internal */
export declare interface ArrayOfObjectsMemberProps {
  member: ArrayOfObjectsMember
  renderAnnotation?: RenderAnnotationCallback
  renderBlock?: RenderBlockCallback
  renderField: RenderFieldCallback
  renderInlineBlock?: RenderBlockCallback
  renderInput: RenderInputCallback
  renderItem: RenderArrayOfObjectsItemCallback
  renderPreview: RenderPreviewCallback
}

/**
 *
 * @hidden
 * @beta
 */
export declare function ArrayOfOptionsInput(
  props: ArrayOfObjectsInputProps | ArrayOfPrimitivesInputProps,
): JSX_2.Element

/**
 * Array of predefined primitive options input
 * Note: this input can only handle primitive values
 *
 *
 * @hidden
 * @beta
 */
export declare function ArrayOfPrimitiveOptionsInput(
  props: ArrayOfPrimitivesInputProps,
): JSX_2.Element

/**
 *
 * @hidden
 * @beta
 */
export declare interface ArrayOfPrimitivesComponents {
  diff?: ComponentType<any>
  field?: ComponentType<ArrayOfPrimitivesFieldProps>
  input?: ComponentType<ArrayOfPrimitivesInputProps>
  item?: ComponentType<PrimitiveItemProps>
  preview?: ComponentType<PreviewProps>
}

/**
 * @hidden
 * @beta */
export declare type ArrayOfPrimitivesElementType<T extends any[]> = T extends (infer K)[]
  ? K
  : unknown

/**
 * @hidden
 * @public */
export declare interface ArrayOfPrimitivesFieldProps extends BaseFieldProps {
  schemaType: ArraySchemaType
  value: unknown[] | undefined
  collapsed?: boolean
  collapsible?: boolean
  onCollapse: () => void
  onExpand: () => void
  inputProps: ArrayOfPrimitivesInputProps
}

/** @public */
export declare interface ArrayOfPrimitivesFormNode<
  T extends (string | number | boolean)[] = (string | number | boolean)[],
  S extends ArraySchemaType = ArraySchemaType,
> extends BaseFormNode<T, S> {
  /** The focus path of the form node. */
  focusPath: Path
  /**
   * @hidden
   * @beta */
  members: ArrayOfPrimitivesMember[]
}

/**
 * @hidden
 * @beta */
export declare function ArrayOfPrimitivesFunctions<
  MemberType extends string | boolean | number,
  SchemaType extends ArraySchemaType,
>(props: ArrayInputFunctionsProps<MemberType, SchemaType>): JSX_2.Element

/**
 * Note: this should be a class component until React provides support for a hook version of getSnapshotBeforeUpdate
 *
 * @hidden
 * @beta
 */
export declare class ArrayOfPrimitivesInput extends PureComponent<
  ArrayOfPrimitivesInputProps,
  State
> {
  _element: HTMLElement | null
  constructor(props: ArrayOfPrimitivesInputProps)
  handleAppend: (itemValue: PrimitiveValue) => void
  handlePrepend: (itemValue: PrimitiveValue) => void
  handleSortEnd: (event: {fromIndex: number; toIndex: number}) => void
  handleItemMoveStart: () => void
  handleItemMoveEnd: () => void
  focus(): void
  getSnapshotBeforeUpdate(prevProps: ArrayOfPrimitivesInputProps):
    | {
        prevFocusedIndex: PathSegment
        restoreSelection: {
          text: string
          start: number | null
          end: number | null
          value: string
        }
      }
    | {
        prevFocusedIndex?: undefined
        restoreSelection?: undefined
      }
    | null
  componentDidUpdate(
    prevProps: ArrayOfPrimitivesInputProps,
    prevState: Record<string, unknown>,
    snapshot?: {
      restoreSelection: {
        start: number
        end: number
      }
      prevFocusedIndex: number
    },
  ): void
  renderArrayItem: (props: Omit<PrimitiveItemProps, 'renderDefault'>) => JSX_2.Element
  render(): JSX_2.Element
}

/**
 * @hidden
 * @public */
export declare interface ArrayOfPrimitivesInputProps<
  T extends string | boolean | number = string | boolean | number,
  S extends ArraySchemaType = ArraySchemaType,
> extends BaseInputProps,
    ArrayOfPrimitivesFormNode<T[], S> {
  /**
   * @hidden
   * @beta */
  arrayFunctions?: ComponentType<ArrayInputFunctionsProps<T, S>>
  onSetCollapsed: (collapsed: boolean) => void
  /**
   * @hidden
   * @beta */
  onChange: (patch: FormPatch | FormPatch[] | PatchEvent) => void
  /**
   * @hidden
   * @beta */
  onItemAppend: (item: ArrayOfPrimitivesElementType<T[]>) => void
  /**
   * @hidden
   * @beta */
  onItemPrepend: (item: ArrayOfPrimitivesElementType<T[]>) => void
  /**
   * @hidden
   * @beta */
  onItemRemove: (index: number) => void
  /**
   * @hidden
   * @beta */
  onMoveItem: (event: ArrayInputMoveItemEvent) => void
  /**
   * @hidden
   * @beta */
  onInsert: (event: {items: T[]; position: 'before' | 'after'; referenceIndex: number}) => void
  /**
   * @hidden
   * @beta */
  resolveUploader: UploaderResolver<NumberSchemaType | BooleanSchemaType | StringSchemaType>
  /**
   * @hidden
   * @beta */
  onUpload: (event: UploadEvent) => void
  /**
   * @hidden
   * @beta */
  onIndexFocus: (index: number) => void
  /**
   * @hidden
   * @beta */
  renderAnnotation?: RenderAnnotationCallback
  /**
   * @hidden
   * @beta */
  renderBlock?: RenderBlockCallback
  /**
   * @hidden
   * @beta */
  renderInlineBlock?: RenderBlockCallback
  /**
   * @hidden
   * @beta */
  renderInput: RenderInputCallback
  /**
   * @hidden
   * @beta */
  renderItem: RenderArrayOfPrimitivesItemCallback
  /**
   * @hidden
   * @beta */
  renderPreview: RenderPreviewCallback
  /**
   * @hidden
   * @beta */
  elementProps: ComplexElementProps
}

/**
 *
 * @hidden
 * @beta
 */
export declare function ArrayOfPrimitivesItem(props: PrimitiveMemberItemProps): JSX_2.Element

/**
 * @hidden
 * @beta */
export declare interface ArrayOfPrimitivesItemMember<
  Node extends PrimitiveFormNode = PrimitiveFormNode,
> {
  kind: 'item'
  key: string
  index: number
  open: boolean
  parentSchemaType: ArraySchemaType
  /**
   * @hidden
   * @beta */
  item: Node
}

/**
 * @hidden
 * @beta */
export declare type ArrayOfPrimitivesMember = ArrayOfPrimitivesItemMember | ArrayItemError

/** @internal */
export declare function asLoadable<T>(): OperatorFunction<T, LoadableState<T>>

/**
 * @hidden
 * @beta
 */
export declare type AssetSourceResolver = ComposableOption<AssetSource[], ConfigContext>

/**
 * @hidden
 * @beta
 */
export declare type AsyncComposableOption<TValue, TContext> = (
  prev: TValue,
  context: TContext,
) => Promise<TValue>

/** @internal */
export declare type AsyncConfigPropertyReducer<TValue, TContext> = (
  prev: TValue,
  config: PluginOptions,
  context: TContext,
) => TValue | Promise<TValue>

/**
 * Authentication options
 *
 * @public
 */
export declare interface AuthConfig {
  /**
   * Login method to use for the studio. Can be one of:
   * - `dual` (default) - attempt to use cookies where possible, falling back to
   *   storing authentication token in `localStorage` otherwise
   * - `cookie` - explicitly disable `localStorage` method, relying only on cookies. May fail due
   *   to cookies being treated as third-party cookies in some browsers, thus the default is `dual`.
   * - `token` - explicitly disable cookies, relying only on `localStorage` method
   */
  loginMethod?: LoginMethod
  /**
   * Whether to append the providers specified in `providers` with the default providers from the
   * API, or replace the default providers with the ones specified.
   *
   * @deprecated Use the function form of `providers` instead for more control
   */
  mode?: 'append' | 'replace'
  /**
   * If true, the "Choose login provider" (eg "Google, "GitHub", "E-mail/password") screen
   * will be skipped if only a single provider is configured in the `providers` array -
   * instead it will redirect unauthenticated users straight to the authenticatino URL.
   */
  redirectOnSingle?: boolean
  /**
   * Array of authentication providers to use, or a function that takes an array of default
   * authentication providers (fetched from the Sanity API) and should return a new list of
   * providers. This can be used to selectively replace, add or remove providers from the
   * list of choices.
   *
   * @remarks If a static array of providers is provided, the `mode` property is taken into account
   *   when determining what to do with it - `append` will append the providers to the default set
   *   of providers, while `replace` will replace the default providers with the ones specified.
   *
   * If not set, the default providers will be used.
   */
  providers?: AuthProvider[] | ((prev: AuthProvider[]) => AuthProvider[] | Promise<AuthProvider[]>)
  /**
   * The API hostname for requests. Should usually be left undefined,
   * but can be set if using custom cname for API domain.
   */
  apiHost?: string
}

/**
 * A provider of authentication.
 *
 * By default, a list of providers for a project will be fetched from the
 * {@link https://api.sanity.io/v1/auth/providers | Sanity API}, but you may choose to limit this
 * list by explicitly defining the providers you want to allow, or add additional custom providers
 * that conforms to the authentication provider specification outlined in
 * {@link https://www.sanity.io/docs/third-party-login | the documentation}.
 *
 * @public
 */
export declare interface AuthProvider {
  /**
   * URL-friendly identifier/name for the provider, eg `github`
   */
  name: string
  /**
   * Human friendly title for the provider, eg `GitHub`
   */
  title: string
  /**
   * URL for the authentication endpoint that will trigger the authentication flow
   */
  url: string
  /**
   * URL for a logo to display next to the provider in the login screen
   */
  logo?: string
}

/**
 * The unit an `AuthStore` emits to determine the user's authentication state.
 *
 * @beta
 * @hidden
 */
export declare interface AuthState {
  /**
   * Similar to a logged-in flag. This state is used in places like the
   * `AuthBoundary` to determine whether or not it should render the
   * `NotAuthenticatedComponent`. Implementers may choose to set this to `true`
   * while also also emitting a `currentUser` of `null` if a `null` user is
   * accepted (e.g. a project that doesn't require a login)
   */
  authenticated: boolean
  /**
   * The value of the user logged in or `null` if none is provided
   */
  currentUser: CurrentUser | null
  /**
   * A client that is expected to be pre-configured to allow for any downstream
   * requests in the Studio
   */
  client: SanityClient
}

/**
 * The interface used by the Studio that produces a `SanityClient` and
 * `CurrentUser` that gets passed to the resulting `Workspace`s and `Source`s.
 *
 * NOTE: This interface is primarily for internal use. Refer to
 * `createAuthStore` instead.
 *
 * @beta
 * @hidden
 */
export declare interface AuthStore {
  /**
   * Emits `AuthState`s. This should update when the user's auth state changes.
   * E.g. After a login, a new `AuthState` could be emitted with a non-null
   * `currentUser` and `authenticated: true`
   *
   * NOTE: all auth store implementations should emit on subscribe using
   * something like shareReplay(1) to ensure all new subscribers get an
   * `AuthState` value on subscribe
   */
  state: Observable<AuthState>
  /**
   * Emits auth tokens, or `null` if not configured to use them or they do not exist
   */
  token?: Observable<string | null>
  /**
   * Custom auth stores are expected to implement a UI that initiates the user's
   * authentication. For the typical case in `createAuthStore`, this means
   * loading the providers and showing them as options to the user.
   */
  LoginComponent?: ComponentType<LoginComponentProps>
  /**
   * Custom auth stores can implement a function that runs when the user logs
   * out. The implementation is expected to remove all credentials both locally
   * and on the server.
   */
  logout?: () => void
  /**
   * Custom auth stores can implement a function that is designated to run when
   * the Studio loads (e.g. to trade a session ID for a token in cookie-less
   * mode). Within the Studio, this is called within the `AuthBoundary`.
   */
  handleCallbackUrl?: () => Promise<void>
}

/** @internal */
export declare interface AuthStoreOptions extends AuthConfig {
  clientFactory?: (options: ClientConfig) => SanityClient
  projectId: string
  dataset: string
}

/** @internal */
export declare const AutoCollapseMenu: ForwardRefExoticComponent<
  Omit<CollapseMenuProps, 'children' | 'collapsed'> & {
    menuOptions: ReactElement[]
  } & RefAttributes<HTMLDivElement>
>

/** @internal */
export declare type AvailabilityReason = 'READABLE' | 'PERMISSION_DENIED' | 'NOT_FOUND'

/** @internal */
export declare interface AvailabilityResponse {
  omitted: {
    id: string
    reason: 'existence' | 'permission'
  }[]
}

declare type BaseButtonProps = Pick<
  ButtonProps_2,
  | 'as'
  | 'icon'
  | 'iconRight'
  | 'justify'
  | 'loading'
  | 'mode'
  | 'paddingY'
  | 'selected'
  | 'tone'
  | 'type'
  | 'width'
> & {
  size?: 'default' | 'large'
}

/**
 * @hidden
 * @public */
export declare interface BaseFieldProps {
  /** @beta */
  actions?: DocumentFieldAction[]
  /** @internal @deprecated DO NOT USE */
  __internal_comments?: FieldCommentsProps
  /** @internal @deprecated ONLY USED BY AI ASSIST PLUGIN */
  __internal_slot?: ReactNode
  schemaType: SchemaType
  title: string | undefined
  description: string | undefined
  /**
   * @hidden
   * @beta */
  presence: FormNodePresence[]
  validation: FormNodeValidation[]
  level: number
  inputId: string
  value: unknown | undefined
  path: Path
  name: string
  index: number
  changed: boolean
  children: ReactNode
  renderDefault: (props: FieldProps) => ReactElement
}

/**
 * @hidden
 * @beta */
declare interface BaseFileInputProps extends ObjectInputProps<BaseFileInputValue, FileSchemaType> {
  assetSources: AssetSource[]
  directUploads?: boolean
  observeAsset: (documentId: string) => Observable<FileAsset>
  resolveUploader: UploaderResolver
  client: SanityClient
  t: (key: string, values?: Record<string, string>) => string
}

/**
 * @hidden
 * @beta */
declare interface BaseFileInputValue extends Partial<File_2> {
  _upload?: UploadState
}

/**
 * @hidden
 * @public
 */
export declare interface BaseFormNode<T = unknown, S extends SchemaType = SchemaType> {
  /** The unique identifier of the node. */
  id: string
  /** The schema type of the node. */
  schemaType: S
  /** The level of the node in the form hierarchy. */
  level: number
  /** The path of the node in the form hierarchy. */
  path: Path
  /**
   * @hidden
   * @beta */
  presence: FormNodePresence[]
  /** The validation markers of the node. */
  validation: FormNodeValidation[]
  /** The value of the node. */
  value: T | undefined
  /** Whether the node is read-only. */
  readOnly?: boolean
  /** Whether the node is focused. */
  focused?: boolean
  /** Whether the node has changes in a draft. */
  changed: boolean
}

/**
 * @hidden
 * @beta */
declare interface BaseImageInputProps
  extends ObjectInputProps<BaseImageInputValue, ImageSchemaType> {
  assetSources: AssetSource[]
  directUploads?: boolean
  imageUrlBuilder: ImageUrlBuilder
  observeAsset: (documentId: string) => Observable<ImageAsset>
  resolveUploader: UploaderResolver
  client: SanityClient
  t: (key: string, values?: Record<string, string>) => string
}

/**
 * @hidden
 * @beta */
declare interface BaseImageInputValue extends Partial<Image_2> {
  _upload?: UploadState
}

/**
 * @hidden
 * @public */
export declare interface BaseInputProps {
  renderDefault: (props: InputProps) => ReactElement
}

/**
 * Base intent parameters
 *
 * @public
 * @todo dedupe with core/structure
 */
declare interface BaseIntentParams {
  /**
   * Document schema type name to create/edit.
   * Required for `create` intents, optional for `edit` (but encouraged, safer and faster)
   */
  type?: string

  /**
   * ID of the document to create/edit.
   * Required for `edit` intents, optional for `create`.
   */
  id?: string

  /* Name (ID) of initial value template to use for `create` intent. Optional.  */
  template?: string

  /**
   * Experimental field path
   *
   * @beta
   * @experimental
   * @hidden
   */
  path?: string

  /**
   * Optional "mode" to use for edit intent.
   * Known modes are `structure` and `presentation`.
   */
  mode?: string

  /**
   * Arbitrary/custom parameters are generally discouraged - try to keep them to a minimum,
   * or use `payload` (arbitrary JSON-serializable object) instead.
   */
  [key: string]: string | undefined
}

/**
 * Props for the base item component.
 *
 * @public
 */
export declare interface BaseItemProps<T> {
  /** The schema type of the item. */
  schemaType: SchemaType
  /** The key of the item. */
  key: string
  /** The index of the item. */
  index: number
  /** The level of the item. */
  level: number
  /** The value of the item. */
  value: unknown
  /** The path of the item. */
  path: Path
  /** The title of the item. */
  title: string | undefined
  /** The description of the item. */
  description: string | undefined
  /** The ID of the input element. */
  inputId: string
  /** The function to call when the item receives focus. */
  onFocus: (event: FocusEvent_2) => void
  /** The function to call when the item loses focus. */
  onBlur: (event: FocusEvent_2) => void
  /** Whether the item is read-only. */
  readOnly?: boolean
  /** Whether the item is focused. */
  focused?: boolean
  /** The function to call when the item is removed. */
  onRemove: () => void
  /**
   * @hidden
   * @beta */
  onInsert: (event: Omit<ArrayInputInsertEvent<T>, 'referenceItem'>) => void
  /** The children of the item. */
  children: ReactNode
  /** The validation markers for the item. */
  validation: FormNodeValidation[]
  /**
   * @hidden
   * @beta */
  presence: FormNodePresence[]
  /** The function to call to render the default item. See {@link ItemProps} */
  renderDefault: (props: ItemProps) => ReactElement
}

/** @internal */
export declare function BetaBadge(
  props: BetaBadgeProps & Omit<HTMLProps<HTMLDivElement>, 'ref'>,
): JSX_2.Element

/** @internal */
export declare type BetaBadgeProps = Omit<BadgeProps, 'mode' | 'tone'>

/**
 * Props for rendering a Portable Text annotation
 *
 * @public
 * @remarks If you want to render a mix of the annotated text and non-text content, you have to attribute
 * the non-text containers with `contentEditable={false}`. See the second example.
 * @example Simple example of customizing the annotation text to render yellow.
 * ```ts
 * (props: BlockAnnotationProps) =>
 *   props.renderDefault({
 *     ...props,
 *     textElement: <span style={{color: 'yellow'}}>{props.textElement}</span>,
 *   })
 * ```
 * @example Simple example of rendering the annotation with a custom modal for editing.
 * Note that the form content container is attributed as `contentEditable={false}`.
 * This is to signal to the text editor that this content isn't part of the editable text.
 * ```ts
 * (props: BlockAnnotationProps) => {
 *   return (
 *     <>
 *       // Render the annotated text
 *       <span onClick={props.onOpen}>
 *         {props.textElement}
 *       </span>
 *       // Render the editing form if the object is opened
 *       {props.open && (
 *         <Dialog
 *           contentEditable={false} // Attribute this as non-editable to the text editor
 *           header={`Edit ${props.schemaType.title}`}
 *           id={`dialog-${props.value._key}`}
 *           onClickOutside={props.onClose}
 *           onClose={props.onClose}
 *         >
 *           <Box margin={2} padding={2}>
 *             {props.children}
 *           </Box>
 *         </Dialog>
 *      )}
 *     </>
 *   )
 * }
 * ```
 * */
export declare interface BlockAnnotationProps {
  /**
   * Boundary element of the floating toolbar element.
   */
  __unstable_floatingBoundary: HTMLElement | null
  /**
   * Boundary element where the text for this annotation appears.
   */
  __unstable_referenceBoundary: HTMLElement | null
  /**
   * DOM element for the annotated text.
   */
  __unstable_referenceElement: HTMLElement | null
  /**
   * Wether the annotated text node has editor focus.
   * @remarks differs from `focused` which is wether the annotation object has form focus.
   */
  __unstable_textElementFocus?: boolean
  /**
   * The input form for the annotation object.
   * @remarks If you wrap this in something, you must make sure to put `contentEditable={false}` on the root container.
   * Otherwise the editor will think content is part of the editable text and will error.
   */
  children: ReactNode
  /**
   * If the editor form for this annotation object currently have form focus.
   */
  focused: boolean
  /**
   * Markers (meta data) connected to this annotation.
   * @deprecated - use `renderBlock` and `renderInlineBlock` interfaces instead
   */
  markers: PortableTextMarker[]
  /**
   * Closes the editing form connected to this annotation.
   */
  onClose: () => void
  /**
   * Opens the editing form connected to this annotation.
   */
  onOpen: () => void
  /**
   * Focus a form node in the object for this annotation.
   * @param path - the relative path to the form node to put focus on.
   */
  onPathFocus: (path: Path) => void
  /**
   * Removes the annotation object from the text.
   */
  onRemove: () => void
  /**
   * If the annotation is currently opened for editing.
   */
  open: boolean
  /**
   * The parent schema type. For annotations this this the block type.
   */
  parentSchemaType: SchemaType
  /**
   * The full form path to this annotation from document root.
   */
  path: Path
  /**
   * Form presence for this annotation.
   */
  presence: FormNodePresence[]
  /**
   * Is the annotation object read only?
   */
  readOnly: boolean
  /**
   * Plugin chain render callback.
   */
  renderAnnotation?: RenderAnnotationCallback
  /**
   * Plugin chain render callback.
   */
  renderBlock?: RenderBlockCallback
  /**
   * Plugin chain render callback.
   */
  renderDefault: (props: BlockAnnotationProps) => ReactElement
  /**
   * Plugin chain render callback.
   */
  renderField: RenderFieldCallback
  /**
   * Plugin chain render callback.
   */
  renderInlineBlock?: RenderBlockCallback
  /**
   * Plugin chain render callback.
   */
  renderInput: RenderInputCallback
  /**
   * Plugin chain render callback.
   */
  renderItem: RenderArrayOfObjectsItemCallback
  /**
   * Plugin chain render callback.
   */
  renderPreview: RenderPreviewCallback
  /**
   * The schema type for the annotation object.
   */
  schemaType: ObjectSchemaType & {
    i18nTitleKey?: string
  }
  /**
   * If the annotated text currently is selected by the user.
   */
  selected: boolean
  /**
   * React element of the text that is being annotated.
   */
  textElement: ReactElement
  /**
   * Form validation for the annotation object.
   */
  validation: FormNodeValidation[]
  /**
   * Value of the annotation object.
   */
  value: PortableTextObject
}

/**
 * Props for rendering text decorations in Portable Text blocks.
 * It could be decorations like bold, italic, subscript etc.
 *
 * @public
 */
export declare interface BlockDecoratorProps {
  /**
   * The span node as rendered without the decorator.
   */
  children: ReactElement
  /**
   * If the span node currently is focused by the user.
   */
  focused: boolean
  /**
   * The default render function for this decorator,
   * some decorators are proved by default and has a default rendering.
   */
  renderDefault: (props: BlockDecoratorProps) => ReactElement
  /**
   * The decorator schema type. Icon can be found here.
   */
  schemaType: BlockDecoratorDefinition
  /**
   * If the span node text currently is selected by the user.
   */
  selected: boolean
  /**
   * The title of the decorator (e.g. 'Underlined text') for UI-representation.
   */
  title: string
  /**
   * The value of the decorator (e.g. 'underlined') as it
   * appears in the child.marks array of the text node.
   */
  value: string
}

/**
 * @hidden
 * @beta */
export declare function BlockImagePreview(props: BlockImagePreviewProps): JSX_2.Element

/**
 * @hidden
 * @beta */
export declare type BlockImagePreviewProps = Omit<PreviewProps<'blockImage'>, 'renderDefault'>

/**
 * Props for rendering a Portable Text block as a list item.
 *
 * @public
 */
export declare interface BlockListItemProps {
  /**
   * The block that is rendered as a list item.
   */
  block: PortableTextTextBlock
  /**
   * The block rendered without the list style.
   */
  children: ReactElement
  /**
   * If the block currently is focused by the user.
   */
  focused: boolean
  /**
   * The nesting level of this list item.
   */
  level: number
  /**
   * The default function for rendering this as a list item. Some list types are built in and
   * will have a default rendering.
   */
  renderDefault: (props: BlockListItemProps) => ReactElement
  /**
   * The schema type for this list type. Icon can be found here.
   */
  schemaType: BlockListDefinition
  /**
   * If the user currently has a text selection in this block.
   */
  selected: boolean
  /**
   * The title of the list item type (e.g. 'Bullet list') for UI-representation.
   */
  title: string
  /**
   * The value of the list item type (e.g. 'bullet') as it appears in the block.listItem attribute.
   */
  value: string
}

/**
 * @hidden
 * @beta */
export declare function BlockPreview(
  props: Omit<PreviewProps<'block'>, 'renderDefault'>,
): JSX_2.Element

/**
 * Props for rendering a Portable Text block
 *
 * @public
 */
export declare interface BlockProps {
  /**
   * Boundary element of the floating toolbar element.
   */
  __unstable_floatingBoundary: HTMLElement | null
  /**
   * Boundary element for the block.
   */
  __unstable_referenceBoundary: HTMLElement | null
  /**
   * DOM element for the block.
   */
  __unstable_referenceElement: HTMLElement | null
  /**
   * The default rendering of the block (the text).
   */
  children: ReactNode
  /**
   * If the block currently is focused by the user.
   */
  focused: boolean
  /**
   * Markers (meta data) connected to this annotation.
   * @deprecated - use `renderBlock` and `renderInlineBlock` interfaces instead
   */
  markers: PortableTextMarker[]
  /**
   * Closes the editing form connected to this block.
   * For regular text blocks this is not relevant.
   */
  onClose: () => void
  /**
   * Opens the editing form connected to this block.
   * For regular text blocks this is not relevant.
   */
  onOpen: () => void
  /**
   * Focus a form node in this block.
   * @param path - the relative path to the form node to put focus on.
   */
  onPathFocus: (path: Path) => void
  /**
   * Removes the block.
   */
  onRemove: () => void
  /**
   * If the block is currently opened for editing.
   */
  open: boolean
  /**
   * The parent schema type (array type).
   */
  parentSchemaType: ArraySchemaType | ObjectSchemaType
  /**
   * The full form path to this block from document root.
   */
  path: Path
  /**
   * Form presence for this block.
   */
  presence: FormNodePresence[]
  /**
   * Is the block object read only?
   */
  readOnly: boolean
  /**
   * Plugin chain render callback.
   */
  renderAnnotation?: RenderAnnotationCallback
  /**
   * Plugin chain render callback.
   */
  renderBlock?: RenderBlockCallback
  /**
   * Plugin chain render callback (default rendering function of the block).
   */
  renderDefault: (props: BlockProps) => ReactElement
  /**
   * Plugin chain render callback.
   */
  renderField: RenderFieldCallback
  /**
   * Plugin chain render callback.
   */
  renderInlineBlock?: RenderBlockCallback
  /**
   * Plugin chain render callback.
   */
  renderInput: RenderInputCallback
  /**
   * Plugin chain render callback.
   */
  renderItem: RenderArrayOfObjectsItemCallback
  /**
   * Plugin chain render callback.
   */
  renderPreview: RenderPreviewCallback
  /**
   * The schema type for the block.
   */
  schemaType: ObjectSchemaType
  /**
   * If the block is in the user's selection.
   */
  selected: boolean
  /**
   * Form validation for the block object.
   */
  validation: FormNodeValidation[]
  /**
   * Value of the block.
   */
  value: PortableTextBlock
}

/**
 * Props for rendering a text block style.
 *
 * @public
 */
export declare interface BlockStyleProps {
  /**
   * The value of the block that is rendered style for.
   */
  block: PortableTextTextBlock
  /**
   * The block as rendered without this style.
   */
  children: ReactElement
  /**
   * If the block currently has focus in the text editor.
   */
  focused: boolean
  /**
   * The default rendering function for this style.
   */
  renderDefault: (props: BlockStyleProps) => ReactElement
  /**
   * The schema type for this style.
   */
  schemaType: BlockStyleDefinition
  /**
   * If the block currently have a text selection.
   */
  selected: boolean
  /**
   * The title of the style (e.g. 'Large Heading') for UI-representation.
   */
  title: string
  /**
   * The value of the style (e.g. 'h1') as it appears in the block's `.style` property value.
   */
  value: string
}

/**
 *
 * @hidden
 * @beta
 */
export declare interface BooleanComponents {
  diff?: ComponentType<any>
  field?: ComponentType<BooleanFieldProps>
  input?: ComponentType<BooleanInputProps>
  item?: ComponentType<PrimitiveItemProps>
  preview?: ComponentType<PreviewProps>
}

/** @internal */
export declare type BooleanDiff = BooleanDiff_2<Annotation>

/**
 * @hidden
 * @public */
export declare interface BooleanFieldProps extends BaseFieldProps {
  schemaType: BooleanSchemaType
  value: boolean | undefined
  inputProps: BooleanInputProps
}

/** @public */
export declare type BooleanFormNode<S extends BooleanSchemaType = BooleanSchemaType> = BaseFormNode<
  boolean,
  S
>

/**
 *
 * @hidden
 * @beta
 */
export declare function BooleanInput(props: BooleanInputProps): JSX_2.Element

/**
 * @hidden
 * @public */
export declare interface BooleanInputProps<S extends BooleanSchemaType = BooleanSchemaType>
  extends BaseInputProps,
    BooleanFormNode<S> {
  /**
   * @hidden
   * @beta */
  onChange: (patch: FormPatch | FormPatch[] | PatchEvent) => void
  /**
   * A shorthand aggregation of any validation errors the input currently have
   * Will be falsey if no error.
   * In the case of multiple errors it will be a newline delimited string of each error message
   * For advanced use cases use the ´validation´ prop which contains more levels and details
   */
  validationError?: string
  /**
   * @hidden
   * @beta */
  elementProps: PrimitiveInputElementProps
}

/**
 * @hidden
 * @beta */
export declare type BufferedDocumentEvent =
  | SnapshotEvent
  | DocumentRebaseEvent
  | DocumentMutationEvent
  | CommittedEvent

/** @internal */
export declare interface BufferedDocumentWrapper {
  consistency$: Observable<boolean>
  remoteSnapshot$: Observable<RemoteSnapshotEvent>
  events: Observable<BufferedDocumentEvent>
  commitRequest$: Observable<CommitRequest>
  patch: (patches: any[]) => MutationPayload[]
  create: (document: Partial<SanityDocument>) => MutationPayload
  createIfNotExists: (document: SanityDocument) => MutationPayload
  createOrReplace: (document: SanityDocument) => MutationPayload
  delete: () => MutationPayload
  mutate: (mutations: MutationPayload[]) => void
  commit: () => void
}

/**
 * Build a Sanity UI theme from legacy CSS properties.
 *
 * @example
 * ```tsx
 * import {buildLegacyTheme, defineConfig} from 'sanity'
 *
 * export default defineConfig({
 *   // project configuration ...
 *
 *   // Customize theming
 *   theme: buildLegacyTheme({
 *     '--black': '#000',
 *     '--gray': '#777',
 *     '--focus-color': '#00f',
 *   })
 * })
 * ```
 *
 * @param partialLegacyTheme - Properties to override the theme with. See {@link LegacyThemeProps}
 * @public
 * @deprecated Legacy theming will be deprecated in a future version of Sanity Studio
 */
export declare function buildLegacyTheme(partialLegacyTheme: Partial<LegacyThemeProps>): StudioTheme

/** @internal */
declare type ButtonProps = BaseButtonProps & (ButtonWithText | IconButton)

declare type ButtonWithText = {
  text: string
  tooltipProps?: TooltipProps | null
  icon?: ButtonProps_2['icon']
}

/** @internal */
export declare function ChangeBreadcrumb(props: {
  change?: FieldChangeNode
  titlePath: ChangeTitlePath
}): JSX_2.Element

/** @internal */
export declare const ChangeConnectorRoot: typeof EnabledChangeConnectorRoot

/**
 * This is used to draw the bar that wraps the diff components in the changes panel
 *
 * @internal
 */
export declare const ChangeFieldWrapper: (props: {
  path: Path
  children: ReactNode
  hasHover: boolean
}) => JSX_2.Element

/** @internal */
export declare function ChangeIndicator(
  props: ChangeIndicatorProps & Omit<HTMLProps<HTMLDivElement>, 'as'>,
): JSX_2.Element

/** @internal */
export declare const ChangeIndicatorContext: Context<ChangeIndicatorContextValue>

/** @internal */
export declare interface ChangeIndicatorContextValue {
  value?: unknown
  focusPath: Path
  path: Path
  fullPath: Path
  isChanged: boolean
}

/** @internal */
export declare interface ChangeIndicatorProps {
  path: Path
  hasFocus: boolean
  isChanged: boolean
  withHoverEffect?: boolean
}

/** @internal */
export declare function ChangeList({diff, fields, schemaType}: ChangeListProps): ReactElement | null

/** @internal */
export declare interface ChangeListProps {
  schemaType: ObjectSchemaType
  diff: ObjectDiff
  fields?: string[]
}

/** @internal */
export declare type ChangeNode = GroupChangeNode | FieldChangeNode

/** @internal */
export declare function ChangeResolver(props: ChangeResolverProps): JSX_2.Element | null

/** @internal */
export declare interface ChangeResolverProps {
  change: ChangeNode
  readOnly?: ConditionalProperty
  hidden?: ConditionalProperty
}

/** @internal */
export declare type ChangeTitlePath = (string | FromToIndex)[]

/** @internal */
export declare function ChangeTitleSegment(props: {
  change?: FieldChangeNode
  segment: string | FromToIndex
}): JSX_2.Element

/** @internal */
export declare function checkoutPair(client: SanityClient, idPair: IdPair): Pair

/**
 * @hidden
 * @beta */
export declare type Chunk = {
  index: number
  id: string
  type: ChunkType
  start: number
  end: number
  startTimestamp: string
  endTimestamp: string
  authors: Set<string>
  draftState: 'present' | 'missing' | 'unknown'
  publishedState: 'present' | 'missing' | 'unknown'
}

/**
 * History timeline / chunking
 *
 *
 * @hidden
 * @beta
 */
export declare type ChunkType =
  | 'initial'
  | 'create'
  | 'editDraft'
  | 'delete'
  | 'publish'
  | 'unpublish'
  | 'discardDraft'
  | 'editLive'

/**
 * @hidden
 * @beta */
export declare function CircularProgress(props: {
  /** Percentage */
  value: number
}): JSX_2.Element

/** @internal */
export declare const CollapseMenu: ForwardRefExoticComponent<CollapseMenuProps & RefAttributes<any>>

/** @internal */
export declare const CollapseMenuButton: ForwardRefExoticComponent<
  Omit<CollapseMenuButtonProps & Omit<HTMLProps<HTMLButtonElement>, 'as' | 'size'>, 'ref'> &
    RefAttributes<HTMLButtonElement>
>

/** @internal */
export declare interface CollapseMenuButtonProps extends CommonProps {
  collapsedProps?: Omit<CommonProps, 'text'>
  expandedProps?: CommonProps
  text: string
}

/** @internal */
export declare interface CollapseMenuProps {
  children: ReactNode | ReactNode[]
  collapsed?: boolean
  collapseText?: boolean
  disableRestoreFocusOnClose?: boolean
  gap?: number | number[]
  menuButtonProps?: Omit<MenuButtonProps, 'id' | 'menu' | 'button'> & {
    id?: string
    button?: ReactElement
  }
  onMenuClose?: () => void
}

/** @internal */
export declare function collate<
  T extends {
    _id: string
    _type: string
  },
>(documents: T[]): CollatedHit<T>[]

/**
 * Takes a list of documents and collates draft/published pairs into single entries
 * `{id: <published id>, draft?: <draft document>, published?: <published document>}`
 *
 * Note: because Map is ordered by insertion key the resulting array will be ordered by whichever
 * version appeared first
 *
 * @internal
 */
export declare interface CollatedHit<
  T extends {
    _id: string
  } = {
    _id: string
  },
> {
  id: string
  type: string
  draft?: T
  published?: T
}

/**
 * If the `scheme` prop is provided we don't need to setup any logic to handle localStorage
 * @internal
 */
export declare function ColorSchemeCustomProvider({
  children,
  onSchemeChange,
  scheme,
}: Pick<ColorSchemeProviderProps, 'children' | 'onSchemeChange'> & {
  scheme: StudioThemeColorSchemeKey
}): JSX_2.Element

/**
 * Uses useSyncExternalStore to ensure that localStorage is accessed in a SSR hydration compatible way
 * @internal
 */
export declare function ColorSchemeLocalStorageProvider({
  children,
  onSchemeChange,
}: Pick<ColorSchemeProviderProps, 'children' | 'onSchemeChange'>): JSX_2.Element

/** @internal */
export declare function ColorSchemeProvider({
  children,
  onSchemeChange,
  scheme: schemeProp,
}: ColorSchemeProviderProps): JSX_2.Element

/** @internal */
export declare interface ColorSchemeProviderProps {
  children: ReactNode
  onSchemeChange?: (nextScheme: StudioThemeColorSchemeKey) => void
  scheme?: StudioThemeColorSchemeKey
}

/**
 * The setter for ColorSchemeValueContext, in a separate context to avoid unnecessary re-renders
 * If set to false then the UI should adjust to reflect that the Studio can't change the color scheme
 * @internal
 */
export declare const ColorSchemeSetValueContext: Context<
  false | ((nextScheme: StudioThemeColorSchemeKey) => void) | null
>

/**
 * Used to keep track of the internal value, which can be "system" in addition to "light" and "dark"
 * @internal
 */
export declare const ColorSchemeValueContext: Context<StudioThemeColorSchemeKey | null>

/**
 * @hidden
 * @beta */
export declare interface CombinedDocument {
  draft: Record<string, unknown> | null
  published: Record<string, unknown> | null
}

/**
 * Renders a Command List with support for the following:
 *
 * - Keyboard navigation (↑ / ↓ / ENTER) to children with a specified container (`childContainerRef`)
 * - Focus redirection when clicking child elements
 * - Pointer blocking when navigating with arrow keys (to ensure that only one active state is visible at any given time)
 * - ARIA attributes to define a `combobox` input that controls a separate `listbox`
 *
 * @internal
 */
export declare const CommandList: ForwardRefExoticComponent<
  CommandListProps<any> & RefAttributes<CommandListHandle>
>

/** @internal */
export declare type CommandListElementType = 'input' | 'list'

/** @internal */
export declare type CommandListGetItemDisabledCallback = (virtualIndex: number) => boolean

/** @internal */
export declare type CommandListGetItemKeyCallback = (virtualIndex: number) => number | string

/** @internal */
export declare type CommandListGetItemSelectedCallback = (virtualIndex: number) => boolean

/** @internal */
export declare interface CommandListHandle {
  focusInputElement: () => void
  focusListElement: () => void
  getTopIndex: () => number
  scrollToIndex: (index: number) => void
}

/** @internal */
export declare type CommandListItemContext = {
  activeIndex: number | null
  disabled?: boolean
  selected?: boolean
  virtualIndex: number
}

/** @internal */
export declare interface CommandListProps<T = any> extends ResponsivePaddingProps {
  /** The data attribute to apply to any active virtual list items */
  activeItemDataAttr?: string
  /** `aria-label` to apply to the virtual list container element */
  ariaLabel: string
  /** Whether `aria-multiselectable` is enabled on the virtual list container element */
  ariaMultiselectable?: boolean
  /** Automatically focus the input or virtual list */
  autoFocus?: CommandListElementType
  /** Whether the virtual list can receive focus */
  canReceiveFocus?: boolean
  /** Pixel offset of the virtual list focus ring. Negative values will cause the focus ring to appear inset */
  focusRingOffset?: number
  /** Force a fixed height for all virtual list children and skip measurement (faster). */
  fixedHeight?: boolean
  /** Custom function to map disabled items */
  getItemDisabled?: CommandListGetItemDisabledCallback
  /** Custom function to map virtual list items to custom keys */
  getItemKey?: CommandListGetItemKeyCallback
  /** Custom function to map selected items */
  getItemSelected?: CommandListGetItemSelectedCallback
  /** Scroll alignment of the initial active index */
  initialScrollAlign?: ScrollToOptions_2['align']
  /** Initial active index on mount */
  initialIndex?: number
  /** Input element to associate with this virtual list. Associated inputs will receive focus and handle key events */
  inputElement?: HTMLInputElement | null
  /** Estimated height for each list item */
  itemHeight: number
  /** Virtual list item values, accessible to all rendered item components */
  items: T[]
  /** Callback fired when the virtual list is within `onEndReachedIndexThreshold` of rendered content */
  onEndReached?: () => void
  /** Number of items from the end of the virtual list before which `onEndReached` is triggered */
  onEndReachedIndexOffset?: number
  /** Only show selection state when the virtual list is active (is hovered or has focus) */
  onlyShowSelectionWhenActive?: boolean
  /** Number of items to render above and below the visible area*/
  overscan?: number
  /** Rendered component in virtual lists */
  renderItem: CommandListRenderItemCallback<T>
  /** Allow wraparound keyboard navigation between first and last items */
  wrapAround?: boolean
}

/** @internal */
export declare type CommandListRenderItemCallback<T> = (
  item: T,
  context: CommandListItemContext,
) => ReactNode

/** @internal */
export declare type CommitFunction = (mutation: Mutation['params']) => Promise<unknown>

/**
 * Represents "commit requests" from the mutator.
 * These are emitted from the BufferedDocument instance's `requestHandler` callback
 *
 * @internal
 */
export declare interface CommitRequest {
  mutation: Mutation
  success: () => void
  failure: (error: Error) => void
  cancel: (error: Error) => void
}

/**
 * @hidden
 * @beta */
export declare interface CommittedEvent {
  type: 'committed'
}

/** @internal */
export declare interface CommonProps extends Omit<ButtonProps, 'text' | 'iconRight'> {
  as?: ElementType | keyof JSX.IntrinsicElements
  dividerBefore?: boolean
  focused?: boolean
  tooltipProps?: TooltipProps
  tooltipText?: ReactNode
}

/**
 * @hidden
 * @beta */
export declare function CompactPreview(props: CompactPreviewProps): JSX_2.Element

/**
 * @hidden
 * @beta */
export declare type CompactPreviewProps = Omit<PreviewProps<'compact'>, 'renderDefault'>

/**
 * @hidden
 * @beta */
export declare interface ComplexElementProps {
  id: string
  onFocus: FocusEventHandler
  onBlur: FocusEventHandler
  ref: MutableRefObject<any>
  'aria-describedby': string | undefined
}

/** @public */
export declare type ComposableOption<TValue, TContext> = (prev: TValue, context: TContext) => TValue

/**
 * @internal
 */
declare interface ConditionalPropertyCallbackContext {
  parent?: unknown
  document?: Record<string, unknown>
  currentUser: Omit<CurrentUser, 'role'> | null
  value: unknown
}

/**
 * @hidden
 * @beta
 */
export declare type Config = SingleWorkspace | WorkspaceOptions[]

/** @public */
export declare interface ConfigContext {
  /**
   * The ID of the project.
   */
  projectId: string
  /**
   * The name of the dataset.
   */
  dataset: string
  /**
   * The schema for this source.
   */
  schema: Schema
  /**
   * The current user or `null` if not authenticated.
   */
  currentUser: CurrentUser | null
  /**
   * A function that returns a Sanity client with the {@link SourceClientOptions | specified options}.
   */
  getClient: (options: SourceClientOptions) => SanityClient
  /**
   * Localization resources
   */
  i18n: LocaleSource
}

declare type ConfigContext_2<T> =
  T extends ConfigPropertyReducer<any, infer TContext> ? TContext : never

/** @internal */
export declare class ConfigPropertyError extends Error {
  propertyName: string
  path: string[]
  cause: unknown
  constructor({propertyName, path, cause}: ConfigPropertyErrorOptions)
}

/** @internal */
export declare interface ConfigPropertyErrorOptions {
  propertyName: string
  path: string[]
  cause: unknown
}

/** @internal */
export declare type ConfigPropertyReducer<TValue, TContext> = (
  prev: TValue,
  config: PluginOptions,
  context: TContext,
) => TValue

/** @internal */
export declare class ConfigResolutionError extends Error {
  name: string
  type: string
  causes: unknown[]
  constructor({causes, name, type}: ConfigResolutionErrorOptions)
}

/** @internal */
export declare interface ConfigResolutionErrorOptions {
  name: string
  type: string
  causes: Array<ConfigResolutionError | Error | unknown>
}

/** @internal */
export declare type ConnectedStatus = {
  type: 'connected'
  lastHeartbeat: Date
}

/** @internal */
export declare const CONNECTING: ConnectingStatus

/** @internal */
export declare type ConnectingStatus = {
  type: 'connecting'
}

/** @internal */
export declare type ConnectionState = 'connecting' | 'reconnecting' | 'connected'

/** @internal */
export declare type ConnectionStatus =
  | ConnectingStatus
  | ErrorStatus
  | ConnectedStatus
  | RetryingStatus

/** @internal */
export declare interface ConnectionStatusStore {
  connectionStatus$: Observable<ConnectionStatus>
}

/** @internal */
export declare interface ConnectionStatusStoreOptions {
  bifur: BifurClient
}

/** @internal */
export declare const ConnectorContext: Context<ConnectorContextValue>

/** @internal */
export declare interface ConnectorContextValue {
  isReviewChangesOpen: boolean
  onOpenReviewChanges: () => void | undefined
  onSetFocus: (nextPath: Path) => void | undefined
}

/**
 * Simple context menu button (with horizontal ellipsis icon) with shared localization.
 *
 * @internal
 */
export declare const ContextMenuButton: ForwardRefExoticComponent<
  ContextMenuButtonProps &
    Pick<HTMLProps<HTMLButtonElement>, 'hidden' | 'onClick' | 'disabled'> &
    RefAttributes<HTMLButtonElement>
>

declare type ContextMenuButtonProps = Pick<
  ButtonProps,
  'mode' | 'paddingY' | 'size' | 'tone' | 'tooltipProps'
>

/**
 * Login methods that acknowledge cookieless authentication tokens.
 *
 * @internal
 * @hidden
 */
export declare type CookielessCompatibleLoginMethod = Extract<LoginMethod, 'dual' | 'token'>

/** @internal */
export declare class CorsOriginError extends Error {
  projectId?: string
  constructor({projectId}: CorsOriginErrorOptions)
}

/** @internal */
export declare interface CorsOriginErrorOptions {
  projectId?: string
}

/**
 * @internal
 */
export declare const createAuthStore: typeof _createAuthStore & MemoizedFunction

/**
 * @internal
 */
export declare function _createAuthStore({
  clientFactory: clientFactoryOption,
  projectId,
  dataset,
  apiHost,
  loginMethod,
  ...providerOptions
}: AuthStoreOptions): AuthStore

/** @internal */
export declare const createBufferedDocument: (
  documentId: string,
  listenerEvent$: Observable<ListenerEvent>,
) => BufferedDocumentWrapper

/**
 * @deprecated Use `defineConfig` instead
 *
 * @hidden
 * @beta
 */
export declare function createConfig<T extends Config>(config: T): T

/**
 * This is the beginning of what should be the data store tracking connection status in the Sanity studio.
 *
 * @internal
 */
export declare function createConnectionStatusStore({
  bifur,
}: ConnectionStatusStoreOptions): ConnectionStatusStore

/** @internal */
export declare function createDocumentPreviewStore({
  client,
}: DocumentPreviewStoreOptions): DocumentPreviewStore

/** @internal */
export declare function createDocumentStore({
  getClient,
  documentPreviewStore,
  historyStore,
  initialValueTemplates,
  schema,
  i18n,
}: DocumentStoreOptions): DocumentStore

/** @internal */
export declare function createDraftFrom(document: SanityDocument): SanityDocument

/** @internal */
export declare function createGrantsStore(opts: GrantsStoreOptions): GrantsStore

/** @internal */
export declare function createHistoryStore({client}: HistoryStoreOptions): HistoryStore

/** @internal */
export declare function createHookFromObservableFactory<T, TArg = void>(
  observableFactory: (arg: TArg) => Observable<T>,
  initialValue: T,
): ReactHook<TArg, LoadingTuple<T>>

/** @internal */
export declare function createHookFromObservableFactory<T, TArg = void>(
  observableFactory: (arg: TArg) => Observable<T>,
  initialValue?: T,
): ReactHook<TArg, LoadingTuple<T | undefined>>

/** @internal */
export declare function createKeyValueStore({client}: {client: SanityClient}): KeyValueStore

/**
 * Creates a mock `AuthStore` (for testing) that emits an `AuthState` derived
 * from the `client` and `currentUser` given.
 *
 * @internal
 */
export declare function createMockAuthStore({client, currentUser}: MockAuthStoreOptions): AuthStore

/** @internal */
export declare function createNoopTrackerScope<T>(): {
  useReportedValues: () => Reported<T>[]
  Tracker: typeof NoopTracker
  useReporter: (id: string | null, value: T | (() => T)) => void
}

/** @internal */
export declare const createObservableBufferedDocument: (
  listenerEvent$: Observable<ListenerEvent>,
) => {
  updates$: Observable<DocumentRebaseEvent | DocumentMutationEvent | SnapshotEvent>
  consistency$: Observable<boolean>
  remoteSnapshot$: Observable<RemoteSnapshotEvent>
  commitRequest$: Subject<CommitRequest>
  addMutation: (mutation: MutationPayload) => void
  addMutations: (mutations: MutationPayload[]) => void
  commit: () => void
}

/**
 * @internal
 */
export declare function createPatchChannel(): PatchChannel

/**
 * @deprecated Use `definePlugin` instead
 *
 * @hidden
 * @beta
 */
export declare function createPlugin<TOptions = void>(
  arg: PluginFactory<TOptions> | PluginOptions,
): Plugin_2<TOptions>

/** @internal */
export declare function createProjectStore(context: {client: SanityClient}): ProjectStore

/** @internal */
export declare function createPublishedFrom(document: SanityDocument): SanityDocument

/**
 * @hidden
 * @beta */
export declare function createSchema(schemaDef: {name: string; types: any[]}): Schema

/** @internal */
export declare const createSharedResizeObserver: () => SharedResizeObserver

/**
 * PRIMARILY FOR TESTING PURPOSES.
 *
 * This will create a fully resolved source from a config and optionally
 * allows a `client` and `currentUser` override. This exists primarily for
 * testing purposes. If you need to use a source, we recommend using the
 * `useSource` hook to grab the fully resolved source from the `StudioProvider`
 *
 * @internal
 */
export declare function createSourceFromConfig(
  options: CreateWorkspaceFromConfigOptions,
): Promise<Source>

/** @internal */
export declare function createTrackerScope<Value>(): {
  Tracker: (props: {children: ReactNode}) => JSX_2.Element
  useReportedValues: () => Reported<Value>[]
  useReporter: ReporterHook<Value>
  useAutoIdReporter: (value: Value | (() => Value), isEqual?: IsEqualFunction<Value>) => void
}

/** @internal */
export declare function createUserColorManager(options: UserColorManagerOptions): UserColorManager

/** @internal */
export declare function createUseReporter<Value>(
  Context: Context<TrackerContext<Value>>,
): ReporterHook<Value>

/**
 * Given a `client` and a `currentUser` creates a datastore that handles
 * fetching, batch fetching, and caching users.
 *
 * @internal
 */
export declare function createUserStore({client: _client, currentUser}: UserStoreOptions): UserStore

/**
 * PRIMARILY FOR TESTING PURPOSES.
 *
 * This will create a fully resolved workspace from a config and optionally
 * allows a `client` and `currentUser` override. This exists primarily for
 * testing purposes. If you need to use a workspace, we recommend using the
 * `useWorkspace` hook to grab the fully resolved workspace from the
 * `StudioProvider`
 *
 * @internal
 */
export declare function createWorkspaceFromConfig(
  options: CreateWorkspaceFromConfigOptions,
): Promise<Workspace>

/** @internal */
export declare type CreateWorkspaceFromConfigOptions =
  | SingleWorkspace
  | (SingleWorkspace & {
      currentUser: CurrentUser
      getClient: (options: {apiVersion: string}) => SanityClient
      schema?: SchemaPluginOptions
    })

/**
 *
 * @hidden
 * @beta
 */
export declare interface CrossDatasetReferenceComponents {
  annotation?: ComponentType<BlockAnnotationProps>
  block?: ComponentType<BlockProps>
  diff?: ComponentType<any>
  field?: ComponentType<ObjectFieldProps<CrossDatasetReferenceValue>>
  inlineBlock?: ComponentType<BlockProps>
  input?: ComponentType<CrossDatasetReferenceInputProps>
  item?: ComponentType<ObjectItemProps<CrossDatasetReferenceValue & ObjectItem>>
  preview?: ComponentType<PreviewProps>
}

/**
 *
 * @hidden
 * @beta
 */
export declare function CrossDatasetReferenceInput(
  props: CrossDatasetReferenceInputProps,
): JSX_2.Element

/**
 *
 * @hidden
 * @beta
 */
export declare type CrossDatasetReferenceInputProps = ObjectInputProps<
  CrossDatasetReferenceValue,
  CrossDatasetReferenceSchemaType
>

/**
 *
 * @hidden
 * @beta
 */
export declare interface DateComponents {
  diff?: ComponentType<any>
  field?: ComponentType<StringFieldProps>
  input?: ComponentType<StringInputProps>
  item?: ComponentType<PrimitiveItemProps>
  preview?: ComponentType<PreviewProps>
}

/**
 * @hidden
 * @beta */
export declare function DateInput(props: DateInputProps): JSX_2.Element

/**
 * @hidden
 * @beta */
export declare type DateInputProps = StringInputProps

/**
 *
 * @hidden
 * @beta
 */
export declare interface DatetimeComponents {
  diff?: ComponentType<any>
  field?: ComponentType<StringFieldProps>
  input?: ComponentType<StringInputProps>
  item?: ComponentType<PrimitiveItemProps>
  preview?: ComponentType<PreviewProps>
}

/**
 * @hidden
 * @beta */
export declare function DateTimeInput(props: DateTimeInputProps): JSX_2.Element

/**
 * @hidden
 * @beta */
export declare type DateTimeInputProps = StringInputProps

/**
 * @hidden
 * @beta */
export declare function dec(amount?: number, path?: Path): FormDecPatch

/**
 * @internal
 */
export declare function decodePath(gradientPath: string): Path

/** @internal */
export declare const DEFAULT_MAX_RECURSION_DEPTH = 10

/**
 * Unless otherwise specified, this is the API version we use for controlled
 * requests on internal studio APIs. The user should always ask for a specific
 * API version when using the client - this way we can upgrade which version we
 * use internally without having the users code break unexpectedly. It also
 * means the user can easily upgrade to newer versions of GROQ when it arrives.
 *
 * @internal
 */
export declare const DEFAULT_STUDIO_CLIENT_OPTIONS: SourceClientOptions

/**
 * @hidden
 * @beta */
export declare function DefaultDocument(props: DefaultDocumentProps): ReactElement

/**
 * @hidden
 * @beta */
export declare interface DefaultDocumentProps {
  entryPath: string
  css?: string[]
  basePath?: string
}

/**
 * The default locale for the studio.
 *
 * @internal
 * @hidden
 */
export declare const defaultLocale: LocaleDefinition

declare type DefaultOperators = typeof searchOperators

/**
 * @hidden
 * @beta */
export declare function DefaultPreview(props: DefaultPreviewProps): JSX_2.Element

/**
 * @hidden
 * @beta */
export declare interface DefaultPreviewProps
  extends Omit<PreviewProps<'default'>, 'renderDefault'> {
  styles?: {
    root?: string
    placeholder?: string
    media?: string
    heading?: string
    title?: string
    subtitle?: string
    hasSubtitle?: string
    mediaString?: string
    status?: string
    children?: string
  }
}

/** @internal */
export declare const defaultRenderAnnotation: RenderAnnotationCallback

/** @internal */
export declare const defaultRenderBlock: RenderBlockCallback

/** @internal */
export declare const defaultRenderField: RenderFieldCallback

/** @internal */
export declare const defaultRenderInlineBlock: RenderBlockCallback

/** @internal */
export declare const defaultRenderInput: RenderInputCallback

/** @internal */
export declare const defaultRenderItem: RenderItemCallback

/** @internal */
export declare const defaultRenderPreview: RenderPreviewCallback

/** @internal */
export declare function defaultTemplateForType(schemaType: SchemaType): Template

/** @internal */
export declare function defaultTemplatesForSchema(schema: Schema): Template[]

/** @internal */
export declare const defaultTheme: RootTheme

/**
 * @hidden
 * @beta */
export declare function defineConfig<T extends Config>(config: T): T

/** @internal */
export declare function defineDocumentFieldAction(
  fieldAction: DocumentFieldAction,
): DocumentFieldAction

/**
 * Define a document inspector to be used in Sanity configuration.
 *
 * @example
 *
 * ```ts
 * // sanity.config.ts
 *
 * import {RocketIcon} from '@sanity/icons'
 * import {defineConfig, defineDocumentInspector} from 'sanity'
 *
 * const customInspector = defineDocumentInspector({
 *   name: 'custom',
 *   useMenuItem: () => ({
 *     icon: RocketIcon,
 *     showAsAction: true,
 *     title: 'Custom'
 *   }),
 *   component: lazy(() => import('./inspectors/custom')),
 * })
 *
 * export default defineConfig({
 *   // ...
 *
 *   document: {
 *     inspectors: (prev) => [customInspector, ...prev],
 *   },
 * })
 * ```
 *
 * @hidden @beta
 * */
export declare function defineDocumentInspector(inspector: DocumentInspector): DocumentInspector

/**
 * Defines a locale and makes it available for use in the studio.
 *
 * @param locale - The locale to define
 * @returns The locale that was passed, as-is (this is an "identity function")
 * @public
 */
export declare function defineLocale(locale: LocaleDefinition): LocaleDefinition

/**
 * Defines a resource bundle for a given locale and namespace.
 *
 * @param bundle - The bundle of resources to define
 * @returns The bundle that was passed, as-is (this is an "identity function")
 * @public
 */
export declare function defineLocaleResourceBundle(
  bundle: LocaleResourceBundle,
): LocaleResourceBundle

/**
 * Internal helper for definining resources for a given namespace.
 *
 * Used for automation (finding the officially defined namespaces and keys), and potentially in
 * the future for type safety/helpers.
 *
 * @param resources - Resources to define
 * @returns The resources that was passed, as-is (this is an "identity function")
 * @deprecated Sanity-internal helper, don't use in external code
 * @internal
 * @hidden
 */
export declare function defineLocalesResources<R extends Record<string, string>>(
  namespace: string,
  resources: R,
): R

/**
 * @hidden
 * @beta */
export declare function definePlugin<TOptions = void>(
  arg: PluginFactory<TOptions> | PluginOptions,
): Plugin_2<TOptions>

/**
 * @alpha
 */
export declare function defineSearchFilter<TOperators = SearchOperatorType>(
  filterDef: SearchFilterDefinition<TOperators>,
): typeof filterDef

/**
 * @alpha
 */
export declare function defineSearchFilterOperators<TOperators = SearchOperatorType>(
  operators: Operator<TOperators>[],
): typeof operators

/**
 * @alpha
 */
export declare function defineSearchOperator<
  TType extends string,
  TValue extends unknown | never,
  TOperatorSnippet extends
    | {
        type: TType
        inputComponent?: never
      }
    | {
        type: TType
        inputComponent: SearchOperatorInput<TValue>
      },
>(
  definition: (TOperatorSnippet extends {
    type: TType
    inputComponent: SearchOperatorInput<TValue>
  }
    ? SearchOperatorBuilder<TType, TValue>
    : ValuelessSearchOperatorBuilder<TType>) &
    TOperatorSnippet,
): typeof definition

declare interface DescriptionSerializerProps {
  blocks: PortableTextBlock[]
}

declare interface DescriptionSerializerProps {
  blocks: PortableTextBlock[]
}

/**
 * @hidden
 * @beta */
export declare function DetailPreview(props: DetailPreviewProps): JSX_2.Element

/**
 * @hidden
 * @beta */
export declare type DetailPreviewProps = PreviewProps<'detail'>

/** @internal */
export declare type Diff<A = unknown, O extends object = Record<string, any>> =
  | ArrayDiff<A>
  | BooleanDiff
  | NullDiff
  | NumberDiff
  | ObjectDiff<O>
  | StringDiff
  | TypeChangeDiff

/** @internal */
export declare const DiffCard: ForwardRefExoticComponent<
  Omit<DiffCardProps & Omit<HTMLProps<HTMLElement>, 'as' | 'height'>, 'ref'> &
    RefAttributes<unknown>
>

/** @internal */
export declare interface DiffCardProps {
  annotation?: Annotation
  as?: ElementType | keyof JSX.IntrinsicElements
  diff?: Diff
  disableHoverEffect?: boolean
  path?: Path | string
  tooltip?:
    | {
        description?: ReactNode
      }
    | boolean
}

/**
 * Diff components
 *
 * @internal
 */
export declare type DiffComponent<T extends Diff = Diff> = ComponentType<DiffProps<T>>

/** @internal */
export declare type DiffComponentOptions<T extends Diff = Diff> = {
  component: DiffComponent<T>
  showHeader?: boolean
}

/**
 * Resolvers
 *
 * @internal
 */
export declare type DiffComponentResolver = (options: {
  schemaType: SchemaType
  parentSchemaType?: ArraySchemaType | ObjectSchemaType
}) => ComponentType<any> | DiffComponentOptions<any> | undefined

/** @internal */
export declare const DiffContext: Context<{
  path: Path
}>

/** @internal */
export declare class DiffErrorBoundary extends Component<
  DiffErrorBoundaryProps,
  DiffErrorBoundaryState
> {
  static getDerivedStateFromError(error: Error): {
    error: Error
  }
  state: DiffErrorBoundaryState
  componentDidCatch(error: Error): void
  render(): string | number | boolean | Iterable<ReactNode> | JSX_2.Element | null | undefined
}

/** @internal */
export declare interface DiffErrorBoundaryProps {
  children: ReactNode
  t: TFunction
}

/** @internal */
export declare interface DiffErrorBoundaryState {
  error?: Error
}

/** @internal */
export declare function DiffFromTo(props: DiffFromToProps): JSX_2.Element

/** @internal */
export declare interface DiffFromToProps {
  align?: 'top' | 'center' | 'bottom'
  cardClassName?: string
  diff: Diff
  layout?: 'grid' | 'inline'
  path?: Path | string
  previewComponent: FieldPreviewComponent
  schemaType: SchemaType
}

/** @internal */
export declare function DiffInspectWrapper(props: DiffInspectWrapperProps & BoxProps): ReactElement

/** @internal */
export declare interface DiffInspectWrapperProps {
  children: ReactNode
  change: FieldChangeNode
  as?: ExecutionProps['as']
}

/**
 * @hidden
 * @beta */
export declare function diffMatchPatch(value: string, path?: Path): FormDiffMatchPatch

/** @internal */
export declare type DiffProps<T extends Diff = Diff> = {
  diff: T
  schemaType: T extends ObjectDiff
    ? ObjectSchemaType
    : T extends ArrayDiff
      ? ArraySchemaType
      : T extends BooleanDiff
        ? BooleanSchemaType
        : T extends StringDiff
          ? StringSchemaType
          : T extends NumberDiff
            ? NumberSchemaType
            : SchemaType
}

/** @internal */
export declare const diffResolver: DiffComponentResolver

/** @internal */
export declare function DiffString(props: {diff: StringDiff}): JSX_2.Element

/** @internal */
export declare function DiffStringSegment(props: {segment: StringDiffSegment}): ReactElement

/** @internal */
export declare function DiffTooltip(
  props: DiffTooltipProps | DiffTooltipWithAnnotationsProps,
): JSX_2.Element

/** @internal */
export declare interface DiffTooltipProps extends TooltipProps {
  children: ReactElement
  description?: ReactNode
  diff: Diff
  path?: Path | string
}

/** @internal */
export declare interface DiffTooltipWithAnnotationsProps extends TooltipProps {
  annotations: AnnotationDetails[]
  children: ReactElement
  description?: ReactNode
}

/** @internal */
export declare type DiffVisitor = (diff: Diff | StringDiffSegment, path: Path) => boolean

/** @internal */
export declare function DisabledChangeConnectorRoot({
  children,
  className,
}: DisabledChangeConnectorRootProps): JSX_2.Element

/** @internal */
export declare interface DisabledChangeConnectorRootProps {
  className?: string
  children: ReactNode
}

/**
 * @hidden
 * @beta */
export declare interface DocumentActionComponent extends ActionComponent<DocumentActionProps> {
  /**
   * An optional meta property that can used to replace this document action
   * with another. E.g.:
   *
   * ```js
   * import {defineConfig} from 'sanity'
   * import {MyPublishAction} from '...'
   *
   * export default defineConfig({
   *   document: {
   *     actions: (prev) =>
   *       prev.map((previousAction) =>
   *         previousAction.action === 'publish' ? MyPublishAction : previousAction
   *       ),
   *   },
   * })
   * ```
   */
  action?: 'delete' | 'discardChanges' | 'duplicate' | 'restore' | 'publish' | 'unpublish'
}

/**
 * @hidden
 * @beta */
export declare interface DocumentActionConfirmDialogProps {
  type: 'confirm'
  tone?: ButtonTone
  message: ReactNode
  onConfirm: () => void
  onCancel: () => void
  cancelButtonIcon?: ComponentType | ReactNode
  cancelButtonText?: string
  confirmButtonIcon?: ComponentType | ReactNode
  confirmButtonText?: string
}

/**
 * @hidden
 * @beta */
export declare interface DocumentActionCustomDialogComponentProps {
  type: 'custom'
  component: ReactNode
}

/**
 * @hidden
 * @beta */
export declare interface DocumentActionDescription {
  tone?: ButtonTone
  dialog?: DocumentActionDialogProps | false | null
  disabled?: boolean
  icon?: ReactNode | ComponentType
  label: string
  onHandle?: () => void
  shortcut?: string | null
  title?: ReactNode
  /**
   * @beta
   */
  group?: DocumentActionGroup[]
}

/**
 * @hidden
 * @beta */
export declare type DocumentActionDialogProps =
  | DocumentActionConfirmDialogProps
  | DocumentActionPopoverDialogProps
  | DocumentActionModalDialogProps
  | DocumentActionCustomDialogComponentProps

/**
 * @hidden
 * @beta */
export declare type DocumentActionGroup = 'default' | 'paneActions'

/**
 * @hidden
 * @beta */
export declare interface DocumentActionModalDialogProps {
  type?: 'dialog'
  content: ReactNode
  /**
   *
   * @hidden
   * @beta
   */
  footer?: DialogProps['footer']
  /**
   *
   * @hidden
   * @beta
   */
  header?: ReactNode
  onClose: () => void
  showCloseButton?: boolean
  /**
   *
   * @hidden
   * @beta
   */
  width?: 'small' | 'medium' | 'large' | 'full'
}

/**
 * @hidden
 * @beta */
export declare interface DocumentActionPopoverDialogProps {
  type: 'popover'
  content: ReactNode
  onClose: () => void
}

/**
 * @hidden
 * @beta */
export declare interface DocumentActionProps extends EditStateFor {
  revision?: string
  onComplete: () => void
}

/**
 * @hidden
 * @beta
 */
export declare interface DocumentActionsContext extends ConfigContext {
  documentId?: string
  schemaType: string
}

/**
 * @hidden
 * @beta
 */
export declare type DocumentActionsResolver = ComposableOption<
  DocumentActionComponent[],
  DocumentActionsContext
>

/**
 * @hidden
 * @beta */
export declare type DocumentAvailability =
  | {
      available: true
      reason: 'READABLE'
    }
  | {
      available: false
      reason: 'PERMISSION_DENIED' | 'NOT_FOUND'
    }

/**
 * @hidden
 * @beta */
export declare interface DocumentBadgeComponent {
  (props: DocumentBadgeProps): DocumentBadgeDescription | null
}

/**
 * @hidden
 * @beta */
export declare interface DocumentBadgeDescription {
  title?: string
  label?: string | undefined
  color?: 'primary' | 'success' | 'warning' | 'danger'
  icon?: ReactNode | ComponentType
}

/**
 * @hidden
 * @beta */
export declare interface DocumentBadgeProps extends EditStateFor {}

/**
 * @hidden
 * @beta
 */
export declare interface DocumentBadgesContext extends ConfigContext {
  documentId?: string
  schemaType: string
}

/**
 * @hidden
 * @beta
 */
export declare type DocumentBadgesResolver = ComposableOption<
  DocumentBadgeComponent[],
  DocumentBadgesContext
>

/** @internal */
export declare const DocumentChangeContext: Context<DocumentChangeContextInstance | null>

/** @internal */
export declare type DocumentChangeContextInstance = {
  documentId: string
  schemaType: SchemaType
  rootDiff: ObjectDiff | null
  isComparingCurrent: boolean
  FieldWrapper: ComponentType<{
    path: Path
    children: ReactNode
    hasHover: boolean
  }>
  value: Partial<SanityDocument>
}

/** @hidden @beta */
export declare interface DocumentCommentsEnabledContext {
  documentId?: string
  documentType: string
}

/**
 *
 * @hidden
 * @beta
 */
export declare interface DocumentComponents {
  diff?: ComponentType<any>
  field?: ComponentType<ObjectFieldProps>
  input?: ComponentType<ObjectInputProps>
  item?: ComponentType<ObjectItemProps>
  preview?: ComponentType<PreviewProps>
}

declare interface DocumentComponents_2 {
  /** @internal */
  unstable_layout?: ComponentType<DocumentLayoutProps>
}

/**
 * @hidden
 * @beta */
export declare interface DocumentFieldAction {
  name: string
  useAction: DocumentFieldActionHook
}

/**
 * @hidden
 * @beta */
export declare interface DocumentFieldActionDivider {
  type: 'divider'
}

/**
 * @hidden
 * @beta */
export declare interface DocumentFieldActionGroup {
  type: 'group'
  children: DocumentFieldActionNode[]
  disabled?:
    | boolean
    | {
        reason: ReactNode
      }
  expanded?: boolean
  hidden?: boolean
  icon?: ComponentType
  renderAsButton?: boolean
  status?: DocumentFieldActionStatus
  title: string
  i18n?: I18nTextRecord<'title'>
  tone?: DocumentFieldActionTone
}

/**
 * @hidden
 * @beta */
export declare interface DocumentFieldActionHook {
  (props: DocumentFieldActionProps): DocumentFieldActionItem | DocumentFieldActionGroup
}

/**
 * @hidden
 * @beta */
export declare interface DocumentFieldActionItem {
  type: 'action'
  disabled?:
    | boolean
    | {
        reason: ReactNode
      }
  hidden?: boolean
  icon?: ComponentType
  iconRight?: ComponentType
  onAction: () => void
  renderAsButton?: boolean
  selected?: boolean
  status?: DocumentFieldActionStatus
  title: string
  i18n?: I18nTextRecord<'title'>
  tone?: DocumentFieldActionTone
}

/**
 * @hidden
 * @beta */
export declare type DocumentFieldActionNode =
  | DocumentFieldActionItem
  | DocumentFieldActionGroup
  | DocumentFieldActionDivider

/**
 * @hidden
 * @beta */
export declare interface DocumentFieldActionProps {
  documentId: string
  documentType: string
  path: Path
  schemaType: SchemaType
}

/** @internal */
export declare const documentFieldActionsReducer: ConfigPropertyReducer<
  DocumentFieldAction[],
  DocumentFieldActionsResolverContext
>

/**
 * @hidden
 * @beta */
export declare type DocumentFieldActionsResolver = ComposableOption<
  DocumentFieldAction[],
  DocumentFieldActionsResolverContext
>

/**
 * @hidden
 * @beta */
export declare interface DocumentFieldActionsResolverContext extends ConfigContext {
  documentId: string
  documentType: string
  schemaType: SchemaType
}

/**
 * @hidden
 * @beta */
export declare type DocumentFieldActionStatus = 'info' | 'success' | 'warning' | 'error'

/**
 * @hidden
 * @beta */
export declare type DocumentFieldActionTone = 'primary' | 'positive' | 'caution' | 'critical'

/** @internal */
export declare type DocumentFormNode<
  T extends {
    [key in string]: unknown
  } = {
    [key in string]: unknown
  },
  S extends ObjectSchemaType = ObjectSchemaType,
> = ObjectFormNode<T, S>

/**
 *
 * Checks if the document ID `documentId` has the same ID as `equalsDocumentId`,
 * ignoring the draft prefix.
 *
 * @public
 *
 * @param documentId - The document ID to check
 * @param equalsDocumentId - The document ID to check against
 *
 * @example
 * Draft vs published document ID, but representing the same document:
 * ```
 * // Prints "true":
 * console.log(documentIdEquals('drafts.agot', 'agot'));
 * ```
 * @example
 * Different documents:
 * ```
 * // Prints "false":
 * console.log(documentIdEquals('hp-tcos', 'hp-hbp'));
 * ```
 *
 * @returns `true` if the document IDs are equal, `false` otherwise
 */
export declare function documentIdEquals(documentId: string, equalsDocumentId: string): boolean

/** @hidden @beta */
export declare interface DocumentInspector {
  name: string
  component: DocumentInspectorComponent
  /**
   * Hook for defining a menu item for the inspector.
   */
  useMenuItem?: (props: DocumentInspectorUseMenuItemProps) => DocumentInspectorMenuItem
  /**
   * Callback for when the inspector is closed, which can be used to clean up custom document pane
   * parameters.
   */
  onClose?: (ctx: {params: Record<string, string | undefined>}) => {
    params: Record<string, string | undefined>
  }
  /**
   * Callback for when the inspector is opened, which can be used to set custom document pane
   * parameters.
   */
  onOpen?: (ctx: {params: Record<string, string | undefined>}) => {
    params: Record<string, string | undefined>
  }
}

/** @hidden @beta */
export declare type DocumentInspectorComponent = ComponentType<DocumentInspectorProps>

/** @hidden @beta */
export declare interface DocumentInspectorContext extends ConfigContext {
  documentId?: string
  documentType: string
}

/** @hidden @beta */
export declare interface DocumentInspectorMenuItem {
  hidden?: boolean
  hotkeys?: string[]
  icon?: ComponentType
  showAsAction?: boolean
  status?: ButtonTone
  title: string
  tone?: ButtonTone
}

/** @hidden @beta */
export declare interface DocumentInspectorProps {
  documentId: string
  documentType: string
  onClose: () => void
}

/** @hidden @beta */
export declare type DocumentInspectorsResolver = ComposableOption<
  DocumentInspector[],
  DocumentInspectorContext
>

/** @hidden @beta */
export declare interface DocumentInspectorUseMenuItemProps {
  documentId: string
  documentType: string
}

/**
 *
 * @hidden
 * @beta
 */
export declare type DocumentLanguageFilterComponent = ComponentType<{
  schemaType: ObjectSchemaType
}>

/**
 *
 * @hidden
 * @beta
 */
export declare interface DocumentLanguageFilterContext extends ConfigContext {
  documentId?: string
  schemaType: string
}

/**
 *
 * @hidden
 * @beta
 */
export declare type DocumentLanguageFilterResolver = ComposableOption<
  DocumentLanguageFilterComponent[],
  DocumentLanguageFilterContext
>

/** @internal*/
export declare interface DocumentLayoutProps {
  /**
   * The ID of the document. This is a read-only property and changing it will have no effect.
   */
  documentId: string
  /**
   * The type of the document. This is a read-only property and changing it will have no effect.
   */
  documentType: string
  renderDefault: (props: DocumentLayoutProps) => React.ReactElement
}

/**
 * @hidden
 * @beta */
export declare interface DocumentMutationEvent {
  type: 'mutation'
  document: SanityDocument
  mutations: MutationPayload[]
  origin: 'local' | 'remote'
}

/** @internal */
export declare interface DocumentPairPermissionsOptions {
  client: SanityClient
  schema: Schema
  grantsStore: GrantsStore
  id: string
  type: string
  permission: DocumentPermission
}

/** @internal */
export declare type DocumentPermission =
  | 'delete'
  | 'discardDraft'
  | 'publish'
  | 'unpublish'
  | 'update'
  | 'duplicate'

/**
 * @hidden
 * @beta
 */
export declare interface DocumentPluginOptions {
  badges?: DocumentBadgeComponent[] | DocumentBadgesResolver
  actions?: DocumentActionComponent[] | DocumentActionsResolver
  /**
   * Components for the document.
   * @internal
   */
  components?: DocumentComponents_2
  /** @internal */
  unstable_fieldActions?: DocumentFieldAction[] | DocumentFieldActionsResolver
  /** @hidden @beta */
  inspectors?: DocumentInspector[] | DocumentInspectorsResolver
  /**
   * @hidden
   * @beta
   */
  productionUrl?: AsyncComposableOption<string | undefined, ResolveProductionUrlContext>
  /**
   * @hidden
   * @beta
   */
  unstable_languageFilter?: DocumentLanguageFilterResolver
  /**
   * @hidden
   * @beta
   */
  newDocumentOptions?: NewDocumentOptionsResolver
  /** @internal */
  unstable_comments?: {
    enabled: boolean | ((context: DocumentCommentsEnabledContext) => boolean)
  }
}

/** @internal */
export declare interface DocumentPresence {
  user: User
  path: Path
  sessionId: string
  lastActiveAt: string
}

/** @internal */
export declare function DocumentPreviewPresence(props: DocumentPreviewPresenceProps): JSX_2.Element

/** @internal */
export declare interface DocumentPreviewPresenceProps {
  presence: Omit<DocumentPresence, 'path'>[]
}

/**
 * @hidden
 * @beta */
export declare interface DocumentPreviewStore {
  observePaths: ObservePathsFn
  observeForPreview: ObserveForPreviewFn
  observeDocumentTypeFromId: (id: string, apiConfig?: ApiConfig) => Observable<string | undefined>
  /**
   *
   * @hidden
   * @beta
   */
  unstable_observeDocumentPairAvailability: (
    id: string,
  ) => Observable<DraftsModelDocumentAvailability>
  unstable_observePathsDocumentPair: <T extends SanityDocument = SanityDocument>(
    id: string,
    paths: PreviewPath[],
  ) => Observable<DraftsModelDocument<T>>
}

/** @internal */
export declare interface DocumentPreviewStoreOptions {
  client: SanityClient
}

/**
 * @hidden
 * @beta */
export declare interface DocumentRebaseEvent {
  type: 'rebase'
  document: SanityDocument
  remoteMutations: MutationPayload[]
  localMutations: MutationPayload[]
}

/**
 * @hidden
 * @beta */
export declare interface DocumentRemoteMutationEvent {
  type: 'remoteMutation'
  head: SanityDocument
  transactionId: string
  author: string
  timestamp: Date
  effects: {
    apply: unknown
    revert: unknown
  }
}

/**
 * @hidden
 * @beta */
export declare type DocumentRemoteMutationVersionEvent = Exclude<
  RemoteSnapshotVersionEvent,
  {
    type: 'snapshot'
  }
>

/**
 * Displays document status indicating both last published and edited dates in either relative (the default)
 * or absolute formats.
 *
 * These can be displayed in a single or multi-line (the default) lockups.
 *
 * Example: `**Published Oct 16 2023** Edited 8m ago`
 *
 * @internal
 */
export declare function DocumentStatus({
  absoluteDate,
  draft,
  published,
  singleLine,
}: DocumentStatusProps): JSX_2.Element

/**
 * Renders a dot indicating the current document status.
 *
 * - Yellow (caution) for published documents with edits
 * - Gray (default) for unpublished documents (with or without edits)
 *
 * No dot will be displayed for published documents without edits.
 *
 * @internal
 */
export declare function DocumentStatusIndicator({
  draft,
  published,
}: DocumentStatusProps_2): JSX_2.Element | null

declare interface DocumentStatusProps {
  absoluteDate?: boolean
  draft?: PreviewValue | Partial<SanityDocument> | null
  published?: PreviewValue | Partial<SanityDocument> | null
  singleLine?: boolean
}

declare interface DocumentStatusProps_2 {
  draft?: PreviewValue | Partial<SanityDocument> | null
  published?: PreviewValue | Partial<SanityDocument> | null
}

/**
 * @hidden
 * @beta */
export declare interface DocumentStore {
  /** @internal */
  checkoutPair: (idPair: IdPair) => Pair
  initialValue: (
    opts: InitialValueOptions,
    context: InitialValueResolverContext,
  ) => Observable<InitialValueMsg>
  listenQuery: (
    query:
      | string
      | {
          fetch: string
          listen: string
        },
    params: QueryParams,
    options: ListenQueryOptions,
  ) => Observable<any>
  resolveTypeForDocument: (id: string, specifiedType?: string) => Observable<string>
  pair: {
    consistencyStatus: (publishedId: string, type: string) => Observable<boolean>
    /** @internal */
    documentEvents: (publishedId: string, type: string) => Observable<DocumentVersionEvent>
    /** @internal */
    editOperations: (publishedId: string, type: string) => Observable<OperationsAPI>
    editState: (publishedId: string, type: string) => Observable<EditStateFor>
    operationEvents: (
      publishedId: string,
      type: string,
    ) => Observable<OperationSuccess | OperationError>
    validation: (publishedId: string, type: string) => Observable<ValidationStatus>
  }
}

/** @internal */
export declare interface DocumentStoreOptions {
  getClient: (options: SourceClientOptions) => SanityClient
  documentPreviewStore: DocumentPreviewStore
  historyStore: HistoryStore
  schema: Schema
  initialValueTemplates: Template[]
  i18n: LocaleSource
}

/** @internal */
export declare interface DocumentTypeResolveState {
  isLoaded: boolean
  documentType: string | undefined
}

/**
 * @hidden
 * @beta */
export declare type DocumentValuePermission =
  | 'read'
  | 'create'
  | 'update'
  | 'history'
  | 'editHistory'

/** @internal */
export declare interface DocumentValuePermissionsOptions {
  grantsStore: GrantsStore
  document: Record<string, unknown>
  permission: DocumentValuePermission
}

/**
 * @hidden
 * @beta */
export declare interface DocumentVersion {
  consistency$: Observable<boolean>
  remoteSnapshot$: Observable<RemoteSnapshotVersionEvent>
  events: Observable<DocumentVersionEvent>
  patch: (patches: any[]) => MutationPayload[]
  create: (document: Partial<SanityDocument>) => MutationPayload
  createIfNotExists: (document: SanityDocument) => MutationPayload
  createOrReplace: (document: SanityDocument) => MutationPayload
  delete: () => MutationPayload
  mutate: (mutations: MutationPayload[]) => void
  commit: () => void
}

/**
 * @hidden
 * @beta */
export declare type DocumentVersionEvent = WithVersion<ReconnectEvent | BufferedDocumentEvent>

/** @internal */
export declare interface DocumentVersionSnapshots {
  snapshots$: Observable<SanityDocument>
  patch: (patches: any[]) => MutationPayload[]
  create: (document: any) => MutationPayload
  createIfNotExists: (document: any) => MutationPayload
  createOrReplace: (document: any) => MutationPayload
  delete: () => MutationPayload
  mutate: (mutations: MutationPayload[]) => void
  commit: () => void
}

/** @internal */
export declare type DraftId = Opaque<string, 'draftId'>

/** @internal */
export declare const DRAFTS_FOLDER = 'drafts'

/**
 * @hidden
 * @beta */
export declare interface DraftsModelDocument<T extends SanityDocumentLike = SanityDocumentLike> {
  id: string
  type: string | null
  draft: {
    availability: DocumentAvailability
    snapshot: T | undefined
  }
  published: {
    availability: DocumentAvailability
    snapshot: T | undefined
  }
}

/**
 * @hidden
 * @beta */
export declare interface DraftsModelDocumentAvailability {
  /**
   * document readability for the published document
   */
  published: DocumentAvailability
  /**
   * document readability for the draft document
   */
  draft: DocumentAvailability
}

/**
 * This error may happen for arrays of objects where one or more of the members are having duplicate keys
 *
 * @public
 */
export declare type DuplicateKeysError = {
  type: 'DUPLICATE_KEYS'
  schemaType: ArraySchemaType
  duplicates: [index: number, key: string][]
}

/** @internal */
export declare interface EditReferenceLinkComponentProps {
  documentId: string
  documentType: string
  parentRefPath: Path
  template?: TemplateOption
  children: ReactNode
}

/**
 * @internal
 */
export declare interface EditReferenceOptions {
  id: string
  type: string
  parentRefPath: Path
  template: TemplateOption
}

/** @internal */
export declare const editState: (
  arg1: {
    client: SanityClient
    schema: Schema
  },
  arg2: IdPair,
  arg3: string,
) => Observable<EditStateFor>

/**
 * @hidden
 * @beta */
export declare interface EditStateFor {
  id: string
  type: string
  transactionSyncLock: TransactionSyncLockState | null
  draft: SanityDocument | null
  published: SanityDocument | null
  liveEdit: boolean
  ready: boolean
}

/**
 *
 * @hidden
 * @beta
 */
export declare interface EmailComponents {
  diff?: ComponentType<any>
  field?: ComponentType<StringFieldProps>
  input?: ComponentType<StringInputProps>
  item?: ComponentType<PrimitiveItemProps>
  preview?: ComponentType<PreviewProps>
}

/**
 *
 * @hidden
 * @beta
 */
export declare function EmailInput(props: EmailInputProps): JSX_2.Element

/**
 *
 * @hidden
 * @beta
 */
export declare type EmailInputProps = StringInputProps

/** @internal */
export declare function emitOperation(
  operationName: keyof OperationsAPI,
  idPair: IdPair,
  typeName: string,
  extraArgs: any[],
): void

/** @internal */
export declare const EMPTY_ARRAY: never[]

/** @internal */
export declare const EMPTY_OBJECT: Record<string, unknown>

/** @internal */
export declare function EnabledChangeConnectorRoot({
  children,
  className,
  isReviewChangesOpen,
  onOpenReviewChanges,
  onSetFocus,
  ...restProps
}: EnabledChangeConnectorRootProps): JSX_2.Element

/** @internal */
export declare interface EnabledChangeConnectorRootProps {
  children: ReactNode
  className?: string
  isReviewChangesOpen: boolean
  onOpenReviewChanges: () => void
  onSetFocus: (path: Path) => void
}

/**
 * @internal
 */
export declare function encodePath(formBuilderPath: Path): string

/**
 * @internal
 */
export declare function ErrorMessage({
  error,
  message,
  path,
  stack,
}: ErrorMessageProps): JSX_2.Element

/**
 * @internal
 */
export declare interface ErrorMessageProps {
  message: string
  stack?: string
  error: unknown
  path: Array<{
    name: string
    type: string
  }>
}

/** @internal */
export declare interface ErrorState {
  value: undefined
  error: Error
  isLoading: false
}

/** @internal */
export declare type ErrorStatus = {
  type: 'error'
  error: Error
  attemptNo: number
  isOffline: boolean
  retryAt: Date
}

/** @internal */
export declare const escapeField: (fieldName: string) => string

/** @internal */
export declare interface EvaluationParams {
  identity?: string
}

declare interface ExecuteArgs {
  operationName: keyof OperationsAPI
  idPair: IdPair
  typeName: string
  extraArgs: any[]
}

/** @internal */
export declare interface ExpandFieldSetOperation {
  type: 'expandFieldSet'
  path: Path
}

/** @internal */
export declare type ExpandOperation =
  | ExpandPathOperation
  | ExpandFieldSetOperation
  | SetActiveGroupOperation

/** @internal */
export declare interface ExpandPathOperation {
  type: 'expandPath'
  path: Path
}

/** @internal */
export declare const FallbackDiff: DiffComponent<Diff<unknown, Record<string, unknown>>>

declare interface Features {
  enabled: boolean
  error: Error | null
  features: string[]
  isLoading: boolean
}

/** @internal */
export declare const FieldActionMenu: NamedExoticComponent<FieldActionMenuProps>

/** @internal */
export declare interface FieldActionMenuProps {
  nodes: DocumentFieldActionNode[]
  onMenuOpenChange: (open: boolean) => void
}

/** @internal */
declare interface FieldActionsContextValue {
  actions: DocumentFieldActionNode[]
  focused?: boolean
  hovered: boolean
  onMouseEnter: () => void
  onMouseLeave: () => void
}

/** @internal */
export declare interface FieldActionsProps {
  actions: DocumentFieldAction[]
  documentId: string
  documentType: string
  onActions: (actions: DocumentFieldActionNode[]) => void
  path: Path
  schemaType: SchemaType
}

/** @internal */
export declare function FieldActionsProvider(props: FieldActionsProviderProps): JSX_2.Element

declare type FieldActionsProviderProps = PropsWithChildren<{
  actions: DocumentFieldActionNode[]
  focused?: boolean
  path: Path
}>

/**
 *
 * The `FieldActionsResolver` component is responsible for resolving the actions for a given field.
 *
 * Since each field action is a React hook, they need to be rendered in a component that returns
 * `null` to allow for the hook's return value to be resolved.
 *
 * The way this works:
 *
 * - The parent component (`FieldProvider`) renders the `FieldActionsResolver` component.
 * - The `FieldActionsResolver` component renders each field action as a child component.
 * - Each field action is a React hook that returns a node, and calls `setFieldAction` with its
 *   index and value.
 * - The `FieldActionsResolver` keeps a state with the array of hook values, making sure the array
 *   has the same length as the number of actions.
 * - The `FieldActionsResolver` calls `onActions` with the array of hook values.
 *
 * @internal
 */
export declare const FieldActionsResolver: NamedExoticComponent<FieldActionsProps>

/** @internal */
export declare function FieldChange(
  props: {
    change: FieldChangeNode
    readOnly?: boolean
    hidden?: boolean
  } & HTMLAttributes<HTMLDivElement>,
): JSX_2.Element | null

/** @internal */
export declare interface FieldChangeNode {
  type: 'field'
  diff: Diff
  itemDiff?: ItemDiff
  parentDiff?: ObjectDiff | ArrayDiff
  key: string
  path: Path
  error?: FieldValueError
  titlePath: ChangeTitlePath
  schemaType: ObjectFieldType
  showHeader: boolean
  showIndex: boolean
  diffComponent?: DiffComponent
  parentSchema?: ArraySchemaType | ObjectSchemaType
  readOnly?: ConditionalProperty
  hidden?: ConditionalProperty
}

/** @internal @deprecated DO NOT USE */
export declare interface FieldCommentsProps {
  hasComments: boolean
  button: ReactNode
  isAddingComment: boolean
}

/**
 * Represents an error that occurred in a specific field of a data object.
 * @public
 *
 * @remarks
 * This interface is used to provide detailed information about the error,
 * including the field name, the error type, and the error message.
 */
export declare interface FieldError {
  /**
   * The type of error that occurred.
   */
  kind: 'error'
  /**
   * The unique identifier for the error.
   */
  key: string
  /**
   * The name of the field that the error occurred in.
   */
  fieldName: string
  /**
   * The specific error that occurred.
   *
   * ```md
   * Possible error types include:
   * - IncompatibleTypeError
   * - TypeAnnotationMismatchError
   * - MissingKeysError
   * - DuplicateKeysError
   * - UndeclaredMembersError
   * - MixedArrayError
   * ```
   *
   * See {@link IncompatibleTypeError},
   * {@link TypeAnnotationMismatchError},
   * {@link MissingKeysError},
   * {@link DuplicateKeysError},
   * {@link UndeclaredMembersError} and
   * {@link MixedArrayError} for more information.
   *
   */
  error:
    | IncompatibleTypeError
    | TypeAnnotationMismatchError
    | MissingKeysError
    | DuplicateKeysError
    | UndeclaredMembersError
    | MixedArrayError
}

/**
 * Represents a field member in a form.
 * @public
 */
export declare interface FieldMember<Node extends BaseFormNode = BaseFormNode> {
  /** The kind of the form node. */
  kind: 'field'
  /** The key of the field. */
  key: string
  /** The name of the field. */
  name: string
  /** The index of the field. */
  index: number
  /** Whether the field is collapsed. */
  collapsed: boolean | undefined
  /** Whether the field is collapsible. */
  collapsible: boolean | undefined
  /** Whether the field is open. */
  open: boolean
  /**
   * @internal
   * Whether this field is in the selected group.
   */
  inSelectedGroup: boolean
  /**
   * @internal
   * Names of the field groups this field is part of.
   */
  groups: string[]
  /**
   * @hidden
   * @beta
   * The form node that represents this field.
   */
  field: Node
}

/**
 * @hidden
 * @beta */
export declare type FieldName = string

/** @internal */
export declare const fieldNeedsEscape: (fieldName: string) => boolean

/** @internal */
export declare interface FieldOperationsAPI {
  patch: {
    execute: (patches: PatchOperations[]) => void
  }
}

/** @internal */
export declare const FieldPresence: typeof FieldPresenceWithoutOverlay

/** @internal */
export declare type FieldPresenceData = {
  element: HTMLElement
  presence: FormNodePresence[]
  maxAvatars: number
}

/** @internal */
export declare const FieldPresenceInner: NamedExoticComponent<FieldPresenceInnerProps>

/** @internal */
export declare interface FieldPresenceInnerProps {
  maxAvatars?: number
  presence: FormNodePresence[]
  stack?: boolean
  position?: AvatarPosition
  animateArrowFrom?: AvatarPosition
}

/** @internal */
export declare interface FieldPresenceProps {
  presence: FormNodePresence[]
  maxAvatars: number
}

/** @internal */
export declare function FieldPresenceWithoutOverlay(props: FieldPresenceProps): JSX_2.Element | null

/** @internal */
export declare function FieldPresenceWithOverlay(props: FieldPresenceProps): JSX_2.Element

/** @internal */
export declare type FieldPreviewComponent<T = any> = ComponentType<{
  color?: UserColor
  schemaType: T extends Array<any>
    ? ArraySchemaType
    : T extends boolean
      ? BooleanSchemaType
      : T extends string
        ? StringSchemaType
        : T extends number
          ? NumberSchemaType
          : T extends Reference
            ? ReferenceSchemaType
            : T extends object
              ? ObjectSchemaType
              : any
  value: T
}>

/**
 * @hidden
 * @public */
export declare type FieldProps =
  | ObjectFieldProps
  | ObjectFieldProps<CrossDatasetReferenceValue>
  | ObjectFieldProps<FileValue>
  | ObjectFieldProps<GeopointValue>
  | ObjectFieldProps<ImageValue>
  | ObjectFieldProps<ReferenceValue>
  | ObjectFieldProps<SlugValue>
  | ArrayFieldProps
  | NumberFieldProps
  | BooleanFieldProps
  | StringFieldProps

/**
 * Represents a member of a field set.
 * @public
 */
export declare interface FieldSetMember {
  /** The kind of member. */
  kind: 'fieldSet'
  /** The key of the member. */
  key: string
  /**
   * Indicates whether the member is included in the currently selected group.
   * If it's hidden and in the currently selected group, it should still be excluded from its group.
   * @internal
   */
  _inSelectedGroup: boolean
  /** The names of the field groups the member belongs to. */
  groups: string[]
  /**
   * @hidden
   * @beta
   * The state of the field set.
   */
  fieldSet: FieldsetState
}

/**
 * @hidden
 * @beta */
export declare interface FieldsetState {
  path: Path
  name: string
  level: number
  title?: string
  description?: string
  hidden?: boolean
  collapsible?: boolean
  collapsed?: boolean
  columns?: number | number[]
  members: (FieldMember | FieldError)[]
}

/** @internal */
export declare interface FieldStatusProps {
  children?: ReactNode
  maxAvatars?: number
  position?: 'top' | 'bottom'
}

/** @internal */
export declare interface FieldValueError {
  /**
   * i18n key for the error message
   */
  messageKey: StudioLocaleResourceKeys
  /**
   * The expected type of the value
   */
  expectedType: string
  /**
   * The actual type of the value
   */
  actualType: string
  /**
   * The actual value of the field
   */
  value: unknown
}

/**
 *
 * @hidden
 * @beta
 */
export declare interface FileComponents {
  annotation?: ComponentType<BlockAnnotationProps>
  block?: ComponentType<BlockProps>
  diff?: ComponentType<any>
  field?: ComponentType<ObjectFieldProps<FileValue>>
  inlineBlock?: ComponentType<BlockProps>
  input?: ComponentType<ObjectInputProps<FileValue>>
  item?: ComponentType<ObjectItemProps<FileValue & ObjectItem>>
  preview?: ComponentType<PreviewProps>
}

/**
 * @hidden
 * @beta */
export declare function FileInput(props: FileInputProps): JSX_2.Element

/**
 * @hidden
 * @beta */
export declare type FileInputProps = Omit<
  BaseFileInputProps,
  'assetSources' | 'directUploads' | 'observeAsset' | 'resolveUploader' | 'client' | 't'
>

/**
 *
 * @hidden
 * @beta
 */
export declare interface FileLike {
  type: string
  name?: string
}

declare type FiltersVisibleSet = {
  type: 'FILTERS_VISIBLE_SET'
  visible: boolean
}

/** @internal */
export declare function findIndex(array: unknown[], segment: PathSegment): number

/** @internal */
export declare type FIXME = any

/** @internal */
export declare type FIXME_SanityDocument = Record<string, unknown>

/**
 * @internal
 *
 * This function flattens the config tree into a list of configs in the order they should be applied.
 */
export declare const flattenConfig: (
  {plugins, ...currentConfig}: PluginOptions,
  path: string[],
) => {
  config: PluginOptions
  path: string[]
}[]

/**
 * Available measurement units
 *
 * @public
 */
export declare type FormattableMeasurementUnit =
  | 'acre'
  | 'bit'
  | 'byte'
  | 'celsius'
  | 'centimeter'
  | 'day'
  | 'degree'
  | 'fahrenheit'
  | 'fluid-ounce'
  | 'foot'
  | 'gallon'
  | 'gigabit'
  | 'gigabyte'
  | 'gram'
  | 'hectare'
  | 'hour'
  | 'inch'
  | 'kilobit'
  | 'kilobyte'
  | 'kilogram'
  | 'kilometer'
  | 'liter'
  | 'megabit'
  | 'megabyte'
  | 'meter'
  | 'mile'
  | 'mile-scandinavian'
  | 'milliliter'
  | 'millimeter'
  | 'millisecond'
  | 'minute'
  | 'month'
  | 'ounce'
  | 'percent'
  | 'petabyte'
  | 'pound'
  | 'second'
  | 'stone'
  | 'terabit'
  | 'terabyte'
  | 'week'
  | 'yard'
  | 'year'

/**
 * The result of the duration formatter
 *
 * @public
 */
export declare interface FormattedDuration {
  /** The human-readable, formatted duration as a string, eg "2 days, 3 hr, and 20 sec" */
  formatted: string
  /** The machine-readable, formatted ISO-8601 duration string, eg "P2DT3H20S" */
  iso8601: string
}

/**
 * @alpha
 */
export declare function FormBuilder(props: FormBuilderProps): JSX_2.Element

/** @internal */
export declare interface FormBuilderComponentResolverContext extends ConfigContext {
  schemaType: SchemaType
}

/**
 * @internal
 */
export declare const FormBuilderContext: Context<FormBuilderContextValue | null>

/**
 *
 * @hidden
 * @beta
 */
export declare interface FormBuilderContextValue {
  /**
   * @deprecated INTERNAL USE ONLY
   * @internal
   */
  __internal: {
    components: {
      CustomMarkers: FormBuilderCustomMarkersComponent
      Markers: FormBuilderMarkersComponent
    }
    file: {
      assetSources: AssetSource[]
      directUploads: boolean
    }
    filterField: FormBuilderFilterFieldFn
    image: {
      assetSources: AssetSource[]
      directUploads: boolean
    }
    patchChannel: PatchChannel
  }
  autoFocus?: boolean
  changesOpen?: boolean
  collapsedFieldSets: StateTree<boolean> | undefined
  collapsedPaths: StateTree<boolean> | undefined
  focusPath: Path
  focused?: boolean
  groups: FormFieldGroup[]
  id: string
  readOnly?: boolean
  renderAnnotation?: RenderAnnotationCallback
  renderBlock?: RenderBlockCallback
  renderField: RenderFieldCallback
  renderInlineBlock?: RenderBlockCallback
  renderInput: RenderInputCallback
  renderItem: RenderItemCallback
  renderPreview: RenderPreviewCallback
  schemaType: ObjectSchemaType
}

/**
 * Component for rendering custom block markers
 *
 * @public
 * @hidden
 * @deprecated use `renderBlock`, `renderInlineBlock`, `renderAnnotation` interfaces instead
 */
export declare type FormBuilderCustomMarkersComponent = ComponentType<{
  markers: PortableTextMarker[]
}>

/**
 * @internal
 */
export declare interface FormBuilderFilterFieldFn {
  (type: ObjectSchemaType, field: ObjectField, selectedLanguageIds: string[]): boolean
}

/**
 *
 * @hidden
 * @beta
 */
export declare type FormBuilderInputComponentMap = Record<
  string,
  {
    field?: ComponentType<FieldProps>
    item?: ComponentType<ItemProps>
    input?: ComponentType<InputProps>
    preview?: ComponentType<PreviewProps>
  }
>

/**
 *
 * @hidden
 * @beta
 */
export declare type FormBuilderMarkersComponent = ComponentType<{
  markers: PortableTextMarker[]
  renderCustomMarkers?: RenderCustomMarkers
  validation: FormNodeValidation[]
}>

/**
 * @alpha
 */
export declare interface FormBuilderProps
  extends Omit<ObjectFormNode, 'level' | 'path' | 'presence' | 'validation' | '_allMembers'> {
  /** @internal */
  __internal_fieldActions?: DocumentFieldAction[]
  /** @internal Considered internal – do not use. */
  __internal_patchChannel: PatchChannel
  autoFocus?: boolean
  changesOpen?: boolean
  collapsedFieldSets: StateTree<boolean> | undefined
  collapsedPaths: StateTree<boolean> | undefined
  focusPath: Path
  focused: boolean | undefined
  id: string
  onChange: (changeEvent: PatchEvent) => void
  onPathBlur: (path: Path) => void
  onPathFocus: (path: Path) => void
  onPathOpen: (path: Path) => void
  onFieldGroupSelect: (path: Path, groupName: string) => void
  onSetFieldSetCollapsed: (path: Path, collapsed: boolean) => void
  onSetPathCollapsed: (path: Path, collapsed: boolean) => void
  presence: FormNodePresence[]
  readOnly?: boolean
  schemaType: ObjectSchemaType
  validation: ValidationMarker[]
  value: FormDocumentValue | undefined
}

/**
 * @internal
 */
export declare const FormCallbacksContext: Context<FormCallbacksValue | null>

/** @internal */
export declare const FormCallbacksProvider: NamedExoticComponent<
  FormCallbacksValue & {
    children: ReactNode
  }
>

/** @internal */
export declare interface FormCallbacksValue {
  transformPatches?: (patches: FormPatch[]) => FormPatch[]
  onChange: (patchEvent: PatchEvent) => void
  onPathFocus: (path: Path) => void
  onPathBlur: (path: Path) => void
  onPathOpen: (path: Path) => void
  onSetPathCollapsed: (path: Path, collapsed: boolean) => void
  onSetFieldSetCollapsed: (path: Path, collapsed: boolean) => void
  onFieldGroupSelect: (path: Path, fieldGroupName: string) => void
}

/**
 * @hidden
 * @beta */
export declare interface FormComponents {
  annotation?: ComponentType<BlockAnnotationProps>
  block?: ComponentType<BlockProps>
  field?: ComponentType<FieldProps>
  inlineBlock?: ComponentType<BlockProps>
  input?: ComponentType<InputProps>
  item?: ComponentType<ItemProps>
  preview?: ComponentType<PreviewProps>
}

/**
 *
 * @hidden
 * @beta
 */
export declare interface FormDecPatch extends FormPatchBase {
  path: Path
  type: 'dec'
  origin?: FormPatchOrigin
  value: FormPatchJSONValue
}

/**
 *
 * @hidden
 * @beta
 */
export declare interface FormDiffMatchPatch extends FormPatchBase {
  path: Path
  type: 'diffMatchPatch'
  origin?: FormPatchOrigin
  value: string
}

/**
 * This represents the shape of the root value sanity forms expect
 * @hidden
 * @public
 */
export declare interface FormDocumentValue {
  _type: string
  _id: string
  [key: string]: unknown
}

/** @internal */
export declare const FormField: NamedExoticComponent<
  FormFieldProps & Omit<HTMLProps<HTMLDivElement>, 'ref' | 'as' | 'height'>
>

/**
 * @hidden
 * @beta */
export declare interface FormFieldGroup {
  name: string
  selected?: boolean
  disabled?: boolean
  title?: string
  icon?: ComponentType
}

/** @internal */
export declare const FormFieldHeaderText: NamedExoticComponent<FormFieldHeaderTextProps>

/** @internal */
export declare interface FormFieldHeaderTextProps {
  /**
   *
   * @hidden
   * @beta
   */
  validation?: FormNodeValidation[]
  description?: ReactNode
  /**
   * The unique ID used to target the actual input element
   */
  inputId?: string
  title?: ReactNode
  deprecated?: DeprecatedProperty
}

/** @internal */
export declare const FormFieldPresenceContext: Context<FormNodePresence[]>

/** @internal */
export declare interface FormFieldProps {
  /**
   * @hidden
   * @beta
   */
  __unstable_headerActions?: DocumentFieldActionNode[]
  /**
   * @hidden
   * @beta
   */
  __unstable_presence?: FormNodePresence[]
  /** @internal @deprecated DO NOT USE */
  __internal_comments?: FieldCommentsProps
  /** @internal @deprecated ONLY USED BY AI ASSIST PLUGIN */
  __internal_slot?: ReactNode
  children: ReactNode
  description?: ReactNode
  /**
   * The unique ID used to target the actual input element
   */
  inputId?: string
  /**
   * The nesting level of the form field
   */
  level?: number
  title?: ReactNode
  /**
   * @beta
   */
  validation?: FormNodeValidation[]
  deprecated?: DeprecatedProperty
}

/** @internal */
export declare const FormFieldSet: ForwardRefExoticComponent<
  FormFieldSetProps &
    Omit<HTMLProps<HTMLDivElement>, 'ref' | 'as' | 'height'> &
    RefAttributes<HTMLDivElement>
>

/** @internal */
export declare interface FormFieldSetProps {
  /**
   *
   * @hidden
   * @beta
   */
  __unstable_headerActions?: DocumentFieldActionNode[]
  /**
   * @beta
   */
  __unstable_presence?: FormNodePresence[]
  /** @internal @deprecated DO NOT USE */
  __internal_comments?: FieldCommentsProps
  /** @internal @deprecated ONLY USED BY AI ASSIST PLUGIN */
  __internal_slot?: ReactNode
  children: ReactNode | (() => ReactNode)
  collapsed?: boolean
  collapsible?: boolean
  columns?: number | number[]
  description?: ReactNode
  /**
   * The nesting level of the form field set
   */
  level?: number
  onCollapse?: () => void
  onExpand?: () => void
  title?: ReactNode
  /**
   *
   * @hidden
   * @beta
   */
  validation?: FormNodeValidation[]
  inputId: string
  deprecated?: DeprecatedProperty
}

/** @internal */
export declare function FormFieldStatus({
  children,
  maxAvatars,
  position,
}: FieldStatusProps): JSX_2.Element

/** @internal */
export declare type FormFieldValidation =
  | FormFieldValidationWarning
  | FormFieldValidationError
  | FormFieldValidationInfo

/** @internal */
export declare interface FormFieldValidationError {
  type: 'error'
  label: string
}

/** @internal */
export declare interface FormFieldValidationInfo {
  type: 'info'
  label: string
}

/** @internal */
export declare function FormFieldValidationStatus(
  props: FormFieldValidationStatusProps,
): JSX_2.Element

/** @internal */
export declare interface FormFieldValidationStatusProps {
  /**
   *
   * @hidden
   * @beta
   */
  validation?: FormNodeValidation[]
  /**
   *
   * @hidden
   * @beta
   */
  __unstable_showSummary?: boolean
  fontSize?: number | number
  placement?: Placement
}

/** @internal */
export declare interface FormFieldValidationWarning {
  type: 'warning'
  label: string
}

/**
 *
 * @hidden
 * @beta
 */
export declare interface FormIncPatch extends FormPatchBase {
  path: Path
  type: 'inc'
  origin?: FormPatchOrigin
  value: FormPatchJSONValue
}

/** @internal */
export declare const FormInput: NamedExoticComponent<
  (
    | ObjectInputProps<Record<string, any>, ObjectSchemaType>
    | ArrayOfObjectsInputProps<
        {
          _key: string
        },
        ArraySchemaType<unknown>
      >
  ) &
    (FormInputAbsolutePathArg | FormInputRelativePathArg) & {
      /**
       * Whether to include the field around the input. Defaults to false
       */
      includeField?: boolean | undefined
    }
>

/** @internal */
export declare type FormInputAbsolutePathArg = {
  absolutePath: Path
}

/** @internal */
export declare type FormInputRelativePathArg = {
  relativePath: Path
}

/**
 *
 * @hidden
 * @beta
 */
export declare interface FormInsertPatch extends FormPatchBase {
  path: Path
  origin?: FormPatchOrigin
  type: 'insert'
  position: FormInsertPatchPosition
  items: FormPatchJSONValue[]
}

/**
 *
 * @hidden
 * @beta
 */
export declare type FormInsertPatchPosition = 'before' | 'after'

/**
 * @hidden
 * @public */
export declare interface FormNodePresence {
  user: User
  path: Path
  sessionId: string
  lastActiveAt: string
}

/**
 *
 * @hidden
 * @beta
 */
export declare type FormPatch =
  | FormSetPatch
  | FormSetIfMissingPatch
  | FormUnsetPatch
  | FormInsertPatch
  | FormDiffMatchPatch

/**
 * @hidden
 * @beta */
export declare interface FormPatchBase {
  /**
   * A property used to identify this as a Sanity patch type, eg "set", "unset", "insert", etc.
   * This allows us to potentially introduce new patch types in the future without breaking
   * existing code. This is an internal property/implementation detail and should not be used by
   * consumers.
   *
   * @internal
   */
  patchType: symbol
}

/**
 *
 * @hidden
 * @beta
 */
export declare type FormPatchJSONValue =
  | number
  | string
  | boolean
  | {
      [key: string]: FormPatchJSONValue
    }
  | FormPatchJSONValue[]

/**
 *
 * @hidden
 * @beta
 */
export declare type FormPatchOrigin = 'remote' | 'local' | 'internal'

/**
 * Default wiring for `FormBuilderProvider` when used with Sanity
 *
 * @alpha This API might change.
 */
export declare function FormProvider(props: FormProviderProps): JSX_2.Element

/**
 * @alpha This API might change.
 */
export declare interface FormProviderProps {
  /** @internal */
  __internal_fieldActions?: DocumentFieldAction[]
  /** @internal Considered internal, do not use. */
  __internal_patchChannel: PatchChannel
  autoFocus?: boolean
  changesOpen?: boolean
  children?: ReactNode
  collapsedFieldSets: StateTree<boolean> | undefined
  collapsedPaths: StateTree<boolean> | undefined
  focusPath: Path
  focused: boolean | undefined
  groups: FormFieldGroup[]
  id: string
  onChange: (changeEvent: PatchEvent) => void
  onPathBlur: (path: Path) => void
  onPathFocus: (path: Path) => void
  onPathOpen: (path: Path) => void
  onFieldGroupSelect: (path: Path, groupName: string) => void
  onSetPathCollapsed: (path: Path, collapsed: boolean) => void
  onSetFieldSetCollapsed: (path: Path, collapsed: boolean) => void
  presence: FormNodePresence[]
  readOnly?: boolean
  schemaType: ObjectSchemaType
  validation: ValidationMarker[]
}

/**
 *
 * @hidden
 * @beta
 */
export declare interface FormSetIfMissingPatch extends FormPatchBase {
  path: Path
  origin?: FormPatchOrigin
  type: 'setIfMissing'
  value: FormPatchJSONValue
}

/**
 *
 * @hidden
 * @beta
 */
export declare interface FormSetPatch extends FormPatchBase {
  path: Path
  type: 'set'
  origin?: FormPatchOrigin
  value: FormPatchJSONValue
}

/** @internal */
export declare type FormState<
  T extends {
    [key in string]: unknown
  } = {
    [key in string]: unknown
  },
  S extends ObjectSchemaType = ObjectSchemaType,
> = ObjectFormNode<T, S>

/**
 *
 * @hidden
 * @beta
 */
export declare interface FormUnsetPatch extends FormPatchBase {
  path: Path
  origin?: FormPatchOrigin
  type: 'unset'
}

/**
 * @internal
 * @hidden
 */
export declare interface FormValueContextValue {
  value: FormDocumentValue | undefined
}

/**
 *
 * @internal
 * @hidden
 */
export declare function FormValueProvider(props: {
  value: FormDocumentValue | undefined
  children: ReactNode
}): JSX_2.Element

/**
 * @internal
 */
export declare function fromMutationPatches(
  origin: FormPatchOrigin,
  patches: MutationPatch[],
): FormPatch[]

/** @internal */
export declare const FromTo: ForwardRefExoticComponent<
  Omit<FromToProps, 'ref'> & RefAttributes<HTMLDivElement>
>

/** @internal */
export declare function FromToArrow(
  props: {
    direction?: FromToArrowDirection
  } & TextProps &
    Omit<HTMLProps<HTMLDivElement>, 'children' | 'ref'>,
): JSX_2.Element

/** @internal */
export declare type FromToArrowDirection = 'down' | 'right'

/** @internal */
export declare interface FromToIndex {
  hasMoved: boolean
  fromIndex?: number
  toIndex?: number
  annotation?: Annotation
}

/** @internal */
export declare type FromToProps = {
  align?: 'top' | 'center' | 'bottom'
  layout?: 'grid' | 'inline'
  from?: ReactNode
  to?: ReactNode
} & Omit<HTMLProps<HTMLDivElement>, 'children' | 'as' | 'height' | 'wrap'>

/**
 * General preview layout key
 *
 * @public
 */
export declare type GeneralPreviewLayoutKey = 'compact' | 'default' | 'media' | 'detail'

/**
 *
 * @hidden
 * @beta
 */
export declare interface GeopointComponents {
  annotation?: ComponentType<BlockAnnotationProps>
  block?: ComponentType<BlockProps>
  diff?: ComponentType<any>
  field?: ComponentType<ObjectFieldProps<GeopointValue>>
  inlineBlock?: ComponentType<BlockProps>
  input?: ComponentType<ObjectInputProps<GeopointValue>>
  item?: ComponentType<ObjectItemProps<GeopointValue & ObjectItem>>
  preview?: ComponentType<PreviewProps>
}

/** @internal */
export declare function getAnnotationAtPath(
  diff: Diff,
  diffPath: string | Path,
): Annotation | undefined

/** @internal */
export declare function getAnnotationColor(
  colorManager: UserColorManager,
  annotation?: Annotation | null,
): UserColor

/**
 * Reduce a {@link Source} down to a {@link ConfigContext}, without memoization - use for non-react contexts
 *
 * @param source - Source to convert
 * @returns A config context containing only the defined properties of that interface
 * @internal
 */
export declare function getConfigContextFromSource(source: Source): ConfigContext

/** @internal */
export declare function getDiffAtPath(diff: Diff, diffPath: string | Path): Diff | undefined

/**
 * The observable version of `useDocumentPairPermissions`
 *
 * @see useDocumentPairPermissions
 *
 * @internal
 */
export declare function getDocumentPairPermissions({
  client,
  grantsStore,
  schema,
  id,
  permission,
  type,
}: DocumentPairPermissionsOptions): Observable<PermissionCheckResult>

/**
 * The observable version of `useDocumentValuePermissions`
 *
 * @see useDocumentValuePermissions
 *
 * @internal
 */
export declare function getDocumentValuePermissions({
  grantsStore,
  document,
  permission,
}: DocumentValuePermissionsOptions): Observable<PermissionCheckResult>

/** @internal */
export declare function getDraftId(id: string): DraftId

/**
 * This takes a form state and returns a list of operations required to open a node at a particular path
 * @param node - The base form node (i.e. the form state node for the _document_)
 * @param path - The path to open
 *
 * @internal
 */
export declare function getExpandOperations(node: BaseFormNode, path: Path): ExpandOperation[]

/** @internal */
export declare function GetHookCollectionState<T, K>(
  props: GetHookCollectionStateProps<T, K>,
): JSX_2.Element

/** @internal */
export declare interface GetHookCollectionStateProps<T, K> {
  /**
   * Arguments that will be received by the action hooks, `onComplete` will be added by the HookStateContainer component.
   */
  args: T
  children: (props: {states: K[]}) => ReactNode
  hooks: ActionHook<
    T & {
      onComplete: () => void
    },
    K
  >[]
  onReset?: () => void
  /**
   * Name for the hook group. If provided, only hooks with the same group name will be included in the collection.
   */
  group?: string
}

/** @internal */
export declare function getIdPair(id: string): {
  draftId: DraftId
  publishedId: PublishedId
}

/**
 * @internal
 */
export declare function getInitialValueStream(
  schema: Schema,
  initialValueTemplates: Template[],
  documentPreviewStore: DocumentPreviewStore,
  opts: InitialValueOptions,
  context: InitialValueResolverContext,
): Observable<InitialValueMsg>

/** @internal */
export declare function getItemKey(arrayItem: unknown): string | undefined

/** @internal */
export declare function getItemKeySegment(arrayItem: unknown): KeyedSegment | undefined

/** @internal */
export declare function getNamelessWorkspaceIdentifier(
  title: string | undefined,
  index: number,
): string

/** @internal */
export declare function getPairListener(
  client: SanityClient,
  idPair: IdPair,
  options?: PairListenerOptions,
): Observable<ListenerEvent>

/** @internal */
export declare function getPreviewPaths(preview: SchemaType['preview']): PreviewPath[] | undefined

/**
 * Obtain a document's published and draft state, along with loading status.
 *
 * @internal
 */
export declare function getPreviewStateObservable(
  documentPreviewStore: DocumentPreviewStore,
  schemaType: SchemaType,
  documentId: string,
  title: ReactNode,
): Observable<PreviewState>

/**
 * Obtain document preview values used in <SanityPreview> and <SanityDefaultPreview> components.
 * Also displays fallback values if the document cannot be found.
 *
 * @internal
 */
export declare const getPreviewValueWithFallback: ({
  value,
  draft,
  published,
}: {
  value: SanityDocument
  draft?: Partial<SanityDocument> | PreviewValue | null | undefined
  published?: Partial<SanityDocument> | PreviewValue | null | undefined
}) =>
  | PreviewValue
  | {
      title: JSX_2.Element
      subtitle: JSX_2.Element
      media: () => JSX_2.Element
    }

/** @internal */
export declare function getProviderTitle(provider?: string): string | undefined

/** @internal */
export declare function getPublishedId(id: string): PublishedId

/**
 * Get the most specific defined title of a schema type
 * If not set directly on the given type, it will traverse up the tree until it
 * finds one, falling back to the _name_ of the type.
 *
 * @param type - The schema type to get the title of
 * @returns A title, alternatively the schema type _name_
 * @internal
 */
export declare function getSchemaTypeTitle(type: SchemaType): string

/**
 * The observable version of `useTemplatePermissions`
 *
 * @internal
 */
export declare function getTemplatePermissions({
  grantsStore,
  templateItems,
  templates,
  schema,
  context,
}: TemplatePermissionsOptions): Observable<
  Array<TemplatePermissionsResult<Record<string, unknown>>>
>

/** @internal */
export declare function getValueAtPath(rootValue: unknown, path: Path): unknown

/** @internal */
export declare function getValueError(
  value: unknown,
  schemaType: SchemaType,
): FieldValueError | undefined

/**
 * Gets a printable identifer for the workspace - either the name, or the index
 * and any potential title set for it
 *
 * @param workspace - The workspace to get the indentifier for
 * @param index - The index at which the workspace appeared in the source array
 * @returns Printable string (eg `intranet`, or `at index 5 (titled "Intranet")`)
 * @internal
 */
export declare function getWorkspaceIdentifier({name, title}: WorkspaceLike, index: number): string

/** @internal */
export declare interface GlobalErrorChannel {
  subscribe: (subscriber: GlobalErrorSubscriber) => GlobalErrorUnsubscriber
}

/** @internal */
export declare function GlobalErrorHandler(): JSX_2.Element

/** @internal */
export declare interface GlobalErrorMessage {
  error: Error | null
  params: {
    colno: number
    lineno: number
    error: Error
    event: ErrorEvent | string
    source?: string
  }
}

/** @internal */
export declare type GlobalErrorSubscriber = (msg: GlobalErrorMessage) => void

/** @internal */
export declare type GlobalErrorUnsubscriber = () => void

/** @internal */
export declare type GlobalPresence = {
  user: User
  status: Status
  lastActiveAt: string
  locations: PresenceLocation[]
}

/** @internal */
export declare const globalScope: typeof globalThis & {
  __sanityErrorChannel?: GlobalErrorChannel | undefined
}

/** @internal */
export declare interface Grant {
  filter: string
  permissions: DocumentValuePermission[]
}

/**
 * @internal
 * Takes a grants object, a permission and a document
 * checks whether the permission is granted for the given document
 */
export declare function grantsPermissionOn(
  userId: string | null,
  grants: Grant[],
  permission: DocumentValuePermission,
  document: SanityDocument | null,
): Promise<PermissionCheckResult>

/**
 * @hidden
 * @beta */
export declare interface GrantsStore {
  /**
   * Returns an observable of `PermissionCheckResult`
   *
   * This API is returns an observable (vs a promise) so the consumer can reac
   * to incoming changes to the user permissions (e.g. for changing _debug_
   * roles).
   *
   * This API also accepts a `null` document in which it should return
   * `granted: true`
   */
  checkDocumentPermission(
    checkPermissionName: DocumentValuePermission,
    document: Partial<SanityDocument> | null,
  ): Observable<PermissionCheckResult>
}

/** @internal */
export declare type GrantsStoreOptions = GrantsStoreOptionsCurrentUser | GrantsStoreOptionsUserId

declare interface GrantsStoreOptionsCurrentUser {
  client: SanityClient
  /**
   * @deprecated The `currentUser` option is deprecated. Use `userId` instead.
   */
  currentUser: CurrentUser | null
}

declare interface GrantsStoreOptionsUserId {
  client: SanityClient
  userId: string | null
}

/** @internal */
export declare function GroupChange(
  props: {
    change: GroupChangeNode
    readOnly?: boolean
    hidden?: boolean
  } & HTMLAttributes<HTMLDivElement>,
): ReactElement | null

/**
 * Schema
 */
/**
 * "Changes" (presentation-oriented grouping of diffs)
 *
 * @internal
 */
export declare interface GroupChangeNode {
  type: 'group'
  changes: ChangeNode[]
  key: string
  path: Path
  titlePath: ChangeTitlePath
  schemaType?: SchemaType
  readOnly?: ConditionalProperty
  hidden?: ConditionalProperty
  fieldsetName?: string
}

declare type GuardedOperation = Operation<any[], 'NOT_READY'>

/** @internal */
export declare type HexColor = string

/** @internal */
export declare interface HiddenField {
  kind: 'hidden'
  key: string
  name: string
  index: number
}

/**
 * @hidden
 * @beta */
export declare interface HistoryStore {
  getDocumentAtRevision: (
    documentId: string,
    revision: string,
  ) => Promise<SanityDocument | undefined>
  getHistory: (
    documentIds: string[],
    options?: {
      time?: string
      revision?: string
    },
  ) => Promise<{
    documents: SanityDocument[]
  }>
  getTransactions: (documentIds: string[]) => Promise<TransactionLogEventWithMutations[]>
  restore: (id: string, targetId: string, rev: string) => Observable<SanityDocument>
  /** @internal */
  getTimelineController: (options: {
    client: SanityClient
    documentId: string
    documentType: string
  }) => TimelineController
}

/** @internal */
export declare interface HistoryStoreOptions {
  client: SanityClient
}

/**
 * Renders given `keys` as "keycaps" visually.
 *
 * This is a wrapper around `@sanity/ui`'s `Hotkeys` component, which allows for altering keys
 * (eg `alt` to `option`) on Apple devices unless `makePlatformAware` is set to `false`.
 *
 * @param props - Properties to render with
 * @returns React element
 * @public
 */
export declare function Hotkeys({
  makePlatformAware,
  keys: hotKeys,
  ...props
}: HotkeysProps): JSX_2.Element

/**
 * Properties for the `Hotkeys` component.
 *
 * @public
 */
export declare type HotkeysProps = HotkeysProps_2 & {
  /**
   * Whether to make the keys platform-aware (eg `alt` to `option` on Apple devices).
   *
   * @defaultValue true
   */
  makePlatformAware?: boolean
} & Omit<HTMLProps<HTMLElement>, 'ref' | 'size' | 'as'> &
  RefAttributes<HTMLElement>

/** @internal */
declare interface HoveredFieldContextValue {
  hoveredStack: string[]
  onMouseEnter: (path: Path) => void
  onMouseLeave: (path: Path) => void
}

/** @internal */
export declare function HoveredFieldProvider(props: PropsWithChildren): JSX_2.Element

/**
 * Enforces the shape of an object allowed to be passed into `useI18nText`.
 * @internal
 */
export declare type I18nNode<
  TNode extends {
    i18n?: {
      [TProp in string]: {
        key: string
        ns: string
      }
    }
  },
> = {
  i18n?: {
    [K in keyof TNode['i18n']]: {
      key: string
      ns: string
    }
  }
} & {
  [K in keyof TNode['i18n']]: string
}

/**
 * @alpha
 */
export declare type I18nSearchOperatorDescriptionKey =
  `search.operator.${Lowercase<string>}.description`

/**
 * @alpha
 */
export declare type I18nSearchOperatorNameKey = `search.operator.${Lowercase<string>}.name`

declare type IconButton = {
  text?: undefined
  icon?: ButtonProps_2['icon']
  /**
   * When using a button with an icon, tooltipProps are required to enforce consistency in UI.
   */
  tooltipProps: TooltipProps | null
}

/** @internal */
export declare type Id = string

/** @internal */
export declare interface IdPair {
  draftId: string
  publishedId: string
}

/**
 *
 * @hidden
 * @beta
 */
export declare interface ImageComponents {
  annotation?: ComponentType<BlockAnnotationProps>
  block?: ComponentType<BlockProps>
  diff?: ComponentType<any>
  field?: ComponentType<ObjectFieldProps<ImageValue>>
  inlineBlock?: ComponentType<BlockProps>
  input?: ComponentType<ObjectInputProps<ImageValue>>
  item?: ComponentType<ObjectItemProps<ImageValue & ObjectItem>>
  preview?: ComponentType<PreviewProps>
}

/**
 * @hidden
 * @beta */
export declare function ImageInput(props: ImageInputProps): JSX_2.Element

/**
 * @hidden
 * @beta */
export declare type ImageInputProps = Omit<
  BaseImageInputProps,
  | 'assetSources'
  | 'directUploads'
  | 'imageUrlBuilder'
  | 'observeAsset'
  | 'client'
  | 'resolveUploader'
>

/**
 * @hidden
 * @beta */
export declare type ImageUrlBuilder = ReturnType<typeof imageUrlBuilder>

/** @internal */
export declare const ImperativeToast: ForwardRefExoticComponent<RefAttributes<unknown>>

/**
 * A locale resource bundle where the locale is inherited from the parent locale definition.
 *
 * @public
 */
export declare type ImplicitLocaleResourceBundle = Omit<LocaleResourceBundle, 'locale'>

/**
 * @hidden
 * @beta */
export declare function inc(amount?: number, path?: Path): FormIncPatch

/**
 * This error may happen if the member type is structurally incompatible with the defined schema type.
 * Some examples:
 *   - the schema type defines an array, but the actual value is an object (or vice versa)
 *   - the schema type defines a number, but the actual value is a string (or vice versa)
 *   - the schema type defines an object, but the actual value is a string (or vice versa)
 *
 * @public
 */
export declare type IncompatibleTypeError = {
  type: 'INCOMPATIBLE_TYPE'
  expectedSchemaType: SchemaType
  resolvedValueType: string
  value: unknown
}

/** @internal */
export declare const initialDocumentFieldActions: DocumentFieldAction[]

/** @internal */
export declare interface InitialSnapshotEvent {
  type: 'snapshot'
  documentId: string
  document: SanityDocument | null
}

/**
 * @hidden
 * @beta */
export declare interface InitialValueErrorMsg {
  type: 'error'
  error: Error
}

/**
 * @hidden
 * @beta */
export declare interface InitialValueLoadingMsg {
  type: 'loading'
}

/**
 * @hidden
 * @beta */
export declare type InitialValueMsg =
  | InitialValueLoadingMsg
  | InitialValueSuccessMsg
  | InitialValueErrorMsg

/**
 * @hidden
 * @beta */
export declare interface InitialValueOptions {
  documentId: string
  documentType: string
  templateName?: string
  templateParams?: Record<string, any>
}

/** @internal */
export declare interface InitialValueState {
  loading: boolean
  error: Error | null
  value: SanityDocumentLike
}

/**
 * @hidden
 * @beta */
export declare interface InitialValueSuccessMsg {
  type: 'success'
  value: SanityDocumentLike | null
}

/**
 * Representation of an initial value template _item_
 * Used by the {@link structure.StructureBuilder} class to determine which initial value templates
 * should be available for a structure node, such as a list pane.
 *
 * @public
 */
export declare interface InitialValueTemplateItem extends TemplateItem {
  type: 'initialValueTemplateItem'
  /** ID for this template item */
  id: string
  /** Initial value template schema type */
  schemaType: string
}

/**
 * @hidden
 * @beta */
export declare function InlinePreview(props: InlinePreviewProps): JSX_2.Element

/**
 * @hidden
 * @beta */
export declare type InlinePreviewProps = Omit<PreviewProps<'inline'>, 'renderDefault'>

/**
 * @hidden
 * @public */
export declare type InputProps =
  | ArrayOfObjectsInputProps
  | ArrayOfPrimitivesInputProps
  | BooleanInputProps
  | NumberInputProps
  | ObjectInputProps
  | ObjectInputProps<CrossDatasetReferenceValue>
  | ObjectInputProps<FileValue>
  | ObjectInputProps<GeopointValue>
  | ObjectInputProps<ImageValue>
  | ObjectInputProps<ReferenceValue>
  | ObjectInputProps<SlugValue>
  | PortableTextInputProps
  | StringInputProps

/**
 * @hidden
 * @beta */
export declare function insert(
  items: any[],
  position: FormInsertPatchPosition,
  path?: Path,
): FormInsertPatch

/** @internal */
export declare function InsufficientPermissionsMessage({
  currentUser,
  context,
}: InsufficientPermissionsMessageProps): JSX_2.Element

/** @internal */
export declare interface InsufficientPermissionsMessageProps {
  currentUser?: CurrentUser | null
  context:
    | 'create-new-reference'
    | 'create-document-type'
    | 'create-any-document'
    | 'create-document'
    | 'delete-document'
    | 'discard-changes'
    | 'duplicate-document'
    | 'publish-document'
    | 'unpublish-document'
}

/**
 *
 * @hidden
 * @beta
 */
export declare function IntentButton(
  props: IntentLinkProps & ButtonProps & Omit<HTMLProps<HTMLButtonElement>, 'ref' | 'size' | 'as'>,
): JSX_2.Element

/**
 * Intent parameters (json)
 *
 * @public
 */
declare type IntentJsonParams = {[key: string]: any}

/**
 * Props for the {@link IntentLink} component.
 *
 * @public
 */
declare interface IntentLinkProps {
  /**
   * The name of the intent.
   */
  intent: string

  /**
   * The parameters to include in the intent.
   * {@link IntentParameters}
   */
  params?: IntentParameters

  /**
   * Whether to replace the current URL in the browser history instead of adding a new entry.
   */
  replace?: boolean
}

/**
 * @public
 * @todo dedupe with intent types in core
 */
declare type IntentParameters = BaseIntentParams | [BaseIntentParams, IntentJsonParams]

declare interface IntermediaryError {
  type: 'error'
  args: ExecuteArgs
  error: any
}

declare interface IntermediarySuccess {
  type: 'success'
  args: ExecuteArgs
}

/**
 * This error may happen for arrays (of both objects and primitive values) if we encounter items that are not valid according to the schema definition
 *
 *
 * @hidden
 * @beta
 */
export declare type InvalidItemTypeError = {
  type: 'INVALID_ITEM_TYPE'
  validTypes: SchemaType[]
  resolvedValueType: string
  value: unknown
}

/** @internal */
export declare function isAddedItemDiff(item: ItemDiff): item is ItemDiff & {
  diff: Diff & {
    action: 'added'
  }
}

/** @internal */
export declare function isArray(value: unknown): value is unknown[]

/**
 * @hidden
 * @beta */
export declare function isArrayOfBlocksInputProps(
  inputProps: InputProps | Omit<InputProps, 'renderDefault'>,
): inputProps is ArrayOfObjectsInputProps

/**
 * @hidden
 * @beta */
export declare function isArrayOfObjectsInputProps(
  inputProps: InputProps | Omit<InputProps, 'renderDefault'>,
): inputProps is ArrayOfObjectsInputProps

/**
 * @hidden
 * @beta */
export declare function isArrayOfPrimitivesInputProps(
  inputProps: InputProps | Omit<InputProps, 'renderDefault'>,
): inputProps is ArrayOfPrimitivesInputProps

/**
 * Duck-type check for whether or not this looks like an auth store
 *
 * @param maybeStore - Item to check if matches the AuthStore interface
 * @returns True if auth store, false otherwise
 * @internal
 */
export declare function isAuthStore(maybeStore: unknown): maybeStore is AuthStore

/**
 * @hidden
 * @beta */
export declare function isBooleanInputProps(
  inputProps: InputProps | Omit<InputProps, 'renderDefault'>,
): inputProps is BooleanInputProps

/** @internal */
export declare function isBuilder(template: unknown): template is Serializeable<Template>

/**
 * Check whether the provided login method is compatible with cookieless auth, e.g. whether any
 * authentication token found in localStorage should be acknowledged.
 *
 * @internal
 */
export declare function isCookielessCompatibleLoginMethod(
  loginMethod: LoginMethod,
): loginMethod is CookielessCompatibleLoginMethod

/**
 * @internal
 */
export declare function _isCustomDocumentTypeDefinition(
  def: SchemaTypeDefinition,
): def is SchemaTypeDefinition<'document'>

/** @internal */
export declare const isDev: boolean

/** @internal */
export declare function isDraft(document: SanityDocumentLike): boolean

/** @internal */
export declare function isDraftId(id: string): id is DraftId

/** @internal */
export declare function isEmptyObject(item: unknown): boolean

/** @internal */
export declare type IsEqualFunction<Value> = (a: Value, b: Value) => boolean

/** @internal */
export declare function isFieldChange(change: ChangeNode): change is FieldChangeNode

/** @internal */
export declare function isGroupChange(change: ChangeNode): change is GroupChangeNode

/**
 * @internal
 */
export declare function isNonNullable<T>(value: T): value is NonNullable<T>

/**
 * @hidden
 * @beta */
export declare function isNumberInputProps(
  inputProps: InputProps | Omit<InputProps, 'renderDefault'>,
): inputProps is NumberInputProps

/**
 * @hidden
 * @beta */
export declare function isObjectInputProps(
  inputProps: InputProps | Omit<InputProps, 'renderDefault'>,
): inputProps is ObjectInputProps

/**
 * @hidden
 * @beta */
export declare function isObjectItemProps(
  item: ItemProps | Omit<ItemProps, 'renderDefault'>,
): item is ObjectItemProps

/** @internal */
export declare const isProd: boolean

/** @internal */
export declare function isPublishedId(id: string): id is PublishedId

/**
 * @internal
 */
export declare function isRecord(value: unknown): value is Record<string, unknown>

/** @internal */
export declare function isRemovedItemDiff(item: ItemDiff): item is ItemDiff & {
  diff: Diff & {
    action: 'removed'
  }
}

/**
 * @internal
 */
export declare function _isSanityDocumentTypeDefinition(
  def: SchemaTypeDefinition,
): def is SchemaTypeDefinition<'document'>

/** @internal */
export declare function isString(value: unknown): value is string

/**
 * @hidden
 * @beta */
export declare function isStringInputProps(
  inputProps: InputProps | Omit<InputProps, 'renderDefault'>,
): inputProps is StringInputProps

/** @internal */
export declare function isTruthy<T>(value: T | false): value is T

/** @internal */
export declare function isUnchangedDiff(diff: Diff): diff is Diff & {
  action: 'unchanged'
}

/** @internal */
export declare type ItemDiff = ItemDiff_2<Annotation>

/** @public */
export declare type ItemProps =
  | ObjectItemProps
  | ObjectItemProps<CrossDatasetReferenceValue & ObjectItem>
  | ObjectItemProps<FileValue & ObjectItem>
  | ObjectItemProps<GeopointValue & ObjectItem>
  | ObjectItemProps<ImageValue & ObjectItem>
  | ObjectItemProps<ReferenceValue & ObjectItem>
  | ObjectItemProps<SlugValue & ObjectItem>
  | PrimitiveItemProps

declare type ItemSelectHandler = (item: Pick<SanityDocumentLike, '_id' | '_type'>) => void

/** @internal */
export declare const joinPath: (pathArray: SearchPathSegment[]) => string

declare type JsonArray = KeyValueStoreValue[] | readonly KeyValueStoreValue[]

declare type JsonObject = {
  [Key in string]: KeyValueStoreValue
} & {
  [Key in string]?: KeyValueStoreValue | undefined
}

declare type JsonPrimitive = string | number | boolean | null

/** @internal */
export declare interface KeyValueStore {
  getKey(key: string): Observable<KeyValueStoreValue | null>
  setKey(key: string, value: KeyValueStoreValue): Observable<KeyValueStoreValue>
}

/** @internal */
export declare type KeyValueStoreValue = JsonPrimitive | JsonObject | JsonArray

declare type LastActiveIndexSet = {
  type: 'LAST_ACTIVE_INDEX_SET'
  index: number
}

/**
 * @hidden
 * @beta */
export declare interface LayoutProps {
  renderDefault: (props: LayoutProps) => ReactElement
}

/**
 * This component should only be used by core Sanity packages.
 * @internal
 */
export declare function LegacyLayerProvider({
  children,
  zOffset: zOffsetKey,
}: {
  children: ReactNode
  zOffset: ZIndexContextValueKey
}): JSX_2.Element

/**
 * Properties that can be used to override the default theme.
 *
 * @public
 */
export declare interface LegacyThemeProps {
  '--font-family-monospace': string
  '--font-family-base': string
  '--black': string
  '--white': string
  '--brand-primary': string
  '--component-bg': string
  '--component-text-color': string
  '--default-button-color': string
  '--default-button-primary-color': string
  '--default-button-success-color': string
  '--default-button-warning-color': string
  '--default-button-danger-color': string
  '--focus-color': string
  '--gray-base': string
  '--gray': string
  '--main-navigation-color': string
  '--main-navigation-color--inverted': string
  '--state-info-color': string
  '--state-success-color': string
  '--state-warning-color': string
  '--state-danger-color': string
  /**
   * @deprecated this theme property is not configurable within the studio
   */
  '--screen-medium-break': string
  /**
   * @deprecated this theme property is not configurable within the studio
   */
  '--screen-default-break': string
  /**
   * @deprecated this theme property is not configurable within the studio
   */
  '--screen-large-break': string
  /**
   * @deprecated this theme property is not configurable within the studio
   */
  '--screen-xlarge-break': string
}

/** @internal */
export declare type LegacyThemeTints = {
  [key in ColorTintKey]: string
}

/**
 * @hidden
 * @beta */
export declare function LinearProgress(props: {
  /** Percentage */
  value: number
}): JSX_2.Element

/** @internal */
export declare type ListenerEvent =
  | MutationEvent_2
  | ReconnectEvent
  | InitialSnapshotEvent
  | PendingMutationsEvent

/** @internal */
export declare function listenQuery(
  client: SanityClient,
  query:
    | string
    | {
        fetch: string
        listen: string
      },
  params?: ListenQueryParams,
  options?: ListenQueryOptions,
): Observable<any>

/**
 * @hidden
 * @beta */
export declare interface ListenQueryOptions {
  tag?: string
  apiVersion?: string
  perspective?: ClientPerspective
  throttleTime?: number
  transitions?: ('update' | 'appear' | 'disappear')[]
}

/** @internal */
export declare type ListenQueryParams = Record<string, string | number | boolean | string[]>

declare type Loadable<T> = {
  data: T | null
  error: Error | null
  loading: boolean
}

/** @internal */
export declare type LoadableState<T> = LoadingState | LoadedState<T> | ErrorState

/** @internal */
export declare interface LoadedState<T> {
  value: T
  error: null
  isLoading: false
}

/**
 * A generic loading container which displays a spinner and text.
 * The spinner won't initially be visible and fades in after a short delay.
 *
 * @internal
 */
export declare function LoadingBlock({fill, showText, title}: LoadingTestProps): JSX_2.Element

/** @internal */
export declare interface LoadingState {
  value: undefined
  error: null
  isLoading: true
}

declare interface LoadingTestProps {
  /** Absolutely positions this component when `true`. */
  fill?: boolean
  /** Optionally show loading title. If `true`, both text and spinner will appear and animate after an initial delay */
  showText?: boolean
  /**
   * Text to display underneath the spinner.  If omitted, will default to `'Loading'`.
   * If providing a value, avoid using trailing ellipses.
   *
   * @defaultValue `'Loading'`
   */
  title?: string | null
}

/** @internal */
export declare type LoadingTuple<T> = [T, boolean]

/**
 * A locale representation
 *
 * @public
 */
declare interface Locale {
  /**
   * The ID of the locale, eg `en-US`, `nb-NO`, `th-TH`…
   */
  id: string
  /**
   * The title of locale, eg `English (US)`, `Norsk (bokmål)`, `ไทย`…
   */
  title: string
  /**
   * Week information for this locale. Based on the `Intl.Locale['weekInfo']` type.
   */
  weekInfo: LocaleWeekInfo
}

/**
 * Context passed to locale config resolvers
 *
 * @public
 */
export declare interface LocaleConfigContext {
  projectId: string
  dataset: string
}

/**
 * @internal
 * @hidden
 */
declare interface LocaleContextValue {
  locales: Locale[]
  currentLocale: Locale
  __internal: {
    i18next: i18n
  }
  changeLocale: (newLocale: string) => Promise<void>
}

/**
 * A locale definition, which describes a locale and its resources.
 *
 * @public
 */
export declare interface LocaleDefinition extends Locale {
  /**
   * Array of resource bundles for this locale, if any.
   *
   * Generally you'll want to provide some base resources, eg for the studio core namespace,
   * as well as for common namespaces like `structure` and `vision`. You can also provide resources
   * for other plugins/namespaces - but preferably the resources should be provided as an async
   * function that imports the resources, in order to lazy load them on use.
   */
  bundles?: (ImplicitLocaleResourceBundle | LocaleResourceBundle)[]
}

/**
 * An object of locale resources, or a string array of resources
 *
 * @public
 */
export declare type LocaleNestedResource = LocaleResourceRecord | string[]

/**
 * Options that defines or adds resources to existing locales
 *
 * @public
 */
export declare interface LocalePluginOptions {
  /**
   * Locales available for user selection.
   *
   * Titles and icons can be changed by using a function (reducer pattern) and transforming values.
   */
  locales?: LocalesOption
  /**
   * Bundles contain "resources" (strings) that yields translations for different locales
   * throughout the studio. The strings are scoped to a specific locale and namespace.
   * Namespaces in this context usually means a specific part of the studio, like a tool or plugin.
   */
  bundles?: LocalesBundlesOption
}

/**
 * @internal
 * @hidden
 */
export declare function LocaleProvider(props: PropsWithChildren): JSX_2.Element

/**
 * @internal
 * @hidden
 */
export declare function LocaleProviderBase({
  projectId,
  sourceId,
  locales,
  i18next,
  children,
}: PropsWithChildren<{
  projectId: string
  sourceId: string
  locales: Locale[]
  i18next: i18n
}>): JSX_2.Element

/**
 * A collection of locale resources for a given locale and namespace.
 * In other words, an object of translated locale strings.
 *
 * @public
 */
export declare interface LocaleResourceBundle {
  /**
   * The locale ID the resources belong to, eg `en-US`, `nb-NO`, `th-TH`…
   */
  locale: string
  /**
   * The namespace the resources belong to, eg `vision`, `structure`, `studio`…
   */
  namespace: string
  /**
   * An object of locale resources, or a function that resolves to one.
   * The localization framework automatically handles ESM modules with a default export,
   * since a common use case is to dynamically load a resource file on use. This is the
   * preferred option, since it allows for lazy loading of locale resources on use.
   */
  resources:
    | LocaleResourceRecord
    | (() => Promise<
        | LocaleResourceRecord
        | {
            default: LocaleResourceRecord
          }
      >)
  /**
   * Whether the resources should be merged deeply (eg for nested objects). Default: true
   */
  deep?: boolean
  /**
   * Whether any existing resource keys for the namespace be overwritten. Default: true
   */
  overwrite?: boolean
}

/**
 * A locale resource key, which can be a leaf string, or a nested resource
 *
 * @public
 */
export declare type LocaleResourceKey = string | LocaleNestedResource

/**
 * An object of locale resources.
 *
 * @public
 */
export declare interface LocaleResourceRecord {
  [key: string]: LocaleResourceKey
}

/**
 * Either an array of locale resource bundles, or a resolver that returns one.
 *
 * @public
 */
export declare type LocalesBundlesOption =
  | ((prev: LocaleResourceBundle[], context: LocaleConfigContext) => LocaleResourceBundle[])
  | LocaleResourceBundle[]

/**
 * Either an array of locale definitions, or a resolver that returns one.
 *
 * @public
 */
export declare type LocalesOption =
  | ((prev: LocaleDefinition[], context: LocaleConfigContext) => LocaleDefinition[])
  | LocaleDefinition[]

/**
 * Internal representation of the available locale configuration.
 *
 * Generally not something you will want to use directly.
 *
 * @public
 */
export declare interface LocaleSource {
  /**
   * Current locale ID (eg `en-US`, `nb-NO`, `th-TH`…)
   */
  currentLocale: Locale
  /**
   * Array of locale definitions
   */
  locales: Locale[]
  /**
   * Loads the given namespaces, if not already done.
   *
   * @param namespaces - Array of namespace names to load
   * @returns Promise which resolves once loaded.
   */
  loadNamespaces(namespaces: string[]): Promise<void>
  /**
   * Translation function, eg `t('some.key') => 'Some string'`
   */
  t: TFunction
}

/**
 * An object representing week information associated with the Locale data specified in
 * {@link https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Patterns_Week_Elements | UTS 35's Week Elements }
 *
 * @public
 */
export declare interface LocaleWeekInfo {
  /**
   * An integer indicating the first day of the week for the locale. Can be either 1 (Monday) or 7 (Sunday).
   */
  firstDay: 1 | 7
  /**
   * An array of integers indicating the weekend days for the locale, where 1 is Monday and 7 is Sunday.
   */
  weekend: (1 | 2 | 3 | 4 | 5 | 6 | 7)[]
  /**
   * An integer between 1 and 7 indicating the minimal days required in the first week of a month or year, for calendar purposes.
   */
  minimalDays: 1 | 2 | 3 | 4 | 5 | 6 | 7
}

/** @internal */
declare interface Location_2 {
  documentId: string
  path: Path
}
export {Location_2 as Location}

/**
 * @beta
 * @hidden
 */
export declare type LoginComponentProps =
  | {
      projectId: string
      /** @deprecated use redirectPath instead */
      basePath: string
      redirectPath?: string
    }
  | {
      projectId: string
      redirectPath: string
      /** @deprecated use redirectPath instead */
      basePath?: string
    }

/**
 * Login methods that may be used for Studio authentication.
 *
 * @public
 */
export declare type LoginMethod = 'dual' | 'cookie' | 'token'

/**
 * @hidden
 * @beta */
export declare interface LogoProps {
  title: string
  renderDefault: (props: LogoProps) => ReactElement
}

/**
 * Given a pathname and a list of workspaces, returns either a workspace match,
 * a redirect, or not-found.
 *
 * @internal
 */
export declare function matchWorkspace({
  pathname,
  workspaces,
  basePathRegex,
}: MatchWorkspaceOptions): MatchWorkspaceResult

/** @internal */
export declare interface MatchWorkspaceOptions {
  workspaces: NormalizedWorkspace[]
  pathname: string
  basePathRegex: RegExp
}

/** @internal */
export declare type MatchWorkspaceResult =
  | {
      type: 'match'
      workspace: WorkspacesContextValue[number]
    }
  | {
      type: 'redirect'
      pathname: string
    }
  | {
      type: 'not-found'
    }

/**
 * @hidden
 * @beta */
export declare function MediaPreview(props: MediaPreviewProps): JSX_2.Element

/**
 * @hidden
 * @beta */
export declare type MediaPreviewProps = Omit<PreviewProps<'media'>, 'renderDefault'>

declare interface MediaProps {
  border?: boolean
  dimensions: PreviewMediaDimensions
  layout: PreviewLayoutKey
  media: PreviewProps['media']
  radius?: number
  responsive?: boolean
  styles?: {
    media?: string
    mediaString?: string
  }
}

/** @internal */
export declare const MemberField: NamedExoticComponent<MemberFieldProps>

/** @internal */
export declare function MemberFieldError(props: {member: FieldError}): JSX_2.Element

/** @internal */
export declare interface MemberFieldProps {
  member: FieldMember
  renderAnnotation?: RenderAnnotationCallback
  renderBlock?: RenderBlockCallback
  renderField: RenderFieldCallback
  renderInlineBlock?: RenderBlockCallback
  renderInput: RenderInputCallback
  renderItem: RenderArrayOfObjectsItemCallback
  renderPreview: RenderPreviewCallback
}

/** @internal */
export declare const MemberFieldSet: NamedExoticComponent<{
  member: FieldSetMember
  renderAnnotation?: RenderAnnotationCallback | undefined
  renderBlock?: RenderBlockCallback | undefined
  renderField: RenderFieldCallback
  renderInlineBlock?: RenderBlockCallback | undefined
  renderInput: RenderInputCallback
  renderItem: RenderArrayOfObjectsItemCallback
  renderPreview: RenderPreviewCallback
}>

/** @internal */
export declare function MemberItemError(props: {member: ArrayItemError}): JSX_2.Element

/**
 *
 * @hidden
 * @beta
 */
export declare interface MemberItemProps {
  member: ArrayOfObjectsItemMember
  renderAnnotation?: RenderAnnotationCallback
  renderBlock?: RenderBlockCallback
  renderInlineBlock?: RenderBlockCallback
  renderItem: RenderArrayOfObjectsItemCallback
  renderField: RenderFieldCallback
  renderInput: RenderInputCallback
  renderPreview: RenderPreviewCallback
}

/** @internal */
declare type MenuButtonProps = Omit<MenuButtonProps_2, 'popover'> & {
  popover?: Omit<PopoverProps_2, 'animate' | 'content' | 'open'>
}

/** @internal */
export declare function MetaInfo(props: MetaInfoProps): JSX_2.Element

/** @internal */
export declare interface MetaInfoProps {
  title: string
  action?: string
  icon?: ComponentType
  children?: ReactNode
  markRemoved?: boolean
}

/**
 * @hidden
 * @beta
 */
export declare interface MissingConfigFile {
  missingConfigFile: true
}

/**
 * This error may happen for arrays of objects where one or more of the members are missing a _key
 *
 * @public
 */
export declare type MissingKeysError = {
  type: 'MISSING_KEYS'
  schemaType: ArraySchemaType
  value: {
    _key?: string
  }[]
}

/**
 * This error may happen for objects if we encounter fields that are not declared in the schema
 *
 * @public
 */
export declare type MixedArrayError = {
  type: 'MIXED_ARRAY'
  schemaType: ArraySchemaType
  value: unknown[]
}

/** @internal */
export declare interface MockAuthStoreOptions {
  currentUser: CurrentUser | null
  client: SanityClient
}

/** @internal */
declare interface MutationEvent_2 {
  type: 'mutation'
  documentId: string
  transactionId: string
  mutations: MutationPayload[]
  effects: {
    apply: unknown
    revert: unknown
  }
  transactionTotalEvents: number
  transactionCurrentEvent: number
  visibility: 'transaction' | 'query'
  transition: 'update' | 'appear' | 'disappear'
}
export {MutationEvent_2 as MutationEvent}

/**
 * @internal
 */
export declare type MutationPatch = Record<string, any>

/**
 *
 * @hidden
 * @beta
 */
export declare interface MutationPatchMsg {
  type: 'mutation'
  patches: FormPatch[]
  snapshot: unknown
}

/**
 * @hidden
 * @beta */
export declare interface MutationPayload {
  create?: any
  createIfNotExists?: any
  createOrReplace?: any
  delete?: any
  patch?: any
}

/**
 * @internal
 * @beta
 * An internal API for defining actions in the navbar.
 */
export declare interface NavbarAction {
  icon?: React.ComponentType
  location: 'topbar' | 'sidebar'
  name: string
  onAction: () => void
  selected: boolean
  title: string
}

/** @internal */
export declare const NavbarContext: Context<NavbarContextValue>

/** @internal */
export declare interface NavbarContextValue {
  onSearchFullscreenOpenChange: (open: boolean) => void
  onSearchOpenChange: (open: boolean) => void
  searchFullscreenOpen: boolean
  searchFullscreenPortalEl: HTMLElement | null
  searchOpen: boolean
}

/**
 * @hidden
 * @beta */
export declare interface NavbarProps {
  renderDefault: (props: NavbarProps) => ReactElement
  /**
   * @internal
   * @beta */
  __internal_actions?: NavbarAction[]
}

/**
 * @hidden
 * @beta
 */
export declare type NewDocumentCreationContext =
  | {
      type: 'global'
      documentId?: undefined
      schemaType?: undefined
    }
  | {
      type: 'document'
      documentId: string
      schemaType: string
    }
  | {
      type: 'structure'
      documentId?: undefined
      schemaType: string
    }

/**
 * @hidden
 * @beta
 */
export declare interface NewDocumentOptionsContext extends ConfigContext {
  creationContext: NewDocumentCreationContext
}

/**
 * @hidden
 * @beta
 */
export declare type NewDocumentOptionsResolver = ComposableOption<
  TemplateItem[],
  NewDocumentOptionsContext
>

/** @internal */
export declare function newDraftFrom(document: SanityDocument): SanityDocument

/** @internal */
export declare function NoChanges(): JSX_2.Element

/** @internal */
export declare function noop(): void

declare function NoopTracker({children}: {children: ReactNode}): JSX_2.Element

/** @internal */
declare type NormalizedWorkspace = {
  workspace: WorkspacesContextValue[number]
  name?: string | undefined
  basePath: string
  basePathRegex: RegExp
}

/** @internal */
export declare function normalizeIndexSegment(segment: string): PathSegment

/** @internal */
export declare function normalizeIndexTupleSegment(segment: string): IndexTuple

/** @internal */
export declare function normalizeKeySegment(segment: string): KeyedSegment

/** @internal */
export declare function normalizePathSegment(segment: string): PathSegment

/** @internal */
export declare type NullDiff = NullDiff_2<Annotation>

/**
 *
 * @hidden
 * @beta
 */
export declare interface NumberComponents {
  diff?: ComponentType<any>
  field?: ComponentType<NumberFieldProps>
  input?: ComponentType<NumberInputProps>
  item?: ComponentType<PrimitiveItemProps>
  preview?: ComponentType<PreviewProps>
}

/** @internal */
export declare type NumberDiff = NumberDiff_2<Annotation>

/**
 * @hidden
 * @public */
export declare interface NumberFieldProps extends BaseFieldProps {
  schemaType: NumberSchemaType
  value: number | undefined
  inputProps: NumberInputProps
}

/** @public */
export declare type NumberFormNode<S extends NumberSchemaType = NumberSchemaType> = BaseFormNode<
  number,
  S
>

/**
 *
 * @hidden
 * @beta
 */
export declare function NumberInput(props: NumberInputProps): JSX_2.Element

/**
 * @hidden
 * @public */
export declare interface NumberInputProps<S extends NumberSchemaType = NumberSchemaType>
  extends BaseInputProps,
    NumberFormNode<S> {
  /**
   * @hidden
   * @beta */
  onChange: (patch: FormPatch | FormPatch[] | PatchEvent) => void
  validationError?: string
  /**
   * @hidden
   * @beta */
  elementProps: PrimitiveInputElementProps
}

/** @public */
export declare interface ObjectArrayFormNode<
  T extends ObjectItem = ObjectItem,
  S extends ObjectSchemaType = ObjectSchemaType,
> extends BaseFormNode<T, S> {
  /** The focus path of the form node. */
  focusPath: Path
  value: T
  /**
   * @hidden
   * @beta */
  groups: FormFieldGroup[]
  /**
   * @hidden
   * @beta */
  members: ObjectMember[]
  changesOpen?: boolean
}

/**
 *
 * @hidden
 * @beta
 */
export declare interface ObjectComponents {
  annotation?: ComponentType<BlockAnnotationProps>
  block?: ComponentType<BlockProps>
  diff?: ComponentType<any>
  field?: ComponentType<ObjectFieldProps>
  inlineBlock?: ComponentType<BlockProps>
  input?: ComponentType<ObjectInputProps>
  item?: ComponentType<ObjectItemProps>
  preview?: ComponentType<PreviewProps>
}

/** @internal */
export declare type ObjectDiff<T extends object = Record<string, any>> = ObjectDiff_2<Annotation, T>

/**
 * @hidden
 * @public */
export declare interface ObjectFieldProps<T = Record<string, unknown>> extends BaseFieldProps {
  schemaType: ObjectSchemaType
  value: T | undefined
  collapsed?: boolean
  collapsible?: boolean
  onCollapse: () => void
  onExpand: () => void
  open: boolean
  onClose: () => void
  onOpen: () => void
  inputProps: ObjectInputProps<T>
}

/** @public */
export declare interface ObjectFormNode<
  T = {
    [key in string]: unknown
  },
  S extends ObjectSchemaType = ObjectSchemaType,
> extends BaseFormNode<T, S> {
  /** The focus path of the form node. */
  focusPath: Path
  /**
   * @hidden
   * @beta */
  groups: FormFieldGroup[]
  /**
   * @hidden
   * @beta */
  members: ObjectMember[]
}

/**
 * @hidden
 * @beta */
export declare const ObjectInput: NamedExoticComponent<
  ObjectInputProps<Record<string, any>, ObjectSchemaType>
>

/** @internal */
export declare const ObjectInputMember: NamedExoticComponent<ObjectInputMemberProps>

/** @internal */
export declare interface ObjectInputMemberProps {
  member: ObjectMember
  renderAnnotation?: RenderAnnotationCallback
  renderBlock?: RenderBlockCallback
  renderField: RenderFieldCallback
  renderInlineBlock?: RenderBlockCallback
  renderInput: RenderInputCallback
  renderItem: RenderArrayOfObjectsItemCallback
  renderPreview: RenderPreviewCallback
}

/**
 * Convenience component for wrapping an object input
 * @internal
 */
export declare function ObjectInputMembers(props: ObjectMembersProps): JSX_2.Element

/**
 * @hidden
 * @public */
export declare interface ObjectInputProps<
  T = Record<string, any>,
  S extends ObjectSchemaType = ObjectSchemaType,
> extends BaseInputProps,
    Omit<ObjectFormNode<T, S>, '_allMembers'> {
  /**
   * @hidden
   * @beta */
  groups: FormFieldGroup[]
  /**
   * @hidden
   * @beta */
  onChange: (patch: FormPatch | FormPatch[] | PatchEvent) => void
  /**
   * @hidden
   * @beta */
  onFieldCollapse: (fieldName: string) => void
  /**
   * @hidden
   * @beta */
  onFieldExpand: (fieldName: string) => void
  /**
   * @hidden
   * @beta */
  onFieldSetCollapse: (fieldSetName: string) => void
  /**
   * @hidden
   * @beta */
  onFieldSetExpand: (fieldSetName: string) => void
  /**
   * @hidden
   * @beta */
  onFieldGroupSelect: (groupName: string) => void
  /**
   * @hidden
   * @beta */
  onPathFocus: (path: Path) => void
  /**
   * @hidden
   * @beta */
  onFieldOpen: (fieldName: string) => void
  /**
   * @hidden
   * @beta */
  onFieldClose: (fieldName: string) => void
  /**
   * @hidden
   * @beta */
  renderAnnotation?: RenderAnnotationCallback
  /**
   * @hidden
   * @beta */
  renderBlock?: RenderBlockCallback
  /**
   * @hidden
   * @beta */
  renderInput: RenderInputCallback
  /**
   * @hidden
   * @beta */
  renderField: RenderFieldCallback
  /**
   * @hidden
   * @beta */
  renderInlineBlock?: RenderBlockCallback
  /**
   * @hidden
   * @beta */
  renderItem: RenderArrayOfObjectsItemCallback
  /**
   * @hidden
   * @beta */
  renderPreview: RenderPreviewCallback
  /**
   * @hidden
   * @beta */
  elementProps: ComplexElementProps
}

/** @public */
export declare type ObjectItem = {
  _type?: string
  _key: string
}

/**
 * Props for the ObjectItem component.
 * @public
 */
export declare interface ObjectItemProps<Item extends ObjectItem = ObjectItem>
  extends BaseItemProps<Item> {
  /** Whether the item has changes in a draft. */
  changed: boolean
  /** The schema type of the object. */
  schemaType: ObjectSchemaType
  /** The schema type of the parent array. */
  parentSchemaType: ArraySchemaType
  /** Whether the item is collapsed. */
  collapsed: boolean | undefined
  /** Whether the item is collapsible. */
  collapsible: boolean | undefined
  /** Callback for when the item is collapsed. */
  onCollapse: () => void
  /** Callback for when the item is expanded. */
  onExpand: () => void
  /** Whether the item is open. */
  open: boolean
  /** Callback for when the item is closed. */
  onClose: () => void
  /** Callback for when the item is opened. */
  onOpen: () => void
  /** The value of the item. */
  value: Item
  /**
   * @hidden
   * @beta */
  inputProps: Omit<ObjectInputProps, 'renderDefault'>
}

/** @public */
export declare type ObjectMember = FieldMember | FieldSetMember | FieldError

/**
 * @deprecated Use ObjectInputMembers instead
 * @internal
 */
export declare const ObjectMembers: typeof ObjectInputMembers

/** @internal */
export declare interface ObjectMembersProps {
  members: ObjectMember[]
  renderAnnotation?: RenderAnnotationCallback
  renderBlock?: RenderBlockCallback
  renderInlineBlock?: RenderBlockCallback
  renderInput: RenderInputCallback
  renderField: RenderFieldCallback
  renderItem: RenderArrayOfObjectsItemCallback
  renderPreview: RenderPreviewCallback
}

declare type ObserveDocumentPairAvailability = (
  id: string,
) => Observable<DraftsModelDocumentAvailability>

/** @internal */
export declare type ObserveDocumentTypeFromIdFn = (id: string) => Observable<string | undefined>

/**
 * @hidden
 * @beta */
export declare type ObserveForPreviewFn = (
  value: Previewable,
  type: PreviewableType,
  viewOptions?: PrepareViewOptions,
  apiConfig?: ApiConfig,
) => Observable<PreparedSnapshot>

/**
 * @hidden
 * @beta */
export declare interface ObservePathsFn {
  (
    value: Previewable,
    paths: (string | PreviewPath)[],
    apiConfig?: ApiConfig,
  ): Observable<PreviewValue | SanityDocumentLike | Reference | string | null>
}

/** @internal */
export declare const onRetry: () => void

/** @internal */
export declare type Opaque<T, K> = T & {
  __opaqueId__: K
}

/** @internal */
export declare interface Operation<
  ExtraArgs extends any[] = [],
  ErrorStrings extends string = string,
> {
  disabled: false | ErrorStrings | 'NOT_READY'
  execute(...extra: ExtraArgs): void
}

/** @internal */
export declare interface OperationArgs {
  historyStore: HistoryStore
  client: SanityClient
  schema: Schema
  typeName: string
  idPair: IdPair
  snapshots: {
    draft: null | SanityDocument
    published: null | SanityDocument
  }
  draft: DocumentVersionSnapshots
  published: DocumentVersionSnapshots
}

/**
 * @hidden
 * @beta */
export declare interface OperationError {
  type: 'error'
  /** @internal */
  op: keyof OperationsAPI
  id: string
  error: Error
}

/** @internal */
export declare const operationEvents: (arg1: {
  client: SanityClient
  historyStore: HistoryStore
  schema: Schema
}) => Observable<IntermediarySuccess | IntermediaryError>

/** @internal */
export declare interface OperationImpl<
  ExtraArgs extends any[] = [],
  DisabledReason extends string = string,
> {
  disabled: (args: OperationArgs) => DisabledReason | 'NOT_READY' | false
  execute(args: OperationArgs, ...extra: ExtraArgs): void
}

/** @internal */
export declare interface OperationsAPI {
  commit: Operation | GuardedOperation
  delete: Operation<[], 'NOTHING_TO_DELETE' | 'NOT_READY'>
  del: Operation<[], 'NOTHING_TO_DELETE'> | GuardedOperation
  publish:
    | Operation<[], 'LIVE_EDIT_ENABLED' | 'ALREADY_PUBLISHED' | 'NO_CHANGES'>
    | GuardedOperation
  patch: Operation<[patches: Patch[], initialDocument?: Record<string, any>]> | GuardedOperation
  discardChanges: Operation<[], 'NO_CHANGES' | 'NOT_PUBLISHED'> | GuardedOperation
  unpublish: Operation<[], 'LIVE_EDIT_ENABLED' | 'NOT_PUBLISHED'> | GuardedOperation
  duplicate: Operation<[documentId: string], 'NOTHING_TO_DUPLICATE'> | GuardedOperation
  restore: Operation<[revision: string]> | GuardedOperation
}

/**
 * @hidden
 * @beta */
export declare interface OperationSuccess {
  type: 'success'
  /** @internal */
  op: keyof OperationsAPI
  id: string
}

declare type Operator<TOperators = string> = OperatorDivider | OperatorItem<TOperators>

/**
 * @alpha
 */
export declare interface OperatorButtonValueComponentProps<T> {
  value: T
}

declare interface OperatorDateDirectionValue {
  includeTime?: boolean
  date: string | null
}

declare interface OperatorDateEqualValue {
  includeTime?: boolean
  date: string | null
}

declare interface OperatorDateLastValue {
  unit: 'day' | 'month' | 'year'
  unitValue: number | null
}

declare interface OperatorDateRangeValue {
  to: string | null
  from: string | null
  includeTime?: boolean
}

/**
 * @internal
 */
export declare const operatorDefinitions: (
  | (SearchOperatorBuilder<'dateAfter', OperatorDateDirectionValue> & {
      nameKey: 'search.operator.date-after.name'
      descriptionKey: 'search.operator.date-after.description'
      groqFilter: ({
        fieldPath,
        value,
      }: SearchOperatorParams<OperatorDateDirectionValue>) => string | null
      inputComponent: SearchOperatorInput<OperatorDateDirectionValue>
      type: 'dateAfter'
      buttonValueComponent: SearchOperatorButtonValue<OperatorDateDirectionValue>
      initialValue: null
    })
  | (SearchOperatorBuilder<'dateBefore', OperatorDateDirectionValue> & {
      nameKey: 'search.operator.date-before.name'
      descriptionKey: 'search.operator.date-before.description'
      groqFilter: ({
        fieldPath,
        value,
      }: SearchOperatorParams<OperatorDateDirectionValue>) => string | null
      inputComponent: SearchOperatorInput<OperatorDateDirectionValue>
      type: 'dateBefore'
      buttonValueComponent: SearchOperatorButtonValue<OperatorDateDirectionValue>
      initialValue: null
    })
  | (SearchOperatorBuilder<'dateEqual', OperatorDateEqualValue> & {
      nameKey: 'search.operator.date-equal.name'
      descriptionKey: 'search.operator.date-equal.description'
      groqFilter: ({
        fieldPath,
        value,
      }: SearchOperatorParams<OperatorDateEqualValue>) => string | null
      inputComponent: SearchOperatorInput<OperatorDateEqualValue>
      type: 'dateEqual'
      buttonValueComponent: SearchOperatorButtonValue<OperatorDateEqualValue>
      initialValue: {
        date: null
        includeTime: boolean
      }
    })
  | (SearchOperatorBuilder<'dateLast', OperatorDateLastValue> & {
      nameKey: 'search.operator.date-last.name'
      descriptionKey: 'search.operator.date-last.description'
      groqFilter: ({fieldPath, value}: SearchOperatorParams<OperatorDateLastValue>) => string | null
      inputComponent: SearchOperatorInput<OperatorDateLastValue>
      initialValue: {
        unit: string
        unitValue: number
      }
      type: 'dateLast'
      buttonValueComponent: SearchOperatorButtonValue<OperatorDateLastValue>
    })
  | (SearchOperatorBuilder<'dateNotEqual', OperatorDateEqualValue> & {
      nameKey: 'search.operator.date-not-equal.name'
      descriptionKey: 'search.operator.date-not-equal.description'
      groqFilter: ({
        fieldPath,
        value,
      }: SearchOperatorParams<OperatorDateEqualValue>) => string | null
      inputComponent: SearchOperatorInput<OperatorDateEqualValue>
      type: 'dateNotEqual'
      buttonValueComponent: SearchOperatorButtonValue<OperatorDateEqualValue>
      initialValue: {
        date: null
        includeTime: boolean
      }
    })
  | (SearchOperatorBuilder<'dateRange', OperatorDateRangeValue> & {
      nameKey: 'search.operator.date-range.name'
      descriptionKey: 'search.operator.date-range.description'
      buttonValueComponent: SearchOperatorButtonValue<OperatorDateRangeValue>
      groqFilter: ({
        fieldPath,
        value,
      }: SearchOperatorParams<OperatorDateRangeValue>) => string | null
      initialValue: {
        includeTime: boolean
        to: string
        from: null
      }
      inputComponent: SearchOperatorInput<OperatorDateRangeValue>
      type: 'dateRange'
    })
  | (SearchOperatorBuilder<'dateTimeAfter', OperatorDateDirectionValue> & {
      nameKey: 'search.operator.date-time-after.name'
      descriptionKey: 'search.operator.date-time-after.description'
      groqFilter: ({
        fieldPath,
        value,
      }: SearchOperatorParams<OperatorDateDirectionValue>) => string | null
      inputComponent: SearchOperatorInput<OperatorDateDirectionValue>
      type: 'dateTimeAfter'
      buttonValueComponent: SearchOperatorButtonValue<OperatorDateDirectionValue>
      initialValue: null
    })
  | (SearchOperatorBuilder<'dateTimeBefore', OperatorDateDirectionValue> & {
      nameKey: 'search.operator.date-time-before.name'
      descriptionKey: 'search.operator.date-time-before.description'
      groqFilter: ({
        fieldPath,
        value,
      }: SearchOperatorParams<OperatorDateDirectionValue>) => string | null
      inputComponent: SearchOperatorInput<OperatorDateDirectionValue>
      type: 'dateTimeBefore'
      buttonValueComponent: SearchOperatorButtonValue<OperatorDateDirectionValue>
      initialValue: null
    })
  | (SearchOperatorBuilder<'dateTimeEqual', OperatorDateEqualValue> & {
      nameKey: 'search.operator.date-time-equal.name'
      descriptionKey: 'search.operator.date-time-equal.description'
      groqFilter: ({
        fieldPath,
        value,
      }: SearchOperatorParams<OperatorDateEqualValue>) => string | null
      inputComponent: SearchOperatorInput<OperatorDateEqualValue>
      type: 'dateTimeEqual'
      buttonValueComponent: SearchOperatorButtonValue<OperatorDateEqualValue>
      initialValue: {
        date: null
        includeTime: boolean
      }
    })
  | (SearchOperatorBuilder<'dateTimeLast', OperatorDateLastValue> & {
      nameKey: 'search.operator.date-time-last.name'
      descriptionKey: 'search.operator.date-time-last.description'
      groqFilter: ({fieldPath, value}: SearchOperatorParams<OperatorDateLastValue>) => string | null
      initialValue: {
        unit: string
        unitValue: number
      }
      inputComponent: SearchOperatorInput<OperatorDateLastValue>
      type: 'dateTimeLast'
      buttonValueComponent: SearchOperatorButtonValue<OperatorDateLastValue>
    })
  | (SearchOperatorBuilder<'dateTimeNotEqual', OperatorDateEqualValue> & {
      nameKey: 'search.operator.date-time-not-equal.name'
      descriptionKey: 'search.operator.date-time-not-equal.description'
      groqFilter: ({
        fieldPath,
        value,
      }: SearchOperatorParams<OperatorDateEqualValue>) => string | null
      inputComponent: SearchOperatorInput<OperatorDateEqualValue>
      type: 'dateTimeNotEqual'
      buttonValueComponent: SearchOperatorButtonValue<OperatorDateEqualValue>
      initialValue: {
        date: null
        includeTime: boolean
      }
    })
  | (SearchOperatorBuilder<'dateTimeRange', OperatorDateRangeValue> & {
      nameKey: 'search.operator.date-time-range.name'
      descriptionKey: 'search.operator.date-time-range.description'
      buttonValueComponent: SearchOperatorButtonValue<OperatorDateRangeValue>
      groqFilter: ({
        fieldPath,
        value,
      }: SearchOperatorParams<OperatorDateRangeValue>) => string | null
      initialValue: {
        includeTime: boolean
        to: string
        from: null
      }
      inputComponent: SearchOperatorInput<OperatorDateRangeValue>
      type: 'dateTimeRange'
    })
  | (SearchOperatorBuilder<'arrayCountEqual', number> & {
      nameKey: 'search.operator.array-count-equal.name'
      descriptionKey: 'search.operator.array-count-equal.description'
      groqFilter: ({fieldPath, value}: SearchOperatorParams<number>) => string | null
      initialValue: null
      inputComponent: SearchOperatorInput<number>
      type: 'arrayCountEqual'
    })
  | (SearchOperatorBuilder<'arrayCountGt', number> & {
      nameKey: 'search.operator.array-count-gt.name'
      descriptionKey: 'search.operator.array-count-gt.description'
      groqFilter: ({fieldPath, value}: SearchOperatorParams<number>) => string | null
      icon: () => JSX_2.Element
      initialValue: null
      inputComponent: SearchOperatorInput<number>
      type: 'arrayCountGt'
    })
  | (SearchOperatorBuilder<'arrayCountGte', number> & {
      nameKey: 'search.operator.array-count-gte.name'
      descriptionKey: 'search.operator.array-count-gte.description'
      groqFilter: ({fieldPath, value}: SearchOperatorParams<number>) => string | null
      icon: () => JSX_2.Element
      initialValue: null
      inputComponent: SearchOperatorInput<number>
      type: 'arrayCountGte'
    })
  | (SearchOperatorBuilder<'arrayCountLt', number> & {
      nameKey: 'search.operator.array-count-lt.name'
      descriptionKey: 'search.operator.array-count-lt.description'
      groqFilter: ({fieldPath, value}: SearchOperatorParams<number>) => string | null
      icon: () => JSX_2.Element
      initialValue: null
      inputComponent: SearchOperatorInput<number>
      type: 'arrayCountLt'
    })
  | (SearchOperatorBuilder<'arrayCountLte', number> & {
      nameKey: 'search.operator.array-count-lte.name'
      descriptionKey: 'search.operator.array-count-lte.description'
      groqFilter: ({fieldPath, value}: SearchOperatorParams<number>) => string | null
      icon: () => JSX_2.Element
      initialValue: null
      inputComponent: SearchOperatorInput<number>
      type: 'arrayCountLte'
    })
  | (SearchOperatorBuilder<'arrayCountNotEqual', number> & {
      nameKey: 'search.operator.array-count-not-equal.name'
      descriptionKey: 'search.operator.array-count-not-equal.description'
      groqFilter: ({fieldPath, value}: SearchOperatorParams<number>) => string | null
      initialValue: null
      inputComponent: SearchOperatorInput<number>
      type: 'arrayCountNotEqual'
    })
  | (SearchOperatorBuilder<'arrayCountRange', OperatorNumberRangeValue> & {
      nameKey: 'search.operator.array-count-range.name'
      descriptionKey: 'search.operator.array-count-range.description'
      groqFilter: ({fieldPath, value}: SearchOperatorParams<OperatorNumberRangeValue>) => string
      initialValue: null
      inputComponent: SearchOperatorInput<OperatorNumberRangeValue>
      type: 'arrayCountRange'
    })
  | (SearchOperatorBuilder<'arrayListIncludes', string | number> & {
      nameKey: 'search.operator.array-list-includes.name'
      descriptionKey: 'search.operator.array-list-includes.description'
      groqFilter: ({fieldPath, value}: SearchOperatorParams<string | number>) => string | null
      initialValue: null
      inputComponent: SearchOperatorInput<string | number>
      type: 'arrayListIncludes'
    })
  | (SearchOperatorBuilder<'arrayListNotIncludes', string | number> & {
      nameKey: 'search.operator.array-list-not-includes.name'
      descriptionKey: 'search.operator.array-list-not-includes.description'
      groqFilter: ({fieldPath, value}: SearchOperatorParams<string | number>) => string | null
      initialValue: null
      inputComponent: SearchOperatorInput<string | number>
      type: 'arrayListNotIncludes'
    })
  | (SearchOperatorBuilder<'arrayReferenceIncludes', Reference> & {
      nameKey: 'search.operator.array-reference-includes.name'
      descriptionKey: 'search.operator.array-reference-includes.description'
      buttonValueComponent: SearchOperatorButtonValue<Reference>
      groqFilter: ({fieldPath, value}: SearchOperatorParams<Reference>) => string | null
      initialValue: null
      inputComponent: SearchOperatorInput<Reference>
      type: 'arrayReferenceIncludes'
    })
  | (SearchOperatorBuilder<'arrayReferenceNotIncludes', Reference> & {
      nameKey: 'search.operator.array-reference-not-includes.name'
      descriptionKey: 'search.operator.array-reference-not-includes.description'
      buttonValueComponent: SearchOperatorButtonValue<Reference>
      groqFilter: ({fieldPath, value}: SearchOperatorParams<Reference>) => string | null
      initialValue: null
      inputComponent: SearchOperatorInput<Reference>
      type: 'arrayReferenceNotIncludes'
    })
  | (SearchOperatorBuilder<'assetFileEqual', Reference> & {
      nameKey: 'search.operator.asset-file-equal.name'
      descriptionKey: 'search.operator.asset-file-equal.description'
      buttonValueComponent: SearchOperatorButtonValue<Reference>
      groqFilter: ({fieldPath, value}: SearchOperatorParams<Reference>) => string | null
      initialValue: null
      inputComponent: ({onChange, value}: OperatorInputComponentProps<Reference>) => JSX_2.Element
      label: string
      type: 'assetFileEqual'
    })
  | (SearchOperatorBuilder<'assetFileNotEqual', Reference> & {
      nameKey: 'search.operator.asset-file-not-equal.name'
      descriptionKey: 'search.operator.asset-file-not-equal.description'
      buttonValueComponent: SearchOperatorButtonValue<Reference>
      groqFilter: ({fieldPath, value}: SearchOperatorParams<Reference>) => string | null
      initialValue: null
      inputComponent: ({onChange, value}: OperatorInputComponentProps<Reference>) => JSX_2.Element
      label: string
      type: 'assetFileNotEqual'
    })
  | (SearchOperatorBuilder<'assetImageEqual', Reference> & {
      nameKey: 'search.operator.asset-image-equal.name'
      descriptionKey: 'search.operator.asset-image-equal.description'
      buttonValueComponent: SearchOperatorButtonValue<Reference>
      groqFilter: ({fieldPath, value}: SearchOperatorParams<Reference>) => string | null
      initialValue: null
      inputComponent: ({onChange, value}: OperatorInputComponentProps<Reference>) => JSX_2.Element
      label: string
      type: 'assetImageEqual'
    })
  | (SearchOperatorBuilder<'assetImageNotEqual', Reference> & {
      nameKey: 'search.operator.asset-image-not-equal.name'
      descriptionKey: 'search.operator.asset-image-not-equal.description'
      buttonValueComponent: SearchOperatorButtonValue<Reference>
      groqFilter: ({fieldPath, value}: SearchOperatorParams<Reference>) => string | null
      initialValue: null
      inputComponent: ({onChange, value}: OperatorInputComponentProps<Reference>) => JSX_2.Element
      label: string
      type: 'assetImageNotEqual'
    })
  | (SearchOperatorBuilder<'booleanEqual', boolean> & {
      nameKey: 'search.operator.boolean-equal.name'
      descriptionKey: 'search.operator.boolean-equal.description'
      groqFilter: ({fieldPath, value}: SearchOperatorParams<boolean>) => string | null
      initialValue: boolean
      inputComponent: SearchOperatorInput<boolean>
      type: 'booleanEqual' /**
       * @internal
       */
    })
  | (ValuelessSearchOperatorBuilder<'defined'> & {
      nameKey: 'search.operator.defined.name'
      descriptionKey: 'search.operator.defined.description'
      groqFilter: ({fieldPath}: ValuelessSearchOperatorParams) => string | null
      type: 'defined'
    })
  | (ValuelessSearchOperatorBuilder<'notDefined'> & {
      nameKey: 'search.operator.not-defined.name'
      descriptionKey: 'search.operator.not-defined.description'
      i18nKey: string
      groqFilter: ({fieldPath}: ValuelessSearchOperatorParams) => string | null
      type: 'notDefined'
    })
  | (SearchOperatorBuilder<'numberEqual', number> & {
      nameKey: 'search.operator.number-equal.name'
      descriptionKey: 'search.operator.number-equal.description'
      groqFilter: ({fieldPath, value}: SearchOperatorParams<number>) => string | null
      initialValue: null
      inputComponent: SearchOperatorInput<number>
      type: 'numberEqual'
    })
  | (SearchOperatorBuilder<'numberGt', number> & {
      nameKey: 'search.operator.number-gt.name'
      descriptionKey: 'search.operator.number-gt.description'
      groqFilter: ({fieldPath, value}: SearchOperatorParams<number>) => string | null
      icon: () => JSX_2.Element
      initialValue: null
      inputComponent: SearchOperatorInput<number>
      type: 'numberGt'
    })
  | (SearchOperatorBuilder<'numberGte', number> & {
      nameKey: 'search.operator.number-gte.name'
      descriptionKey: 'search.operator.number-gte.description'
      groqFilter: ({fieldPath, value}: SearchOperatorParams<number>) => string | null
      icon: () => JSX_2.Element
      initialValue: null
      inputComponent: SearchOperatorInput<number>
      type: 'numberGte'
    })
  | (SearchOperatorBuilder<'numberLt', number> & {
      nameKey: 'search.operator.number-lt.name'
      descriptionKey: 'search.operator.number-lt.description'
      groqFilter: ({fieldPath, value}: SearchOperatorParams<number>) => string | null
      icon: () => JSX_2.Element
      initialValue: null
      inputComponent: SearchOperatorInput<number>
      type: 'numberLt'
    })
  | (SearchOperatorBuilder<'numberLte', number> & {
      nameKey: 'search.operator.number-lte.name'
      descriptionKey: 'search.operator.number-lte.description'
      groqFilter: ({fieldPath, value}: SearchOperatorParams<number>) => string | null
      icon: () => JSX_2.Element
      initialValue: null
      inputComponent: SearchOperatorInput<number>
      type: 'numberLte'
    })
  | (SearchOperatorBuilder<'numberNotEqual', number> & {
      nameKey: 'search.operator.number-not-equal.name'
      descriptionKey: 'search.operator.number-not-equal.description'
      groqFilter: ({fieldPath, value}: SearchOperatorParams<number>) => string | null
      initialValue: null
      inputComponent: SearchOperatorInput<number>
      type: 'numberNotEqual'
    })
  | (SearchOperatorBuilder<'numberRange', OperatorNumberRangeValue> & {
      nameKey: 'search.operator.number-range.name'
      descriptionKey: 'search.operator.number-range.description'
      groqFilter: ({fieldPath, value}: SearchOperatorParams<OperatorNumberRangeValue>) => string
      initialValue: null
      inputComponent: SearchOperatorInput<OperatorNumberRangeValue>
      type: 'numberRange'
    })
  | (SearchOperatorBuilder<'portableTextEqual', string | number> & {
      nameKey: 'search.operator.portable-text-equal.name'
      descriptionKey: 'search.operator.portable-text-equal.description'
      groqFilter: ({fieldPath, value}: SearchOperatorParams<string | number>) => string | null
      initialValue: null
      inputComponent: SearchOperatorInput<string | number>
      type: 'portableTextEqual'
    })
  | (SearchOperatorBuilder<'portableTextMatches', string | number> & {
      nameKey: 'search.operator.portable-text-contains.name'
      descriptionKey: 'search.operator.portable-text-contains.description'
      groqFilter: ({fieldPath, value}: SearchOperatorParams<string | number>) => string | null
      initialValue: null
      inputComponent: SearchOperatorInput<string | number>
      type: 'portableTextMatches'
    })
  | (SearchOperatorBuilder<'portableTextNotEqual', string | number> & {
      nameKey: 'search.operator.portable-text-not-equal.name'
      descriptionKey: 'search.operator.portable-text-not-equal.description'
      groqFilter: ({fieldPath, value}: SearchOperatorParams<string | number>) => string | null
      initialValue: null
      inputComponent: SearchOperatorInput<string | number>
      type: 'portableTextNotEqual'
    })
  | (SearchOperatorBuilder<'portableTextNotMatches', string | number> & {
      nameKey: 'search.operator.portable-text-not-contains.name'
      descriptionKey: 'search.operator.portable-text-not-contains.description'
      groqFilter: ({fieldPath, value}: SearchOperatorParams<string | number>) => string | null
      initialValue: null
      inputComponent: SearchOperatorInput<string | number>
      type: 'portableTextNotMatches'
    })
  | (SearchOperatorBuilder<'referenceEqual', Reference> & {
      nameKey: 'search.operator.reference-equal.name'
      descriptionKey: 'search.operator.reference-equal.description'
      buttonValueComponent: SearchOperatorButtonValue<Reference>
      groqFilter: ({fieldPath, value}: SearchOperatorParams<Reference>) => string | null
      initialValue: null
      inputComponent: SearchOperatorInput<Reference>
      type: 'referenceEqual'
    })
  | (SearchOperatorBuilder<'referenceNotEqual', Reference> & {
      nameKey: 'search.operator.reference-not-equal.name'
      descriptionKey: 'search.operator.reference-not-equal.description'
      buttonValueComponent: SearchOperatorButtonValue<Reference>
      groqFilter: ({fieldPath, value}: SearchOperatorParams<Reference>) => string | null
      initialValue: null
      inputComponent: SearchOperatorInput<Reference>
      type: 'referenceNotEqual'
    })
  | (SearchOperatorBuilder<'referencesAssetFile', Reference> & {
      nameKey: 'search.operator.reference-asset-file.name'
      descriptionKey: 'search.operator.reference-asset-file.description'
      buttonValueComponent: SearchOperatorButtonValue<Reference>
      groqFilter: ({value}: SearchOperatorParams<Reference>) => string | null
      initialValue: null
      inputComponent: ({onChange, value}: OperatorInputComponentProps<Reference>) => JSX_2.Element
      type: 'referencesAssetFile'
    })
  | (SearchOperatorBuilder<'referencesAssetImage', Reference> & {
      nameKey: 'search.operator.reference-asset-image.name'
      descriptionKey: 'search.operator.reference-asset-image.description'
      buttonValueComponent: SearchOperatorButtonValue<Reference>
      groqFilter: ({value}: SearchOperatorParams<Reference>) => string | null
      initialValue: null
      inputComponent: ({onChange, value}: OperatorInputComponentProps<Reference>) => JSX_2.Element
      type: 'referencesAssetImage'
    })
  | (SearchOperatorBuilder<'referencesDocument', Reference> & {
      nameKey: 'search.operator.reference-document.name'
      descriptionKey: 'search.operator.reference-document.description'
      buttonValueComponent: SearchOperatorButtonValue<Reference>
      groqFilter: ({value}: SearchOperatorParams<Reference>) => string | null
      initialValue: null
      inputComponent: SearchOperatorInput<Reference>
      type: 'referencesDocument'
    })
  | (SearchOperatorBuilder<'slugEqual', string | number> & {
      nameKey: 'search.operator.slug-equal.name'
      descriptionKey: 'search.operator.slug-equal.description'
      groqFilter: ({fieldPath, value}: SearchOperatorParams<string | number>) => string | null
      initialValue: null
      inputComponent: SearchOperatorInput<string | number>
      type: 'slugEqual'
    })
  | (SearchOperatorBuilder<'slugMatches', string | number> & {
      nameKey: 'search.operator.slug-contains.name'
      /**
       * @internal
       */
      descriptionKey: 'search.operator.slug-contains.description'
      groqFilter: ({fieldPath, value}: SearchOperatorParams<string | number>) => string | null
      initialValue: null
      inputComponent: SearchOperatorInput<string | number>
      label: string
      type: 'slugMatches'
    })
  | (SearchOperatorBuilder<'slugNotEqual', string | number> & {
      nameKey: 'search.operator.slug-not-equal.name'
      descriptionKey: 'search.operator.slug-not-equal.description'
      groqFilter: ({fieldPath, value}: SearchOperatorParams<string | number>) => string | null
      initialValue: null
      inputComponent: SearchOperatorInput<string | number>
      type: 'slugNotEqual'
    })
  | (SearchOperatorBuilder<'slugNotMatches', string | number> & {
      nameKey: 'search.operator.slug-not-contains.name'
      descriptionKey: 'search.operator.slug-not-contains.description'
      groqFilter: ({fieldPath, value}: SearchOperatorParams<string | number>) => string | null
      initialValue: null
      inputComponent: SearchOperatorInput<string | number>
      type: 'slugNotMatches'
    })
  | (SearchOperatorBuilder<'stringEqual', string | number> & {
      nameKey: 'search.operator.string-equal.name'
      descriptionKey: 'search.operator.string-equal.description'
      groqFilter: ({fieldPath, value}: SearchOperatorParams<string | number>) => string | null
      initialValue: null
      inputComponent: SearchOperatorInput<string | number>
      type: 'stringEqual'
    })
  | (SearchOperatorBuilder<'stringListEqual', string | number> & {
      nameKey: 'search.operator.string-list-equal.name'
      descriptionKey: 'search.operator.string-list-equal.description'
      groqFilter: ({fieldPath, value}: SearchOperatorParams<string | number>) => string | null
      initialValue: null
      inputComponent: SearchOperatorInput<string | number>
      type: 'stringListEqual'
    })
  | (SearchOperatorBuilder<'stringListNotEqual', string | number> & {
      nameKey: 'search.operator.string-list-not-equal.name'
      descriptionKey: 'search.operator.string-list-not-equal.description'
      groqFilter: ({fieldPath, value}: SearchOperatorParams<string | number>) => string | null
      initialValue: null
      inputComponent: SearchOperatorInput<string | number>
      type: 'stringListNotEqual'
    })
  | (SearchOperatorBuilder<'stringMatches', string | number> & {
      nameKey: 'search.operator.string-contains.name'
      descriptionKey: 'search.operator.string-contains.description'
      groqFilter: ({fieldPath, value}: SearchOperatorParams<string | number>) => string | null
      initialValue: null
      inputComponent: SearchOperatorInput<string | number>
      type: 'stringMatches'
    })
  | (SearchOperatorBuilder<'stringNotEqual', string | number> & {
      nameKey: 'search.operator.string-not-equal.name'
      descriptionKey: 'search.operator.string-not-equal.description'
      groqFilter: ({fieldPath, value}: SearchOperatorParams<string | number>) => string | null
      initialValue: null
      inputComponent: SearchOperatorInput<string | number>
      type: 'stringNotEqual'
    })
  | (SearchOperatorBuilder<'stringNotMatches', string | number> & {
      nameKey: 'search.operator.string-not-contains.name'
      descriptionKey: 'search.operator.string-not-contains.description'
      groqFilter: ({fieldPath, value}: SearchOperatorParams<string | number>) => string | null
      initialValue: null
      inputComponent: SearchOperatorInput<string | number>
      type: 'stringNotMatches'
    })
)[]

declare type OperatorDivider = {
  type: 'divider'
}

/**
 * @alpha
 */
export declare interface OperatorInputComponentProps<T> {
  fieldDefinition?: SearchFieldDefinition
  onChange: (value: T | null) => void
  value: T | null
}

declare type OperatorItem<TOperators = string> = {
  name: TOperators
  type: 'item'
}

declare interface OperatorNumberRangeValue {
  from: number | null
  to: number | null
}

declare type OrderingReset = {
  type: 'ORDERING_RESET'
}

declare type OrderingSet = {
  ordering: SearchOrdering
  type: 'ORDERING_SET'
}

/** @internal */
export declare function OverlayDisabled(props: PresenceOverlayProps): JSX.Element

declare type PageIncrement = {
  type: 'PAGE_INCREMENT'
}

declare interface PaginationState {
  cursor: string | null
  nextCursor: string | null
}

/**
 * @hidden
 * @beta */
export declare interface Pair {
  /** @internal */
  transactionsPendingEvents$: Observable<PendingMutationsEvent>
  published: DocumentVersion
  draft: DocumentVersion
  complete: () => void
}

/** @internal */
export declare interface PairListenerOptions {
  tag?: string
}

/**
 * @hidden
 * @beta */
export declare type ParsedTimeRef = Chunk | 'loading' | 'invalid'

/**
 * @hidden
 * @beta
 */
export declare type PartialContext<TContext extends ConfigContext> = Pick<
  TContext,
  Exclude<keyof TContext, keyof ConfigContext>
>

/** @internal */
export declare type PartialExcept<T, K extends keyof T> = Pick<T, K> & Partial<Omit<T, K>>

declare type Patch = any

/**
 *
 * @hidden
 * @beta
 */
export declare type PatchArg = FormPatch | FormPatch[]

/**
 *
 * @hidden
 * @beta
 */
export declare interface PatchChannel {
  publish: (msg: PatchMsg) => void
  subscribe: (subscriber: PatchMsgSubscriber) => () => void
}

/**
 *
 * @hidden
 * @beta
 */
export declare class PatchEvent {
  static from(input: PatchArg | PatchEvent): PatchEvent
  patches: Array<FormPatch>
  constructor(patches: Array<FormPatch>)
  prepend(...patches: PatchArg[]): PatchEvent
  append(...patches: PatchArg[]): PatchEvent
  prefixAll(segment: PathSegment): PatchEvent
}

/**
 *
 * @hidden
 * @beta
 */
export declare type PatchMsg = MutationPatchMsg | RebasePatchMsg

/**
 *
 * @hidden
 * @beta
 */
export declare interface PatchMsgSubscriber {
  (msg: PatchMsg): void
}

declare type PatchTransformer = (patches: FormPatch[]) => FormPatch[]

/** @internal */
export declare function pathsAreEqual(pathA: Path, pathB: Path): boolean

/** @internal */
export declare function pathToString(path: Path): string

/** @internal */
export declare interface PendingMutationsEvent {
  type: 'pending'
  phase: 'begin' | 'end'
}

/**
 * @hidden
 * @beta */
export declare interface PermissionCheckResult {
  granted: boolean
  reason: string
}

/**
 * @hidden
 * @beta
 */
declare type Plugin_2<TOptions = void> = (options: TOptions) => PluginOptions
export {Plugin_2 as Plugin}

/**
 * @hidden
 * @beta */
export declare type PluginFactory<TOptions> = (options: TOptions) => PluginOptions

/** @beta */
export declare interface PluginOptions {
  name: string
  plugins?: PluginOptions[]
  schema?: SchemaPluginOptions
  document?: DocumentPluginOptions
  tools?: Tool[] | ComposableOption<Tool[], ConfigContext>
  form?: SanityFormConfig
  __internal_tasks?: {
    footerAction: ReactNode
  }
  studio?: {
    /**
     * Components for the studio.
     * @hidden
     * @beta
     */
    components?: StudioComponentsPluginOptions
  }
  /** @beta @hidden */
  i18n?: LocalePluginOptions
  search?: {
    unstable_partialIndexing?: {
      enabled: boolean
    }
    /**
     * Enables the experimental new search API as an opt-in feature. This flag
     * allows you to test and provide feedback on the new search capabilities
     * before they become the default search mechanism. It is part of an
     * experimental set of features that are subject to change. Users should be
     * aware that while this feature is in use, they may encounter
     * inconsistencies or unexpected behavior compared to the stable search
     * functionality.
     */
    unstable_enableNewSearch?: boolean
  }
}

/** @internal */
export declare function PopoverDialog(props: PopoverDialogProps): JSX_2.Element

declare interface PopoverDialogProps {
  children: ReactNode
  header?: ReactNode
  onClose: () => void
  referenceElement: PopoverProps['referenceElement']
  width: ResponsiveWidthProps['width']
  containerRef?: Dispatch<SetStateAction<HTMLDivElement | null>>
}

/** @internal */
declare type PopoverProps = Omit<PopoverProps_2, 'animate'>

/** @internal */
export declare type PortableTextEditorElement = HTMLDivElement | HTMLSpanElement

/**
 * Input component for editing block content
 * ({@link https://github.com/portabletext/portabletext | Portable Text}) in the Sanity Studio.
 *
 * Supports multi-user real-time block content editing on larger documents.
 *
 * This component can be configured and customized extensively.
 * {@link https://www.sanity.io/docs/customizing-the-portable-text-editor | Go to the documentation for more details}.
 *
 * @public
 * @param props - {@link PortableTextInputProps} component props.
 */
declare function PortableTextInput(props: PortableTextInputProps): JSX_2.Element
export {PortableTextInput as BlockEditor}
export {PortableTextInput}

/**
 * Component props for the {@link PortableTextInput} React component.
 *
 * Extends {@link ArrayOfObjectsInputProps}.
 *
 * @public
 * */
export declare interface PortableTextInputProps
  extends ArrayOfObjectsInputProps<PortableTextBlock, ArraySchemaType<PortableTextBlock>> {
  /**
   * A React Ref that can reference the underlying editor instance
   */
  editorRef?: React.MutableRefObject<PortableTextEditor | null>
  /**
   * Assign hotkeys that can be attached to custom editing functions
   */
  hotkeys?: HotkeyOptions
  /**
   * Array of {@link PortableTextMarker} with meta data connected to the content.
   * @deprecated will be removed in the next major version of Sanity Studio.
   * Use the `renderBlock` interface instead.
   */
  markers?: PortableTextMarker[]
  /**
   * Returns changes from the underlying editor
   */
  onEditorChange?: (change: EditorChange, editor: PortableTextEditor) => void
  /**
   * Optional callback for when the editor goes into or out of full screen mode
   * @hidden
   * @beta
   */
  onFullScreenChange?: (isFullScreen: boolean) => void
  /**
   * Custom copy function
   */
  onCopy?: OnCopyFn
  /**
   * Custom paste function
   */
  onPaste?: OnPasteFn
  /**
   * Function to render custom block actions
   * @deprecated will be removed in the next major version of Sanity Studio.
   * Use the `renderBlock` interface instead.
   */
  renderBlockActions?: RenderBlockActionsCallback
  /**
   * Function to render custom markers
   * @deprecated will be removed in the next major version of Sanity Studio.
   * Use the `renderBlock` interface instead.
   */
  renderCustomMarkers?: RenderCustomMarkers
  /**
   * Array of {@link RangeDecoration} that can be used to decorate the content.
   */
  rangeDecorations?: RangeDecoration[]
}

/**
 * A generic marker for attaching metadata to specific nodes of the Portable Text input.
 *
 * @public
 * @hidden
 * @deprecated use `renderBlock`, `renderInlineBlock`, `renderAnnotation` interfaces instead
 * @param type - a type name for this marker
 * @param data - some data connected to this marker
 * @param path - the path to the Portable Text content connected to this marker
 */
export declare interface PortableTextMarker {
  type: string
  data?: unknown
  path: Path
}

/** @internal */
export declare interface PortableTextMemberItem {
  kind: 'annotation' | 'textBlock' | 'objectBlock' | 'inlineObject'
  key: string
  member: ArrayOfObjectsItemMember
  node: ObjectFormNode
  elementRef?: MutableRefObject<PortableTextEditorElement | null>
  input?: ReactNode
}

/**
 * Portable text preview layout key
 *
 * @public
 */
export declare type PortableTextPreviewLayoutKey = 'block' | 'blockImage' | 'inline'

/** @internal */
export declare type Position = 'top' | 'bottom' | 'inside' | null

/** @internal */
export declare function prefixPath<
  T extends {
    path: Path
  },
>(patch: T, segment: PathSegment): T

/**
 * Takes in a config (created from the `defineConfig` function) and returns
 * an array of `WorkspaceSummary`. Note: this only partially resolves a config.
 *
 * For usage inside the Studio, it's preferred to pull the pre-resolved
 * workspaces and sources via `useWorkspace` or `useSource`. For usage outside
 * the Studio or for testing, use `resolveConfig`.
 *
 * @internal
 */
export declare function prepareConfig(
  config: Config | MissingConfigFile,
  options?: {
    basePath?: string
  },
): PreparedConfig

/** @internal */
export declare interface PreparedConfig {
  type: 'prepared-config'
  workspaces: WorkspaceSummary[]
}

/**
 * @hidden
 * @beta */
export declare interface PreparedSnapshot {
  type?: PreviewableType
  snapshot: PreviewValue | null | undefined
}

/** @internal */
export declare function prepareForPreview(
  rawValue: unknown,
  type: SchemaType,
  viewOptions?: PrepareViewOptions,
): PreviewValue & {
  _createdAt?: string
  _updatedAt?: string
}

/** @internal */
export declare function prepareTemplates(
  schema: Schema,
  initialValueTemplates: Template[],
): Template[]

/** @internal */
export declare interface PresenceLocation {
  type: 'document'
  documentId: string
  lastActiveAt: string
  path: Path
}

/** @internal */
export declare const PresenceOverlay: typeof OverlayDisabled

/** @internal */
export declare interface PresenceOverlayProps {
  children: ReactNode
  margins?: [number, number, number, number]
}

/** @internal */
export declare function PresenceScope(props: PresenceScopeProps): JSX_2.Element

/** @internal */
export declare interface PresenceScopeProps {
  readOnly?: boolean
  path: Path
  children: ReactNode
}

/**
 * @hidden
 * @beta */
export declare interface PresenceStore {
  /**
   * @internal
   */
  documentPresence: (documentId: string) => Observable<DocumentPresence[]>
  /**
   * @internal
   */
  globalPresence$: Observable<GlobalPresence[]>
  /**
   * @internal
   */
  reportLocations: (locations: PresenceLocation[]) => Observable<void>
  /**
   * @internal
   */
  setLocation: (nextLocation: PresenceLocation[]) => void
  /**
   * @internal
   */
  debugPresenceParam$: Observable<string[]>
}

/** @internal */
export declare type PresentUser = {
  user: User
  status?: Status
  sessions?: Session[]
}

/**
 * @internal
 */
export declare function Preview(props: RenderPreviewCallbackProps): JSX_2.Element

/**
 * @hidden
 * @beta */
export declare type Previewable = (
  | {
      _id: string
    }
  | {
      _type: string
    }
  | {
      _ref: string
      _dataset?: string
      _projectId?: string
    }
) & {
  /**
   * optional object used to attach meta data to the prepared result.
   * currently used to add a flag for the invalid preview error fallback and
   * insufficient permissions fallback
   * @internal
   */
  _internalMeta?: {
    type?: string
  }
}

/**
 * @hidden
 * @beta */
export declare interface PreviewableType {
  fields?: {
    name: string
    type: SchemaType
  }[]
  preview?: PreviewConfig
}

/** @internal */
export declare const PreviewCard: ForwardRefExoticComponent<
  Omit<CardProps & Omit<HTMLProps<HTMLDivElement>, 'height'>, 'ref'> & RefAttributes<HTMLDivElement>
>

/** @internal */
export declare interface PreviewCardContextValue {
  selected?: boolean
}

/**
 * @hidden
 * @beta
 */
export declare type PreviewComponent = ComponentType<PreviewProps>

/**
 * Preview layout key. See also {@link GeneralPreviewLayoutKey} and {@link PortableTextPreviewLayoutKey}
 *
 * @public
 */
export declare type PreviewLayoutKey = GeneralPreviewLayoutKey | PortableTextPreviewLayoutKey

/**
 * This component is responsible for converting renderPreview() calls into an element.
 * It:
 * - subscribes to "prepared" preview value as long as the element is visible on screen
 * - resolves the configured preview component for the schema type
 * - prepares "preview"-props and passes this to the configured preview component
 * @internal
 * */
export declare function PreviewLoader(
  props: RenderPreviewCallbackProps & {
    component: ComponentType<Omit<PreviewProps, 'renderDefault'>>
  },
): ReactElement

/**
 * @hidden
 * @public
 */
export declare interface PreviewMediaDimensions {
  aspect?: number
  dpr?: number
  fit?: ImageUrlFitMode
  height?: number
  width?: number
}

/**
 * TODO: unify with content path from `@sanity/types`
 *
 *
 * @hidden
 * @beta
 */
export declare type PreviewPath = FieldName[]

/**
 * @hidden
 * @beta
 */
export declare interface PreviewProps<TLayoutKey = PreviewLayoutKey> {
  actions?:
    | ReactNode
    | ComponentType<{
        layout: TLayoutKey
      }>
  children?: ReactNode
  description?:
    | ReactNode
    | ComponentType<{
        layout: TLayoutKey
      }>
  error?: Error | null
  fallbackTitle?: ReactNode
  imageUrl?: string
  isPlaceholder?: boolean
  layout?: TLayoutKey
  media?:
    | ReactNode
    | ComponentType<{
        dimensions: PreviewMediaDimensions
        layout: TLayoutKey
      }>
  mediaDimensions?: PreviewMediaDimensions
  progress?: number
  status?:
    | ReactNode
    | ComponentType<{
        layout: TLayoutKey
      }>
  subtitle?:
    | ReactNode
    | ComponentType<{
        layout: TLayoutKey
      }>
  title?:
    | ReactNode
    | ComponentType<{
        layout: TLayoutKey
      }>
  withBorder?: boolean
  withRadius?: boolean
  withShadow?: boolean
  schemaType?: SchemaType
  renderDefault: (props: PreviewProps) => ReactElement
}

declare interface PreviewState {
  isLoading?: boolean
  draft?: PreviewValue | Partial<SanityDocument> | null
  published?: PreviewValue | Partial<SanityDocument> | null
}

/** @internal */
export declare type PrimitiveFieldProps = NumberFieldProps | BooleanFieldProps | StringFieldProps

/**
 * @hidden
 * @beta */
export declare type PrimitiveFormNode = BooleanFormNode | NumberFormNode | StringFormNode

/**
 * @hidden
 * @public */
export declare interface PrimitiveInputElementProps {
  value?: string
  id: string
  readOnly: boolean
  placeholder?: string
  onChange: FormEventHandler
  onFocus: FocusEventHandler
  onBlur: FocusEventHandler
  ref: MutableRefObject<any>
  'aria-describedby': string | undefined
}

/**
 * @hidden
 * @beta */
export declare type PrimitiveInputProps = StringInputProps | BooleanInputProps | NumberInputProps

/** @public */
export declare interface PrimitiveItemProps extends BaseItemProps<string | number | boolean> {
  /**
   * The value of the primitive item.
   */
  value: string | number | boolean
  /**
   * The schema type of the primitive item.
   */
  schemaType: NumberSchemaType | BooleanSchemaType | StringSchemaType
  /**
   * The schema type of the parent array containing the item.
   */
  parentSchemaType: ArraySchemaType
}

/**
 *
 * @hidden
 * @beta
 */
export declare interface PrimitiveMemberItemProps {
  member: ArrayOfPrimitivesItemMember
  renderItem: RenderArrayOfPrimitivesItemCallback
  renderInput: RenderInputCallback
}

declare type PrimitiveValue = string | number | boolean

/**
 * @hidden
 * @beta */
export declare interface ProjectData {
  id: string
  displayName: string
  studioHost: string | null
  isBlocked: boolean
  isDisabled: boolean
  isDisabledByUser: boolean
  metadata: {
    color: string
    externalStudioHost: string
  }
  maxRetentionDays: number
  activityFeedEnabled: boolean
  createdAt: string
  updatedAt: string
  organizationId: string
  members: {
    id: string
    createdAt: string
    updatedAt: string
    isCurrentUser: boolean
    isRobot: boolean
    role: string
    roles: Role[]
  }[]
  features: string[]
  pendingInvites: number
}

/**
 * @hidden
 * @beta */
export declare interface ProjectDatasetData {
  name: string
  aclMode: 'public' | 'private'
  createdAt: string
  createdByUserId: string
  tags: {
    name: string
    title: string
  }[]
}

/**
 * @hidden
 * @beta */
export declare interface ProjectStore {
  get: () => Observable<ProjectData>
  getDatasets: () => Observable<ProjectDatasetData[]>
}

/** @internal */
export declare type PublishedId = Opaque<string, 'publishedId'>

/**
 * @hidden
 * @beta */
export declare type QueryParams = Record<string, string | number | boolean | string[]>

/** @internal */
export declare type ReactHook<TArgs, TResult> = (args: TArgs) => TResult

/**
 *
 * @hidden
 * @beta
 */
export declare interface RebasePatchMsg {
  type: 'rebase'
  patches: FormPatch[]
  snapshot: unknown
}

declare type RecentSearch = SearchTerms & {
  __recent: {
    index: number
    timestamp: number
  }
  filters?: SearchFilter[]
}

/**
 * @hidden
 * @beta */
export declare interface ReconnectEvent {
  type: 'reconnect'
}

/** @internal */
export declare interface Rect {
  height: number
  width: number
  top: number
  left: number
}

/**
 *
 * @hidden
 * @beta
 */
export declare interface ReferenceComponents {
  annotation?: ComponentType<BlockAnnotationProps>
  block?: ComponentType<BlockProps>
  diff?: ComponentType<any>
  field?: ComponentType<ObjectFieldProps<ReferenceValue>>
  inlineBlock?: ComponentType<BlockProps>
  input?: ComponentType<ReferenceInputProps>
  item?: ComponentType<ObjectItemProps<ReferenceValue & ObjectItem>>
  preview?: ComponentType<PreviewProps>
}

/** @internal */
export declare type ReferenceDiff = ObjectDiff<Reference>

/**
 *
 * @hidden
 * @beta
 */
export declare function ReferenceInput(props: ReferenceInputProps): JSX_2.Element

/**
 * @internal
 */
export declare interface ReferenceInputOptions {
  /**
   * Represents the highlighted path if ths current document has a related open
   * child (e.g. reference in place).
   */
  activePath?: {
    path: Path
    state: 'selected' | 'pressed' | 'none'
  }
  /**
   * A specialized `EditReferenceLinkComponent` component that takes in the needed props to open a
   * referenced document to the right
   */
  EditReferenceLinkComponent?: ComponentType<
    Omit<HTMLProps<'a'>, 'children'> & EditReferenceLinkComponentProps
  >
  initialValueTemplateItems?: TemplatePermissionsResult[]
  /**
   * Similar to `EditReferenceChildLink` expect without the wrapping component
   */
  onEditReference?: (options: EditReferenceOptions) => void
}

/**
 * @internal
 */
export declare function ReferenceInputOptionsProvider(
  props: ReferenceInputOptions & {
    children: ReactNode
  },
): JSX_2.Element

/**
 *
 * @hidden
 * @beta
 */
export declare type ReferenceInputProps = ObjectInputProps<Reference, ReferenceSchemaType>

/** @internal */
export declare type RegionWithIntersectionDetails = {
  distanceTop: number
  distanceBottom: number
  position: 'top' | 'bottom' | 'inside'
  region: ReportedRegionWithRect<FieldPresenceData>
}

/**
 * @internal
 */
export declare function RelativeTime({time, ...options}: RelativeTimeProps): JSX_2.Element

/** @internal */
export declare interface RelativeTimeOptions {
  minimal?: boolean
  useTemporalPhrase?: boolean
  relativeTo?: Date
  timeZone?: string
}

/**
 * @internal
 */
export declare interface RelativeTimeProps extends RelativeTimeOptions {
  time: string | Date
}

/**
 * @hidden
 * @beta */
export declare type RemoteSnapshotEvent = DocumentRemoteMutationEvent | SnapshotEvent

/** @internal */
export declare const remoteSnapshots: (
  arg1: SanityClient,
  arg2: IdPair,
  arg3: string,
) => Observable<RemoteSnapshotVersionEvent>

/**
 * @hidden
 * @beta */
export declare type RemoteSnapshotVersionEvent = WithVersion<RemoteSnapshotEvent>

/** @internal */
export declare function removeDupes(documents: SanityDocumentLike[]): SanityDocumentLike[]

/** @internal */
export declare const removeMissingReferences: (
  doc: SanityDocument,
  existingIds: Record<string, boolean | undefined>,
) => SanityDocument

/**
 * Removes any values that are undefined from the given object.
 *
 * This is used to remove any placeholders from the generated files, while being able to leave them
 * in place to ease spotting the missing translations.
 *
 * @param resources - The resources to remove undefined values from
 * @returns The resources without any undefined values
 * @public
 * @hidden
 */
export declare function removeUndefinedLocaleResources<
  T extends {
    [key: string]: string | undefined
  },
>(
  resources: T,
): {
  [K in keyof T]: Exclude<T[K], undefined>
}

/**
 * @hidden
 * @public */
export declare type RenderAnnotationCallback<
  T extends BlockAnnotationProps = BlockAnnotationProps,
> = (annotationProps: Omit<T, 'renderDefault'>) => ReactNode

/**
 * @hidden
 * @public  */
export declare type RenderArrayOfObjectsItemCallback = (
  itemProps: Omit<ObjectItemProps, 'renderDefault'>,
) => ReactNode

/**
 * @hidden
 * @beta */
export declare type RenderArrayOfPrimitivesItemCallback = (
  itemProps: Omit<PrimitiveItemProps, 'renderDefault'>,
) => ReactNode

/**
 * Function for rendering custom block actions
 *
 * @public
 * @hidden
 * @deprecated use `renderBlock`, `renderInlineBlock`, `renderAnnotation` interfaces instead
 */
export declare type RenderBlockActionsCallback = (props: RenderBlockActionsProps) => ReactNode

/**
 * Props for rendering block actions
 *
 * @public
 * @hidden
 * @deprecated use `renderBlock`, `renderInlineBlock`, `renderAnnotation` interfaces instead
 */
export declare interface RenderBlockActionsProps {
  block: PortableTextBlock
  value: PortableTextBlock[] | undefined
  set: (block: PortableTextBlock) => void
  unset: () => void
  insert: (block: PortableTextBlock | PortableTextBlock[]) => void
}

/**
 * @hidden
 * @public */
export declare type RenderBlockCallback<T extends BlockProps = BlockProps> = (
  blockProps: Omit<T, 'renderDefault'>,
) => ReactNode

/**
 * Function for rendering custom block markers
 *
 * @public
 * @hidden
 * @deprecated use `renderBlock`, `renderInlineBlock`, `renderAnnotation` interfaces instead
 */
export declare type RenderCustomMarkers = (markers: PortableTextMarker[]) => ReactNode

/**
 * @hidden
 * @public */
export declare type RenderFieldCallback<T extends FieldProps = FieldProps> = (
  fieldProps: Omit<T, 'renderDefault'>,
) => ReactNode

/**
 * @hidden
 * @public */
export declare type RenderInputCallback<T extends InputProps = InputProps> = (
  inputProps: Omit<T, 'renderDefault'>,
) => ReactNode

/**
 * @hidden
 * @public */
export declare type RenderItemCallback = (
  itemProps: Omit<ObjectItemProps, 'renderDefault'> | Omit<PrimitiveItemProps, 'renderDefault'>,
) => ReactNode

/**
 * @hidden
 * @public */
export declare type RenderPreviewCallback = (props: RenderPreviewCallbackProps) => ReactNode

/**
 *
 * @hidden
 * @public
 */
export declare interface RenderPreviewCallbackProps<TLayoutKey = PreviewLayoutKey> {
  actions?:
    | ReactNode
    | ComponentType<{
        layout: TLayoutKey
      }>
  children?: ReactNode
  error?: Error | null
  fallbackTitle?: ReactNode
  isPlaceholder?: boolean
  layout?: TLayoutKey
  mediaDimensions?: PreviewMediaDimensions
  progress?: number
  status?:
    | ReactNode
    | ComponentType<{
        layout: TLayoutKey
      }>
  value: unknown
  withBorder?: boolean
  withRadius?: boolean
  withShadow?: boolean
  schemaType: SchemaType
  skipVisibilityCheck?: boolean
  style?: CSSProperties
}

/**
 * @internal
 * @deprecated Use `renderStudio(rootElement, config, {reactStrictMode: true})` instead
 */
export declare function renderStudio(
  rootElement: HTMLElement | null,
  config: Config,
  options: boolean,
): () => void

/** @internal */
export declare function renderStudio(rootElement: HTMLElement | null, config: Config): () => void

/** @internal */
export declare function renderStudio(
  rootElement: HTMLElement | null,
  config: Config,
  options: RenderStudioOptions,
): () => void

declare interface RenderStudioOptions {
  basePath?: string
  reactStrictMode?: boolean
}

/** @internal */
export declare type Reported<Value> = [string, Value]

/** @internal */
export declare type ReportedRegionWithRect<T> = T & {
  id: string
  rect: Rect
}

/** @internal */
export declare type ReporterHook<Payload> = (
  id: string | null,
  value: Payload | (() => Payload),
  isEqual?: (a: Payload, b: Payload) => boolean,
) => void

/**
 * A subset of the History API is used, and explicitly declared so it's possible to write a custom
 * history implementation that can be used to integrate the router in a variety of parent routers.
 * @internal
 */
declare type RequiredHistory = Pick<History_2, 'listen' | 'location' | 'push' | 'replace'>

/** @internal */
export declare const resizeObserver: SharedResizeObserver

/**
 * @internal
 */
export declare function resolveConditionalProperty(
  property: ConditionalProperty,
  context: ConditionalPropertyCallbackContext,
): boolean

/**
 * Fully resolves a configuration including subscribing to all sources and
 * workspaces from a config. Returns an `Observable` that waits till all sources
 * emit once before emitting an array of fully resolved sources and workspaces.
 *
 * @internal
 */
export declare function resolveConfig(config: Config): Observable<Workspace[]>

/** @internal */
export declare function resolveDiffComponent<D extends Diff = any>(
  type: SchemaType,
  parentSchemaType?: ArraySchemaType | ObjectSchemaType,
): DiffComponent<D> | DiffComponentOptions | undefined

/**
 *
 * @hidden
 * @beta
 */
export declare type ResolvedUploader = {
  uploader: Uploader
  type: SchemaType
}

/** @internal */
export declare function resolveInitialObjectValue<Params extends Record<string, unknown>>(
  type: ObjectSchemaType,
  params: Params,
  maxDepth: number,
  context: InitialValueResolverContext,
): Promise<any>

/** @internal */
export declare function resolveInitialValue(
  schema: Schema,
  template: Template,
  params:
    | {
        [key: string]: any
      }
    | undefined,
  context: InitialValueResolverContext,
): Promise<{
  [key: string]: any
}>

/**
 * Resolve initial value for the given schema type (recursively)
 *
 * @internal
 */
export declare function resolveInitialValueForType<Params extends Record<string, unknown>>(
  /**
   * This is the name of the document.
   */
  type: SchemaType,
  /**
   * Params is a sanity context object passed to every initial value function.
   */
  params: Params,
  /**
   * Maximum recursion depth (default 9).
   */
  maxDepth: number | undefined,
  context: InitialValueResolverContext,
): Promise<any>

/**
 * @hidden
 * @beta
 */
export declare interface ResolveProductionUrlContext extends ConfigContext {
  document: SanityDocumentLike
}

/**
 * @internal
 * @hidden
 */
export declare function resolveSchemaTypes({
  config,
  context,
}: ResolveSchemaTypesOptions): SchemaTypeDefinition[]

declare interface ResolveSchemaTypesOptions {
  config: PluginOptions
  context: SchemaTypeContext
}

/** @internal */
export declare interface ResourceCache {
  get<T = unknown>(options: {namespace: string; dependencies: (object | null)[]}): T | undefined
  set(options: {namespace: string; dependencies: (object | null)[]; value: unknown}): void
}

/** @internal */
export declare function ResourceCacheProvider({children}: ResourceCacheProviderProps): JSX_2.Element

/** @internal */
export declare interface ResourceCacheProviderProps {
  children: ReactNode
}

/** @internal */
export declare type RetryingStatus = {
  type: 'retrying'
}

/** @internal */
export declare const RevertChangesButton: ForwardRefExoticComponent<
  Omit<ButtonProps, 'tooltipProps'> &
    Omit<HTMLProps<HTMLButtonElement>, 'ref'> & {
      changeCount: number
    } & RefAttributes<HTMLButtonElement>
>

/**
 * @internal
 */
export declare const ReviewChangesContext: Context<ReviewChangesContextValue | null>

/**
 * @internal
 */
export declare interface ReviewChangesContextValue {
  changesOpen?: boolean
}

/**
 * @public
 */
declare interface Route {
  /**
   * The raw string representation of the route.
   */
  raw: string
  /**
   * An array of route segments that make up the route.
   * See {@link RouteSegment}
   */
  segments: RouteSegment[]
  /**
   * An optional object containing route transforms.
   * See {@link RouteTransform} and {@link RouterState}
   */
  transform?: {
    [key: string]: RouteTransform<RouterState>
  }
}

/**
 * @public
 */
declare type RouteChildren =
  | RouterNode[]
  | ((state: RouterState) => Router | RouterNode | RouterNode[] | undefined | false)

/**
 * @public
 */
declare interface Router extends RouterNode {
  /**
   * Indicates whether this router is a route.
   * @internal
   */
  _isRoute: boolean
  /**
   * Encodes the specified router state into a path string.
   * See {@link RouterState}
   *
   */
  encode: (state: RouterState) => string

  /**
   * Decodes the specified path string into a router state.
   * See {@link RouterState}
   */
  decode: (path: string) => RouterState | null

  /**
   * Determines whether the specified path is not found.
   */
  isNotFound: (path: string) => boolean

  /**
   * Gets the base path of this router.
   */
  getBasePath: () => string

  /**
   * Gets the redirect base of this router.
   */
  getRedirectBase: (pathname: string) => string | null

  /**
   * Determines whether the specified path is the root path.
   */
  isRoot: (path: string) => boolean
}

/**
 * The history context is either one of the implementations from the `history` package, or a custom one that only implements
 * the subset of the History API that is used by the router, documented in `RequiredHistory`.
 * @internal
 */
declare type RouterHistory = BrowserHistory | MemoryHistory | HashHistory | RequiredHistory

/**
 * @public
 */
declare interface RouterNode {
  /**
   * The route information for this node. See {@link Route}
   */
  route: Route
  /**
   * An optional scope for this node.
   */
  scope?: string

  /**
   * Optionally disable scoping of search params
   * Scoped search params will be represented as scope[param]=value in the url
   * Disabling this will still scope search params based on any parent scope unless the parent scope also has disabled search params scoping
   * Caution: enabling this can cause conflicts with multiple plugins defining search params with the same name
   */
  __unsafe_disableScopedSearchParams?: boolean

  /**
   * An optional object containing transforms to apply to this node.
   * See {@link RouteTransform} and {@link RouterState}
   */
  transform?: {
    [key: string]: RouteTransform<RouterState>
  }
  /**
   * The child nodes of this node. See {@link RouteChildren}
   */
  children: RouteChildren
}

/**
 * @public
 */
declare type RouterState = Record<string, unknown> & {_searchParams?: SearchParam[]}

/**
 * @public
 */
declare interface RouteSegment {
  /**
   * The name of the segment.
   */
  name: string
  /**
   * The type of the segment.
   * Can be either "dir" or "param".
   */
  type: 'dir' | 'param'
}

/**
 * @public
 */
declare interface RouteTransform<T> {
  /**
   * Converts a path string to a state object.
   */
  toState: (value: string) => T

  /**
   * Converts a state object to a path string.
   */
  toPath: (value: T) => string
}

/**
 * @hidden
 * @beta */
export declare type RovingFocusNavigationType = 'arrows' | 'tab'

/**
 * @hidden
 * @beta */
export declare interface RovingFocusProps {
  direction?: 'horizontal' | 'vertical'
  initialFocus?: 'first' | 'last'
  navigation?: RovingFocusNavigationType[]
  loop?: boolean
  pause?: boolean
  rootElement: HTMLElement | HTMLDivElement | null
}

/** @internal */
export declare const SANITY_PATCH_TYPE: unique symbol

/**
 * This version is provided by `@sanity/pkg-utils` at build time
 * @hidden
 * @beta
 */
export declare const SANITY_VERSION: string

export {SanityClient}

/**
 * Used in cases where no custom preview component is provided
 * @internal
 * */
export declare function SanityDefaultPreview(props: SanityDefaultPreviewProps): ReactElement

/** @internal */
export declare interface SanityDefaultPreviewProps extends Omit<PreviewProps, 'renderDefault'> {
  error?: Error | null
  icon?: ElementType | false
  tooltip?: ReactNode
}

/**
 * @public
 */
export declare interface SanityFormConfig {
  /**
   * these have not been migrated over
   *
   *
   * @hidden
   * @beta
   */
  unstable?: {
    CustomMarkers?: FormBuilderCustomMarkersComponent
    Markers?: FormBuilderMarkersComponent
  }
  /**
   * Components for the form.
   * @hidden
   * @beta
   */
  components?: FormComponents
  file?: {
    /**
     * @hidden
     * @beta
     */
    assetSources?: AssetSource[] | AssetSourceResolver
    directUploads?: boolean
  }
  /**
   * @hidden
   * @beta
   */
  image?: {
    assetSources?: AssetSource[] | AssetSourceResolver
    directUploads?: boolean
  }
}

/** @internal */
export declare class SchemaError extends Error {
  schema: Schema
  constructor(schema: Schema)
}

/**
 * @hidden
 * @beta
 */
export declare interface SchemaPluginOptions {
  name?: string
  types?:
    | SchemaTypeDefinition[]
    | ComposableOption<
        SchemaTypeDefinition[],
        Omit<ConfigContext, 'schema' | 'currentUser' | 'getClient' | 'client' | 'i18n'>
      >
  templates?: Template[] | TemplateResolver
}

declare type SchemaTypeContext = ConfigContext_2<typeof schemaTypesReducer>

declare const schemaTypesReducer: ConfigPropertyReducer<
  SchemaTypeDefinition[],
  Omit<ConfigContext, 'schema' | 'currentUser' | 'client' | 'getClient' | 'i18n'>
>

/**
 * This provides a utility function for use within Sanity Studios to create scrollable containers
 * It also provides a way for components inside a scrollable container to track onScroll on their first parent scroll container
 * NOTE: this is used by different studio utilities to track positions of elements on screen
 * NOTE: It will call any given `onScroll` callback with a Native DOM Event, and not a React Synthetic event
 * NOTE: It will not make sure the element is actually scrollable, this still needs to be done with css as usual
 *
 * @internal
 */
export declare const ScrollContainer: ForwardRefExoticComponent<
  Omit<ScrollContainerProps<ElementType>, 'ref'> & RefAttributes<HTMLDivElement>
>

/** @internal */
export declare interface ScrollContainerProps<T extends ElementType>
  extends Omit<HTMLProps<T>, 'as' | 'onScroll'> {
  as?: ElementType | keyof JSX.IntrinsicElements
  onScroll?: (event: Event) => () => void
}

/** @internal */
export declare interface ScrollContextValue {
  onScroll?: ScrollEventHandler
}

/** @internal */
export declare type ScrollEventHandler = (event: Event) => void

/** @internal */
export declare function ScrollMonitor({onScroll, children}: ScrollMonitorProps): JSX_2.Element

/** @internal */
export declare interface ScrollMonitorProps {
  onScroll: ScrollEventHandler
  children?: ReactNode
}

declare type SearchAction =
  | FiltersVisibleSet
  | LastActiveIndexSet
  | OrderingReset
  | OrderingSet
  | PageIncrement
  | SearchClear
  | SearchRequestComplete
  | SearchRequestError
  | SearchRequestStart
  | TermsFiltersAdd
  | TermsFiltersClear
  | TermsFiltersSetOperator
  | TermsFiltersRemove
  | TermsFiltersSetValue
  | TermsQuerySet
  | TermsSet
  | TermsTypeAdd
  | TermsTypeRemove
  | TermsTypesClear

/**
 * @internal
 */
export declare const SearchButton: ForwardRefExoticComponent<
  SearchButtonProps & RefAttributes<HTMLButtonElement>
>

declare interface SearchButtonProps {
  onClick: () => void
}

declare type SearchClear = {
  type: 'SEARCH_CLEAR'
}

/**
 * @internal
 */
export declare const SearchContext: Context<SearchContextValue | undefined>

/**
 * @internal
 */
export declare interface SearchContextValue {
  dispatch: Dispatch<SearchAction>
  onClose: (() => void) | null
  searchCommandList: CommandListHandle | null
  setSearchCommandList: Dispatch<SetStateAction<CommandListHandle | null>>
  setOnClose: (onClose: () => void) => void
  state: SearchReducerState
}

declare interface SearchDefinitions {
  fields: SearchFieldDefinitionDictionary
  filters: SearchFilterDefinitionDictionary
  operators: SearchOperatorDefinitionDictionary
}

/**
 * @internal
 */
export declare function SearchDialog({onClose, onOpen, open}: SearchDialogProps): JSX_2.Element

declare interface SearchDialogProps {
  onClose: () => void
  onOpen: () => void
  open: boolean
}

/**
 * @internal
 */
export declare interface SearchFactoryOptions {
  maxDepth?: number
  filter?: string
  params?: Record<string, unknown>
  tag?: string
  unique?: boolean
  unstable_enableNewSearch?: boolean
}

/**
 * @internal
 */
declare interface SearchFieldDefinition {
  documentTypes: string[]
  fieldPath: string
  filterName: string
  id: string
  name: string
  title: string
  titlePath: string[]
  type: string
}

/**
 * @internal
 */
declare type SearchFieldDefinitionDictionary = Record<
  SearchFieldDefinition['id'],
  SearchFieldDefinition
>

/**
 * @internal
 */
declare interface SearchFilter {
  fieldId?: string
  filterName: string
  operatorType: string
  value?: any
}

declare interface SearchFilterBaseDefinition<TOperators> {
  description?: string
  icon: ComponentType
  name: string
  operators: Operator<TOperators>[]
}

/**
 * @beta
 */
export declare type SearchFilterDefinition<TOperators = string> =
  | SearchFilterFieldDefinition<TOperators>
  | SearchFilterPinnedDefinition<TOperators>

/**
 * @internal
 */
declare type SearchFilterDefinitionDictionary = Record<
  SearchFilterDefinition['name'],
  SearchFilterDefinition
>

declare interface SearchFilterFieldDefinition<TOperators = string>
  extends SearchFilterBaseDefinition<TOperators> {
  fieldType: IntrinsicTypeName
  type: 'field'
}

declare interface SearchFilterPinnedDefinition<TOperators = string>
  extends SearchFilterBaseDefinition<TOperators> {
  fieldPath?: string
  group?: string
  title: string
  type: 'pinned'
}

/**
 * @internal
 */
declare interface SearchHit {
  hit: SanityDocumentLike
}

/**
 * @alpha
 */
export declare interface SearchOperatorBase {
  /** i18n resource key for the "name", eg `quantity is` or `contains` */
  nameKey: I18nSearchOperatorNameKey
  /** i18n resource key for the "name", eg `quantity is` or `contains` */
  descriptionKey: I18nSearchOperatorDescriptionKey
  /** icon for explaining the operator (React component) */
  icon?: ComponentType
  /** name/type of operator, eg `arrayCountEqual` or `numberGt` */
  type: string
}

/**
 * @alpha
 */
export declare interface SearchOperatorBuilder<TType extends string, TValue>
  extends SearchOperatorBase {
  buttonValueComponent?: SearchOperatorButtonValue<TValue>
  groqFilter: (params: SearchOperatorParams<TValue>) => string | null
  initialValue: TValue | null
  inputComponent: SearchOperatorInput<TValue>
  type: TType
}

/**
 * @alpha
 */
export declare type SearchOperatorButtonValue<TValue> = ComponentType<
  OperatorButtonValueComponentProps<TValue>
>

/** @internal */
declare interface SearchOperatorDefinition<TValue = any> extends SearchOperatorBase {
  buttonValueComponent?: SearchOperatorButtonValue<TValue>
  groqFilter: (params: SearchOperatorParams<TValue>) => string | null
  initialValue?: TValue
  inputComponent?: SearchOperatorInput<TValue>
  type: string
}

/** @internal */
declare type SearchOperatorDefinitionDictionary = Record<
  SearchOperatorDefinition['type'],
  SearchOperatorDefinition
>

/**
 * @alpha
 */
export declare type SearchOperatorInput<TValue> = ComponentType<OperatorInputComponentProps<TValue>>

/**
 * @alpha
 */
export declare type SearchOperatorParams<TValue> = {
  fieldPath?: string
  value?: TValue
}

declare const searchOperators: {
  stringEqual: SearchOperatorBuilder<'stringEqual', string | number> & {
    nameKey: 'search.operator.string-equal.name'
    descriptionKey: 'search.operator.string-equal.description'
    groqFilter: ({fieldPath, value}: SearchOperatorParams<string | number>) => string | null
    initialValue: null
    inputComponent: SearchOperatorInput<string | number>
    type: 'stringEqual'
  }
  stringListEqual: SearchOperatorBuilder<'stringListEqual', string | number> & {
    nameKey: 'search.operator.string-list-equal.name'
    descriptionKey: 'search.operator.string-list-equal.description'
    groqFilter: ({fieldPath, value}: SearchOperatorParams<string | number>) => string | null
    initialValue: null
    inputComponent: SearchOperatorInput<string | number>
    type: 'stringListEqual'
  }
  stringListNotEqual: SearchOperatorBuilder<'stringListNotEqual', string | number> & {
    nameKey: 'search.operator.string-list-not-equal.name'
    descriptionKey: 'search.operator.string-list-not-equal.description'
    groqFilter: ({fieldPath, value}: SearchOperatorParams<string | number>) => string | null
    initialValue: null
    inputComponent: SearchOperatorInput<string | number>
    type: 'stringListNotEqual'
  }
  stringMatches: SearchOperatorBuilder<'stringMatches', string | number> & {
    nameKey: 'search.operator.string-contains.name'
    descriptionKey: 'search.operator.string-contains.description'
    groqFilter: ({fieldPath, value}: SearchOperatorParams<string | number>) => string | null
    initialValue: null
    inputComponent: SearchOperatorInput<string | number>
    type: 'stringMatches'
  }
  stringNotEqual: SearchOperatorBuilder<'stringNotEqual', string | number> & {
    nameKey: 'search.operator.string-not-equal.name'
    descriptionKey: 'search.operator.string-not-equal.description'
    groqFilter: ({fieldPath, value}: SearchOperatorParams<string | number>) => string | null
    initialValue: null
    inputComponent: SearchOperatorInput<string | number>
    type: 'stringNotEqual'
  }
  stringNotMatches: SearchOperatorBuilder<'stringNotMatches', string | number> & {
    nameKey: 'search.operator.string-not-contains.name'
    descriptionKey: 'search.operator.string-not-contains.description'
    groqFilter: ({fieldPath, value}: SearchOperatorParams<string | number>) => string | null
    initialValue: null
    inputComponent: SearchOperatorInput<string | number>
    type: 'stringNotMatches'
  }
  slugEqual: SearchOperatorBuilder<'slugEqual', string | number> & {
    nameKey: 'search.operator.slug-equal.name'
    descriptionKey: 'search.operator.slug-equal.description'
    groqFilter: ({fieldPath, value}: SearchOperatorParams<string | number>) => string | null
    initialValue: null
    inputComponent: SearchOperatorInput<string | number>
    type: 'slugEqual'
  }
  slugMatches: SearchOperatorBuilder<'slugMatches', string | number> & {
    nameKey: 'search.operator.slug-contains.name'
    /**
     * @internal
     */
    descriptionKey: 'search.operator.slug-contains.description'
    groqFilter: ({fieldPath, value}: SearchOperatorParams<string | number>) => string | null
    initialValue: null
    inputComponent: SearchOperatorInput<string | number>
    label: string
    type: 'slugMatches'
  }
  slugNotEqual: SearchOperatorBuilder<'slugNotEqual', string | number> & {
    nameKey: 'search.operator.slug-not-equal.name'
    descriptionKey: 'search.operator.slug-not-equal.description'
    groqFilter: ({fieldPath, value}: SearchOperatorParams<string | number>) => string | null
    initialValue: null
    inputComponent: SearchOperatorInput<string | number>
    type: 'slugNotEqual'
  }
  slugNotMatches: SearchOperatorBuilder<'slugNotMatches', string | number> & {
    nameKey: 'search.operator.slug-not-contains.name'
    descriptionKey: 'search.operator.slug-not-contains.description'
    groqFilter: ({fieldPath, value}: SearchOperatorParams<string | number>) => string | null
    initialValue: null
    inputComponent: SearchOperatorInput<string | number>
    type: 'slugNotMatches'
  }
  referenceEqual: SearchOperatorBuilder<'referenceEqual', Reference> & {
    nameKey: 'search.operator.reference-equal.name'
    descriptionKey: 'search.operator.reference-equal.description'
    buttonValueComponent: SearchOperatorButtonValue<Reference>
    groqFilter: ({fieldPath, value}: SearchOperatorParams<Reference>) => string | null
    initialValue: null
    inputComponent: SearchOperatorInput<Reference>
    type: 'referenceEqual'
  }
  referenceNotEqual: SearchOperatorBuilder<'referenceNotEqual', Reference> & {
    nameKey: 'search.operator.reference-not-equal.name'
    descriptionKey: 'search.operator.reference-not-equal.description'
    buttonValueComponent: SearchOperatorButtonValue<Reference>
    groqFilter: ({fieldPath, value}: SearchOperatorParams<Reference>) => string | null
    initialValue: null
    inputComponent: SearchOperatorInput<Reference>
    type: 'referenceNotEqual'
  }
  referencesAssetFile: SearchOperatorBuilder<'referencesAssetFile', Reference> & {
    nameKey: 'search.operator.reference-asset-file.name'
    descriptionKey: 'search.operator.reference-asset-file.description'
    buttonValueComponent: SearchOperatorButtonValue<Reference>
    groqFilter: ({value}: SearchOperatorParams<Reference>) => string | null
    initialValue: null
    inputComponent: ({onChange, value}: OperatorInputComponentProps<Reference>) => JSX_2.Element
    type: 'referencesAssetFile'
  }
  referencesAssetImage: SearchOperatorBuilder<'referencesAssetImage', Reference> & {
    nameKey: 'search.operator.reference-asset-image.name'
    descriptionKey: 'search.operator.reference-asset-image.description'
    buttonValueComponent: SearchOperatorButtonValue<Reference>
    groqFilter: ({value}: SearchOperatorParams<Reference>) => string | null
    initialValue: null
    inputComponent: ({onChange, value}: OperatorInputComponentProps<Reference>) => JSX_2.Element
    type: 'referencesAssetImage'
  }
  referencesDocument: SearchOperatorBuilder<'referencesDocument', Reference> & {
    nameKey: 'search.operator.reference-document.name'
    descriptionKey: 'search.operator.reference-document.description'
    buttonValueComponent: SearchOperatorButtonValue<Reference>
    groqFilter: ({value}: SearchOperatorParams<Reference>) => string | null
    initialValue: null
    inputComponent: SearchOperatorInput<Reference>
    type: 'referencesDocument'
  }
  portableTextEqual: SearchOperatorBuilder<'portableTextEqual', string | number> & {
    nameKey: 'search.operator.portable-text-equal.name'
    descriptionKey: 'search.operator.portable-text-equal.description'
    groqFilter: ({fieldPath, value}: SearchOperatorParams<string | number>) => string | null
    initialValue: null
    inputComponent: SearchOperatorInput<string | number>
    type: 'portableTextEqual'
  }
  portableTextMatches: SearchOperatorBuilder<'portableTextMatches', string | number> & {
    nameKey: 'search.operator.portable-text-contains.name'
    descriptionKey: 'search.operator.portable-text-contains.description'
    groqFilter: ({fieldPath, value}: SearchOperatorParams<string | number>) => string | null
    initialValue: null
    inputComponent: SearchOperatorInput<string | number>
    type: 'portableTextMatches'
  }
  portableTextNotEqual: SearchOperatorBuilder<'portableTextNotEqual', string | number> & {
    nameKey: 'search.operator.portable-text-not-equal.name'
    descriptionKey: 'search.operator.portable-text-not-equal.description'
    groqFilter: ({fieldPath, value}: SearchOperatorParams<string | number>) => string | null
    initialValue: null
    inputComponent: SearchOperatorInput<string | number>
    type: 'portableTextNotEqual'
  }
  portableTextNotMatches: SearchOperatorBuilder<'portableTextNotMatches', string | number> & {
    nameKey: 'search.operator.portable-text-not-contains.name'
    descriptionKey: 'search.operator.portable-text-not-contains.description'
    groqFilter: ({fieldPath, value}: SearchOperatorParams<string | number>) => string | null
    initialValue: null
    inputComponent: SearchOperatorInput<string | number>
    type: 'portableTextNotMatches'
  }
  numberEqual: SearchOperatorBuilder<'numberEqual', number> & {
    nameKey: 'search.operator.number-equal.name'
    descriptionKey: 'search.operator.number-equal.description'
    groqFilter: ({fieldPath, value}: SearchOperatorParams<number>) => string | null
    initialValue: null
    inputComponent: SearchOperatorInput<number>
    type: 'numberEqual'
  }
  numberGt: SearchOperatorBuilder<'numberGt', number> & {
    nameKey: 'search.operator.number-gt.name'
    descriptionKey: 'search.operator.number-gt.description'
    groqFilter: ({fieldPath, value}: SearchOperatorParams<number>) => string | null
    icon: () => JSX_2.Element
    initialValue: null
    inputComponent: SearchOperatorInput<number>
    type: 'numberGt'
  }
  numberGte: SearchOperatorBuilder<'numberGte', number> & {
    nameKey: 'search.operator.number-gte.name'
    descriptionKey: 'search.operator.number-gte.description'
    groqFilter: ({fieldPath, value}: SearchOperatorParams<number>) => string | null
    icon: () => JSX_2.Element
    initialValue: null
    inputComponent: SearchOperatorInput<number>
    type: 'numberGte'
  }
  numberLt: SearchOperatorBuilder<'numberLt', number> & {
    nameKey: 'search.operator.number-lt.name'
    descriptionKey: 'search.operator.number-lt.description'
    groqFilter: ({fieldPath, value}: SearchOperatorParams<number>) => string | null
    icon: () => JSX_2.Element
    initialValue: null
    inputComponent: SearchOperatorInput<number>
    type: 'numberLt'
  }
  numberLte: SearchOperatorBuilder<'numberLte', number> & {
    nameKey: 'search.operator.number-lte.name'
    descriptionKey: 'search.operator.number-lte.description'
    groqFilter: ({fieldPath, value}: SearchOperatorParams<number>) => string | null
    icon: () => JSX_2.Element
    initialValue: null
    inputComponent: SearchOperatorInput<number>
    type: 'numberLte'
  }
  numberNotEqual: SearchOperatorBuilder<'numberNotEqual', number> & {
    nameKey: 'search.operator.number-not-equal.name'
    descriptionKey: 'search.operator.number-not-equal.description'
    groqFilter: ({fieldPath, value}: SearchOperatorParams<number>) => string | null
    initialValue: null
    inputComponent: SearchOperatorInput<number>
    type: 'numberNotEqual'
  }
  numberRange: SearchOperatorBuilder<'numberRange', OperatorNumberRangeValue> & {
    nameKey: 'search.operator.number-range.name'
    descriptionKey: 'search.operator.number-range.description'
    groqFilter: ({fieldPath, value}: SearchOperatorParams<OperatorNumberRangeValue>) => string
    initialValue: null
    inputComponent: SearchOperatorInput<OperatorNumberRangeValue>
    type: 'numberRange'
  }
  defined: ValuelessSearchOperatorBuilder<'defined'> & {
    nameKey: 'search.operator.defined.name'
    descriptionKey: 'search.operator.defined.description'
    groqFilter: ({fieldPath}: ValuelessSearchOperatorParams) => string | null
    type: 'defined'
  }
  notDefined: ValuelessSearchOperatorBuilder<'notDefined'> & {
    nameKey: 'search.operator.not-defined.name'
    descriptionKey: 'search.operator.not-defined.description'
    i18nKey: string
    groqFilter: ({fieldPath}: ValuelessSearchOperatorParams) => string | null
    type: 'notDefined'
  }
  dateAfter: SearchOperatorBuilder<'dateAfter', OperatorDateDirectionValue> & {
    nameKey: 'search.operator.date-after.name'
    descriptionKey: 'search.operator.date-after.description'
    groqFilter: ({
      fieldPath,
      value,
    }: SearchOperatorParams<OperatorDateDirectionValue>) => string | null
    inputComponent: SearchOperatorInput<OperatorDateDirectionValue>
    type: 'dateAfter'
    buttonValueComponent: SearchOperatorButtonValue<OperatorDateDirectionValue>
    initialValue: null
  }
  dateBefore: SearchOperatorBuilder<'dateBefore', OperatorDateDirectionValue> & {
    nameKey: 'search.operator.date-before.name'
    descriptionKey: 'search.operator.date-before.description'
    groqFilter: ({
      fieldPath,
      value,
    }: SearchOperatorParams<OperatorDateDirectionValue>) => string | null
    inputComponent: SearchOperatorInput<OperatorDateDirectionValue>
    type: 'dateBefore'
    buttonValueComponent: SearchOperatorButtonValue<OperatorDateDirectionValue>
    initialValue: null
  }
  dateEqual: SearchOperatorBuilder<'dateEqual', OperatorDateEqualValue> & {
    nameKey: 'search.operator.date-equal.name'
    descriptionKey: 'search.operator.date-equal.description'
    groqFilter: ({fieldPath, value}: SearchOperatorParams<OperatorDateEqualValue>) => string | null
    inputComponent: SearchOperatorInput<OperatorDateEqualValue>
    type: 'dateEqual'
    buttonValueComponent: SearchOperatorButtonValue<OperatorDateEqualValue>
    initialValue: {
      date: null
      includeTime: boolean
    }
  }
  dateLast: SearchOperatorBuilder<'dateLast', OperatorDateLastValue> & {
    nameKey: 'search.operator.date-last.name'
    descriptionKey: 'search.operator.date-last.description'
    groqFilter: ({fieldPath, value}: SearchOperatorParams<OperatorDateLastValue>) => string | null
    inputComponent: SearchOperatorInput<OperatorDateLastValue>
    initialValue: {
      unit: string
      unitValue: number
    }
    type: 'dateLast'
    buttonValueComponent: SearchOperatorButtonValue<OperatorDateLastValue>
  }
  dateNotEqual: SearchOperatorBuilder<'dateNotEqual', OperatorDateEqualValue> & {
    nameKey: 'search.operator.date-not-equal.name'
    descriptionKey: 'search.operator.date-not-equal.description'
    groqFilter: ({fieldPath, value}: SearchOperatorParams<OperatorDateEqualValue>) => string | null
    inputComponent: SearchOperatorInput<OperatorDateEqualValue>
    type: 'dateNotEqual'
    buttonValueComponent: SearchOperatorButtonValue<OperatorDateEqualValue>
    initialValue: {
      date: null
      includeTime: boolean
    }
  }
  dateRange: SearchOperatorBuilder<'dateRange', OperatorDateRangeValue> & {
    nameKey: 'search.operator.date-range.name'
    descriptionKey: 'search.operator.date-range.description'
    buttonValueComponent: SearchOperatorButtonValue<OperatorDateRangeValue>
    groqFilter: ({fieldPath, value}: SearchOperatorParams<OperatorDateRangeValue>) => string | null
    initialValue: {
      includeTime: boolean
      to: string
      from: null
    }
    inputComponent: SearchOperatorInput<OperatorDateRangeValue>
    type: 'dateRange'
  }
  dateTimeAfter: SearchOperatorBuilder<'dateTimeAfter', OperatorDateDirectionValue> & {
    nameKey: 'search.operator.date-time-after.name'
    descriptionKey: 'search.operator.date-time-after.description'
    groqFilter: ({
      fieldPath,
      value,
    }: SearchOperatorParams<OperatorDateDirectionValue>) => string | null
    inputComponent: SearchOperatorInput<OperatorDateDirectionValue>
    type: 'dateTimeAfter'
    buttonValueComponent: SearchOperatorButtonValue<OperatorDateDirectionValue>
    initialValue: null
  }
  dateTimeBefore: SearchOperatorBuilder<'dateTimeBefore', OperatorDateDirectionValue> & {
    nameKey: 'search.operator.date-time-before.name'
    descriptionKey: 'search.operator.date-time-before.description'
    groqFilter: ({
      fieldPath,
      value,
    }: SearchOperatorParams<OperatorDateDirectionValue>) => string | null
    inputComponent: SearchOperatorInput<OperatorDateDirectionValue>
    type: 'dateTimeBefore'
    buttonValueComponent: SearchOperatorButtonValue<OperatorDateDirectionValue>
    initialValue: null
  }
  dateTimeEqual: SearchOperatorBuilder<'dateTimeEqual', OperatorDateEqualValue> & {
    nameKey: 'search.operator.date-time-equal.name'
    descriptionKey: 'search.operator.date-time-equal.description'
    groqFilter: ({fieldPath, value}: SearchOperatorParams<OperatorDateEqualValue>) => string | null
    inputComponent: SearchOperatorInput<OperatorDateEqualValue>
    type: 'dateTimeEqual'
    buttonValueComponent: SearchOperatorButtonValue<OperatorDateEqualValue>
    initialValue: {
      date: null
      includeTime: boolean
    }
  }
  dateTimeLast: SearchOperatorBuilder<'dateTimeLast', OperatorDateLastValue> & {
    nameKey: 'search.operator.date-time-last.name'
    descriptionKey: 'search.operator.date-time-last.description'
    groqFilter: ({fieldPath, value}: SearchOperatorParams<OperatorDateLastValue>) => string | null
    initialValue: {
      unit: string
      unitValue: number
    }
    inputComponent: SearchOperatorInput<OperatorDateLastValue>
    type: 'dateTimeLast'
    buttonValueComponent: SearchOperatorButtonValue<OperatorDateLastValue>
  }
  dateTimeNotEqual: SearchOperatorBuilder<'dateTimeNotEqual', OperatorDateEqualValue> & {
    nameKey: 'search.operator.date-time-not-equal.name'
    descriptionKey: 'search.operator.date-time-not-equal.description'
    groqFilter: ({fieldPath, value}: SearchOperatorParams<OperatorDateEqualValue>) => string | null
    inputComponent: SearchOperatorInput<OperatorDateEqualValue>
    type: 'dateTimeNotEqual'
    buttonValueComponent: SearchOperatorButtonValue<OperatorDateEqualValue>
    initialValue: {
      date: null
      includeTime: boolean
    }
  }
  dateTimeRange: SearchOperatorBuilder<'dateTimeRange', OperatorDateRangeValue> & {
    nameKey: 'search.operator.date-time-range.name'
    descriptionKey: 'search.operator.date-time-range.description'
    buttonValueComponent: SearchOperatorButtonValue<OperatorDateRangeValue>
    groqFilter: ({fieldPath, value}: SearchOperatorParams<OperatorDateRangeValue>) => string | null
    initialValue: {
      includeTime: boolean
      to: string
      from: null
    }
    inputComponent: SearchOperatorInput<OperatorDateRangeValue>
    type: 'dateTimeRange'
  }
  booleanEqual: SearchOperatorBuilder<'booleanEqual', boolean> & {
    nameKey: 'search.operator.boolean-equal.name'
    descriptionKey: 'search.operator.boolean-equal.description'
    groqFilter: ({fieldPath, value}: SearchOperatorParams<boolean>) => string | null
    initialValue: boolean
    inputComponent: SearchOperatorInput<boolean>
    type: 'booleanEqual' /**
     * @internal
     */
  }
  assetFileEqual: SearchOperatorBuilder<'assetFileEqual', Reference> & {
    nameKey: 'search.operator.asset-file-equal.name'
    descriptionKey: 'search.operator.asset-file-equal.description'
    buttonValueComponent: SearchOperatorButtonValue<Reference>
    groqFilter: ({fieldPath, value}: SearchOperatorParams<Reference>) => string | null
    initialValue: null
    inputComponent: ({onChange, value}: OperatorInputComponentProps<Reference>) => JSX_2.Element
    label: string
    type: 'assetFileEqual'
  }
  assetFileNotEqual: SearchOperatorBuilder<'assetFileNotEqual', Reference> & {
    nameKey: 'search.operator.asset-file-not-equal.name'
    descriptionKey: 'search.operator.asset-file-not-equal.description'
    buttonValueComponent: SearchOperatorButtonValue<Reference>
    groqFilter: ({fieldPath, value}: SearchOperatorParams<Reference>) => string | null
    initialValue: null
    inputComponent: ({onChange, value}: OperatorInputComponentProps<Reference>) => JSX_2.Element
    label: string
    type: 'assetFileNotEqual'
  }
  assetImageEqual: SearchOperatorBuilder<'assetImageEqual', Reference> & {
    nameKey: 'search.operator.asset-image-equal.name'
    descriptionKey: 'search.operator.asset-image-equal.description'
    buttonValueComponent: SearchOperatorButtonValue<Reference>
    groqFilter: ({fieldPath, value}: SearchOperatorParams<Reference>) => string | null
    initialValue: null
    inputComponent: ({onChange, value}: OperatorInputComponentProps<Reference>) => JSX_2.Element
    label: string
    type: 'assetImageEqual'
  }
  assetImageNotEqual: SearchOperatorBuilder<'assetImageNotEqual', Reference> & {
    nameKey: 'search.operator.asset-image-not-equal.name'
    descriptionKey: 'search.operator.asset-image-not-equal.description'
    buttonValueComponent: SearchOperatorButtonValue<Reference>
    groqFilter: ({fieldPath, value}: SearchOperatorParams<Reference>) => string | null
    initialValue: null
    inputComponent: ({onChange, value}: OperatorInputComponentProps<Reference>) => JSX_2.Element
    label: string
    type: 'assetImageNotEqual'
  }
  arrayCountEqual: SearchOperatorBuilder<'arrayCountEqual', number> & {
    nameKey: 'search.operator.array-count-equal.name'
    descriptionKey: 'search.operator.array-count-equal.description'
    groqFilter: ({fieldPath, value}: SearchOperatorParams<number>) => string | null
    initialValue: null
    inputComponent: SearchOperatorInput<number>
    type: 'arrayCountEqual'
  }
  arrayCountGt: SearchOperatorBuilder<'arrayCountGt', number> & {
    nameKey: 'search.operator.array-count-gt.name'
    descriptionKey: 'search.operator.array-count-gt.description'
    groqFilter: ({fieldPath, value}: SearchOperatorParams<number>) => string | null
    icon: () => JSX_2.Element
    initialValue: null
    inputComponent: SearchOperatorInput<number>
    type: 'arrayCountGt'
  }
  arrayCountGte: SearchOperatorBuilder<'arrayCountGte', number> & {
    nameKey: 'search.operator.array-count-gte.name'
    descriptionKey: 'search.operator.array-count-gte.description'
    groqFilter: ({fieldPath, value}: SearchOperatorParams<number>) => string | null
    icon: () => JSX_2.Element
    initialValue: null
    inputComponent: SearchOperatorInput<number>
    type: 'arrayCountGte'
  }
  arrayCountLt: SearchOperatorBuilder<'arrayCountLt', number> & {
    nameKey: 'search.operator.array-count-lt.name'
    descriptionKey: 'search.operator.array-count-lt.description'
    groqFilter: ({fieldPath, value}: SearchOperatorParams<number>) => string | null
    icon: () => JSX_2.Element
    initialValue: null
    inputComponent: SearchOperatorInput<number>
    type: 'arrayCountLt'
  }
  arrayCountLte: SearchOperatorBuilder<'arrayCountLte', number> & {
    nameKey: 'search.operator.array-count-lte.name'
    descriptionKey: 'search.operator.array-count-lte.description'
    groqFilter: ({fieldPath, value}: SearchOperatorParams<number>) => string | null
    icon: () => JSX_2.Element
    initialValue: null
    inputComponent: SearchOperatorInput<number>
    type: 'arrayCountLte'
  }
  arrayCountNotEqual: SearchOperatorBuilder<'arrayCountNotEqual', number> & {
    nameKey: 'search.operator.array-count-not-equal.name'
    descriptionKey: 'search.operator.array-count-not-equal.description'
    groqFilter: ({fieldPath, value}: SearchOperatorParams<number>) => string | null
    initialValue: null
    inputComponent: SearchOperatorInput<number>
    type: 'arrayCountNotEqual'
  }
  arrayCountRange: SearchOperatorBuilder<'arrayCountRange', OperatorNumberRangeValue> & {
    nameKey: 'search.operator.array-count-range.name'
    descriptionKey: 'search.operator.array-count-range.description'
    groqFilter: ({fieldPath, value}: SearchOperatorParams<OperatorNumberRangeValue>) => string
    initialValue: null
    inputComponent: SearchOperatorInput<OperatorNumberRangeValue>
    type: 'arrayCountRange'
  }
  arrayListIncludes: SearchOperatorBuilder<'arrayListIncludes', string | number> & {
    nameKey: 'search.operator.array-list-includes.name'
    descriptionKey: 'search.operator.array-list-includes.description'
    groqFilter: ({fieldPath, value}: SearchOperatorParams<string | number>) => string | null
    initialValue: null
    inputComponent: SearchOperatorInput<string | number>
    type: 'arrayListIncludes'
  }
  arrayListNotIncludes: SearchOperatorBuilder<'arrayListNotIncludes', string | number> & {
    nameKey: 'search.operator.array-list-not-includes.name'
    descriptionKey: 'search.operator.array-list-not-includes.description'
    groqFilter: ({fieldPath, value}: SearchOperatorParams<string | number>) => string | null
    initialValue: null
    inputComponent: SearchOperatorInput<string | number>
    type: 'arrayListNotIncludes'
  }
  arrayReferenceIncludes: SearchOperatorBuilder<'arrayReferenceIncludes', Reference> & {
    nameKey: 'search.operator.array-reference-includes.name'
    descriptionKey: 'search.operator.array-reference-includes.description'
    buttonValueComponent: SearchOperatorButtonValue<Reference>
    groqFilter: ({fieldPath, value}: SearchOperatorParams<Reference>) => string | null
    initialValue: null
    inputComponent: SearchOperatorInput<Reference>
    type: 'arrayReferenceIncludes'
  }
  arrayReferenceNotIncludes: SearchOperatorBuilder<'arrayReferenceNotIncludes', Reference> & {
    nameKey: 'search.operator.array-reference-not-includes.name'
    descriptionKey: 'search.operator.array-reference-not-includes.description'
    buttonValueComponent: SearchOperatorButtonValue<Reference>
    groqFilter: ({fieldPath, value}: SearchOperatorParams<Reference>) => string | null
    initialValue: null
    inputComponent: SearchOperatorInput<Reference>
    type: 'arrayReferenceNotIncludes'
  }
}

/**
 * @alpha
 */
export declare type SearchOperatorType = keyof DefaultOperators

/**
 * @internal
 */
export declare type SearchOptions = {
  __unstable_extendedProjection?: string
  maxDepth?: number
  comments?: string[]
  includeDrafts?: boolean
  skipSortByScore?: boolean
  sort?: SearchSort[]
  cursor?: string
  limit?: number
  isCrossDataset?: boolean
}

/**
 * @internal
 */
declare interface SearchOrdering {
  customMeasurementLabel?: string
  ignoreScore?: boolean
  sort: SearchSort
  /**
   * i18n key for title
   */
  titleKey: `search.ordering.${string}-label`
}

/**
 * @public
 */
declare type SearchParam = [key: string, value: string]

declare type SearchPathSegment = string | number | []

/**
 * @internal
 */
export declare function SearchPopover({
  disableFocusLock,
  disableIntentLink,
  onClose,
  onItemSelect,
  onOpen,
  open,
}: SearchPopoverProps): JSX_2.Element

/**
 * @internal
 */
export declare interface SearchPopoverProps {
  disableFocusLock?: boolean
  disableIntentLink?: boolean
  onClose: () => void
  onItemSelect?: ItemSelectHandler
  onOpen: () => void
  open: boolean
}

/**
 * @internal
 */
export declare function SearchProvider({children, fullscreen}: SearchProviderProps): JSX_2.Element

declare interface SearchProviderProps {
  children?: ReactNode
  fullscreen?: boolean
}

declare type SearchReducerState = PaginationState & {
  currentUser: CurrentUser | null
  debug: boolean
  definitions: SearchDefinitions
  documentTypesNarrowed: string[]
  filters: SearchFilter[]
  filtersVisible: boolean
  fullscreen?: boolean
  lastAddedFilter?: SearchFilter | null
  lastActiveIndex: number
  ordering: SearchOrdering
  result: SearchResult
  terms: RecentSearch | SearchTerms
}

declare type SearchRequestComplete = {
  type: 'SEARCH_REQUEST_COMPLETE'
  hits: SearchHit[]
  nextCursor: string | undefined
}

declare type SearchRequestError = {
  type: 'SEARCH_REQUEST_ERROR'
  error: Error
}

declare type SearchRequestStart = {
  type: 'SEARCH_REQUEST_START'
}

declare interface SearchResult {
  error: Error | null
  hasLocal: boolean
  hits: SearchHit[]
  loaded: boolean
  loading: boolean
}

/**
 * @internal
 */
export declare function SearchResultItemPreview({
  documentId,
  layout,
  presence,
  schemaType,
  showBadge,
}: SearchResultItemPreviewProps): JSX_2.Element

declare interface SearchResultItemPreviewProps {
  documentId: string
  layout?: GeneralPreviewLayoutKey
  presence?: DocumentPresence[]
  schemaType: SchemaType
  showBadge?: boolean
}

/**
 * @internal
 */
export declare type SearchSort = {
  direction: SortDirection
  field: string
  mapWith?: string
}

/**
 * @internal
 */
export declare interface SearchTerms<Type extends SchemaType | CrossDatasetType = SchemaType> {
  filter?: string
  params?: Record<string, unknown>
  query: string
  types: Type[]
}

/**
 * @alpha
 */
export declare type SearchValueFormatterContext = {
  i18n: LocaleSource
}

/**
 *
 * @hidden
 * @beta
 */
export declare function SelectInput(props: StringInputProps): JSX_2.Element

/** @internal */
declare type Selection_2 = [Id, FieldName[]]
export {Selection_2 as Selection}

/**
 * @hidden
 * @beta */
export declare type SelectionState = 'inactive' | 'rev' | 'range' | 'loading' | 'invalid'

/** @internal */
export declare type Serializeable<T> = {
  serialize(): T
}

/** @internal */
export declare interface Session {
  sessionId: string
  userId: string
  lastActiveAt: string
  locations: PresenceLocation[]
}

/** @internal */
export declare const SESSION_ID: string

/**
 * @hidden
 * @beta */
export declare function set(value: any, path?: Path): FormSetPatch

/** @internal */
export declare interface SetActiveGroupOperation {
  type: 'setSelectedGroup'
  path: Path
  groupName: string
}

/** @internal */
export declare function setAtPath<T>(
  currentTree: StateTree<T> | undefined,
  path: Path,
  value: T,
): StateTree<T>

/**
 * @hidden
 * @beta */
export declare function setIfMissing(value: any, path?: Path): FormSetIfMissingPatch

/** @internal */
export declare interface SharedResizeObserver {
  observe: (
    element: Element,
    observer: Subscriber<ResizeObserverEntry_2>,
    options?: ResizeObserverOptions,
  ) => () => void
  unobserve: (element: Element) => void
}

/**
 * If a single workspace is used, not specifying a name or basePath is acceptable
 *
 *
 * @hidden
 * @beta
 */
export declare type SingleWorkspace = Omit<WorkspaceOptions, 'name' | 'basePath'> & {
  name?: string
  basePath?: string
}

/** @internal */
export declare type Size = 'xsmall' | 'small' | 'medium'

/**
 * Truncates a string to a given length, taking into account surrogate pairs and grapheme clusters
 * (using zero-width joiners). This means the resulting string may be longer in number of bytes,
 * but will be shorter in number of "characters". Should only be used for display purposes -
 * not for truncating strings for storage or similar.
 *
 * Examples of differences between `String.prototype.slice` and this function:
 *
 * - '👨‍👨‍👧‍👧'.slice(0, 1) === '�'  vs sliceString('👨‍👨‍👧‍👧', 0, 1) === '👨‍👨‍👧‍👧'
 * - '👨‍👨‍👧‍👧'.slice(0, 2) === '👨' vs sliceString('👨‍👨‍👧‍👧', 0, 2) === '👨‍👨‍👧‍👧'
 *
 * @param str - String to slice
 * @param start - Start index
 * @param end - End index (exclusive)
 * @returns The sliced string
 * @internal
 */
export declare function sliceString(str: string, start: number, end: number): string

/**
 *
 * @hidden
 * @beta
 */
export declare interface SlugComponents {
  diff?: ComponentType<any>
  field?: ComponentType<ObjectFieldProps<SlugValue>>
  input?: ComponentType<ObjectInputProps<SlugValue>>
  item?: ComponentType<ObjectItemProps<SlugValue & ObjectItem>>
  preview?: ComponentType<PreviewProps>
}

/**
 *
 * @hidden
 * @beta
 */
export declare function SlugInput(props: SlugInputProps): JSX_2.Element

/**
 *
 * @hidden
 * @beta
 */
export declare type SlugInputProps = ObjectInputProps<SlugValue, SlugSchemaType>

/**
 * @hidden
 * @beta */
export declare interface SnapshotEvent {
  type: 'snapshot'
  document: SanityDocument
}

/** @internal */
declare interface SnapshotPair {
  transactionsPendingEvents$: Observable<PendingMutationsEvent>
  draft: DocumentVersionSnapshots
  published: DocumentVersionSnapshots
}

/** @internal */
export declare const snapshotPair: (
  arg1: SanityClient,
  arg2: IdPair,
  arg3: string,
) => Observable<SnapshotPair>

/**
 * @internal
 */
declare type SortDirection = 'asc' | 'desc'

/**
 * Represents a source.
 * @public
 */
export declare interface Source {
  /** The type of the source. */
  type: 'source'
  /** The name of the source. */
  name: string
  /** The title of the source. */
  title: string
  /** The ID of the project. */
  projectId: string
  /** The name of the dataset. */
  dataset: string
  /** The schema of the source. */
  schema: Schema
  /** The templates of the source. */
  templates: Template[]
  /** The tools of the source. */
  tools: Tool[]
  /** The current user of the source. */
  currentUser: CurrentUser | null
  /** Whether the user is authenticated. */
  authenticated: boolean
  /** @internal */
  auth: AuthStore
  /**
   * Returns a client instance.
   * @param clientOptions - Options to pass to the client. See {@link SourceClientOptions}
   */
  getClient: (clientOptions: SourceClientOptions) => SanityClient
  /**
   * Document-related functionality.
   * @hidden
   * @beta
   */
  document: {
    /**
     * Returns an array of actions for the document.
     * @hidden
     * @beta
     */
    actions: (props: PartialContext<DocumentActionsContext>) => DocumentActionComponent[]
    /**
     * Returns an array of badges for the document.
     * @hidden
     * @beta
     */
    badges: (props: PartialContext<DocumentActionsContext>) => DocumentBadgeComponent[]
    /**
     * Components for the document.
     * @internal
     */
    components?: DocumentComponents_2
    /** @internal */
    unstable_fieldActions: (
      props: PartialContext<DocumentFieldActionsResolverContext>,
    ) => DocumentFieldAction[]
    /**
     * Resolves the production URL for the document.
     * @hidden
     * @beta
     */
    resolveProductionUrl: (
      context: PartialContext<ResolveProductionUrlContext>,
    ) => Promise<string | undefined>
    /**
     * Resolves the new document options.
     * @hidden
     * @beta
     */
    resolveNewDocumentOptions: (context: NewDocumentCreationContext) => InitialValueTemplateItem[]
    /** @alpha */
    unstable_languageFilter: (
      props: PartialContext<DocumentLanguageFilterContext>,
    ) => DocumentLanguageFilterComponent[]
    /**
     * @hidden
     * @beta
     */
    inspectors: (props: PartialContext<DocumentInspectorContext>) => DocumentInspector[]
    /** @internal */
    unstable_comments: {
      enabled: (props: DocumentCommentsEnabledContext) => boolean
    }
  }
  /** @internal */
  __internal_tasks?: {
    footerAction: ReactNode
  }
  /**
   * Form-related functionality.
   * @hidden
   * @beta
   */
  form: {
    /**
     * File-related functionality.
     * @hidden
     * @beta
     */
    file: {
      /** The asset sources. */
      assetSources: AssetSource[]
      /** Whether direct uploads are enabled. */
      directUploads: boolean
    }
    /**
     * Image-related functionality.
     * @hidden
     * @beta
     */
    image: {
      /** The asset sources. */
      assetSources: AssetSource[]
      /** Whether direct uploads are enabled. */
      directUploads: boolean
    }
    /**
     * Components for the form.
     * @hidden
     * @beta
     */
    components?: FormComponents
    /**
     * these have not been migrated over and are not merged by the form builder
     *
     * @hidden
     * @beta
     */
    unstable?: {
      CustomMarkers?: FormBuilderCustomMarkersComponent
      Markers?: FormBuilderMarkersComponent
    }
  }
  /**
   * @hidden
   * @beta
   */
  studio?: {
    /**
     * Components for the studio.
     * @hidden
     * @beta
     */
    components?: StudioComponents
  }
  /** @alpha */
  search: {
    filters: SearchFilterDefinition[]
    operators: SearchOperatorDefinition[]
    unstable_partialIndexing?: {
      enabled: boolean
    }
    unstable_enableNewSearch?: boolean
  }
  /** @internal */
  i18n: LocaleSource
  /** @internal */
  __internal: {
    /** @internal */
    bifur: BifurClient
    /** @internal */
    staticInitialValueTemplateItems: InitialValueTemplateItem[]
    /** @internal */
    options: SourceOptions
    /**
     * _VERY_ internal, likely to change at any point.
     * @internal
     */
    i18next: i18n
  }
  /** @beta */
  tasks?: WorkspaceOptions['unstable_tasks']
}

/** @public */
export declare interface SourceClientOptions {
  /**
   * API version to use. See {@link https://www.sanity.io/docs/api-versioning | api-versioning}
   */
  apiVersion: string
}

/**
 * @hidden
 * @beta
 */
export declare interface SourceOptions extends PluginOptions {
  title?: string
  /**
   * Project ID for this source
   */
  projectId: string
  /**
   * Dataset name for this source
   */
  dataset: string
  /**
   * API hostname used for requests. Generally used for custom CNAMEs, allowing businesses to use
   * their own domain for API requests. Must include protocol:
   * eg `https://sanityapi.mycompany.com`
   *
   * Note that (currently) the project ID will be prepended to the passed URL, so the above
   * example would end up as: `https://<projectId>.sanityapi.mycompany.com`
   */
  apiHost?: string
  /**
   * Authentication options for this source.
   */
  auth?: AuthConfig | AuthStore
  /**
   * @hidden
   * @beta
   */
  unstable_clientFactory?: (options: ClientConfig) => SanityClient
}

/** @internal */
export declare function SourceProvider({children, ...props}: SourceProviderProps): JSX_2.Element

/** @internal */
export declare type SourceProviderProps =
  | {
      source: Source
      children?: ReactNode
    }
  | {
      name: string
      children?: ReactNode
    }

/**
 *
 * @hidden
 * @beta
 */
export declare interface SpanComponents {
  diff?: ComponentType<any>
  field?: ComponentType<ObjectFieldProps>
  input?: ComponentType<ObjectInputProps>
  item?: ComponentType<ObjectItemProps>
  preview?: ComponentType<PreviewProps>
}

declare interface State {
  disableTransition: boolean
}

declare interface State_2 {
  isLoading: boolean
  error?: Error
  value?: PreviewValue
}

/**
 * @hidden
 * @beta */
export declare interface StateTree<T> {
  value: T | undefined
  children?: {
    [key: string]: StateTree<T>
  }
}

/**
 * A locale resource bundle where the resources are static, eg not lazy loaded.
 *
 * @public
 */
export declare type StaticLocaleResourceBundle = Omit<ImplicitLocaleResourceBundle, 'resources'> & {
  /**
   * The locale ID the resources belong to, eg `en-US`, `nb-NO`, `th-TH`…
   */
  locale?: string
  /**
   * An object of locale resources.
   */
  resources: LocaleResourceRecord
}

/** @internal */
export declare type Status = 'online' | 'editing' | 'inactive'

/** @hidden @beta */
export declare const StatusButton: ForwardRefExoticComponent<
  (StatusButtonProps & Omit<HTMLProps<HTMLButtonElement>, 'title' | 'ref' | 'disabled' | 'size'>) &
    RefAttributes<HTMLButtonElement>
>

/** @hidden @beta */
export declare type StatusButtonProps = ButtonProps & {
  forwardedAs?: string
  disabled?:
    | boolean
    | {
        reason: ReactNode
      }
  mode?: ButtonProps['mode']
  iconRight?: undefined
}

/**
 *
 * @hidden
 * @beta
 */
export declare interface StringComponents {
  diff?: ComponentType<any>
  field?: ComponentType<StringFieldProps>
  input?: ComponentType<StringInputProps>
  item?: ComponentType<PrimitiveItemProps>
  preview?: ComponentType<PreviewProps>
}

/** @internal */
export declare type StringDiff = StringDiff_2<Annotation>

/** @internal */
export declare type StringDiffSegment = StringSegmentChanged | StringSegmentUnchanged

/**
 * @hidden
 * @public */
export declare interface StringFieldProps extends BaseFieldProps {
  schemaType: StringSchemaType
  value: string | undefined
  inputProps: StringInputProps
}

/** @public */
export declare type StringFormNode<S extends StringSchemaType = StringSchemaType> = BaseFormNode<
  string,
  S
>

/**
 *
 * @hidden
 * @beta
 */
export declare function StringInput(props: StringInputProps): JSX_2.Element

/**
 * @hidden
 * @public */
export declare interface StringInputProps<S extends StringSchemaType = StringSchemaType>
  extends BaseInputProps,
    StringFormNode<S> {
  /**
   * @hidden
   * @beta */
  onChange: (patch: FormPatch | FormPatch[] | PatchEvent) => void
  validationError?: string
  /**
   * @hidden
   * @beta */
  elementProps: PrimitiveInputElementProps
}

/** @internal */
export declare type StringSegmentChanged = StringSegmentChanged_2<Annotation>

/** @internal */
export declare type StringSegmentUnchanged = StringSegmentUnchanged_2

/** @internal */
export declare function stringToPath(path: string): Path

/**
 * @hidden
 * @beta */
export declare function Studio(props: StudioProps): ReactElement

/**
 * @hidden
 * @beta */
export declare interface StudioComponents {
  layout: ComponentType<Omit<LayoutProps, 'renderDefault'>>
  logo: ComponentType<Omit<LogoProps, 'renderDefault'>>
  navbar: ComponentType<Omit<NavbarProps, 'renderDefault'>>
  toolMenu: ComponentType<Omit<ToolMenuProps, 'renderDefault'>>
}

/**
 * @hidden
 * @beta */
export declare interface StudioComponentsPluginOptions {
  activeToolLayout?: ComponentType<ActiveToolLayoutProps>
  layout?: ComponentType<LayoutProps>
  /**
   * @deprecated Add custom icons on a per-workspace basis by customizing workspace `icon` instead.
   * @see {@link https://www.sanity.io/docs/workspaces}
   */
  logo?: ComponentType<LogoProps>
  navbar?: ComponentType<NavbarProps>
  toolMenu?: ComponentType<ToolMenuProps>
}

/**
 * The Studio Layout component is the root component of the Sanity Studio UI.
 * It renders the navbar, the active tool, and the search modal as well as the error boundary.
 *
 * @public
 * @returns A Studio Layout element that renders the navbar, the active tool, and the search modal as well as the error boundary
 * @remarks This component should be used as a child component to the StudioProvider
 * @example Rendering a Studio Layout
 * ```ts
 * <StudioProvider
 *  basePath={basePath}
 *  config={config}
 *  onSchemeChange={onSchemeChange}
 *  scheme={scheme}
 *  unstable_history={unstable_history}
 *  unstable_noAuthBoundary={unstable_noAuthBoundary}
 * >
 *   <StudioLayout />
 *</StudioProvider>
 * ```
 */
export declare function StudioLayout(): JSX_2.Element

/**
 * @internal
 * The default Studio Layout component
 * */
export declare function StudioLayoutComponent(): JSX_2.Element

/**
 * The i18n resource keys for the studio.
 *
 * @alpha
 * @hidden
 */
export declare type StudioLocaleResourceKeys = keyof typeof studioLocaleStrings

/**
 * The string resources for the studio core.
 *
 * @internal
 * @hidden
 */
declare const studioLocaleStrings: {
  /** Menu item for deleting the asset */
  'asset-source.asset-list.menu.delete': string
  /** Menu item for showing where a particular asset is used */
  'asset-source.asset-list.menu.show-usage': string
  /** Header in usage dialog for file assets */
  'asset-source.asset-usage-dialog.header_file': string
  /** Header in usage dialog for image assets */
  'asset-source.asset-usage-dialog.header_image': string
  /** Text shown in usage dialog when loading documents using the selected asset */
  'asset-source.asset-usage-dialog.loading': string
  /** Text for cancel action in delete-asset dialog */
  'asset-source.delete-dialog.action.cancel': string
  /** Text for "confirm delete" action in delete-asset dialog */
  'asset-source.delete-dialog.action.delete': string
  /** Dialog header for delete-asset dialog when deleting a file */
  'asset-source.delete-dialog.header_file': string
  /** Dialog header for delete-asset dialog when deleting an image */
  'asset-source.delete-dialog.header_image': string
  /** Text shown in delete dialog when loading documents using the selected asset */
  'asset-source.delete-dialog.loading': string
  /** Message confirming to delete *named* file */
  'asset-source.delete-dialog.usage-list.confirm-delete-file_named': string
  /** Message confirming to delete *unnamed* file */
  'asset-source.delete-dialog.usage-list.confirm-delete-file_unnamed': string
  /** Message confirming to delete *named* image */
  'asset-source.delete-dialog.usage-list.confirm-delete-image_named': string
  /** Message confirming to delete *unnamed* image */
  'asset-source.delete-dialog.usage-list.confirm-delete-image_unnamed': string
  /** Alt text showing on image preview in delete asset dialog  */
  'asset-source.delete-dialog.usage-list.image-preview-alt': string
  /** Warning message showing when *named* file can't be deleted because it is in use */
  'asset-source.delete-dialog.usage-list.warning-file-is-in-use_named': string
  /** Warning message showing when *unnamed* file can't be deleted because it is in use */
  'asset-source.delete-dialog.usage-list.warning-file-is-in-use_unnamed': string
  /** Warning message showing when *named* image can't be deleted because it is in use */
  'asset-source.delete-dialog.usage-list.warning-image-is-in-use_named': string
  /** Warning message showing when *unnamed* image can't be deleted because it is in use */
  'asset-source.delete-dialog.usage-list.warning-image-is-in-use_unnamed': string
  /** Text shown when the list of assets only include a specific set of types */
  'asset-source.dialog.accept-message': string
  /** Keys shared between both image asset source and file asset source */
  /** Select asset dialog title for files */
  'asset-source.dialog.default-title_file': string
  /** Select asset dialog title for images */
  'asset-source.dialog.default-title_image': string
  /** Select asset dialog load more items */
  'asset-source.dialog.load-more': string
  /** Text shown when selecting a file but there's no files to select from */
  'asset-source.dialog.no-assets_file': string
  /** Text shown when selecting an image but there's no images to select from */
  'asset-source.dialog.no-assets_image': string
  'asset-source.file.asset-list.action.delete.disabled-cannot-delete-current-file': string
  'asset-source.file.asset-list.action.delete.text': string
  'asset-source.file.asset-list.action.delete.title': string
  'asset-source.file.asset-list.action.select-file.title': string
  'asset-source.file.asset-list.action.show-usage.title': string
  'asset-source.file.asset-list.delete-failed': string
  'asset-source.file.asset-list.delete-successful': string
  'asset-source.file.asset-list.header.date-added': string
  /** File asset source */
  'asset-source.file.asset-list.header.filename': string
  'asset-source.file.asset-list.header.size': string
  'asset-source.file.asset-list.header.type': string
  /** Text displayed on button or menu invoking the file asset source */
  'asset-source.file.title': string
  'asset-source.image.asset-list.delete-failed': string
  /** Image asset source */
  'asset-source.image.asset-list.delete-successful': string
  /** Text displayed on button or menu invoking the image asset source */
  'asset-source.image.title': string
  'asset-source.usage-list.documents-using-file_named_one': string
  'asset-source.usage-list.documents-using-file_named_other': string
  /** Text shown in usage dialog for a file asset when there are zero, one or more documents using the *named* file **/
  'asset-source.usage-list.documents-using-file_named_zero': string
  'asset-source.usage-list.documents-using-file_unnamed_one': string
  'asset-source.usage-list.documents-using-file_unnamed_other': string
  /** Text shown in usage dialog for a file asset when there are zero, one or more documents using the *unnamed* file **/
  'asset-source.usage-list.documents-using-file_unnamed_zero': string
  'asset-source.usage-list.documents-using-image_named_one': string
  'asset-source.usage-list.documents-using-image_named_other': string
  /** Text shown in usage dialog for an image asset when there are zero, one or more documents using the *named* image **/
  'asset-source.usage-list.documents-using-image_named_zero': string
  'asset-source.usage-list.documents-using-image_unnamed_one': string
  'asset-source.usage-list.documents-using-image_unnamed_other': string
  /** Text shown in usage dialog for an image asset when there are zero, one or more documents using the *unnamed* image **/
  'asset-source.usage-list.documents-using-image_unnamed_zero': string
  /** Action message for navigating to next month */
  'calendar.action.go-to-next-month': string
  /** Action message for navigating to next year */
  'calendar.action.go-to-next-year': string
  /** Action message for navigating to previous month */
  'calendar.action.go-to-previous-month': string
  /** Action message for navigating to previous year */
  'calendar.action.go-to-previous-year': string
  'calendar.action.go-to-today': string
  'calendar.action.go-to-today-aria-label': string
  'calendar.action.go-to-tomorrow': string
  'calendar.action.go-to-yesterday': string
  /** Label for switch that controls whether or not to include time in given timestamp */
  'calendar.action.include-time-label': string
  /** Action message for selecting the hour */
  'calendar.action.select-hour': string
  /** Action message for selecting the minute */
  'calendar.action.select-minute': string
  /** Action message for setting to the current time */
  'calendar.action.set-to-current-time': string
  /** Label for selecting an hour preset. Receives a `time` param as a string on hh:mm format and a `date` param as a Date instance denoting the preset date */
  'calendar.action.set-to-time-preset': string
  /** Error message displayed in calendar when entered date is not the correct format */
  'calendar.error.must-be-in-format': string
  /** Month name for April */
  'calendar.month-names.april': string
  /** Month name for August */
  'calendar.month-names.august': string
  /** Month name for December */
  'calendar.month-names.december': string
  /** Month name for February */
  'calendar.month-names.february': string
  /** Month name for January */
  'calendar.month-names.january': string
  /** Month name for July */
  'calendar.month-names.july': string
  /** Month name for June */
  'calendar.month-names.june': string
  /** Month name for March */
  'calendar.month-names.march': string
  /** Month name for May */
  'calendar.month-names.may': string
  /** Month name for November */
  'calendar.month-names.november': string
  /** Month name for October */
  'calendar.month-names.october': string
  /** Month name for September */
  'calendar.month-names.september': string
  /** Short weekday name for Friday */
  'calendar.weekday-names.short.friday': string
  /** Short weekday name for Monday */
  'calendar.weekday-names.short.monday': string
  /** Short weekday name for Saturdayday */
  'calendar.weekday-names.short.saturday': string
  /** Short weekday name for Sunday */
  'calendar.weekday-names.short.sunday': string
  /** Short weekday name for Thursday */
  'calendar.weekday-names.short.thursday': string
  /** Short weekday name for Tuesday */
  'calendar.weekday-names.short.tuesday': string
  /** Short weekday name for Wednesday */
  'calendar.weekday-names.short.wednesday': string
  /** Label for the close button label in Review Changes pane */
  'changes.action.close-label': string
  /** Cancel label for revert button prompt action */
  'changes.action.revert-all-cancel': string
  /** Revert all confirm label for revert button action - used on prompt button + review changes pane */
  'changes.action.revert-all-confirm': string
  /** Prompt for reverting all changes in document in Review Changes pane. Includes a count of changes. */
  'changes.action.revert-all-description': string
  /** Prompt for confirming revert change (singular) label for field change action */
  'changes.action.revert-changes-confirm-change_one': string
  /** Revert for confirming revert (plural) label for field change action */
  'changes.action.revert-changes-confirm-change_other': string
  /** Prompt for reverting changes for a field change */
  'changes.action.revert-changes-description': string
  /** Prompt for reverting changes for a group change, eg multiple changes */
  'changes.action.revert-changes-description_one': string
  /** Label for when the action of the change was to set something that was previously empty, eg a field was given a value, an array item was added, an asset was selected or similar */
  'changes.added-label': string
  /** Array diff: An item was added in a given position (`{{position}}`) */
  'changes.array.item-added-in-position': string
  'changes.array.item-moved_down_one': string
  'changes.array.item-moved_down_other': string
  /**
   * Array diff: An item was moved within the array.
   * Receives `{{count}}` representing number of positions it moved.
   * Context is the direction of the move, either `up` or `down`.
   */
  'changes.array.item-moved_up_one': string
  'changes.array.item-moved_up_other': string
  /** Array diff: An item was removed from a given position (`{{position}}`) */
  'changes.array.item-removed-from-position': string
  /** Accessibility label for the "change bar" shown when there are edits on a field-level */
  'changes.change-bar.aria-label': string
  /** Label for when the action of the change was _not_ an add/remove, eg a text field changed value, an image was changed from one asset to another or similar */
  'changes.changed-label': string
  /** Label and text for tooltip that indicates the authors of the changes */
  'changes.changes-by-author': string
  /** Additional text shown in development mode when a diff component crashes during rendering */
  'changes.error-boundary.developer-info': string
  /** Text shown when a diff component crashes during rendering, triggering the error boundary */
  'changes.error-boundary.title': string
  /** Error message shown when the value of a field is not the expected one */
  'changes.error.incorrect-type-message': string
  /** File diff: Fallback title for the meta info section when there is no original filename to use  */
  'changes.file.meta-info-fallback-title': string
  /** Image diff: Text shown in tooltip when hovering hotspot that has changed in diff view */
  'changes.image.crop-changed': string
  /** Image diff: Text shown if the previous image asset was deleted (shouldn't theoretically happen) */
  'changes.image.deleted': string
  /** Image diff: Text shown if the image failed to be loaded when previewing it */
  'changes.image.error-loading-image': string
  /** Image diff: Text shown in tooltip when hovering hotspot that has changed in diff view */
  'changes.image.hotspot-changed': string
  /** Image diff: Fallback title for the meta info section when there is no original filename to use  */
  'changes.image.meta-info-fallback-title': string
  /** Image diff: Text shown if no asset has been set for the field (but has metadata changes) */
  'changes.image.no-asset-set': string
  /** Image diff: Text shown when the from/to state has/had no image */
  'changes.image.no-image-placeholder': string
  /** Label for the "from" value in the change inspector */
  'changes.inspector.from-label': string
  /** Label for the "meta" (field path, action etc) information in the change inspector */
  'changes.inspector.meta-label': string
  /** Label for the "to" value in the change inspector */
  'changes.inspector.to-label': string
  /** Loading author of change in the differences tooltip in the review changes pane */
  'changes.loading-author': string
  /** Loading changes in Review Changes Pane */
  'changes.loading-changes': string
  /** No Changes description in the Review Changes pane */
  'changes.no-changes-description': string
  /** No Changes title in the Review Changes pane */
  'changes.no-changes-title': string
  /** Portable Text diff: An annotation was added */
  'changes.portable-text.annotation_added': string
  /** Portable Text diff: An annotation was changed */
  'changes.portable-text.annotation_changed': string
  /** Portable Text diff: An annotation was removed */
  'changes.portable-text.annotation_removed': string
  /** Portable Text diff: An annotation was left unchanged */
  'changes.portable-text.annotation_unchanged': string
  /** Portable Text diff: A block changed from one style to another (eg `normal` to `h1` or similar) */
  'changes.portable-text.block-style-changed': string
  /** Portable Text diff: Change formatting of text (setting/unsetting marks, eg bold/italic etc) */
  'changes.portable-text.changed-formatting': string
  /** Portable Text diff: An empty inline object is part of a change */
  'changes.portable-text.empty-inline-object': string
  /** Portable Text diff: An empty object is the result of adding/removing an annotation */
  'changes.portable-text.empty-object-annotation': string
  /** Portable Text diff: Added a block containing no text (eg empty block) */
  'changes.portable-text.empty-text_added': string
  /** Portable Text diff: Changed a block that contained no text (eg empty block) */
  'changes.portable-text.empty-text_changed': string
  /** Portable Text diff: Removed a block containing no text (eg empty block) */
  'changes.portable-text.empty-text_removed': string
  /** Portable Text diff: An inline object was added */
  'changes.portable-text.inline-object_added': string
  /** Portable Text diff: An inline object was changed */
  'changes.portable-text.inline-object_changed': string
  /** Portable Text diff: An inline object was removed */
  'changes.portable-text.inline-object_removed': string
  /** Portable Text diff: An inline object was left unchanged */
  'changes.portable-text.inline-object_unchanged': string
  /** Portable Text diff: Added a chunk of text */
  'changes.portable-text.text_added': string
  /** Portable Text diff: Removed a chunk of text */
  'changes.portable-text.text_removed': string
  /** Portable Text diff: Annotation has an unknown schema type */
  'changes.portable-text.unknown-annotation-schema-type': string
  /** Portable Text diff: Inline object has an unknown schema type */
  'changes.portable-text.unknown-inline-object-schema-type': string
  /** Label for when the action of the change was a removal, eg a field was cleared, an array item was removed, an asset was deselected or similar */
  'changes.removed-label': string
  /** Title for the Review Changes pane */
  'changes.title': string
  /** --- Common components --- */
  /** Tooltip text for context menu buttons */
  'common.context-menu-button.tooltip': string
  /** Default text for dialog cancel button */
  'common.dialog.cancel-button.text': string
  /** Default text for dialog confirm button */
  'common.dialog.confirm-button.text': string
  /** Default text in shared loader text / spinner lockup */
  'common.loading': string
  /** --- Configuration issues --- */
  /** Tooltip displayed on configuration issues button */
  'configuration-issues.button.tooltip': string
  /** The fallback title for an ordering menu item if no localized titles are provided. */
  'default-menu-item.fallback-title': string
  /** Title for the default ordering/SortOrder if no orderings are provided and the caption field is found */
  'default-orderings.caption': string
  /** Title for the default ordering/SortOrder if no orderings are provided and the description field is found */
  'default-orderings.description': string
  /** Title for the default ordering/SortOrder if no orderings are provided and the header field is found */
  'default-orderings.header': string
  /** Title for the default ordering/SortOrder if no orderings are provided and the heading field is found */
  'default-orderings.heading': string
  /** Title for the default ordering/SortOrder if no orderings are provided and the label field is found */
  'default-orderings.label': string
  /** Title for the default ordering/SortOrder if no orderings are provided and the name field is found */
  'default-orderings.name': string
  /** Title for the default ordering/SortOrder if no orderings are provided and the title field is found */
  'default-orderings.title': string
  /** Label to show in the document footer indicating the last edited date of the document */
  'document-status.edited': string
  /** Label to show in the document footer indicating the document is not published*/
  'document-status.not-published': string
  /** Label to show in the document footer indicating the published date of the document */
  'document-status.published': string
  /** The value of the <code>_key</code> property must be a unique string. */
  'form.error.duplicate-keys-alert.details.additional-description': string
  /** This usually happens when items are created using an API client, and the <code>_key</code> property of each elements has been generated non-uniquely. */
  'form.error.duplicate-keys-alert.details.description': string
  /** Developer info */
  'form.error.duplicate-keys-alert.details.title': string
  /** Generate unique keys */
  'form.error.duplicate-keys-alert.generate-button.text': string
  /** Several items in this list share the same identifier (key). Every item must have an unique identifier. */
  'form.error.duplicate-keys-alert.summary': string
  /** Non-unique keys */
  'form.error.duplicate-keys-alert.title': string
  /** Error text shown when a field with a given name cannot be found in the schema or is conditionally hidden but explicitly told to render  */
  'form.error.field-not-found': string
  /** Add missing keys */
  'form.error.missing-keys-alert.add-button.text': string
  /** The value of the <code>_key</code> property must be a unique string. */
  'form.error.missing-keys-alert.details.additional-description': string
  /** This usually happens when items are created using an API client, and the <code>_key</code> property has not been included. */
  'form.error.missing-keys-alert.details.description': string
  /** Developer info */
  'form.error.missing-keys-alert.details.title': string
  /** Some items in the list are missing their keys. This must be fixed in order to edit the list. */
  'form.error.missing-keys-alert.summary': string
  /** Missing keys */
  'form.error.missing-keys-alert.title': string
  /** This usually happens when items are created using an API client, or when a custom input component has added invalid data to the list. */
  'form.error.mixed-array-alert.details.description': string
  /** Developer info */
  'form.error.mixed-array-alert.details.title': string
  /**  Remove non-object values */
  'form.error.mixed-array-alert.remove-button.text': string
  /** Some items in this list are not objects. This must be fixed in order to edit the list. */
  'form.error.mixed-array-alert.summary': string
  /** Invalid list values */
  'form.error.mixed-array-alert.title': string
  /** Error text shown when form is unable to find an array item at a given indexed path */
  'form.error.no-array-item-at-index': string
  /** Error text shown when form is unable to find an array item at a given keyed path */
  'form.error.no-array-item-at-key': string
  /** Form field deprecated label */
  'form.field.deprecated-label': string
  /** Fallback title shown above field if it has no defined title */
  'form.field.untitled-field-label': string
  /** Fallback title shown above fieldset if it has no defined title */
  'form.field.untitled-fieldset-label': string
  /** Accessibility label for the icon that indicates the field has a validation error */
  'form.validation.has-error-aria-label': string
  /** Accessibility label for the icon that indicates the field has validation information */
  'form.validation.has-info-aria-label': string
  /** Accessibility label for the icon that indicates the field has a validation warning */
  'form.validation.has-warning-aria-label': string
  /** Text shown when summarizing validation information, when the field has one or more errors */
  'form.validation.summary.errors-count_one': string
  'form.validation.summary.errors-count_other': string
  /** Text shown when summarizing validation information, when the field has one or more warnings */
  'form.validation.summary.warnings-count_one': string
  'form.validation.summary.warnings-count_other': string
  /** Tooltip for free trial navbar button indicating remaining days */
  'free-trial.tooltip.days-count_one': string
  'free-trial.tooltip.days-count_other': string
  /** Tooltip for free trial navbar button, once trial has ended */
  'free-trial.tooltip.trial-finished': string
  /**
   * Label for "contact sales" call to action
   * These are titles for fallback links in the event the help & resources endpoint isn't able to be fetched
   */
  'help-resources.action.contact-sales': string
  /**
   * Label for "help and support" call to action
   * These are titles for fallback links in the event the help & resources endpoint isn't able to be fetched
   */
  'help-resources.action.help-and-support': string
  /**
   * Label for "join our community" call to action
   * These are titles for fallback links in the event the help & resources endpoint isn't able to be fetched
   */
  'help-resources.action.join-our-community': string
  /** Information for what the latest sanity version is */
  'help-resources.latest-sanity-version': string
  /** Information for what studio version the current studio is running */
  'help-resources.studio-version': string
  /** Title for help and resources menus */
  'help-resources.title': string
  /** Text for button to cancel an ongoing upload */
  'input.files.common.cancel-upload': string
  /** Text for file input button in upload placeholder */
  'input.files.common.upload-placeholder.file-input-button.text': string
  /** Uploading <FileName/> */
  'input.files.common.upload-progress': string
  /** The referenced document cannot be opened, because the URL failed to be resolved */
  'input.reference.document-cannot-be-opened.failed-to-resolve-url': string
  /** Label for adding item after a specific array item */
  'inputs.array.action.add-after': string
  /** Label for adding item before a specific array item */
  'inputs.array.action.add-before': string
  /** Label for adding array item action when the schema allows for only one schema type */
  'inputs.array.action.add-item': string
  /**
   * Label for adding one array item action when the schema allows for multiple schema types,
   * eg. will prompt the user to select a type once triggered
   */
  'inputs.array.action.add-item-select-type': string
  /** Array drag handle button tooltip */
  'inputs.array.action.drag.tooltip': string
  /** Label for duplicating an array item  */
  'inputs.array.action.duplicate': string
  /** Label for editing the item of a specific type, eg "Edit Person" */
  'inputs.array.action.edit': string
  /** Label for removing an array item action  */
  'inputs.array.action.remove': string
  /** Label for removing action when an array item has an error  */
  'inputs.array.action.remove-invalid-item': string
  /** Label for viewing the item of a specific type, eg "View Person" */
  'inputs.array.action.view': string
  /** Error description for the array item tooltip that explains that the current item can still be moved or deleted but not edited since the schema definition is not found */
  'inputs.array.error.can-delete-but-no-edit-description': string
  /** Error label for toast when array could not resolve the initial value */
  'inputs.array.error.cannot-resolve-initial-value-title': string
  /** Error label for toast when trying to upload one array item of a type that cannot be converted to array */
  'inputs.array.error.cannot-upload-unable-to-convert_one': string
  /** Error label for toast when trying to upload multiple array items of a type that cannot be converted to array */
  'inputs.array.error.cannot-upload-unable-to-convert_other': string
  /** Error description for the array item tooltip that explains that the current type item is not valid for the list  */
  'inputs.array.error.current-schema-not-declare-description': string
  /** Error description to show how the item is being represented in the json format */
  'inputs.array.error.json-representation-description': string
  /** Error description for the array item tooltip that explains what the error means with more context */
  'inputs.array.error.type-is-incompatible-prompt': string
  /** Error title for when an item type within an array input is incompatible, used in the tooltip */
  'inputs.array.error.type-is-incompatible-title': string
  /** Error label for unexpected errors in the Array Input */
  'inputs.array.error.unexpected-error': string
  /** Label for when the array input doesn't have any items */
  'inputs.array.no-items-label': string
  /** Label for read only array fields */
  'inputs.array.read-only-label': string
  /** Label for when the array input is resolving the initial value for the item */
  'inputs.array.resolving-initial-value': string
  /** Placeholder value for datetime input */
  'inputs.datetime.placeholder': string
  /** Acessibility label for button to open file options menu */
  'inputs.file.actions-menu.file-options.aria-label': string
  /** Browse */
  'inputs.file.browse-button.text': string
  /** Select file */
  'inputs.file.dialog.title': string
  /** Unknown member kind: `{{kind}}` */
  'inputs.file.error.unknown-member-kind': string
  /** The value of this field is not a valid file. Resetting this field will let you choose a new file. */
  'inputs.file.invalid-file-warning.description': string
  /** Reset value */
  'inputs.file.invalid-file-warning.reset-button.text': string
  /** Invalid file value */
  'inputs.file.invalid-file-warning.title': string
  /** Select */
  'inputs.file.multi-browse-button.text': string
  /** The upload could not be completed at this time. */
  'inputs.file.upload-failed.description': string
  /** Upload failed */
  'inputs.file.upload-failed.title': string
  /** Clear field */
  'inputs.files.common.actions-menu.clear-field.label': string
  /** Copy URL */
  'inputs.files.common.actions-menu.copy-url.label': string
  /** Download */
  'inputs.files.common.actions-menu.download.label': string
  /** The URL is copied to the clipboard */
  'inputs.files.common.actions-menu.notification.url-copied': string
  /** Replace */
  'inputs.files.common.actions-menu.replace.label': string
  /** Upload */
  'inputs.files.common.actions-menu.upload.label': string
  /** Drop to upload */
  'inputs.files.common.drop-message.drop-to-upload': string
  /** Drop to upload `{{count}}` file */
  'inputs.files.common.drop-message.drop-to-upload-multi_one': string
  /** Drop to upload `{{count}}` files */
  'inputs.files.common.drop-message.drop-to-upload-multi_other': string
  /** Can't upload this file here */
  'inputs.files.common.drop-message.drop-to-upload.no-accepted-file-message_one': string
  /** Can't upload any of these files here */
  'inputs.files.common.drop-message.drop-to-upload.no-accepted-file-message_other': string
  /** `{{count}}` file can't be uploaded here */
  'inputs.files.common.drop-message.drop-to-upload.rejected-file-message_one': string
  /** `{{count}}` files can't be uploaded here */
  'inputs.files.common.drop-message.drop-to-upload.rejected-file-message_other': string
  /** Cannot upload `{{count}}` files */
  'inputs.files.common.placeholder.cannot-upload-some-files_one': string
  'inputs.files.common.placeholder.cannot-upload-some-files_other': string
  /** Drag or paste type here */
  'inputs.files.common.placeholder.drag-or-paste-to-upload_file': string
  /** Drag or paste image here */
  'inputs.files.common.placeholder.drag-or-paste-to-upload_image': string
  /** Drop to upload file */
  'inputs.files.common.placeholder.drop-to-upload_file': string
  /** Drop to upload image */
  'inputs.files.common.placeholder.drop-to-upload_image': string
  /** Read only */
  'inputs.files.common.placeholder.read-only': string
  /** Can't upload files here */
  'inputs.files.common.placeholder.upload-not-supported': string
  /** Clear upload */
  'inputs.files.common.stale-upload-warning.clear': string
  /** An upload has made no progress for at least `{{staleThresholdMinutes}}` minutes and likely got interrupted. You can safely clear the incomplete upload and try uploading again. */
  'inputs.files.common.stale-upload-warning.description': string
  /** Incomplete upload */
  'inputs.files.common.stale-upload-warning.title': string
  /** Tooltip text for action to crop image */
  'inputs.image.actions-menu.crop-image-tooltip': string
  /** Accessibility label for button to open image edit dialog */
  'inputs.image.actions-menu.edit-details.aria-label': string
  /** Accessibility label for button to open image options menu */
  'inputs.image.actions-menu.options.aria-label': string
  /** Select */
  'inputs.image.browse-menu.text': string
  /** Cannot upload this file here */
  'inputs.image.drag-overlay.cannot-upload-here': string
  /** Drop image to upload */
  'inputs.image.drag-overlay.drop-to-upload-image': string
  /** This field is read only */
  'inputs.image.drag-overlay.this-field-is-read-only': string
  /** Unknown member kind: `{{kind}}` */
  'inputs.image.error.unknown-member-kind': string
  /** Edit hotspot and crop */
  'inputs.image.hotspot-dialog.title': string
  /** The value of this field is not a valid image. Resetting this field will let you choose a new image. */
  'inputs.image.invalid-image-warning.description': string
  /** Reset value */
  'inputs.image.invalid-image-warning.reset-button.text': string
  /** Invalid image value */
  'inputs.image.invalid-image-warning.title': string
  /** Preview of uploaded image */
  'inputs.image.preview-uploaded-image': string
  /** The upload could not be completed at this time. */
  'inputs.image.upload-error.description': string
  /** Upload failed */
  'inputs.image.upload-error.title': string
  /** Adjust the rectangle to crop image. Adjust the circle to specify the area that should always be visible. */
  'inputs.imagetool.description': string
  /** Error: `{{errorMessage}}` */
  'inputs.imagetool.load-error': string
  /** Hotspot & Crop */
  'inputs.imagetool.title': string
  /** Convert to `{{targetType}}` */
  'inputs.invalid-value.convert-button.text': string
  /** The current value (<code>`{{actualType}}`</code>) */
  'inputs.invalid-value.current-type': string
  /** The property value is stored as a value type that does not match the expected type. */
  'inputs.invalid-value.description': string
  /** The value of this property must be of type <code>`{{validType}}`</code> according to the schema. */
  'inputs.invalid-value.details.description': string
  /** Only the following types are valid here according to schema: */
  'inputs.invalid-value.details.multi-type-description': string
  /** Mismatching value types typically occur when the schema has recently been changed. */
  'inputs.invalid-value.details.possible-reason': string
  /** Developer info */
  'inputs.invalid-value.details.title': string
  /** -- Invalid Value Input -- */
  /** Reset value */
  'inputs.invalid-value.reset-button.text': string
  /** Invalid property value */
  'inputs.invalid-value.title': string
  /** Field groups */
  'inputs.object.field-group-tabs.aria-label': string
  /** Read-only field description */
  'inputs.object.unknown-fields.read-only.description': string
  /** Remove field */
  'inputs.object.unknown-fields.remove-field-button.text': string
  /** Encountered `{{count}}` fields that are not defined in the schema. */
  'inputs.object.unknown-fields.warning.description_one': string
  'inputs.object.unknown-fields.warning.description_other': string
  /** Detailed description of unknown field warning */
  'inputs.object.unknown-fields.warning.details.description_one': string
  'inputs.object.unknown-fields.warning.details.description_other': string
  /** Developer info */
  'inputs.object.unknown-fields.warning.details.title': string
  /** Unknown field found */
  'inputs.object.unknown-fields.warning.title_one': string
  'inputs.object.unknown-fields.warning.title_other': string
  /** Collapse the editor to save screen space  */
  'inputs.portable-text.action.collapse-editor': string
  /** Aria label for action to edit an existing annotation */
  'inputs.portable-text.action.edit-annotation-aria-label': string
  /** Expand the editor to give more editing space */
  'inputs.portable-text.action.expand-editor': string
  /** Label label for action to insert a block of a given type (`{{typeName}}`) */
  'inputs.portable-text.action.insert-block': string
  /** Accessibility label for action to insert a block of a given type (`{{typeName}}`) */
  'inputs.portable-text.action.insert-block-aria-label': string
  /** Label for action to insert an inline object of a given type (`{{typeName}}`) */
  'inputs.portable-text.action.insert-inline-object': string
  /** Accessibility label for action to insert an inline object of a given type (`{{typeName}}`) */
  'inputs.portable-text.action.insert-inline-object-aria-label': string
  /** Aria label for action to remove an annotation */
  'inputs.portable-text.action.remove-annotation-aria-label': string
  /** Label for activate on focus with context of click and not focused */
  'inputs.portable-text.activate-on-focus-message_click': string
  /** Label for activate on focus with context of click and focused */
  'inputs.portable-text.activate-on-focus-message_click-focused': string
  /** Label for activate on focus with context of tap and not focused */
  'inputs.portable-text.activate-on-focus-message_tap': string
  /**Aria label for the annotation object */
  'inputs.portable-text.annotation-aria-label': string
  /** Title for dialog that allows editing an annotation */
  'inputs.portable-text.annotation-editor.title': string
  /** Title of the default "link" annotation */
  'inputs.portable-text.annotation.link': string
  /**Aria label for the block object */
  'inputs.portable-text.block.aria-label': string
  /** Label for action to edit a block item, in the case where it is editable */
  'inputs.portable-text.block.edit': string
  /** Accessibility label for the button that opens the actions menu on blocks */
  'inputs.portable-text.block.open-menu-aria-label': string
  /** Label for action to open a reference, in the case of block-level reference types */
  'inputs.portable-text.block.open-reference': string
  /** Label for action to remove a block item */
  'inputs.portable-text.block.remove': string
  /** Label for action to view a block item, in the case where it is read-only and thus cannot be edited */
  'inputs.portable-text.block.view': string
  /** Title of the "code" decorator */
  'inputs.portable-text.decorator.code': string
  /** Title of the "em" (emphasis) decorator */
  'inputs.portable-text.decorator.emphasis': string
  /** Title of the "strike-through" decorator */
  'inputs.portable-text.decorator.strike-through': string
  /** Title of the "strong" decorator */
  'inputs.portable-text.decorator.strong': string
  /** Title of the "underline" decorator */
  'inputs.portable-text.decorator.underline': string
  /** Placeholder text for when the editor is empty */
  'inputs.portable-text.empty-placeholder': string
  /**Aria label for the block object */
  'inputs.portable-text.inline-block.aria-label': string
  /** Label for action to edit an inline object item */
  'inputs.portable-text.inline-object.edit': string
  /** Aria label for icon for action to edit an inline object item */
  'inputs.portable-text.inline-object.edit-aria-label': string
  /** Label for action to remove an inline object item */
  'inputs.portable-text.inline-object.remove': string
  /** Aria label for icon for action to remove an inline object item */
  'inputs.portable-text.inline-object.remove-aria-label': string
  /** Disclaimer text shown on invalid Portable Text value, when an action is available to unblock the user, but it is not guaranteed to be safe */
  'inputs.portable-text.invalid-value.action-disclaimer': string
  /** Action presented when the Portable Text field value is invalid, when block with key `{{key}}` has a child with key `{{childKey}}` of type `{{childType}}` which is not allowed by the schema definition */
  'inputs.portable-text.invalid-value.disallowed-child-type.action': string
  /** Text explaining that the Portable Text field value is invalid, when block with key `{{key}}` has a child with key `{{childKey}}` of type `{{childType}}` which is not allowed by the schema definition */
  'inputs.portable-text.invalid-value.disallowed-child-type.description': string
  /** Action presented when the Portable Text field value is invalid, when child with key `{{key}}` has a type (`{{typeName}}`) that is not an allowed block type for this field */
  'inputs.portable-text.invalid-value.disallowed-type.action': string
  /** Text explaining that the Portable Text field value is invalid, when child with key `{{key}}` has a type (`{{typeName}}`) that is not an allowed block type for this field */
  'inputs.portable-text.invalid-value.disallowed-type.description': string
  /** Action presented when the Portable Text field value is invalid, when block with key `{{key}}` contains no children */
  'inputs.portable-text.invalid-value.empty-children.action': string
  /** Text explaining that the Portable Text field value is invalid, when block with key `{{key}}` contains no children */
  'inputs.portable-text.invalid-value.empty-children.description': string
  /** Label for the button to ignore invalid values in the Portable Text editor */
  'inputs.portable-text.invalid-value.ignore-button.text': string
  /** Action presented when the Portable Text field value is invalid, when child with key `{{key}}` has a `_type` property that is set to `block`, but the block type defined in schema has a different name (`{{expectedTypeName}}`) */
  'inputs.portable-text.invalid-value.incorrect-block-type.action': string
  /** Text explaining that the Portable Text field value is invalid, when child with key `{{key}}` has a `_type` property that is set to `block`, but the block type defined in schema has a different name (`{{expectedTypeName}}`) */
  'inputs.portable-text.invalid-value.incorrect-block-type.description': string
  /** Action presented when the Portable Text field value is invalid, when block with key `{{key}}` has a span with key `{{childKey}}` that has a missing or invalid `text` property */
  'inputs.portable-text.invalid-value.invalid-span-text.action': string
  /** Text explaining that the Portable Text field value is invalid, when block with key `{{key}}` has a span with key `{{childKey}}` that has a missing or invalid `text` property */
  'inputs.portable-text.invalid-value.invalid-span-text.description': string
  /** Action presented when the Portable Text field value is invalid, when child with key `{{key}}` is missing a `_type` property, but seems to be a block of type `{{expectedTypeName}}` */
  'inputs.portable-text.invalid-value.missing-block-type.action': string
  /** Text explaining that the Portable Text field value is invalid, when child with key `{{key}}` is missing a `_type` property, but seems to be a block of type `{{expectedTypeName}}` */
  'inputs.portable-text.invalid-value.missing-block-type.description': string
  /** Action presented when the Portable Text field value is invalid, when block with key `{{key}}` has a child at `{{index}}` which is missing `_key` property */
  'inputs.portable-text.invalid-value.missing-child-key.action': string
  /** Text explaining that the Portable Text field value is invalid, when block with key `{{key}}` has a child at `{{index}}` which is missing `_key` property */
  'inputs.portable-text.invalid-value.missing-child-key.description': string
  /** Action presented when the Portable Text field value is invalid, when block with key `{{key}}` has a child with key `{{childKey}}` which is missing a `_type` property */
  'inputs.portable-text.invalid-value.missing-child-type.action': string
  /** Text explaining that the Portable Text field value is invalid, when block with key `{{key}}` has a child with key `{{childKey}}` which is missing a `_type` property */
  'inputs.portable-text.invalid-value.missing-child-type.description': string
  /** Action presented when the Portable Text field value is invalid, when child at `{{index}}` is missing the required `_key` property */
  'inputs.portable-text.invalid-value.missing-key.action': string
  /** Text explaining that the Portable Text field value is invalid, when child at `{{index}}` is missing the required `_key` property */
  'inputs.portable-text.invalid-value.missing-key.description': string
  /** Action presented when the Portable Text field value is invalid, when child with key `{{key}}` has a missing or invalid `children` property */
  'inputs.portable-text.invalid-value.missing-or-invalid-children.action': string
  /** Text explaining that the Portable Text field value is invalid, when child with key `{{key}}` has a missing or invalid `children` property */
  'inputs.portable-text.invalid-value.missing-or-invalid-children.description': string
  /** Action presented when the Portable Text field value is invalid, when child with key `{{key}}` has a missing or invalid `markDefs` property */
  'inputs.portable-text.invalid-value.missing-or-invalid-markdefs.action': string
  /** Text explaining that the Portable Text field value is invalid, when child with key `{{key}}` has a missing or invalid `markDefs` property */
  'inputs.portable-text.invalid-value.missing-or-invalid-markdefs.description': string
  /** Action presented when the Portable Text field value is invalid, when child with key `{{key}}` is missing a `_type` property  */
  'inputs.portable-text.invalid-value.missing-type.action': string
  /** Text explaining that the Portable Text field value is invalid, when child with key `{{key}}` is missing a `_type` property  */
  'inputs.portable-text.invalid-value.missing-type.description': string
  /** Action presented when the Portable Text field value is invalid, when block with key `{{key}}` contains a non-object child at index `{{index}}` */
  'inputs.portable-text.invalid-value.non-object-child.action': string
  /** Text explaining that the Portable Text field value is invalid, when block with key `{{key}}` contains a non-object child at index `{{index}}` */
  'inputs.portable-text.invalid-value.non-object-child.description': string
  /** Action presented when the Portable Text field value is invalid, when the Portable Text field is not an array, or the array is empty */
  'inputs.portable-text.invalid-value.not-an-array.action': string
  /** Text explaining that the Portable Text field value is invalid, when the Portable Text field is not an array, or the array is empty */
  'inputs.portable-text.invalid-value.not-an-array.description': string
  /** Action presented when the Portable Text field value is invalid, when child at `{{index}}` is not an object */
  'inputs.portable-text.invalid-value.not-an-object.action': string
  /** Text explaining that the Portable Text field value is invalid, when child at `{{index}}` is not an object */
  'inputs.portable-text.invalid-value.not-an-object.description': string
  /** Action presented when the Portable Text field value is invalid, when block with key `{{key}}` contains marks (`{{orphanedMarks}}`) that are not supported by the current schema */
  'inputs.portable-text.invalid-value.orphaned-marks.action': string
  /** Text explaining that the Portable Text field value is invalid, when block with key `{{key}}` contains marks (`{{orphanedMarks}}`) that are not supported by the current schema */
  'inputs.portable-text.invalid-value.orphaned-marks.description': string
  /** Title for the alert indicating that the Portable Text field has an invalid value */
  'inputs.portable-text.invalid-value.title': string
  /** Title of "bulleted" list type */
  'inputs.portable-text.list-type.bullet': string
  /** Title of numbered list type */
  'inputs.portable-text.list-type.number': string
  /** Title of the "h1" block style */
  'inputs.portable-text.style.h1': string
  /** Title of the "h2" block style */
  'inputs.portable-text.style.h2': string
  /** Title of the "h3" block style */
  'inputs.portable-text.style.h3': string
  /** Title of the "h4" block style */
  'inputs.portable-text.style.h4': string
  /** Title of the "h5" block style */
  'inputs.portable-text.style.h5': string
  /** Title of the "h6" block style */
  'inputs.portable-text.style.h6': string
  /** Title shown when multiple blocks of varying styles is selected */
  'inputs.portable-text.style.multiple': string
  /** Title of fallback when no style is given for a block */
  'inputs.portable-text.style.none': string
  /** Title of the "normal" block style */
  'inputs.portable-text.style.normal': string
  /** Title of the "quote" block style */
  'inputs.portable-text.style.quote': string
  /** Label for action to clear the current value of the reference field */
  'inputs.reference.action.clear': string
  /** Label for action to create a new document from the reference input */
  'inputs.reference.action.create-new-document': string
  /** Label for action to create a new document from the reference input, when there are multiple templates or document types to choose from */
  'inputs.reference.action.create-new-document-select': string
  /** Label for action to duplicate the current item to a new item (used within arrays) */
  'inputs.reference.action.duplicate': string
  /** Label for action that opens the referenced document in a new tab */
  'inputs.reference.action.open-in-new-tab': string
  /** Label for action to remove the reference from an array */
  'inputs.reference.action.remove': string
  /** Label for action to replace the current value of the field */
  'inputs.reference.action.replace': string
  /** Label for action to cancel a previously initiated replace action  */
  'inputs.reference.action.replace-cancel': string
  /** The cross-dataset reference field currently has a reference, but the feature has been disabled since it was created. This explains what can/cannot be done in its current state. */
  'inputs.reference.cross-dataset.feature-disabled-actions': string
  /** A cross-dataset reference field exists but the feature has been disabled. A <DocumentationLink> component is available. */
  'inputs.reference.cross-dataset.feature-disabled-description': string
  /** Title for a warning telling the user that the current project does not have the "cross dataset references" feature */
  'inputs.reference.cross-dataset.feature-unavailable-title': string
  /** The cross-dataset reference points to a document with an invalid type  */
  'inputs.reference.cross-dataset.invalid-type': string
  /** The referenced document will open in a new tab (due to external studio) */
  'inputs.reference.document-opens-in-new-tab': string
  /** Error title for when the document is unavailable (for any possible reason) */
  'inputs.reference.error.document-unavailable-title': string
  /** Error title for when the referenced document failed to be loaded */
  'inputs.reference.error.failed-to-load-document-title': string
  /** Error title for when the reference search returned a document that is not an allowed type for the field */
  'inputs.reference.error.invalid-search-result-type-title': string
  /** Error description for when the document referenced is not one of the types declared as allowed target types in schema */
  'inputs.reference.error.invalid-type-description': string
  /** Error title for when the document referenced is not one of the types declared as allowed target types in schema */
  'inputs.reference.error.invalid-type-title': string
  /** Error description for when the user does not have permissions to read the referenced document */
  'inputs.reference.error.missing-read-permissions-description': string
  /** Error title for when the user does not have permissions to read the referenced document */
  'inputs.reference.error.missing-read-permissions-title': string
  /** Error description for when the current reference value points to a document that does not exist (on weak references) */
  'inputs.reference.error.nonexistent-document-description': string
  /** Error title for when the current reference value points to a document that does not exist (on weak references) */
  'inputs.reference.error.nonexistent-document-title': string
  /** Label for button that clears the reference when it points to a document that does not exist (on weak references) */
  'inputs.reference.error.nonexistent-document.clear-button-label': string
  /** Error title for when the search for a reference failed. Note that the message sent by the backend may not be localized. */
  'inputs.reference.error.search-failed-title': string
  /** Alternative text for the image shown in cross-dataset reference input */
  'inputs.reference.image-preview-alt-text': string
  /** Description for alert shown when a reference in a live-edit document is marked as being weak, the referenced document exists, AND the reference is supposed to be have been strengthened on publish */
  'inputs.reference.incomplete-reference.finalize-action-description': string
  /** Title for alert shown when a reference in a live-edit document is marked as being weak, the referenced document exists, AND the reference is supposed to be have been strengthened on publish */
  'inputs.reference.incomplete-reference.finalize-action-title': string
  /** Description for alert shown when a reference in a live-edit document points to a document that exists and has been published, but the reference is still marked as weak */
  'inputs.reference.incomplete-reference.strengthen-action-description': string
  /** Title for alert shown when a reference in a live-edit document points to a document that exists and has been published, but the reference is still marked as weak */
  'inputs.reference.incomplete-reference.strengthen-action-title': string
  /** Label for button that triggers the action that strengthen a reference */
  'inputs.reference.incomplete-reference.strengthen-button-label': string
  /** Label for button that triggers a retry attempt for reference metadata  */
  'inputs.reference.metadata-error.retry-button-label': string
  /** Title for alert shown when reference metadata fails to be loaded */
  'inputs.reference.metadata-error.title': string
  /** Message shown when no documents were found that matched the given search string */
  'inputs.reference.no-results-for-query': string
  /** Text for tooltip showing when a document was edited, using relative time (eg "how long ago was it edited?") */
  'inputs.reference.preview.edited-at-time': string
  /** Accessibility label for icon indicating that document does _not_ have any unpublished changes */
  'inputs.reference.preview.has-no-unpublished-changes-aria-label': string
  /** Accessibility label for icon indicating that document has unpublished changes */
  'inputs.reference.preview.has-unpublished-changes-aria-label': string
  /** Accessibility label for icon indicating that document does _not_ have a published version */
  'inputs.reference.preview.is-not-published-aria-label': string
  /** Accessibility label for icon indicating that document has a published version */
  'inputs.reference.preview.is-published-aria-label': string
  /** Text for tooltip indicating that a document has no unpublished edits */
  'inputs.reference.preview.no-unpublished-edits': string
  /** Text for tooltip indicating that a document has not yet been published */
  'inputs.reference.preview.not-published': string
  /** Text for tooltip showing when a document was published, using relative time (eg "how long ago was it published?") */
  'inputs.reference.preview.published-at-time': string
  /** The referenced document no longer exist and might have been deleted (for weak references) */
  'inputs.reference.referenced-document-does-not-exist': string
  /** The referenced document could not be displayed to the user because of insufficient permissions */
  'inputs.reference.referenced-document-insufficient-permissions': string
  /** Label for when the reference input is resolving the initial value for an item */
  'inputs.reference.resolving-initial-value': string
  /** Placeholder shown in a reference input with no current value */
  'inputs.reference.search-placeholder': string
  /** Explanation of the consequences of leaving the reference as strong instead of weak */
  'inputs.reference.strength-mismatch.is-strong-consquences': string
  /** Description for alert shown when a reference is supposed to be weak, but the actual value is strong */
  'inputs.reference.strength-mismatch.is-strong-description': string
  /** Explanation of the consequences of leaving the reference as weak instead of strong */
  'inputs.reference.strength-mismatch.is-weak-consquences': string
  /** Description for alert shown when a reference is supposed to be strong, but the actual value is weak */
  'inputs.reference.strength-mismatch.is-weak-description': string
  /** Label for button that triggers the action that strengthens a reference on strength mismatch */
  'inputs.reference.strength-mismatch.strengthen-button-label': string
  /** Title for alert shown when a reference is supposed to be weak/strong, but the actual value is the opposite of what it is supposed to be */
  'inputs.reference.strength-mismatch.title': string
  /** Label for button that triggers the action that weakens a reference on strength mismatch */
  'inputs.reference.strength-mismatch.weaken-button-label': string
  /** Action message for generating the slug */
  'inputs.slug.action.generate': string
  /** Loading message for when the input is actively generating a slug */
  'inputs.slug.action.generating': string
  /** Error message for when the source to generate a slug from is missing */
  'inputs.slug.error.missing-source': string
  /** Placeholder for an empty tag input */
  'inputs.tags.placeholder': string
  /** Placeholder for an empty tag input on touch devices */
  'inputs.tags.placeholder_touch': string
  /** Convert to `{{targetType}}` */
  'inputs.untyped-value.convert-button.text': string
  /** Encountered an object value without a <code>_type</code> property. */
  'inputs.untyped-value.description': string
  /** Either remove the <code>name</code> property of the object declaration, or set <code>_type</code> property on items. */
  'inputs.untyped-value.details.description': string
  /** Current value (<code>object</code>): */
  'inputs.untyped-value.details.json-dump-prefix': string
  /** The following types are valid here according to schema: */
  'inputs.untyped-value.details.multi-type-description': string
  /** Developer info */
  'inputs.untyped-value.details.title': string
  /** Property value missing <code>_type</code> */
  'inputs.untyped-value.title': string
  /** Unset value */
  'inputs.untyped-value.unset-item-button.text': string
  /** The fallback explanation if no context is provided */
  'insufficient-permissions-message.not-authorized-explanation': string
  /** The explanation when unable to create any document at all */
  'insufficient-permissions-message.not-authorized-explanation_create-any-document': string
  /** The explanation when unable to create a particular document */
  'insufficient-permissions-message.not-authorized-explanation_create-document': string
  /** The explanation when unable to create a particular type of document */
  'insufficient-permissions-message.not-authorized-explanation_create-document-type': string
  /** The explanation when unable to create a new reference in a document */
  'insufficient-permissions-message.not-authorized-explanation_create-new-reference': string
  /** The explanation when unable to delete a particular document */
  'insufficient-permissions-message.not-authorized-explanation_delete-document': string
  /** The explanation when unable to discard changes in a particular document */
  'insufficient-permissions-message.not-authorized-explanation_discard-changes': string
  /** The explanation when unable to duplicate a particular document */
  'insufficient-permissions-message.not-authorized-explanation_duplicate-document': string
  /** The explanation when unable to publish a particular document */
  'insufficient-permissions-message.not-authorized-explanation_publish-document': string
  /** The explanation when unable to unpublish a particular document */
  'insufficient-permissions-message.not-authorized-explanation_unpublish-document': string
  /** Appears after the not-authorized message. Lists the current roles. */
  'insufficient-permissions-message.roles': string
  /** The title for the insufficient permissions message component */
  'insufficient-permissions-message.title': string
  /** Unexpected error: `{{error}}` */
  'member-field-error.unexpected-error': string
  /** Button label for "Create new document" button */
  'new-document.button': string
  /**
   * Tooltip message displayed when hovering/activating the "Create new document" action,
   * when there are templates/types available for creation
   */
  'new-document.create-new-document-label': string
  /** Placeholder for the "filter" input within the new document menu */
  'new-document.filter-placeholder': string
  /** Loading indicator text within the new document menu */
  'new-document.loading': string
  /** Accessibility label for the list displaying options in the new document menu */
  'new-document.new-document-aria-label': string
  /** Message for when there are no document type options in the new document menu */
  'new-document.no-document-types-found': string
  /**
   * Tooltip message displayed when hovering/activating the "Create new document" action,
   * when there are no templates/types to create from
   */
  'new-document.no-document-types-label': string
  /** Message for when no results are found for a specific search query in the new document menu */
  'new-document.no-results': string
  /** Aria label for the button that opens the "Create new document" popover/dialog */
  'new-document.open-dialog-aria-label': string
  /** Title for "Create new document" dialog */
  'new-document.title': string
  /** Label for action to manage members of the current studio project */
  'presence.action.manage-members': string
  /** Accessibility label for presence menu button */
  'presence.aria-label': string
  /** Message description for when no one else is currently present */
  'presence.no-one-else-description': string
  /** Message title for when no one else is currently present */
  'presence.no-one-else-title': string
  /** Message for when a user is not in a document (displayed in the global presence menu) */
  'presence.not-in-a-document': string
  /** Tooltip content text for presence menu button */
  'presence.tooltip-content': string
  /** Fallback title shown when a preview does not provide a title */
  'preview.default.title-fallback': string
  /** Fallback preview value for types that have "no value" (eg null, undefined) */
  'preview.fallback.no-value': string
  /** Alternative text for image being shown while image is being uploaded, in previews */
  'preview.image.file-is-being-uploaded.alt-text': string
  'relative-time.just-now': string
  /** Accessibility label to open search action when the search would go fullscreen (eg on narrower screens) */
  'search.action-open-aria-label': string
  /** Action label for adding a search filter */
  'search.action.add-filter': string
  /** Action label for clearing search filters */
  'search.action.clear-filters': string
  /** Label for action to clear recent searches */
  'search.action.clear-recent-searches': string
  /** Accessibility label for action to clear all currently applied document type filters */
  'search.action.clear-type-filters-aria-label': string
  /** Label for action to clear all currently applied document type filters */
  'search.action.clear-type-filters-label': string
  /** Accessibility label for when the search is full screen (on narrow screens) and you want to close the search */
  'search.action.close-search-aria-label': string
  /** Accessibility label for filtering by document type */
  'search.action.filter-by-document-type-aria-label': string
  /** Accessibility action label for removing an already applied search filter */
  'search.action.remove-filter-aria-label': string
  /**
   * Text displayed when either no document type(s) have been selected, or we need a fallback,
   * eg "Search for all types".
   */
  'search.action.search-all-types': string
  /**
   * Text displayed when we are able to determine one or more document types that will be used for
   * searching, and can fit within the space assigned by the design.
   */
  'search.action.search-specific-types': string
  /**
   * Text displayed when we are able to determine one or more document types that will be used for
   * searching, but cannot list them all within the space assigned by the design, so we need an
   * additional "and X more" suffix. Allows using pluralization suffixes, eg `_one`, `_other` etc.
   */
  'search.action.search-specific-types-truncated': string
  /** Dialog title for action to select an asset of unknown type */
  'search.action.select-asset': string
  /** Dialog title for action to select a file asset */
  'search.action.select-asset_file': string
  /** Dialog title for action to select an image asset */
  'search.action.select-asset_image': string
  /** Accessibility label for when the search is full screen (on narrow screens) and you want to hide filters */
  'search.action.toggle-filters-aria-label_hide': string
  /** Accessibility label for when the search is full screen (on narrow screens) and you want to show filters */
  'search.action.toggle-filters-aria-label_show': string
  /** Label for when the search is full screen (on narrow screens) and you want to hide filters */
  'search.action.toggle-filters-label_hide': string
  /** Label for when the search is full screen (on narrow screens) and you want to show filters */
  'search.action.toggle-filters-label_show': string
  /** Tooltip text for the global search button */
  'search.button.tooltip': string
  /**
   * A list of provided types (use `list` formatter preferably).
   */
  'search.document-type-list': string
  /**
   * In the context of a list of document types - no filtering selection has been done,
   * thus the default is "all types".
   */
  'search.document-type-list-all-types': string
  /**
   * A list of provided types that has been truncated - more types are included but not displayed,
   * thus we need to indicate that there are more. Allows using pluralization suffixes,
   * eg `_one`, `_other` etc.
   */
  'search.document-type-list-truncated': string
  /** Accessibility label for list displaying the available document types */
  'search.document-types-aria-label': string
  /** Label for when no document types matching the filter are found */
  'search.document-types-no-matches-found': string
  /** Description for error when a filter cannot be displayed, describes that you should check the schema */
  'search.error.display-filter-description': string
  /** Title for error when a filter cannot be displayed (mainly a developer-oriented error) */
  'search.error.display-filter-title': string
  /** Description for error when no valid asset source is found, describes that you should check the the current studio config */
  'search.error.no-valid-asset-source-check-config-description': string
  /** Description for error when no valid asset source is found, describes that only the default asset is supported */
  'search.error.no-valid-asset-source-only-default-description': string
  /** Title for error when no valid asset sources found */
  'search.error.no-valid-asset-source-title': string
  /** Helpful description for when search returned an error that we are not able to describe in detail */
  'search.error.unspecified-error-help-description': string
  /** Title label for when search returned an error that we are not able to describe in detail */
  'search.error.unspecified-error-title': string
  /**
   * Label for "All fields", a label that appears above the list of available fields when filtering.
   * If one or more document type has been chosen as filter, this label is replaced with a group of
   * fields per selected document type
   */
  'search.filter-all-fields-header': string
  /** Label for the action of changing from one file to a different file in asset search filter */
  'search.filter-asset-change_file': string
  /** Label for the action of changing from one image to a different image in asset search filter */
  'search.filter-asset-change_image': string
  /** Label for the action of clearing the currently selected asset in an image/file filter */
  'search.filter-asset-clear': string
  /** Label for the action of selecting a file in asset search filter */
  'search.filter-asset-select_file': string
  /** Label for the action of selecting an image in asset search filter */
  'search.filter-asset-select_image': string
  /** Label for boolean filter - false */
  'search.filter-boolean-false': string
  /** Label for boolean filter - true */
  'search.filter-boolean-true': string
  /** Accessibility label for list that lets you filter fields by title, when adding a new filter in search */
  'search.filter-by-title-aria-label': string
  /** Accessibility label for date filter input */
  'search.filter-date-aria-label': string
  /** Accessibility label for selecting end date on the date range search filter */
  'search.filter-date-range-end-date-aria-label': string
  /** Accessibility label for selecting start date on the date range search filter */
  'search.filter-date-range-start-date-aria-label': string
  /** Accessibility label for selecting the unit (day/month/year) when adding "X days ago" search filter */
  'search.filter-date-unit-aria-label': string
  /**
   * Label for "Days"/"Months"/"Years" when selecting it as unit in "X days ago" search filter.
   * Capitalized, as it would be listed in a dropdown.
   */
  'search.filter-date-unit_days': string
  'search.filter-date-unit_months': string
  'search.filter-date-unit_years': string
  /** Accessibility label for the input value (days/months/years) when adding "X days ago" search filter */
  'search.filter-date-value-aria-label': string
  /** Label for "field description" shown in tooltip when navigating list of possible fields to filter */
  'search.filter-field-tooltip-description': string
  /** Label for "field name" shown in tooltip when navigating list of possible fields to filter */
  'search.filter-field-tooltip-name': string
  /** Label for "Used in document types", a list of the document types a field appears in. Shown in tooltip when navigating list of possible fields to filter */
  'search.filter-field-tooltip-used-in-document-types': string
  /** Label for when no fields/filters are found for the given term */
  'search.filter-no-matches-found': string
  /** Placeholder value for maximum numeric value filter */
  'search.filter-number-max-value-placeholder': string
  /** Placeholder value for minimum numeric value filter */
  'search.filter-number-min-value-placeholder': string
  /** Placeholder value for the number filter */
  'search.filter-number-value-placeholder': string
  /** Placeholder for the "Filter" input, when narrowing possible fields/filters */
  'search.filter-placeholder': string
  /** Label for the action of clearing the currently selected document in a reference filter */
  'search.filter-reference-clear': string
  /**
   * Label for "shared fields", a label that appears above a list of fields that all filtered types
   * have in common, when adding a new filter. For instance, if "book" and "employee" both have a
   * "title" field, this field would be listed under "shared fields".
   * */
  'search.filter-shared-fields-header': string
  /** Placeholder value for the string filter */
  'search.filter-string-value-placeholder': string
  /** Label/placeholder prompting user to select one of the predefined, allowed values for a string field */
  'search.filter-string-value-select-predefined-value': string
  /** Accessibility label for the "Filters" list, that is shown when using "Add filter" in search (singular) */
  'search.filters-aria-label_one': string
  /** Accessibility label for the "Filters" list, that is shown when using "Add filter" in search (plural) */
  'search.filters-aria-label_other': string
  /** Label for instructions on how to use the search - displayed when no recent searches are available */
  'search.instructions': string
  /** Helpful description for when no search results are found */
  'search.no-results-help-description': string
  /** Title label for when no search results are found */
  'search.no-results-title': string
  /**
   * Individual search operators.
   *
   * The `name` variant is the form we use when the user is building a query, and selecting from a
   * list of available operators for a field. Keep in mind that since the user knows what the field
   * represents, we do not need to contextualize too much, and that the user may not be a developer
   * eg prefer "quantity is" over "array has length". Additionally, (if applicable in language) use
   * lowercased names.
   *
   * The `description` variant is the form shown once the filter has enough information to apply,
   * and is shown in the list of applied filters. It is passed components that _should_ be used to
   * compose the filter string, and to format them correctly:
   *
   * `<Field/>` - eg "Bird species", "Category", "Date of birth"
   * `<Operator>operator text</Operator>` - eg "has ≤", "includes", "is"
   * `<Value>{{value}}</Value>` - eg "Hawk", "Sparrow", "Eagle"
   *
   * Where applicable, a `count` is passed, allowing you to pluralize where needed, by using
   * suffixes such as `_zero`, `_one`, `_other` etc.
   *
   * Prefer (reasonable) brevity since many filters may be applied. For instance:
   * `<Field/> has ≤ <Value/>` may be better than
   * `<Field/> has less than or equal to <Value/>`
   **/
  'search.operator.array-count-equal.description_one': string
  'search.operator.array-count-equal.description_other': string
  'search.operator.array-count-equal.name': string
  'search.operator.array-count-gt.description_one': string
  'search.operator.array-count-gt.description_other': string
  'search.operator.array-count-gt.name': string
  'search.operator.array-count-gte.description_one': string
  'search.operator.array-count-gte.description_other': string
  'search.operator.array-count-gte.name': string
  'search.operator.array-count-lt.description_one': string
  'search.operator.array-count-lt.description_other': string
  'search.operator.array-count-lt.name': string
  'search.operator.array-count-lte.description_one': string
  'search.operator.array-count-lte.description_other': string
  'search.operator.array-count-lte.name': string
  'search.operator.array-count-not-equal.description_one': string
  'search.operator.array-count-not-equal.description_other': string
  'search.operator.array-count-not-equal.name': string
  /**
   * Array should have a count within the range of given filter values.
   * Gets passed `{{from}}` and `{{to}}` values.
   **/
  'search.operator.array-count-range.description': string
  'search.operator.array-count-range.name': string
  'search.operator.array-list-includes.description': string
  'search.operator.array-list-includes.name': string
  'search.operator.array-list-not-includes.description': string
  'search.operator.array-list-not-includes.name': string
  'search.operator.array-reference-includes.description': string
  'search.operator.array-reference-includes.name': string
  'search.operator.array-reference-not-includes.description': string
  'search.operator.array-reference-not-includes.name': string
  'search.operator.asset-file-equal.description': string
  'search.operator.asset-file-equal.name': string
  'search.operator.asset-file-not-equal.description': string
  'search.operator.asset-file-not-equal.name': string
  'search.operator.asset-image-equal.description': string
  'search.operator.asset-image-equal.name': string
  'search.operator.asset-image-not-equal.description': string
  'search.operator.asset-image-not-equal.name': string
  /**
   * Boolean value should be the given filter value (true/false).
   * Context passed is `true` and `false`, allowing for more specific translations:
   * - `search.operator.boolean-equal.description_true`
   * - `search.operator.boolean-equal.description_false`
   */
  'search.operator.boolean-equal.description': string
  'search.operator.boolean-equal.name': string
  'search.operator.date-after.description': string
  'search.operator.date-after.name': string
  'search.operator.date-before.description': string
  'search.operator.date-before.name': string
  'search.operator.date-equal.description': string
  'search.operator.date-equal.name': string
  'search.operator.date-last.description': string
  'search.operator.date-last.name': string
  'search.operator.date-not-equal.description': string
  'search.operator.date-not-equal.name': string
  'search.operator.date-range.description': string
  'search.operator.date-range.name': string
  'search.operator.date-time-after.description': string
  'search.operator.date-time-after.name': string
  'search.operator.date-time-before.description': string
  'search.operator.date-time-before.name': string
  'search.operator.date-time-equal.description': string
  'search.operator.date-time-equal.name': string
  'search.operator.date-time-last.description': string
  'search.operator.date-time-last.name': string
  'search.operator.date-time-not-equal.description': string
  'search.operator.date-time-not-equal.name': string
  'search.operator.date-time-range.description': string
  'search.operator.date-time-range.name': string
  'search.operator.defined.description': string
  'search.operator.defined.name': string
  'search.operator.not-defined.description': string
  'search.operator.not-defined.name': string
  'search.operator.number-equal.description': string
  'search.operator.number-equal.name': string
  'search.operator.number-gt.description': string
  'search.operator.number-gt.name': string
  'search.operator.number-gte.description': string
  'search.operator.number-gte.name': string
  'search.operator.number-lt.description': string
  'search.operator.number-lt.name': string
  'search.operator.number-lte.description': string
  'search.operator.number-lte.name': string
  'search.operator.number-not-equal.description': string
  'search.operator.number-not-equal.name': string
  'search.operator.number-range.description': string
  'search.operator.number-range.name': string
  'search.operator.portable-text-contains.description': string
  'search.operator.portable-text-contains.name': string
  'search.operator.portable-text-equal.description': string
  'search.operator.portable-text-equal.name': string
  'search.operator.portable-text-not-contains.description': string
  'search.operator.portable-text-not-contains.name': string
  'search.operator.portable-text-not-equal.description': string
  'search.operator.portable-text-not-equal.name': string
  'search.operator.reference-asset-file.description': string
  'search.operator.reference-asset-file.name': string
  'search.operator.reference-asset-image.description': string
  'search.operator.reference-asset-image.name': string
  'search.operator.reference-document.description': string
  'search.operator.reference-document.name': string
  'search.operator.reference-equal.description': string
  'search.operator.reference-equal.name': string
  'search.operator.reference-not-equal.description': string
  'search.operator.reference-not-equal.name': string
  'search.operator.slug-contains.description': string
  'search.operator.slug-contains.name': string
  'search.operator.slug-equal.description': string
  'search.operator.slug-equal.name': string
  'search.operator.slug-not-contains.description': string
  'search.operator.slug-not-contains.name': string
  'search.operator.slug-not-equal.description': string
  'search.operator.slug-not-equal.name': string
  'search.operator.string-contains.description': string
  'search.operator.string-contains.name': string
  'search.operator.string-equal.description': string
  'search.operator.string-equal.name': string
  'search.operator.string-list-equal.description': string
  'search.operator.string-list-equal.name': string
  'search.operator.string-list-not-equal.description': string
  'search.operator.string-list-not-equal.name': string
  'search.operator.string-not-contains.description': string
  'search.operator.string-not-contains.name': string
  'search.operator.string-not-equal.description': string
  'search.operator.string-not-equal.name': string
  /** Label for the "Best match" search ordering type */
  'search.ordering.best-match-label': string
  /** Label for the "Created: Oldest first" search ordering type */
  'search.ordering.created-ascending-label': string
  /** Label for the "Created: Newest first" search ordering type */
  'search.ordering.created-descending-label': string
  /** Label for the "Updated: Oldest first" search ordering type */
  'search.ordering.updated-ascending-label': string
  /** Label for the "Updated: Newest first" search ordering type */
  'search.ordering.updated-descending-label': string
  /** Placeholder text for the global search input field */
  'search.placeholder': string
  /** Accessibility label for the recent searches section, shown when no valid search terms has been given */
  'search.recent-searches-aria-label': string
  /** Label/heading shown for the recent searches section */
  'search.recent-searches-label': string
  /** Accessibility label for the search results section, shown when the user has typed valid terms */
  'search.search-results-aria-label': string
  /** Accessibility label for the navbar status button */
  'status-button.aria-label': string
  /** Description for error when the timeline for the given document can't be loaded */
  'timeline.error.load-document-changes-description': string
  /** Title for error when the timeline for the given document can't be loaded */
  'timeline.error.load-document-changes-title': string
  /** Error description for when the document doesn't have history */
  'timeline.error.no-document-history-description': string
  /** Error title for when the document doesn't have history */
  'timeline.error.no-document-history-title': string
  /** Error prompt when revision cannot be loaded */
  'timeline.error.unable-to-load-revision': string
  /** Label for when the timeline item is the latest in the history */
  'timeline.latest': string
  /** Label for latest version for timeline menu dropdown */
  'timeline.latest-version': string
  /** The aria-label for the list of revisions in the timeline */
  'timeline.list.aria-label': string
  /** Label for loading history */
  'timeline.loading-history': string
  /** Label shown in review changes timeline when a document has been created */
  'timeline.operation.created': string
  /** Label shown in review changes timeline when a document was initially created */
  'timeline.operation.created-initial': string
  /** Label shown in review changes timeline when a document was initially created, with a timestamp */
  'timeline.operation.created-initial_timestamp': string
  /** Label shown in review changes timeline when a document has been created, with a timestamp */
  'timeline.operation.created_timestamp': string
  /** Label shown in review changes timeline when a document has been deleted */
  'timeline.operation.deleted': string
  /** Label shown in review changes timeline when a document has been deleted, with a timestamp */
  'timeline.operation.deleted_timestamp': string
  /** Label shown in review changes timeline when a draft has been discarded */
  'timeline.operation.draft-discarded': string
  /** Label shown in review changes timeline when a draft has been discarded, with a timestamp */
  'timeline.operation.draft-discarded_timestamp': string
  /** Label shown in review changes timeline when a draft has been edited */
  'timeline.operation.edited-draft': string
  /** Label shown in review changes timeline when a draft has been edited, with a timestamp */
  'timeline.operation.edited-draft_timestamp': string
  /** Label shown in review changes timeline when a document has been edited live */
  'timeline.operation.edited-live': string
  /** Label shown in review changes timeline when a document has been edited live, with a timestamp */
  'timeline.operation.edited-live_timestamp': string
  /** Label shown in review changes timeline when a document was published */
  'timeline.operation.published': string
  /** Label shown in review changes timeline when a document was published, with a timestamp */
  'timeline.operation.published_timestamp': string
  /** Label shown in review changes timeline when a document was unpublished */
  'timeline.operation.unpublished': string
  /** Label shown in review changes timeline when a document was unpublished, with a timestamp */
  'timeline.operation.unpublished_timestamp': string
  /**
   * Label for determining since which version the changes for timeline menu dropdown are showing.
   * Receives the time label as a parameter (`timestamp`).
   */
  'timeline.since': string
  /** Label for missing change version for timeline menu dropdown are showing */
  'timeline.since-version-missing': string
  /**Aria label for the action buttons in the PTE toolbar */
  'toolbar.portable-text.action-button-aria-label': string
  /** Label for the button showed after trial ended */
  'user-menu.action.free-trial-finished': string
  /** Label for button showing the free trial days left */
  'user-menu.action.free-trial_one': string
  'user-menu.action.free-trial_other': string
  /** Label for action to invite members to the current sanity project */
  'user-menu.action.invite-members': string
  /** Accessibility label for action to invite members to the current sanity project */
  'user-menu.action.invite-members-aria-label': string
  /** Label for action to manage the current sanity project */
  'user-menu.action.manage-project': string
  /** Accessibility label for the action to manage the current project */
  'user-menu.action.manage-project-aria-label': string
  /** Tooltip helper text when portable text annotation is disabled for empty block*/
  'user-menu.action.portable-text.annotation-disabled_empty-block': string
  /** Tooltip helper text when portable text annotation is disabled for multiple blocks */
  'user-menu.action.portable-text.annotation-disabled_multiple-blocks': string
  /** Label for action to sign out of the current sanity project */
  'user-menu.action.sign-out': string
  /** Title for appearance section for the current studio (dark / light / system scheme) */
  'user-menu.appearance-title': string
  /** Label for close menu button for user menu */
  'user-menu.close-menu': string
  /** Description for using the "dark theme" in the appearance user menu */
  'user-menu.color-scheme.dark-description': string
  /** Title for using the "dark theme" in the appearance user menu */
  'user-menu.color-scheme.dark-title': string
  /** Description for using the "light theme" in the appearance user menu */
  'user-menu.color-scheme.light-description': string
  /** Title for using the "light theme" in the appearance user menu */
  'user-menu.color-scheme.light-title': string
  /** Description for using "system apparence" in the appearance user menu */
  'user-menu.color-scheme.system-description': string
  /** Title for using system apparence in the appearance user menu */
  'user-menu.color-scheme.system-title': string
  /** Title for locale section for the current studio */
  'user-menu.locale-title': string
  /** Label for tooltip to show which provider the currently logged in user is using */
  'user-menu.login-provider': string
  /** Label for open menu button for user menu */
  'user-menu.open-menu': string
  /**
   * Label for action to add a workspace (currently a developer-oriented action, as this will
   * lead to the documentation on workspace configuration)
   */
  'workspaces.action.add-workspace': string
  /**
   * Label for action to choose a different workspace, in the case where you are not logged in,
   * have selected a workspace, and are faced with the authentication options for the selected
   * workspace. In other words, label for the action shown when you have reconsidered which
   * workspace to authenticate in.
   */
  'workspaces.action.choose-another-workspace': string
  /** Label for heading that indicates that you can choose your workspace */
  'workspaces.choose-your-workspace-label': string
  /** Label for the workspace menu */
  'workspaces.select-workspace-aria-label': string
  /** Button label for opening the workspace switcher */
  'workspaces.select-workspace-label': string
  /** Tooltip for the workspace menu */
  'workspaces.select-workspace-tooltip': string
  /** Title for Workplaces dropdown menu */
  'workspaces.title': string
}

/**
 * @hidden
 * @beta */
export declare function StudioLogo(props: LogoProps): JSX_2.Element

/**
 * @hidden
 * @beta */
export declare function StudioNavbar(props: Omit<NavbarProps, 'renderDefault'>): JSX_2.Element

/**
 * @hidden
 * @beta */
export declare interface StudioProps {
  config: Config
  basePath?: string
  /**
   * Useful for scenarios where the Studio is embedded in another app,
   * and the surrounding app also implements light and dark color schemes.
   *
   * The callback is fired whenever the user selects a new color scheme in the "Appearance" menu in the top-right dropdown.
   * It also fires on first render with its initial value if you don't provide a `scheme` prop.
   *
   * If the user selects "System" in the "Appearance" menu, the callback will be fired with `"system"` as the scheme.
   * To resolve `"system"` to the same color scheme as the Studio use the `usePrefersDark` hook from `@sanity/ui`:
   *
   * ```tsx
   * import {usePrefersDark} from '@sanity/ui'
   * import {Studio} from 'sanity'
   *
   * export default function StudioPage() {
   *   const prefersDark = usePrefersDark()
   *   const [_scheme, setScheme] = useState('system')
   *   const prefersScheme = prefersDark ? 'dark' : 'light'
   *   const scheme = _scheme === 'system' ? prefersScheme : _scheme
   *
   *   return (
   *     <AppLayout scheme={scheme}>
   *       <Studio config={config} onSchemeChange={setScheme} />
   *     </AppLayout>
   *   )
   * }
   * ```
   *
   *
   * @hidden
   * @beta
   */
  onSchemeChange?: (nextScheme: StudioThemeColorSchemeKey) => void
  /**
   * By default the Studio handles the color scheme itself, but you can provide a color scheme to use.
   * If you only define `scheme` then the top-right "Appearance" dropdown menu will be hidden,
   * and the Studio will stay in sync with the `scheme` prop.
   *
   * You may setup two-way sync and re-enable the "Appearance" dropdown menu by also providing an `onSchemeChange` callback:
   * ```tsx
   * import {Studio} from 'sanity'
   * import {useSession} from 'your-app'
   *
   * export default function StudioPage() {
   *   const session = useSession()
   *   // Overrides the default scheme to be what's in the app user session
   *   const [_scheme, setScheme] = useState(session.scheme)
   *   const scheme = _scheme === 'system' ? session.scheme : _scheme
   *
   *   return (
   *     <AppLayout scheme={scheme}>
   *       <Studio config={config} scheme={scheme} onSchemeChange={setScheme} />
   *     </AppLayout>
   *   )
   * }
   * ```
   *
   *
   * @hidden
   * @beta
   */
  scheme?: StudioThemeColorSchemeKey
  /**
   * @hidden
   * @beta */
  unstable_history?: RouterHistory
  /**
   * @hidden
   * @beta */
  unstable_globalStyles?: boolean
  /**
   * @hidden
   * @beta */
  unstable_noAuthBoundary?: boolean
}

/**
 * @hidden
 * @beta */
export declare function StudioProvider({
  children,
  config,
  basePath,
  onSchemeChange,
  scheme,
  unstable_history: history,
  unstable_noAuthBoundary: noAuthBoundary,
}: StudioProviderProps): JSX_2.Element

/**
 * @hidden
 * @beta */
export declare interface StudioProviderProps extends StudioProps {
  children: ReactNode
}

/** @public */
export declare interface StudioTheme
  extends Omit<
    RootTheme,
    | 'avatar'
    | 'button'
    | 'container'
    | 'focusRing'
    | 'input'
    | 'layer'
    | 'media'
    | 'radius'
    | 'shadows'
    | 'space'
    | 'styles'
    | 'color'
    | 'fonts'
  > {
  /** @internal */
  __dark?: boolean
  /** @internal */
  __legacy?: boolean
  /**
   * @deprecated this theme property is not configurable within the studio
   */
  avatar?: RootTheme['avatar']
  /**
   * @deprecated this theme property is not configurable within the studio
   */
  button?: RootTheme['button']
  /**
   * @deprecated this theme property is not configurable within the studio
   */
  container?: RootTheme['container']
  /**
   * @deprecated this theme property is not configurable within the studio
   */
  focusRing?: RootTheme['focusRing']
  /**
   * @deprecated this theme property is not configurable within the studio
   */
  input?: RootTheme['input']
  /**
   * @deprecated this theme property is not configurable within the studio
   */
  layer?: RootTheme['layer']
  /**
   * @deprecated this theme property is not configurable within the studio
   */
  media?: RootTheme['media']
  /**
   * @deprecated this theme property is not configurable within the studio
   */
  radius?: RootTheme['radius']
  /**
   * @deprecated this theme property is not configurable within the studio
   */
  shadows?: RootTheme['shadows']
  /**
   * @deprecated this theme property is not configurable within the studio
   */
  space?: RootTheme['space']
  /**
   * @deprecated this theme property is not configurable within the studio
   */
  styles?: RootTheme['styles']
  color?: RootTheme['color']
  fonts?: RootTheme['fonts']
}

/**
 * Used to specify light or dark mode, or to respect system settings (prefers-color-scheme media query) use 'system'
 * @public
 */
export declare type StudioThemeColorSchemeKey = ThemeColorSchemeKey | 'system'

/**
 * @hidden
 * @beta */
export declare function StudioToolMenu(props: ToolMenuProps): JSX_2.Element | null

/** @internal */
export declare const supportsTouch: boolean

/** @internal */
export declare interface SyncState {
  isSyncing: boolean
}

/**
 *
 * @hidden
 * @beta
 */
export declare function TagsArrayInput(props: TagsArrayInputProps): JSX_2.Element

/**
 *
 * @hidden
 * @beta
 */
export declare type TagsArrayInputProps = ArrayOfPrimitivesInputProps<string>

/**
 *
 * @hidden
 * @beta
 */
export declare function TelephoneInput(props: TelephoneInputProps): JSX_2.Element

/**
 *
 * @hidden
 * @beta
 */
export declare type TelephoneInputProps = StringInputProps

/**
 * An initial value template is a template that can be used to create a new documents.
 *
 * This allows a document type to have multiple different starting values while having the same
 * shared schema definition. Using parameters allows for dynamic template values.
 *
 * As the name implies, these are _initial_ values, not _default_ values. The distinction is that
 * the initial value is only set when the document is created - it is not "merged" into existing
 * documents that may lack values for fields.
 *
 * All document types will by default (automatically, behind the scenes) have an initial value
 * template generated for them, which will have the same ID as the schema type name. The value of
 * this template will be the value of the `initialValue` property on the schema type definition,
 * or an empty object if none is set.
 *
 * @public
 */
export declare interface Template<Params = any, Value = any> {
  /**
   * Template ID. Automatically generated templates will have the same ID as the schema type name.
   */
  id: string
  /**
   * Template title.
   */
  title: string
  i18n?: I18nTextRecord<'title'>
  /**
   * Schema type name the template belongs to. For the automatically generated templates,
   * this will be equal to the `id` property.
   */
  schemaType: string
  /**
   * Template icon. Rendered in places such as the "new document" dialog. Optional.
   * Inferred from the schema type icon if not set.
   */
  icon?: SchemaType['icon']
  /**
   * Value to use as initial value. Can either be a static object value, or a function that
   * resolves _to_ an object value. If using a function, it can be given a set of parameters,
   * which can then determine the value that is returned.
   */
  value: InitialValueProperty<Params, Value>
  /**
   * Array of parameters the template accepts. Currently not used (any parameters are accepted),
   * but by defining parameters, the templates that require parameters can be identified and
   * excluded from UIs that do not provide them.
   */
  parameters?: TemplateParameter[]
  /**
   * Template description. Rendered in places such as the "new document" dialog. Optional.
   *
   * @deprecated No longer used
   */
  description?: string
}

/** @public */
export declare type TemplateArrayFieldDefinition = TemplateFieldDefinition & {
  type: 'array'
  /** Defines items that are definition of. See {@link TemplateReferenceTarget} and {@link TypeTarget} */
  of: (TemplateReferenceTarget | TypeTarget)[]
}

/**
 * Field definition for a template parameter.
 * Closely resembles API used to define fields for object schema types.
 *
 * @public
 */
export declare interface TemplateFieldDefinition {
  /**
   * Parameter name. Must be unique within the template.
   */
  name: string
  /**
   * Parameter type, eg `string`, `number`, `boolean` etc.
   */
  type: string
  /**
   * Parameter type. Will be attempted to be automatically set if not given,
   * by title-casing the `name` property.
   */
  title?: string
  /**
   * Description for the parameter. Optional.
   * May be used in the future to explain the parameter in UIs.
   */
  description?: string
  /**
   * Optional bag of options for the parameter. Currently unused.
   */
  options?: {
    [key: string]: any
  }
}

/**
 * Represents the items that can appear in different parts of the Sanity studio when creating
 * new documents - examples being the "New document" button in the navigation bar,
 * the corresponding button in panes, as well as the "Create new" button on references.
 *
 * Differs from an actual _template_ in that a single template can be pointed at by multiple
 * different items. This is useful when the template can create different values based on
 * passed parameters.
 *
 * @public
 */
export declare interface TemplateItem {
  /**
   * ID for the template. Must be unique within the set of templates.
   */
  templateId: string
  /**
   * Title for the item.
   * Defaults to the title of the associated template.
   */
  title?: string
  i18n?: I18nTextRecord<'title'>
  /**
   * Parameters for the template - an object of any JSON-serializable values
   */
  parameters?: {
    [key: string]: any
  }
  /**
   * React icon for the item, if any.
   * Defaults to the icon for the associated template.
   */
  icon?: ElementType | ReactElement
  /**
   * Experimental: not fully supported yet
   * Hints at what the document ID for the new document should be.
   * Leave undefined to let the system decide.
   *
   * @experimental
   * @beta
   * @hidden
   */
  initialDocumentId?: string
  /**
   * @deprecated No longer used anywhere
   * @hidden
   */
  subtitle?: string
  /**
   * @deprecated No longer used anywhere
   * @hidden
   */
  description?: string
}

/** @internal */
export declare interface TemplateOption {
  id: string
  params?: Record<string, string | number | boolean>
}

/**
 * Parameter for a template. Closely resembles API used to define fields for object schema types.
 * See {@link TemplateFieldDefinition} and {@link TemplateArrayFieldDefinition}
 * @public
 */
export declare type TemplateParameter = TemplateFieldDefinition | TemplateArrayFieldDefinition

/** @internal */
export declare interface TemplatePermissionsOptions {
  grantsStore: GrantsStore
  schema: Schema
  templates: Template[]
  templateItems: InitialValueTemplateItem[]
  context: InitialValueResolverContext
}

/** @internal */
export declare interface TemplatePermissionsResult<TInitialValue = Record<string, unknown>>
  extends PermissionCheckResult,
    InitialValueTemplateItem {
  granted: boolean
  reason: string
  resolvedInitialValue: TInitialValue
  subtitle?: string
  template: Template
}

/**
 * @hidden
 * @beta */
export declare function TemplatePreview(props: TemplatePreviewProps): JSX_2.Element

/**
 * @hidden
 * @beta */
export declare interface TemplatePreviewProps {
  description?: ReactNode
  isPlaceholder?: boolean
  media?: MediaProps['media']
  mediaDimensions?: PreviewMediaDimensions
  subtitle?:
    | ElementType<{
        layout: 'default'
      }>
    | ReactNode
  title?:
    | ElementType<{
        layout: 'default'
      }>
    | ReactNode
}

/** @public */
export declare interface TemplateReferenceTarget {
  type: 'reference'
  /** Type to reference. See {@link TypeTarget} */
  to: TypeTarget | TypeTarget[]
}

/** @public */
export declare type TemplateResolver = ComposableOption<Template[], ConfigContext>

declare type TermsFiltersAdd = {
  filter: SearchFilter
  type: 'TERMS_FILTERS_ADD'
}

declare type TermsFiltersClear = {
  type: 'TERMS_FILTERS_CLEAR'
}

declare type TermsFiltersRemove = {
  filterKey: string
  type: 'TERMS_FILTERS_REMOVE'
}

declare type TermsFiltersSetOperator = {
  filterKey: string
  operatorType: string
  type: 'TERMS_FILTERS_SET_OPERATOR'
}

declare type TermsFiltersSetValue = {
  filterKey: string
  type: 'TERMS_FILTERS_SET_VALUE'
  value?: any
}

declare type TermsQuerySet = {
  type: 'TERMS_QUERY_SET'
  query: string
}

declare type TermsSet = {
  type: 'TERMS_SET'
  filters?: SearchFilter[]
  terms: SearchTerms
}

declare type TermsTypeAdd = {
  type: 'TERMS_TYPE_ADD'
  schemaType: SchemaType
}

declare type TermsTypeRemove = {
  type: 'TERMS_TYPE_REMOVE'
  schemaType: SchemaType
}

declare type TermsTypesClear = {
  type: 'TERMS_TYPES_CLEAR'
}

/**
 *
 * @hidden
 * @beta
 */
export declare interface TextComponents {
  diff?: ComponentType<any>
  field?: ComponentType<StringFieldProps>
  input?: ComponentType<StringInputProps>
  item?: ComponentType<PrimitiveItemProps>
  preview?: ComponentType<PreviewProps>
}

/**
 *
 * @hidden
 * @beta
 */
export declare function TextInput(props: TextInputProps): JSX_2.Element

/**
 *
 * @hidden
 * @beta
 */
export declare type TextInputProps = StringInputProps<TextSchemaType>

/** @internal */
export declare const TextWithTone: ForwardRefExoticComponent<
  Omit<TextWithToneProps, 'ref'> & RefAttributes<HTMLDivElement>
>

/** @internal */
export declare interface TextWithToneProps extends ComponentProps<typeof Text_2> {
  tone: ButtonTone
  dimmed?: boolean
}

export {TFunction}

/** @internal */
export declare interface TimeAgoOpts {
  minimal?: boolean
  agoSuffix?: boolean
}

/**
 * Timeline maintains information about the history of a document:
 * Grouping raw translog entries into sensible groups, replaying and
 * reconstructing different versions and abstract other details.
 *
 * Note that this class by itself is not capable of _fetching_ information,
 * but will only organize and structure the incoming translog entries.
 *
 *
 * @hidden
 * @beta
 */
export declare class Timeline {
  reachedEarliestEntry: boolean
  publishedId: string
  draftId: string
  private _transactions
  private _chunks
  private _possiblePendingTransactions
  private _recreateTransactionsFrom?
  private _trace?
  constructor(opts: TimelineOptions)
  get chunkCount(): number
  /** Maps over the chunk from newest to oldest. */
  mapChunks<T>(mapper: (chunk: Chunk, idx: number) => T): T[]
  reset(): void
  /**
   * Adds a remote mutation to the timeline. This methods assumes that the remote mutations
   * come in correct order for their respective version, but has no ordering requirements
   * across draft/published.
   *
   * Example: [D1, D2, P1] (where D1 and P1 were mutations done to the draft and published
   * version in the same transaction) is a valid input. [P1, D2, D1] is _not_ valid since
   * the mutation for the draft is out of order.
   */
  addRemoteMutation(entry: DocumentRemoteMutationVersionEvent): void
  addTranslogEntry(event: TransactionLogEventWithEffects): void
  /** Mark that we've reached the earliest entry. */
  didReachEarliestEntry(): void
  /**
   * updateChunks synchronizes the chunks to match the current state
   * of the transactions array. After calling this method you need
   * to invalidate all Chunks.
   */
  updateChunks(): void
  private _removeInvalidatedChunks
  private _addChunksFromTransactions
  private _invalidateTransactionFrom
  private _createInitialChunk
  /**
   * Resolves a time reference.
   *
   * Note that the chunk returned is only valid if the timeline stays constant.
   * Once the timeline is updated, you must re-parse all references.
   */
  parseTimeId(id: string): ParsedTimeRef
  findLastPublishedBefore(chunk: Chunk | null): ParsedTimeRef
  isLatestChunk(chunk: Chunk): boolean
  createTimeId(chunk: Chunk): string
  lastChunk(): Chunk
  transactionByIndex(idx: number): Transaction | null
  chunkByTransactionIndex(idx: number, startChunkIdx?: number): Chunk
  replayBackwardsBetween(firstIdx: number, lastIdx: number, doc: CombinedDocument): CombinedDocument
  replayBackwardsUntil(firstIdx: number, doc: CombinedDocument): CombinedDocument
  calculateDiff(
    initialDoc: CombinedDocument,
    finalDoc: CombinedDocument,
    firstIdx: number,
    lastIdx: number,
  ): Diff_2<Annotation>
}

/**
 * The controller is responsible for fetching information
 * about a document and maintaining a Timeline.
 *
 *
 * @hidden
 * @beta
 */
export declare class TimelineController {
  timeline: Timeline
  client: SanityClient
  handler: TimelineControllerOptions['handler']
  version: number
  /**
   * The selection state represents the  different states of the current selection:
   * - inactive: No selection is active.
   * - rev: A selection is active for a single revision.
   * - range: A selection is active for a range and we have all the data needed to render it.
   * - loading: A selection is active, but we don't have the entries yet.
   * - invalid: The selection picked is invalid.
   */
  selectionState: SelectionState
  constructor(options: TimelineControllerOptions)
  private _aligner
  private _fetchMore
  private _fetchAtLeast
  private _isRunning
  private _isSuspended
  private _didErr
  private _since
  private _sinceTime
  private _rev
  private _revTime
  private _reconstruction?
  clearRange(): void
  setRange(since: string | null, rev: string | null): void
  setLoadMore(flag: boolean): void
  get sinceTime(): Chunk | null
  get revTime(): Chunk | null
  get realRevChunk(): Chunk
  /** Returns true when there's an older revision we want to render. */
  onOlderRevision(): boolean
  findRangeForNewRev(rev: Chunk): [string | null, string | null]
  findRangeForNewSince(since: Chunk): [string, string | null]
  setRevTime(rev: string | null): void
  setSinceTime(since: string | null): void
  sinceAttributes(): Record<string, unknown> | null
  displayed(): Record<string, unknown> | null
  setReconstruction(since: Chunk | null, rev: Chunk): void
  currentDiff(): Diff_2<Annotation> | null
  currentObjectDiff(): ObjectDiff_2<Annotation> | null
  handleRemoteMutation(ev: RemoteSnapshotVersionEvent): void
  start(): void
  resume(): void
  suspend(): void
  private tick
  private fetchMoreTransactions
  private markChange
}

/**
 * @hidden
 * @beta */
export declare type TimelineControllerOptions = {
  timeline: Timeline
  client: SanityClient
  documentId: string
  documentType: string
  handler?: (err: Error | null, controller: TimelineController) => void
}

/**
 * @hidden
 * @beta */
export declare interface TimelineOptions {
  publishedId: string
  enableTrace?: boolean
}

/** @internal */
export declare interface TimelineState {
  chunks: Chunk[]
  diff: ObjectDiff_2<Annotation, Record<string, any>> | null
  /** null is used here when the chunks hasn't loaded / is not known */
  hasMoreChunks: boolean | null
  isLoading: boolean
  /**
   * Whether this timeline is fully loaded and completely empty (true for new documents)
   * It can be `null` when the chunks hasn't loaded / is not known
   */
  isPristine: boolean | null
  lastNonDeletedRevId: string | null
  onOlderRevision: boolean
  realRevChunk: Chunk | null
  revTime: Chunk | null
  selectionState: SelectionState
  sinceAttributes: Record<string, unknown> | null
  sinceTime: Chunk | null
  timelineDisplayed: Record<string, unknown> | null
  timelineReady: boolean
}

/** @internal */
export declare interface TimelineStore {
  findRangeForRev: TimelineController['findRangeForNewRev']
  findRangeForSince: TimelineController['findRangeForNewSince']
  loadMore: () => void
  getSnapshot: () => TimelineState
  subscribe: (callback: () => void) => () => void
}

/** @internal */
export declare interface ToastParams {
  closable?: boolean
  description?: ReactNode
  duration?: number
  onClose?: () => void
  title?: ReactNode
  status?: 'error' | 'warning' | 'success' | 'info'
}

/**
 * @internal
 */
export declare function toMutationPatches(patches: FormPatch[]): MutationPatch[]

/**
 * A tool can be thought of as a top-level "view" or "app".
 * They are available through the global menu bar, and has a URL route associated with them.
 *
 * In essence, a tool is a React component that is rendered when the tool is active,
 * along with a title, name (URL segment) and icon.
 *
 * Tools can handle {@link structure.Intent | intents} such as "edit" or "create" by defining a
 * function for the `canHandleIntent` property, as well as the `getIntentState` property,
 * which defines what an intent will be mapped to in terms of the tool's URL state.
 *
 * @public
 */
export declare interface Tool<Options = any> {
  /**
   * The React component that renders the tool.
   */
  component: ComponentType<{
    tool: Tool<Options>
  }>
  /**
   * React component for the icon representing the tool.
   *
   * @deprecated Tool icons are no longer displayed.
   */
  icon?: ComponentType
  /**
   * The name of the tool, used as part of the URL.
   */
  name: string
  /**
   * Options are passed through from the configuration to the component defined by the `component`
   */
  options?: Options
  /**
   * The router for the tool. See {@link router.Router}
   */
  router?: Router
  /**
   * Title of the tool - used for the navigation menu item, along with the icon.
   */
  title: string
  /**
   * Determines whether the tool will control the `document.title`.
   */
  controlsDocumentTitle?: boolean
  /**
   * Gets the state for the given intent.
   *
   * @param intent - The intent to get the state for.
   * @param params - The parameters for the intent.
   * @param routerState - The current router state. See {@link router.RouterState}
   * @param payload - The payload for the intent.
   * @returns The state for the intent.
   */
  getIntentState?: (
    intent: string,
    params: Record<string, string>,
    routerState: RouterState | undefined,
    payload: unknown,
  ) => unknown
  /**
   * Determines whether the tool can handle the given intent.
   *
   * Can either return a boolean, or an object where the keys represent the parameters that
   * can/can not be handled. This will be used to determine whether or not a tool is the best
   * suited to handle an intent. Note that an object of only `false` values (or an empty object)
   * is treated as `true`, so you want to explicitly return `false` if you know the intent cannot
   * fulfill the intent request.
   *
   * @param intent - The intent to check.
   * @param params - The parameters for the intent.
   * @param payload - The payload for the intent.
   * @returns Boolean: whether it can handle the intent. Object: Values representing what specific parameters can be handled.
   */
  canHandleIntent?: (
    intent: string,
    params: Record<string, unknown>,
    payload: unknown,
  ) =>
    | boolean
    | {
        [key: string]: boolean
      }
}

/**
 * @hidden
 * @beta */
export declare const ToolLink: ForwardRefExoticComponent<
  Omit<ToolLinkProps & Omit<HTMLProps<HTMLAnchorElement>, 'name' | 'href'>, 'ref'> &
    RefAttributes<HTMLAnchorElement>
>

/**
 * @hidden
 * @beta */
export declare interface ToolLinkProps {
  children: ReactNode
  name: string
}

/**
 * @hidden
 * @beta */
export declare interface ToolMenuProps {
  activeToolName?: string
  closeSidebar: () => void
  context: 'sidebar' | 'topbar'
  isSidebarOpen: boolean
  tools: Tool[]
  renderDefault: (props: ToolMenuProps) => ReactElement
}

/** @internal */
export declare const TooltipOfDisabled: ForwardRefExoticComponent<
  Omit<TooltipProps_2, 'arrow' | 'padding' | 'shadow'> & {
    hotkeys?: string[] | undefined
  } & RefAttributes<HTMLDivElement>
>

/** @internal */
declare type TooltipProps = Omit<TooltipProps_2, 'arrow' | 'padding' | 'shadow'> & {
  hotkeys?: HotkeysProps_2['keys']
}

/** @internal */
export declare interface TrackedArea {
  element: HTMLElement
}

/** @internal */
export declare interface TrackedChange {
  element: HTMLElement
  path: Path
  isChanged: boolean
  hasFocus: boolean
  hasHover: boolean
  hasRevertHover: boolean
  zIndex: number
}

/** @internal */
export declare const Tracker:
  | (({children}: {children: ReactNode}) => JSX_2.Element)
  | ((props: {children: ReactNode}) => JSX_2.Element)

/** @internal */
export declare interface TrackerContext<Value> {
  add: (id: string, value: Value) => void
  update: (id: string, value: Value) => void
  remove: (id: string) => void
  read: () => Reported<Value>[]
  subscribe: (subscriber: Subscriber<Reported<Value>[]>) => () => void
}

/**
 * @hidden
 * @beta */
export declare interface Transaction {
  index: number
  id: string
  author: string
  timestamp: string
  draftEffect?: MendozaEffectPair
  publishedEffect?: MendozaEffectPair
}

declare interface TransactionSyncLockState {
  enabled: boolean
}

/**
 * @hidden
 * @beta */
export declare const TransformPatches: NamedExoticComponent<
  {
    transform: PatchTransformer
  } & {
    children: ReactNode
  }
>

/**
 * Component for translating i18n resources.
 *
 * Note that this component is more expensive to render than using the `t` function from
 * `useTranslate` directly, so prefer that if possible. Generally, the only valid use case
 * for this component is when the translation needs to render a React component as part of
 * the message.
 *
 * @public
 */
export declare function Translate(props: TranslationProps): JSX_2.Element

/**
 * A map of component names to React components. The component names are the names used within the
 * locale resources, eg a key of `SearchTerm` should be rendered as `<SearchTerm/>` or
 * `<SearchTerm>{{term}}</SearchTerm>` (no whitespace in tag, nor attributes).
 *
 * The components receives `children`, but no other props.
 *
 * @public
 */
export declare type TranslateComponentMap = Record<
  string,
  | ComponentType<{
      children?: ReactNode
    }>
  | keyof JSX.IntrinsicElements
>

/**
 * Props for the `Translate` component.
 *
 * @public
 */
export declare interface TranslationProps {
  /**
   * The `t` function to use, from the `useTranslation` hook
   */
  t: TFunction
  /**
   * The i18n resource key to translate
   */
  i18nKey: string
  /**
   * A map of component names to React components, used to render more complex content
   */
  components?: TranslateComponentMap
  /**
   * A string representing the "context" of the resource key.
   *
   * For an i18nKey of `greeter.greet-entity`, passing `context: 'human'` will look for a key of
   * `greeter.greet-entity_human` in the locale resources. If not found, it will fall back to the
   * base key (`greeter.greet-entity`).
   */
  context?: string
  /**
   * A map of values to interpolate into the translated string. The resources should use the
   * double curly bracket annotation to use them, eg `{{petName}}`. Will be escaped by React,
   * so no need to escape HTML.
   */
  values?: Record<string, string | string[] | number | undefined>
}

/**
 * Truncates a string to a given length, taking into account surrogate pairs and grapheme clusters
 * (using zero-width joiners). This means the resulting string may be longer in number of bytes,
 * but will be shorter in number of "characters". Should only be used for display purposes -
 * not for truncating strings for storage or similar.
 *
 * @param str - String to truncate
 * @param maxLength - Maximum length in "characters"
 * @returns The truncated string
 * @internal
 */
export declare function truncateString(str: string, maxLength: number): string

/**
 * This error may happen if the _type of the value is different from the declared schema type
 * It represents a case where we encounter field value that is structurally compatible with the field's defined schema type
 * (e.g. they are both json objects), but the _type name is different from what the schema type expects
 *
 * Note on compatibility: The schema of a field may be defined as an object with fields (a, b, c), but the value is an object with (d, e, f)
 * These are still structurally compatible because (d, e, f) will be considered undeclared members
 *
 * @public
 */
export declare type TypeAnnotationMismatchError = {
  type: 'TYPE_ANNOTATION_MISMATCH'
  expectedSchemaType: SchemaType
  resolvedValueType: string
}

/** @internal */
export declare type TypeChangeDiff = TypeChangeDiff_2<Annotation>

/**
 * @public
 */
export declare interface TypeTarget {
  type: string
}

/** @internal */
export declare const uncaughtErrorHandler: () => string

/**
 * This error may happen for objects if we encounter fields that are not declared in the schema
 *
 * @public
 */
export declare type UndeclaredMembersError = {
  type: 'UNDECLARED_MEMBERS'
  schemaType: ArraySchemaType
}

/**
 * Formats a number using the specified unit, using the currently active locale.
 *
 * @param value - The number to format
 * @param unit - The unit to format the number as
 * @returns The formatted number
 * @public
 */
export declare type UnitFormatter = (value: number, unit: FormattableMeasurementUnit) => string

/**
 * Universal array input that will introspect its schemaType and delegate to the right implementation
 * Useful as a fallback/last resort input for an array type
 *
 *
 * @hidden
 * @beta
 */
export declare function UniversalArrayInput(
  props: ArrayOfObjectsInputProps | ArrayOfPrimitivesInputProps,
): JSX_2.Element

/**
 * @hidden
 * @beta */
export declare function unset(path?: Path): FormUnsetPatch

/**
 * @internal
 * @deprecated FOR INTERNAL USE.
 */
export declare function unstable_useValuePreview(props: {
  enabled?: boolean
  ordering?: SortOrdering
  schemaType?: SchemaType
  value: unknown | undefined
}): State_2

/**
 *
 * @hidden
 * @beta
 */
export declare type Uploader<S extends SchemaType = SchemaType> = {
  type: string
  accepts: string
  upload: (
    client: SanityClient,
    file: File,
    type: S,
    options?: UploadOptions,
  ) => Observable<UploadProgressEvent>
  priority: number
}

/**
 * @internal
 */
export declare type UploaderDef = {
  type: string
  accepts: string
  upload: (client: SanityClient, file: File, type: SchemaType) => Observable<UploadProgressEvent>
}

/**
 *
 * @hidden
 * @beta
 */
export declare type UploaderResolver<S extends SchemaType = SchemaType> = (
  type: S,
  file: FileLike,
) => Uploader<S> | null

/**
 * @hidden
 * @beta */
export declare interface UploadEvent {
  file: File
  schemaType: SchemaType
  uploader: Uploader
}

/**
 *
 * @hidden
 * @beta
 */
export declare type UploadOptions = {
  metadata?: AssetMetadataType[]
  storeOriginalFilename?: boolean
  label?: string
  title?: string
  description?: string
  creditLine?: string
  source?: AssetSourceSpec
}

/**
 *
 * @hidden
 * @beta
 */
export declare type UploadProgressEvent = {
  type: 'uploadProgress'
  patches: FormPatch[] | null
}

/**
 * Portable text serializer for the description text for upsell elements.
 * Not meant for public consumption.
 * @internal
 */
export declare function UpsellDescriptionSerializer(
  props: DescriptionSerializerProps,
): JSX_2.Element

declare interface UpsellDialogActionsInfo {
  feature: 'comments' | 'scheduled_publishing' | 'ai_assist'
  type: 'modal' | 'inspector'
}

/**
 * @internal
 */
export declare const UpsellDialogDismissed: DefinedTelemetryLog<UpsellDialogActionsInfo>

/**
 * @internal
 */
export declare const UpsellDialogLearnMoreCtaClicked: DefinedTelemetryLog<UpsellDialogActionsInfo>

/**
 * @internal
 */
export declare const UpsellDialogUpgradeCtaClicked: DefinedTelemetryLog<UpsellDialogActionsInfo>

/**
 * @internal
 */
export declare const UpsellDialogViewed: DefinedTelemetryLog<UpsellDialogViewedInfo>

/** @internal */
export declare interface UpsellDialogViewedInfo extends UpsellDialogActionsInfo {
  source: 'field_action' | 'document_toolbar' | 'document_action' | 'navbar' | 'link' | 'pte'
}

/**
 *
 * @hidden
 * @beta
 */
export declare interface UrlComponents {
  diff?: ComponentType<any>
  field?: ComponentType<StringFieldProps>
  input?: ComponentType<StringInputProps>
  item?: ComponentType<PrimitiveItemProps>
  preview?: ComponentType<PreviewProps>
}

/**
 *
 * @hidden
 * @beta
 */
export declare function UrlInput(props: UrlInputProps): JSX_2.Element

/**
 *
 * @hidden
 * @beta
 */
export declare type UrlInputProps = StringInputProps

/** @internal */
export declare function useActiveWorkspace(): ActiveWorkspaceMatcherContextValue

/**
 * @beta
 * @hidden
 */
export declare function useAddonDataset(): AddonDatasetContextValue

/** @internal */
export declare function useAnnotationColor(annotation?: Annotation | null): UserColor

/**
 * React hook that returns a configured Sanity client instance based on the given configuration.
 * Automatically uses the correct project and dataset based on the current active workspace.
 *
 * @public
 * @param clientOptions - Options for the client. Specifying
 *   {@link https://www.sanity.io/docs/api-versioning | apiVersion} is required in order to
 *   prevent breaking changes if studio changes the API version used in other places.
 *   See {@link SourceClientOptions}
 * @returns A configured Sanity client instance
 * @remarks The client instance is automatically memoized based on API version
 * @example Instantiating a client
 * ```ts
 * function MyComponent() {
 *   const client = useClient({apiVersion: '2021-06-07'})
 *   // ... do something with client instance ...
 * }
 * ```
 */
export declare function useClient(clientOptions?: SourceClientOptions): SanityClient

/**
 * @deprecated Use `useColorSchemeValue` or `useColorSchemeSetValue` instead
 * @internal
 */
export declare function useColorScheme(): {
  scheme: 'light' | 'dark'
  setScheme: false | ((nextScheme: StudioThemeColorSchemeKey) => void)
}

/** @internal */
export declare function _useColorSchemeInternalValue(): StudioThemeColorSchemeKey

/**
 * @internal
 */
export declare function useColorSchemeOptions(
  setScheme: (nextScheme: StudioThemeColorSchemeKey) => void,
  t: TFunction<'studio', undefined>,
): (
  | {
      title: string
      name: 'system'
      label: string
      selected: boolean
      onSelect: () => void
      icon: ForwardRefExoticComponent<
        Omit<SVGProps<SVGSVGElement>, 'ref'> & RefAttributes<SVGSVGElement>
      >
    }
  | {
      title: string
      name: 'dark'
      label: string
      selected: boolean
      onSelect: () => void
      icon: ForwardRefExoticComponent<
        Omit<SVGProps<SVGSVGElement>, 'ref'> & RefAttributes<SVGSVGElement>
      >
    }
  | {
      title: string
      name: 'light'
      label: string
      selected: boolean
      onSelect: () => void
      icon: ForwardRefExoticComponent<
        Omit<SVGProps<SVGSVGElement>, 'ref'> & RefAttributes<SVGSVGElement>
      >
    }
)[]

/** @alpha */
export declare function useColorSchemeSetValue():
  | false
  | ((nextScheme: StudioThemeColorSchemeKey) => void)

/** @alpha */
export declare function useColorSchemeValue(): ThemeColorSchemeKey_2

/**
 * Reduce a {@link Source} down to a {@link ConfigContext}, memoizing using `useMemo`
 *
 * @param source - Source to convert
 * @returns A config context containing only the defined properties of that interface
 * @internal
 */
export declare function useConfigContextFromSource(source: Source): ConfigContext

/** @internal */
export declare function useConnectionState(
  publishedDocId: string,
  docTypeName: string,
): ConnectionState

/** @internal */
export declare function useConnectionStatusStore(): ConnectionStatusStore

/**
 * Returns the currently active locale
 *
 * @public
 */
export declare function useCurrentLocale(): Locale

/**
 * Retrieves information about the currently authenticated user.
 *
 * @returns The current user or null if not available.
 *
 * @public
 *
 * @example
 * ```ts
 * const currentUser = useCurrentUser()
 *
 * if (currentUser) {
 *  console.log('Logged in as', currentUser.name)
 * }
 * ```
 */
export declare function useCurrentUser(): CurrentUser | null

/**
 * React hook that returns the name of the current dataset
 *
 * @public
 * @returns The name of the current dataset
 * @example Using the `useDataset` hook
 * ```ts
 * function MyComponent() {
 *   const dataset = useDataset()
 *   // ... do something with the dataset name ...
 * }
 * ```
 */
export declare function useDataset(): string

/**
 * Returns an instance of `Intl.DateTimeFormat` that uses the currently selected locale,
 * and enables locale and culture-sensitive date formatting.
 *
 * @param options - Optional options for the date/time formatter
 * @returns Instance of `Intl.DateTimeFormat`
 * @public
 */
export declare function useDateTimeFormat(options?: UseDateTimeFormatOptions): Intl.DateTimeFormat

/**
 * Options for the `useDateTimeFormat` hook
 *
 * @public
 */
export declare type UseDateTimeFormatOptions = Omit<
  Intl.DateTimeFormatOptions,
  'fractionalSecondDigits'
>

/**
 * A hook for doing side effects as a response to a change in a hook value between renders
 *
 * @example
 * ```ts
 * useDidUpdate(hasFocus, (hadFocus, hasFocus) => {
 *  if (hasFocus) {
 *    scrollIntoView(elementRef.current)
 *   }
 * })
 * ```
 *
 * @beta
 * @hidden
 */
export declare function useDidUpdate<T>(
  /** The value you want to respond to changes in. */
  current: T,
  /** Callback to run when the value changes. */
  didUpdate: (previous: T | undefined, current: T) => void,
  compare?: (previous: T | undefined, current: T) => boolean,
): void

/** @internal */
export declare function useDiffAnnotationColor(diff: Diff, path?: string | Path): UserColor

/** @internal */
export declare function useDocumentChange(): DocumentChangeContextInstance

/** @internal */
export declare function useDocumentOperation(
  publishedDocId: string,
  docTypeName: string,
): OperationsAPI

/** @internal */
export declare function useDocumentOperationEvent(
  publishedDocId: string,
  docTypeName: string,
): OperationError | OperationSuccess | undefined

/** @internal */
export declare function useDocumentPairPermissions({
  id,
  type,
  permission,
  client: overrideClient,
  schema: overrideSchema,
  grantsStore: overrideGrantsStore,
}: PartialExcept<DocumentPairPermissionsOptions, 'id' | 'type' | 'permission'>): ReturnType<
  typeof useDocumentPairPermissionsFromHookFactory
>

/**
 * Gets document pair permissions based on a document ID and a type.
 *
 * This permissions API is a high-level permissions API that is draft-model
 * aware. In order to determine whether or not the user has the given
 * permission, both the draft and published documents are pulled and run through
 * all of the user's grants. If any pre or post conditions fail a permissions
 * checks, the operations will not be granted.
 *
 * The operations this hook accepts are only relevant to document pairs. E.g.
 * `'create'` is not included as an operation because it's not possible to tell
 * if a document can be created by only using the initial ID and type because an
 * initial template value may not have a matching grant (e.g. locked-document
 * pattern `!locked`). In contrast, the operation `'duplicate'` is supported
 * because the draft value of the document can be live queried and checked for
 * matching grants.
 *
 * Note: for live-edit documents, non-applicable operations (e.g. publish) will
 * return as true.
 *
 * @see useDocumentValuePermissions
 *
 * @internal
 */
export declare const useDocumentPairPermissionsFromHookFactory: ReactHook<
  DocumentPairPermissionsOptions,
  LoadingTuple<PermissionCheckResult | undefined>
>

/** @internal */
export declare function useDocumentPresence(documentId: string): DocumentPresence[]

/**
 * @hidden
 * @beta */
export declare function useDocumentPreviewStore(): DocumentPreviewStore

/**
 * @hidden
 * @beta */
export declare function useDocumentStore(): DocumentStore

/** @internal */
export declare function useDocumentType(
  documentId: string,
  specifiedType?: string,
): DocumentTypeResolveState

/** @internal */
export declare function useDocumentValuePermissions({
  document,
  permission,
  ...rest
}: PartialExcept<DocumentValuePermissionsOptions, 'permission' | 'document'>): ReturnType<
  typeof useDocumentValuePermissionsFromHookFactory
>

/**
 * Gets permissions based on the value of the document passed into the hook
 * (stateless).
 *
 * Note: this is a lower-level API (compared to `useDocumentPairPermissions`)
 * that is _not_ draft-model aware.
 *
 * As a consequence, the operations it accepts are also low-level. (e.g.
 * `'publish'` permissions can't be determined with this API). This is because
 * it's not possible to tell if a user can do high-level document pair
 * operations on document using only one document value.
 *
 * For example, in order to determine if a user can publish, the current value
 * of the published document needs to be pulled and checked against the user's
 * grants. If there are no matching grants, then it fails the pre-condition and
 * no operation is allowed regardless of the given document.
 *
 * @see useDocumentPairPermissions
 *
 * @internal
 */
export declare const useDocumentValuePermissionsFromHookFactory: ReactHook<
  DocumentValuePermissionsOptions,
  LoadingTuple<PermissionCheckResult | undefined>
>

/** @internal */
export declare function useDocumentValues<T = Record<string, unknown>>(
  documentId: string,
  paths: string[],
): LoadableState<T | undefined>

/** @internal */
export declare function useEditState(
  publishedDocId: string,
  docTypeName: string,
  priority?: 'default' | 'low',
): EditStateFor

/** @internal */
export declare function useFeatureEnabled(featureKey: string): Features

/** @internal */
export declare function useFieldActions(): FieldActionsContextValue

/**
 * Formats a duration (in milliseconds) to a more user friendly string eg `1h 30m` or `1t 29m 15s`.
 * Can be configured to output full units, eg `1 hour 30 minutes` or `1 hour 3 minutes 15 seconds`.
 * Uses the current locale, which also applies to the division of units.
 *
 * @example English (en-US) locale formatting
 * ```ts
 * useFormattedDuration(5589000)
 * // {"formatted": "1 hour, 33 minutes, and 9 seconds", "iso8601": "PT1H33M9S"}
 * ```
 *
 * @example Norwegian (no-NB) locale formatting
 * ```ts
 * useFormattedDuration(5589000)
 * // {"formatted": "1 time, 33 minutter og 9 sekunder", "iso8601": "PT1H33M9S"}
 * ```
 *
 * @param options - Optional options for the number formatter
 * @returns An object with `formatted` and `iso8601` properties
 * @public
 */
export declare function useFormattedDuration(
  durationMs: number,
  options?: UseFormattedDurationOptions,
): FormattedDuration

/**
 * Options for the duration formatter
 *
 * @public
 */
export declare interface UseFormattedDurationOptions {
  /**
   * The formatting style to use in unit and list formatting. The default is "short".
   */
  style?: 'short' | 'long' | 'narrow'
  /**
   * The resolution of the duration. The default is "seconds".
   */
  resolution?: 'seconds' | 'milliseconds'
}

/**
 *
 * @hidden
 * @beta
 */
export declare function useFormBuilder(): FormBuilderContextValue

/** @internal */
export declare function useFormCallbacks(): FormCallbacksValue

/** @internal */
export declare function useFormState<
  T extends {
    [key in string]: unknown
  } = {
    [key in string]: unknown
  },
  S extends ObjectSchemaType = ObjectSchemaType,
>(
  schemaType: ObjectSchemaType,
  {
    comparisonValue,
    value,
    fieldGroupState,
    collapsedFieldSets,
    collapsedPaths,
    focusPath,
    openPath,
    presence,
    validation,
    readOnly,
    changesOpen,
  }: {
    fieldGroupState?: StateTree<string> | undefined
    collapsedFieldSets?: StateTree<boolean> | undefined
    collapsedPaths?: StateTree<boolean> | undefined
    value: Partial<FIXME_SanityDocument>
    comparisonValue: Partial<FIXME_SanityDocument> | null
    openPath: Path
    focusPath: Path
    presence: FormNodePresence[]
    validation: ValidationMarker[]
    changesOpen?: boolean
    readOnly?: boolean
  },
): FormState<T, S> | null

/**
 * React hook that returns the value of the field specified by a path.
 * @public
 *
 * @param path - An array notation with segments that are either strings representing field names, index integers for arrays with simple values, or objects with a _key for arrays containing objects
 *
 * @returns The value of the field specified by the path
 *
 * @example Using the `useFormValue` hook
 * ```ts
 * function MyComponent() {
 *    // get value of field 'name' in object 'author'
 *    const authorName = useFormValue(['author', 'name'])
 *    // get value of the second item in array 'tags' of type 'string'
 *    const secondTag = useFormValue(['tags', 1])
 *    // get value of the reference with the matching key in an array of references
 *    const specificBook = useFormValue([ 'bibliography', {_key: '<key>'} ])
 *   // ... do something with the form values ...
 * }
 * ```
 */
export declare function useFormValue(path: Path): unknown

/**
 * Similar to `useI18nText` except returns a function that can be called
 * conditionally.
 * @internal
 */
export declare function useGetI18nText<TNode extends I18nNode<TNode>>(
  input: TNode | undefined | Array<TNode | undefined>,
): (node: TNode) => TNode

/** @internal */
export declare function useGlobalPresence(): GlobalPresence[]

/**
 * @hidden
 * @beta */
export declare function useGrantsStore(): GrantsStore

/**
 * @hidden
 * @beta */
export declare function useHistoryStore(): HistoryStore

/** @internal */
export declare function useHoveredField(): HoveredFieldContextValue

/**
 * A React hook for localizing strings in a given object (`node`) using the
 * `useTranslation` hook.
 *
 * This hook expects an object (`node`) with top-level keys associated with
 * string values. If an `i18n` property is present within the object, it should
 * contain localization configurations for each top-level key. Each
 * configuration must include a `key` and `ns` (namespace) used for the
 * translation of the corresponding string value.
 *
 * The hook uses a proxy to intercept access to properties of the `node`. For
 * properties defined in the `i18n` object, it returns the translated string
 * using the `t` function. If no translation is found, the original string value
 * is used as a fallback. For properties not defined in the `i18n` object, their
 * original values are returned.
 *
 * @param node - The object containing strings to be localized along with
 *  optional i18n configurations.
 * @returns A proxy of the original `node` object where each property access
 *  returns localized strings.
 * @internal
 */
export declare function useI18nText<TNode extends I18nNode<TNode>>(node: TNode): TNode

/**
 * @internal
 */
export declare function useInitialValue(props: {
  documentId: string
  documentType: string
  templateName?: string
  templateParams?: Record<string, unknown>
}): InitialValueState

/**
 * @internal
 */
export declare function useInitialValueResolverContext(): InitialValueResolverContext

/** @internal */
export declare function useKeyValueStore(): KeyValueStore

/**
 * Returns an instance of `Intl.ListFormat` that uses the currently selected locale,
 * and enables language-sensitive list formatting.
 *
 * @param options - Optional options for the list formatter
 * @returns Instance of `Intl.ListFormat`
 * @public
 */
export declare function useListFormat(options?: UseListFormatOptions): Intl.ListFormat

/**
 * Options for the `useListFormat` hook
 *
 * @public
 */
export declare interface UseListFormatOptions {
  /**
   * The format of output message.
   * - `conjunction` (read: "and") - default
   * - `disjunction` (read: "or")
   * - `unit` (just a list)
   */
  type?: Intl.ListFormatType | undefined
  /**
   * The length of the internationalized message.
   * This obviously varies based on language, but in US English this maps to:
   * - `long`: "a, b and c" - default
   * - `short`: "a, b & c"
   * - `narrow`: `a, b, c`
   */
  style?: Intl.ListFormatStyle | undefined
}

/** @internal */
export declare function useLoadable<T>(value$: Observable<T>): LoadableState<T | undefined>

/** @internal */
export declare function useLoadable<T>(value$: Observable<T>, initialValue: T): LoadableState<T>

/**
 * @hidden
 * @internal
 */
export declare function useLocale(): LocaleContextValue

/**
 * @internal
 * This hook returns a component based on the Components API middleware chain.
 *
 * - The `pick` function is used to select a component from the provided plugin options in the configuration.
 * - The `defaultComponent` is the default component that gets rendered with `renderDefault`.
 *   The `renderDefault` function is added to the props of the middleware components so that they can render the default
 *   component and continue the middleware chain.
 *
 * @example
 * Example usage of:
 *
 * ```ts
 *  const StudioLayout = useMiddlewareComponents({
 *   pick: (plugin) => plugin.studio?.components?.layout,
 *   defaultComponent: StudioLayout,
 *  })
 *
 * return <StudioLayout />
 *```
 */
export declare function useMiddlewareComponents<T extends {}>(props: {
  pick: (plugin: PluginOptions) => ComponentType<T>
  defaultComponent: ComponentType<T>
}): ComponentType<T>

/**
 * The default US English locale for the studio.
 *
 * @internal
 * @hidden
 */
export declare const usEnglishLocale: LocaleDefinition

/**
 * Returns an instance of `Intl.NumberFormat` that uses the currently selected locale,
 * and enables locale/language-sensitive number formatting.
 *
 * @param options - Optional options for the number formatter
 * @returns Instance of `Intl.NumberFormat`
 * @public
 */
export declare function useNumberFormat(options?: UseNumberFormatOptions): Intl.NumberFormat

/**
 * Options for the `useNumberFormat` hook
 *
 * @public
 */
export declare type UseNumberFormatOptions = Intl.NumberFormatOptions

/** @internal */
export declare function useOnScroll(callback: Subscriber<Event>): void

/**
 * @hidden
 * @beta */
export declare function usePresenceStore(): PresenceStore

/** @internal */
export declare function usePreviewCard(): PreviewCardContextValue

/** @internal */
export declare function useProject(): {
  value: ProjectData | null
}

/** @internal */
export declare function useProjectDatasets(): {
  value: ProjectDatasetData[] | null
}

/**
 * React hook that returns the current project id
 *
 * @public
 * @returns The current project id
 * @example Using the `useProjectId` hook
 * ```ts
 * function MyComponent() {
 *   const projectId = useProjectId()
 *   // ... do something with the project id ...
 * }
 * ```
 */
export declare function useProjectId(): string

/**
 * @hidden
 * @beta */
export declare function useProjectStore(): ProjectStore

/**
 * @hidden
 * @beta */
export declare function UserAvatar(props: UserAvatarProps): JSX_2.Element

/**
 * @hidden
 * @beta */
export declare interface UserAvatarProps {
  __unstable_hideInnerStroke?: AvatarProps['__unstable_hideInnerStroke']
  animateArrowFrom?: AvatarPosition
  position?: AvatarPosition
  size?: AvatarSize
  status?: AvatarStatus
  tone?: 'navbar'
  user: User | string
  withTooltip?: boolean
}

/** @internal */
export declare interface UserColor {
  name: ColorHueKey
  background: HexColor
  border: HexColor
  text: HexColor
  tints: ColorTints
}

/** @internal */
export declare type UserColorHue = string

/** @internal */
export declare interface UserColorManager {
  get: (userId: UserId | null) => UserColor
  listen: (userId: UserId) => Observable<UserColor>
}

/** @internal */
export declare interface UserColorManagerOptions {
  anonymousColor?: UserColor
  userStore?: {
    me: Observable<{
      id: string
    } | null>
  }
  colors?: Record<UserColorHue, UserColor>
  currentUserColor?: UserColorHue
  scheme: ThemeColorSchemeKey_2
}

/** @internal */
export declare function UserColorManagerProvider({
  children,
  manager: managerFromProps,
}: UserColorManagerProviderProps): ReactElement

/** @internal */
export declare interface UserColorManagerProviderProps {
  children: ReactNode
  manager?: UserColorManager
}

/**
 * @internal
 */
export declare function useReferenceInputOptions(): ReferenceInputOptions

/** @internal */
export declare function useRelativeTime(time: Date | string, options?: RelativeTimeOptions): string

/** @internal */
export declare const useReportedValues:
  | (() => Reported<TrackedChange | TrackedArea>[])
  | (() => Reported<TrackedChange | TrackedArea>[])

/** @internal */
export declare const useReporter:
  | ((
      id: string | null,
      value: TrackedChange | TrackedArea | (() => TrackedChange | TrackedArea),
    ) => void)
  | ReporterHook<TrackedChange | TrackedArea>

/** @internal */
export declare function useResolveInitialValueForType<Params extends Record<string, unknown>>(): (
  /**
   * This is the name of the document.
   */
  type: SchemaType,
  /**
   * Params is a sanity context object passed to every initial value function.
   */
  params: Params,
) => Promise<any>

/** @internal */
export declare function useResourceCache(): ResourceCache

/**
 * @internal
 */
export declare function useReviewChanges(): ReviewChangesContextValue

/**
 * Checks whether or not the given user has the role with the given ID
 *
 * @param user - The user to check (currently only the current user is supported)
 *   If `null` is passed, this function always returns `false`.
 * @param roleId - The ID of the role to check for
 *
 * @returns true if the user has the role, false otherwise
 *
 * @example
 * Fetch the current user and check if they have the role "administrator":
 * ```ts
 * import {userHasRole, useCurrentUser} from 'sanity'
 *
 * export function MyComponent() {
 *   const user = useCurrentUser()
 *   const hasAdminRole = userHasRole(user, 'administrator')
 *   return <div>Is administrator: {hasAdminRole ? 'Yes' : 'No'}</div>
 * }
 * ```
 * @public
 */
export declare function userHasRole(
  user:
    | (Omit<CurrentUser, 'role'> & {
        role?: string
      })
    | null,
  roleId: string,
): boolean

/** @internal */
export declare type UserId = string

/**
 * @beta
 * @hidden
 */
export declare type UserListWithPermissionsHookValue = Loadable<UserWithPermission[]>

/**
 * @beta
 */
export declare interface UserListWithPermissionsOptions {
  documentValue: SanityDocument_2 | null
  permission: DocumentValuePermission
}

/**
 * This hook handles focus with the keyboard arrows.
 *
 * @see {@link https://a11y-solutions.stevenwoodson.com/solutions/focus/roving-focus/ | Roving focus definition}
 *
 * @example
 * ```tsx
 * function MyComponent() {
 *   const [rootElement, setRootElement] = setRootElement(null)
 *
 *   useRovingFocus({
 *     rootElement: rootElement,
 *   })
 *
 *   return (
 *     <div ref={setRootElement}>
 *       <button>Button</button>
 *       <button>Button</button>
 *       <button>Button</button>
 *     </div>
 *   )
 * }
 * ```
 *
 *
 * @hidden
 * @beta
 */
export declare function useRovingFocus(props: RovingFocusProps): undefined

/** @internal */
export declare interface UserSessionPair {
  user: User
  session: Session
}

/**
 * @hidden
 * @beta */
export declare interface UserStore {
  getUser(userId: string): Promise<User | null>
  getUsers(userIds: string[]): Promise<User[]>
}

/** @internal */
export declare interface UserStoreOptions {
  client: SanityClient
  currentUser: CurrentUser | null
}

/**
 * @beta
 * @hidden
 */
export declare interface UserWithPermission extends User {
  granted: boolean
}

/**
 * React hook that returns the schema registry for the current project
 *
 * @public
 * @returns The schema registry for the current project
 * @example Using the `useSchema` hook
 * ```ts
 * function MyComponent() {
 *   const schema = useSchema()
 *   // ... do something with the schema ...
 * }
 * ```
 */
export declare function useSchema(): Schema

/**
 * @internal
 */
export declare function useSearchState(): SearchContextValue

/**
 * @internal
 * @deprecated INTERNAL USE ONLY
 */
export declare function useSource(): Source

/** @internal */
export declare function useSyncState(publishedDocId: string, documentType: string): SyncState

/** @internal */
export declare function useTemplatePermissions({
  templateItems,
  ...rest
}: PartialExcept<TemplatePermissionsOptions, 'templateItems'>): ReturnType<
  typeof useTemplatePermissionsFromHookFactory
>

/**
 * Takes in an array of initial template values and returns an object of
 * `TemplatePermissionsResult` keyed by the IDs of the initial template values
 * given.
 *
 * The `TemplatePermissionsResult` is an object that contains a `granted`
 * boolean per key and can be used to determine if a user has the ability to
 * create documents using the given initial value template items.
 *
 * For each initial template value item, the corresponding template is found and
 * resolved against the parameters in each the initial template value item. The
 * resolved value is then run through the document-value permissions. If there
 * are any matching grants for the resolved initial template value, the
 * `TemplatePermissionsResult` will include `granted: true`.
 *
 * @internal
 */
export declare const useTemplatePermissionsFromHookFactory: ReactHook<
  TemplatePermissionsOptions,
  LoadingTuple<TemplatePermissionsResult<Record<string, unknown>>[] | undefined>
>

/**
 *
 * @hidden
 * @beta
 */
export declare function useTemplates(): Template[]

/**
 * @internal
 *
 * @example
 * ```tsx
 * // First create a callback using React’s `useCallback` hook
 * const myCallback = useCallback(() => {
 *   // this is not throttled
 * }, [])
 *
 * // Then make a throttled version using the `useThrottledCallback` hook
 * const myThrottledCallback = useThrottledCallback(myCallback, 100)
 *
 * // Call the throttled callback
 * <Button onClick={myThrottledCallback} />
 * ```
 */
export declare function useThrottledCallback(
  callback: (...args: any[]) => any,
  wait: number,
  options: ThrottleSettings,
): (...args: any[]) => any

/**
 * @deprecated - Use {@link useRelativeTime} instead
 * @internal
 */
export declare function useTimeAgo(time: Date | string, options?: TimeAgoOpts): string

declare interface UseTimelineControllerOpts {
  documentId: string
  documentType: string
  onError?: (err: Error) => void
  rev?: string
  since?: string
}

/**
 * Custom hook which wraps around `useSyncExternalStore`.
 * Accepts a selector function which can be used to opt-in to specific timelineStore updates.
 *
 * @internal
 */
export declare function useTimelineSelector<ReturnValue>(
  timelineStore: TimelineStore,
  selector: (timelineState: TimelineState) => ReturnValue,
): ReturnValue

/**
 * Creates a store which handles the creation of a document Timeline,
 * TimelineController and also fetches pre-requisite document snapshots.
 *
 * `TimelineStore` exposes select TimelineController methods used to query
 * ranges and fetch more transactions. It can also be used with
 * `useSyncExternalStore` to subscribe to selected state changes.
 *
 * @internal
 * */
export declare function useTimelineStore({
  documentId,
  documentType,
  onError,
  rev,
  since,
}: UseTimelineControllerOpts): TimelineStore

/**
 *
 * @hidden
 * @beta
 */
export declare function useTools(): Tool[]

/**
 * Returns a `t` translator function for the given namespace.
 *
 * If the given namespace is not loaded, it will trigger a suspense, and the component will resume
 * rendering once the namespace is loaded.
 *
 * @public
 */
export declare function useTranslation<
  Ns extends FlatNamespace | $Tuple<FlatNamespace> | undefined = undefined,
  KPrefix extends KeyPrefix<FallbackNs<Ns>> = undefined,
>(
  ns?: Ns,
  options?: UseTranslationOptions<KPrefix>,
): UseTranslationResponse<FallbackNs<Ns>, KPrefix>

/**
 * Options for the `useTranslate` hook
 *
 * @public
 */
export declare interface UseTranslationOptions<KPrefix> {
  /**
   * @deprecated Avoid using this, it may be
   */
  keyPrefix?: KPrefix
  lng?: string
}

/**
 * Return value from the `useTranslate` hook
 *
 * @public
 */
export declare type UseTranslationResponse<Ns extends Namespace, KPrefix> = {
  /**
   * The translate function for the given namespace(s)
   */
  t: TFunction<Ns, KPrefix>
}

/**
 * This React hook should be considered an escape hatch – to make sure that a value is the same
 * on every render. SHOULD NOT BE USED IN MOST CASES.
 * @deprecated please use `useMemo` and `useCallback` strategies instead to make deps stable, this hook runs comparisons on every single render and while each comparison can be fast, it quickly adds up
 *
 * @internal
 */
export declare function useUnique<ValueType>(value: ValueType): ValueType

/**
 * Returns a formatter with the given options. Function takes a number and the unit to format as
 * the second argument. The formatter will yield localized output, based on the users' selected
 * locale.
 *
 * This differs from regular `Intl.NumberFormat` in two ways:
 * 1. You do not need to instantiate a new formatter for each unit you want to format
 *    (still happens behind the scenes, but is memoized)
 * 2. The default unit display style (`unitDisplay`) is `long`
 *
 * @example
 * ```ts
 * function MyComponent() {
 *   const format = useUnitFormatter()
 *   return <div>{format(2313, 'meter')}</div>
 *   // en-US -> 2,313 meters
 *   // fr-FR -> 2 313 mètres
 * }
 * ```
 *
 * @param options - Optional options for the unit formatter
 * @returns Formatter function
 * @public
 */
export declare function useUnitFormatter(options?: UseUnitFormatterOptions): UnitFormatter

/**
 * Options for the `useUnitFormatter` hook
 *
 * @public
 */
export declare type UseUnitFormatterOptions = Pick<
  Intl.NumberFormatOptions,
  'notation' | 'signDisplay' | 'unitDisplay' | 'maximumFractionDigits' | 'minimumFractionDigits'
>

/** @internal */
export declare function useUser(userId: string): LoadingTuple<User | null | undefined>

/** @internal */
export declare function useUserColor(userId: string | null): UserColor

/** @internal */
export declare function useUserColorManager(): UserColorManager

/**
 * @beta
 * Returns a list of users with the specified permission on the document.
 * If no document is provided it will return all as `granted: true`
 */
export declare function useUserListWithPermissions(
  opts: UserListWithPermissionsOptions,
): UserListWithPermissionsHookValue

/**
 * @hidden
 * @beta */
export declare function useUserStore(): UserStore

/** @internal */
export declare function useValidationStatus(
  publishedDocId: string,
  docTypeName: string,
): ValidationStatus

/**
 * @internal
 */
export declare function useVirtualizerScrollInstance(): VirtualizerScrollInstance

/**
 * @hidden
 * @beta */
export declare function useWorkspace(): Workspace

/**
 * @internal
 */
export declare function useWorkspaceLoader(activeWorkspace: WorkspaceSummary): Workspace | null

/** @internal */
export declare function useWorkspaces(): WorkspaceSummary[]

/**
 * TODO: Rename to `useZOffsets`
 *
 * @internal
 */
export declare function useZIndex(): ZIndexContextValue

/**
 * Validates the base paths of every workspace
 * Only exported for testing purposes
 *
 * @param workspaces - An array of workspaces
 * @internal
 */
export declare function validateBasePaths(workspaces: WorkspaceLike[]): void

/**
 * Validates a document against the schema in the given workspace. Returns an
 * array of validation markers with a path, message, and validation level.
 *
 * @beta
 */
export declare function validateDocument({
  document,
  workspace,
  environment,
  ...options
}: ValidateDocumentOptions): Promise<ValidationMarker[]>

/**
 * @beta
 */
export declare interface ValidateDocumentOptions {
  /**
   * The document to be validated
   */
  document: SanityDocument
  /**
   * The workspace instance (and associated schema) used to validate the given
   * document against.
   */
  workspace: Workspace
  /**
   * Function used to check if referenced documents exists (and is published).
   *
   * If you're validating many documents in bulk, you may want to query for all
   * document IDs first and provide your own implementation using those.
   *
   * If no function is provided a default one will be provided that will batch
   * call the `doc` endpoint to check for document existence.
   */
  getDocumentExists?: (options: {id: string}) => Promise<boolean>
  /**
   * The factory function used to get a sanity client used in custom validators.
   * If not provided, the one from the workspace will be used (preferred).
   *
   * @deprecated For internal use only
   */
  getClient?: (clientOptions: SourceClientOptions) => SanityClient
  /**
   * Specify the environment name. This will be passed down to the
   * `ValidationContext` and made available to custom validators.
   */
  environment?: 'cli' | 'studio'
  /**
   * The maximum amount of custom validation functions to be running
   * concurrently at once. This helps prevent custom validators from
   * overwhelming backend services (e.g. called via fetch) used in async,
   * user-defined validation functions. (i.e. `rule.custom(async() => {})`)
   */
  maxCustomValidationConcurrency?: number
}

/**
 * Validates the workspace names of every workspace
 * Only exported for testing purposes
 *
 * @param workspaces - An array of workspaces
 * @internal
 */
export declare function validateNames(workspaces: WorkspaceLike[]): void

/** @internal */
export declare interface ValidateWorkspaceOptions {
  workspaces: WorkspaceLike[]
}

/**
 * Validates workspace configuration, throwing if:
 *
 * - Workspaces do not all have base paths and names (if multiple given)
 * - Base paths or names are invalid
 * - Base paths or names are not unique
 *
 * @internal
 */
export declare function validateWorkspaces({workspaces}: ValidateWorkspaceOptions): void

/** @internal */
export declare const validation: (
  arg1: {
    client: SanityClient
    getClient: (options: SourceClientOptions) => SanityClient
    observeDocumentPairAvailability: ObserveDocumentPairAvailability
    schema: Schema
    i18n: LocaleSource
  },
  arg2: IdPair,
  arg3: string,
) => Observable<ValidationStatus>

/**
 * The i18n resource keys for the validation.
 *
 * @alpha
 * @hidden
 */
export declare type ValidationLocaleResourceKeys = keyof typeof validationLocaleStrings

/**
 * The string resources for validation.
 *
 * @internal
 * @hidden
 */
declare const validationLocaleStrings: {
  /** Array must have exactly "$wantedLength" items, but has more/less */
  readonly 'array.exact-length': 'Must have exactly {{wantedLength}} items'
  /** Portable Text array must have exactly "$wantedLength" blocks, but has more/less */
  readonly 'array.exact-length_blocks': 'Must have exactly {{wantedLength}} blocks'
  /** Array item is a duplicate, but array wants only unique items */
  readonly 'array.item-duplicate': "Can't be a duplicate"
  /** Array has more than the maximum of "$maxLength" items */
  readonly 'array.maximum-length': 'Must have at most {{maxLength}} items'
  /** Portable Text array has more than the maximum of "$maxLength" items */
  readonly 'array.maximum-length_blocks': 'Must have at most {{maxLength}} blocks'
  /** Array has less than the minimum of "$minLength" items */
  readonly 'array.minimum-length': 'Must have at least {{minLength}} items'
  /** Portable Text array has less than the minimum of "$minLength" blocks */
  readonly 'array.minimum-length_blocks': 'Must have at least {{minLength}} blocks'
  /** Date is not valid or not in the correct format (ISO-8601) */
  readonly 'date.invalid-format': 'Must be a valid ISO-8601 formatted date string'
  /** Date is later than the given maximum date "$maxDate" */
  readonly 'date.maximum': 'Must be at or before {{maxDate}}'
  /** Date is earlier than the given minimum date "$minDate" */
  readonly 'date.minimum': 'Must be at or after {{minDate}}'
  /** A value of incorrect type is found, eg found `number` instead of `string` */
  readonly 'generic.incorrect-type': 'Expected type "{{expectedType}}", got "{{actualType}}"'
  /** Value is not one of the values specifically allowed */
  readonly 'generic.not-allowed': 'Value did not match any allowed values'
  /** Value "$givenValue" is not one of the values specifically allowed */
  readonly 'generic.not-allowed_hint': 'Value "{{hint}}" did not match any allowed values'
  /** A value is expected, but none is provided */
  readonly 'generic.required': 'Required'
  /** Number is less than the given minimum threshold value "$threshold" */
  readonly 'number.greater-than': 'Must be greater than {{threshold}}'
  /** Number is greater than the given maximum threshold value "$threshold" */
  readonly 'number.less-than': 'Must be less than {{threshold}}'
  /** Number is higher than the given maximum value "$maxNumber" */
  readonly 'number.maximum': 'Must be lower than or equal to {{maxNumber}}'
  /** Number has more precision (decimals) than the allowed "$limit" */
  readonly 'number.maximum-precision': 'Max precision is {{limit}}'
  /** Number is lower than the given minimum value "$minNumber" */
  readonly 'number.minimum': 'Must be greater than or equal to {{minNumber}}'
  /** Number is not an integer ("whole number") */
  readonly 'number.non-integer': 'Must be an integer'
  /** Object is missing a reference to an asset document in its `asset` field */
  readonly 'object.asset-required': 'Asset is required'
  /** Object is missing a reference to a file asset document in its `asset` field */
  readonly 'object.asset-required_file': 'File is required'
  /** Object is missing a reference to an image asset document in its `asset` field */
  readonly 'object.asset-required_image': 'Image is required'
  /** Object is not a reference to a document (eg `{_ref: 'documentId'}`) */
  readonly 'object.not-reference': 'Must be a reference to a document'
  /** Object references a document which is not published */
  readonly 'object.reference-not-published': 'Referenced document must be published'
  /** Accessibility label for closing the validation panel */
  readonly 'panel.close-button-aria-label': 'Close validation'
  /** Message shown when the validation panel is opened but there are no errors/warnings */
  readonly 'panel.no-errors-message': 'No validation errors'
  /** Title for the actual "Validation" panel/feature */
  readonly 'panel.title': 'Validation'
  /** Slug is an object, but is missing a `current` string property */
  readonly 'slug.missing-current': 'Slug must have a value'
  /** Slug is not an object (eg `{current: 'some-slug'}`) */
  readonly 'slug.not-object': 'Slug must be an object'
  /** Slug is already in use somewhere else, but needs to be unique */
  readonly 'slug.not-unique': 'Slug is already in use'
  /** String is not a valid email address */
  readonly 'string.email': 'Must be a valid email address'
  /** String has a different character length than the exact number "$wantedLength" */
  readonly 'string.exact-length': 'Must be exactly {{wantedLength}} characters long'
  /** String contains characters that are not in lowercase  */
  readonly 'string.lowercase': 'Must be all lowercase characters'
  /** String is longer than the limit of "$maxLength" characters */
  readonly 'string.maximum-length': 'Must be at most {{maxLength}} characters long'
  /** String is shorter than the limit of "$minLength" characters */
  readonly 'string.minimum-length': 'Must be at least {{minLength}} characters long'
  /** String does not match the given regular expression, but should */
  readonly 'string.regex-does-not-match': 'Does not match "{{name}}"-pattern'
  /** String matches the given regular expression, but should not */
  readonly 'string.regex-match': 'Should not match "{{name}}"-pattern'
  /** String contains characters that are not in uppercase */
  readonly 'string.uppercase': 'Must be all uppercase characters'
  /** String contains a protocol/scheme that is not allowed, eg (`ftp`, `mailto`…) */
  readonly 'string.url.disallowed-scheme': 'Does not match allowed protocols/schemes'
  /** String contains a URL with a username or password specified before the host */
  readonly 'string.url.includes-credentials': 'Username/password not allowed'
  /** String is not a valid URL */
  readonly 'string.url.invalid': 'Not a valid URL'
  /** String is not an absolute URL (eg it is missing a protocol/host) */
  readonly 'string.url.not-absolute': 'Relative URLs are not allowed'
  /** String is not a relative URL (eg it contains a protocol/host) */
  readonly 'string.url.not-relative': 'Only relative URLs are allowed'
}

/**
 * @hidden
 * @beta */
export declare interface ValidationStatus {
  isValidating: boolean
  validation: ValidationMarker[]
  revision?: string
}

/** @internal */
export declare function ValueError({error}: {error: FieldValueError}): JSX_2.Element

/**
 * @alpha
 */
export declare interface ValuelessSearchOperatorBuilder<TType extends string>
  extends SearchOperatorBase {
  buttonValueComponent?: never
  groqFilter: (params: ValuelessSearchOperatorParams) => string | null
  initialValue?: never
  inputComponent?: never
  type: TType
}

/**
 * @alpha
 */
export declare type ValuelessSearchOperatorParams = {
  fieldPath?: string
}

/**
 * @internal
 */
export declare interface VirtualizerScrollInstance {
  /**
   * The parent that has the overflow scroll
   */
  scrollElement: HTMLElement | null
  /**
   * The container that wraps the array items
   */
  containerElement: MutableRefObject<HTMLElement | null>
}

/**
 * This is used to store the reference to the scroll element for virtualizer
 * @internal
 */
export declare const VirtualizerScrollInstanceContext: Context<VirtualizerScrollInstance | null>

/**
 *
 * @internal
 */
export declare function VirtualizerScrollInstanceProvider(
  props: VirtualizerScrollInstanceProviderProps,
): JSX_2.Element

/**
 * @internal
 */
declare interface VirtualizerScrollInstanceProviderProps extends VirtualizerScrollInstance {
  children: ReactNode
}

/**
 * Visit all diffs in tree, until visitor returns false
 *
 * @param diff - Diff to visit
 * @param visitor - Visitor function, return false to stop from going deeper
 *
 * @internal
 */
export declare function visitDiff(
  diff: Diff | StringDiffSegment,
  visitor: DiffVisitor,
  path?: Path,
): void

/** @internal */
export declare interface WelcomeEvent {
  type: 'welcome'
}

/**
 * @internal
 * @deprecated - Will be removed in 4.0.0, use the `useReferringDocuments(<documentId>)` hook instead
 */
export declare function WithReferringDocuments({
  children,
  id,
}: {
  children: (props: {isLoading: boolean; referringDocuments: SanityDocument[]}) => ReactElement
  /**
   * @deprecated - no longer required
   */
  documentStore?: DocumentStore
  id: string
}): ReactElement<any, string | JSXElementConstructor<any>>

/**
 * @hidden
 * @beta */
export declare type WithVersion<T> = T & {
  version: 'published' | 'draft'
}

/**
 * Definition for Workspace
 *
 * @public
 */
export declare interface Workspace extends Omit<Source, 'type'> {
  type: 'workspace'
  /**
   * URL base path to use, for instance `/myWorkspace`
   * Note that this will be prepended with any _studio_ base path, eg `/studio/myWorkspace`,
   * and is a client-side routing feature. If you're looking to serve your studio from a subpath,
   * you're probably looking for the `basePath` property in `sanity.cli.ts`/`sanity.cli.js`.
   */
  basePath: string
  /** Subtitle to show under the name of the workspace */
  subtitle?: string
  /** React component to use as icon for this workspace */
  icon: ReactNode
  /**
   *
   * @hidden
   * @beta
   */
  unstable_sources: Source[]
}

/** @internal */
export declare interface WorkspaceLike {
  name?: string
  title?: string
  basePath?: string
}

/**
 * @internal
 */
export declare function WorkspaceLoader({
  ConfigErrorsComponent,
  ...props
}: WorkspaceLoaderProps): JSX_2.Element

declare interface WorkspaceLoaderProps {
  children: ReactNode
  ConfigErrorsComponent: ComponentType
  LoadingComponent: ComponentType
}

/**
 * @hidden
 * @beta
 */
export declare interface WorkspaceOptions extends SourceOptions {
  basePath: string
  subtitle?: string
  /**
   * The workspace logo
   *
   * @deprecated Custom logo components are no longer supported.
   * Users are encouraged to provide custom components for individual workspace icons instead.
   */
  logo?: ComponentType
  icon?: ComponentType
  /**
   * @hidden
   * @beta
   */
  theme?: StudioTheme
  /**
   * @hidden
   * @beta
   */
  unstable_sources?: SourceOptions[]
  /**
   * @hidden
   * @beta
   */
  unstable_tasks?: {
    enabled: boolean
  }
}

/** @internal */
export declare function WorkspaceProvider({
  children,
  workspace,
}: WorkspaceProviderProps): JSX_2.Element

/** @internal */
export declare interface WorkspaceProviderProps {
  workspace: Workspace
  children?: ReactChild
}

/** @internal */
export declare const WorkspacesContext: Context<WorkspacesContextValue | null>

/** @internal */
export declare type WorkspacesContextValue = WorkspaceSummary[]

/** @internal */
export declare function WorkspacesProvider({
  config,
  children,
  basePath,
}: WorkspacesProviderProps): JSX_2.Element

/** @internal */
export declare interface WorkspacesProviderProps {
  config: Config
  children: ReactNode
  basePath?: string
}

/** @internal */
export declare interface WorkspaceSummary {
  type: 'workspace-summary'
  name: string
  title: string
  /**
   * User supplied component if provided, otherwise falls back to
   * an automatically generated default icon.
   */
  icon: ReactNode
  /** Returns true if a custom icon has been provided in studio config */
  customIcon: boolean
  subtitle?: string
  basePath: string
  auth: AuthStore
  projectId: string
  dataset: string
  theme: StudioTheme
  schema: Schema
  i18n: LocaleSource
  /**
   * @internal
   * @deprecated not actually deprecated but don't use or you'll be fired
   */
  __internal: {
    sources: Array<{
      name: string
      projectId: string
      dataset: string
      title: string
      auth: AuthStore
      schema: Schema
      i18n: LocaleSource
      source: Observable<Source>
    }>
  }
  tasks: WorkspaceOptions['unstable_tasks']
}

/**
 * TODO: Rename to `ZOffsetsContextValue`
 *
 * @internal
 */
export declare interface ZIndexContextValue {
  /** Used by: Navbar */
  navbar: number | number[]
  navbarPopover: number | number[]
  navbarDialog: number | number[]
  /** Used by: DefaultPane, DocumentPane */
  pane: number | number[]
  paneHeader: number | number[]
  paneFooter: number | number[]
  paneResizer: number | number[]
  paneDialog: number | number[]
  /** Used by: EditItemFoldOut, Spinner, ConnectorsOverlay, tippy.css, BaseDateTimeInput */
  portal: number | number[]
  /** Used by: Tooltip */
  popover: number | number[]
  /** Used by: `@sanity/google-maps-input` */
  modal: number | number[]
  /** TODO this path does not seem to be correct - fix?  */
  /** Used by: `movingItem` in packages/sanity/src/styles/layout/helpers.css */
  movingItem: number | number[]
  /** Used for shadow behind the navbar search, and behind sidemenu */
  drawershade: number | number[]
  /** Used by: Snackbar */
  drawer: number | number[]
  /** Used for UI that sits on top of the entire application */
  fullscreen: number | number[]
  /** Used for toasts */
  toast: number | number[]
  dropdown: number | number[]
  navbarFixed: number | number[]
  fullscreenEdit: number | number[]
  popoverBackground: number | number[]
  tooltip: number | number[]
  modalBackground: number | number[]
  spinner: number | number[]
}

/** @internal */
export declare type ZIndexContextValueKey = keyof ZIndexContextValue

/**
 * TODO: Rename to `ZOffsetsProvider`
 *
 * @internal
 */
export declare function ZIndexProvider({children}: {children?: ReactNode}): ReactElement

export * from '@sanity/types'

export {}

declare module '@sanity/types' {
  interface ArrayDefinition {
    /**
     *
     * @hidden
     * @beta
     */
    components?: ArrayOfObjectsComponents | ArrayOfPrimitivesComponents
  }
  interface BlockDefinition {
    /**
     * Components for the block schema type
     *
     * @public
     * @remarks - This only applies to the block text type, and not block object types (like images).
     * - Don't render arbitrary text nodes inside regular text blocks, as this will confuse the editor with
     * what is editable text and not. Make sure to wrap all nodes which are NOT part of the edited text inside a
     * container with `contentEditable={false}` and with `style={{userSelection: 'none'}}` so that
     * the editor can distinguish between editable text and non-editable text.
     * @example Example of custom block component with delete button next to it that removes the block.
     * ```ts
     * {
     *   block: (blockProps) => {
     *     return (
     *       <Flex>
     *         <Box flex={1}>{blockProps.renderDefault(blockProps)}</Box>
     *         <Box contentEditable={false} style={{userSelect: 'none'}}>
     *           <Button
     *             icon={TrashIcon}
     *             onClick={(event) => {
     *               event.preventDefault()
     *               blockProps.onRemove()
     *              }}
     *             />
     *         </Box>
     *       </Flex>
     *     )
     *   },
     * },
     * ```
     */
    components?: {
      block?: ComponentType<BlockProps>
    }
  }
  interface BlockDecoratorDefinition {
    /**
     * Component for rendering a decorator.
     *
     * See also {@link BlockDecoratorProps | BlockDecoratorProps}
     *
     * @public
     * @remarks - Try not to hard code CSS properties that could be derived from `@sanity/ui`.
     * This will make sure your rendering looks good independent of the theme context it appears in.
     * - Don't render arbitrary text nodes as this will confuse the editor with
     * what is editable text and not. If you need arbitrary text, make sure to wrap them in in a
     * container with `contentEditable={false}`.
     * @example Example of rendering custom decorator that highlights text.
     * ```ts
     * const Highlight = (props: BlockDecoratorProps) => (
     *   <span style={{backgroundColor: '#ff0'}}>
     *     {props.children}
     *   </span>
     * )
     * ```
     */
    component?: ComponentType<BlockDecoratorProps>
  }
  interface BlockStyleDefinition {
    /**
     * Component for rendering a text style.
     *
     * See also {@link BlockStyleProps | BlockStyleProps}
     *
     * @public
     * @remarks - Try not to hard code CSS properties that could be derived from `@sanity/ui`.
     * This will make sure your rendering looks good independent of the theme context it appears in.
     * - Don't render arbitrary text nodes as this will confuse the editor with
     * what is editable text and not. If you need arbitrary text, make sure to wrap them in in a
     * container with `contentEditable={false}`.
     * @example Example of rendering a custom style for article leads which is bigger,
     * and bolder, but will adapt to what the current `@sanity/ui` theme has defined
     * as actual values for weight "bold" and `size={3}`.
     * ```ts
     * import {Text} from '@sanity/ui'
     *
     * const LeadStyle = (props: BlockStyleProps) => (
     *   <Text weight="bold" size={3}>
     *     {props.children}
     *   </Text>
     * )
     * ```
     */
    component?: ComponentType<BlockStyleProps>
  }
  interface BlockListDefinition {
    /**
     * Component for rendering a block as a list item
     *
     * See also {@link BlockListItemProps | BlockListItemProps}
     *
     * @public
     * @remarks - Try not to hard code CSS properties that could be derived from `@sanity/ui`.
     * This will make sure your rendering looks good independent of the theme context it appears in.
     * - Don't render arbitrary text nodes as this will confuse the editor with
     * what is editable text and not. If you need arbitrary text, make sure to wrap them in in a
     * container with `contentEditable={false}`.
     */
    component?: ComponentType<BlockListItemProps>
  }
  interface BlockAnnotationDefinition {
    /**
     *
     * @hidden
     * @beta
     */
    components?: {
      annotation?: ComponentType<BlockAnnotationProps>
    }
  }
  interface BooleanDefinition {
    components?: BooleanComponents
  }
  interface DateDefinition {
    /**
     *
     * @hidden
     * @beta
     */
    components?: DateComponents
  }
  interface DatetimeDefinition {
    components?: DatetimeComponents
  }
  interface DocumentDefinition {
    /**
     *
     * @hidden
     * @beta
     */
    components?: DocumentComponents
  }
  interface FileDefinition {
    /**
     *
     * @hidden
     * @beta
     */
    components?: FileComponents
  }
  interface GeopointDefinition {
    /**
     *
     * @hidden
     * @beta
     */
    components?: GeopointComponents
  }
  interface ImageDefinition {
    /**
     *
     * @hidden
     * @beta
     */
    components?: ImageComponents
  }
  interface NumberDefinition {
    /**
     *
     * @hidden
     * @beta
     */
    components?: NumberComponents
  }
  interface ObjectDefinition {
    /**
     *
     * @hidden
     * @beta
     */
    components?: ObjectComponents
  }
  interface ReferenceDefinition {
    /**
     *
     * @hidden
     * @beta
     */
    components?: ReferenceComponents
  }
  interface CrossDatasetReferenceDefinition {
    /**
     *
     * @hidden
     * @beta
     */
    components?: CrossDatasetReferenceComponents
  }
  interface SlugDefinition {
    /**
     *
     * @hidden
     * @beta
     */
    components?: SlugComponents
  }
  interface SpanDefinition {
    components?: SpanComponents
  }
  interface StringDefinition {
    /**
     *
     * @hidden
     * @beta
     */
    components?: StringComponents
  }
  interface TextDefinition {
    /**
     *
     * @hidden
     * @beta
     */
    components?: TextComponents
  }
  interface UrlDefinition {
    /**
     *
     * @hidden
     * @beta
     */
    components?: UrlComponents
  }
  interface EmailDefinition {
    /**
     *
     * @hidden
     * @beta
     */
    components?: EmailComponents
  }
}
//# sourceMappingURL=definitionExtensions.d.ts.map

declare module '@sanity/types' {
  /**
   * Extended validation context that includes internationalization
   *
   * Why is this not directly part of `@sanity/types`, you ask?
   * Because `@sanity/types` shouldn't need to depend on the `i18next` package, which it needs
   * for the `TFunction` type. The `ValidationContext` should never have been part of the types
   * module in the first place, but is now unfortunately part of the public API and thus cannot
   * be changed easily.
   *
   * This is a temporary solution until we can remove the `ValidationContext` from the types module,
   * which is likely to happen at the next major version.
   *
   * @public
   */
  interface ValidationContext {
    /**
     * Internationalization utilities, for translation of validation messages
     *
     * See {@link LocaleSource} for details.
     */
    i18n: LocaleSource
  }
}
