import {ArraySchemaType} from '@sanity/types'
import {AssetMetadataType} from '@sanity/types'
import {AssetSource} from '@sanity/types'
import {AssetSourceSpec} from '@sanity/types'
import {BooleanSchemaType} from '@sanity/types'
import {ButtonTone} from '@sanity/ui'
import {CardProps} from '@sanity/ui'
import {ClientConfig} from '@sanity/client'
import {ComponentProps} from 'react'
import {ComponentType} from 'react'
import {ConfigContext} from 'sanity'
import {CrossDatasetReferenceValue} from '@sanity/types'
import {CSSProperties} from 'react'
import {CurrentUser} from '@sanity/types'
import {DialogProps} from '@sanity/ui'
import {DocumentActionComponent as DocumentActionComponent_2} from 'sanity'
import {DocumentBadgeComponent as DocumentBadgeComponent_2} from 'sanity'
import {DocumentFieldAction as DocumentFieldAction_2} from 'sanity'
import {DocumentFieldActionNode} from 'sanity'
import {DocumentFormNode} from 'sanity'
import {DocumentInspector as DocumentInspector_2} from 'sanity'
import {DocumentLanguageFilterComponent as DocumentLanguageFilterComponent_2} from 'sanity'
import {DocumentStore} from 'sanity'
import {EditorChange} from '@portabletext/editor'
import {EditorSelection} from '@portabletext/editor'
import {EditStateFor as EditStateFor_2} from 'sanity'
import {ErrorInfo} from 'react'
import {FileValue} from '@sanity/types'
import {FocusEvent as FocusEvent_2} from 'react'
import {FocusEventHandler} from 'react'
import {FormEventHandler} from 'react'
import {FormNodeValidation} from '@sanity/types'
import {GeneralPreviewLayoutKey} from 'sanity'
import {GeopointValue} from '@sanity/types'
import {HotkeyOptions} from '@portabletext/editor'
import {HTMLProps} from 'react'
import {I18nTextRecord} from 'sanity'
import {I18nTextRecord as I18nTextRecord_2} from '@sanity/types'
import {ImageUrlFitMode} from '@sanity/types'
import {ImageValue} from '@sanity/types'
import {InitialValueProperty} from '@sanity/types'
import {InitialValueTemplateItem} from 'sanity'
import {JSX as JSX_2} from 'react'
import {KeyedSegment} from '@sanity/types'
import {LocaleSource} from 'sanity'
import {MemoExoticComponent} from 'react'
import {MutableRefObject} from 'react'
import {NamedExoticComponent} from 'react'
import {NumberSchemaType} from '@sanity/types'
import {ObjectSchemaType} from '@sanity/types'
import {Observable} from 'rxjs'
import {OnCopyFn} from '@portabletext/editor'
import {OnPasteFn} from '@portabletext/editor'
import {PatchEvent as PatchEvent_2} from 'sanity'
import {Path} from '@sanity/types'
import {PathSegment} from '@sanity/types'
import {PermissionCheckResult} from 'sanity'
import {PortableTextBlock} from '@sanity/types'
import {PortableTextEditableProps} from '@portabletext/editor'
import {PortableTextEditor} from '@portabletext/editor'
import {PortableTextObject} from '@sanity/types'
import {PreviewLayoutKey} from 'sanity'
import {RangeDecoration} from '@portabletext/editor'
import {ReactNode} from 'react'
import {ReferenceValue} from '@sanity/types'
import {ReleaseId} from 'sanity'
import {RenderEditableFunction} from '@portabletext/editor'
import {RootTheme} from '@sanity/ui/theme'
import {Router} from 'sanity/router'
import {RouterState} from 'sanity/router'
import {SanityClient} from '@sanity/client'
import {SanityDocument} from '@sanity/types'
import {SanityDocumentLike} from '@sanity/types'
import {Schema} from '@sanity/types'
import {SchemaType} from '@sanity/types'
import {SchemaTypeDefinition} from '@sanity/types'
import {SearchParam} from 'sanity/router'
import {SearchStrategy} from '@sanity/types'
import {SlugValue} from '@sanity/types'
import {SortOrdering} from '@sanity/types'
import {SortOrderingItem} from '@sanity/types'
import {Source} from 'sanity'
import {StateTree} from 'sanity'
import {StringSchemaType} from '@sanity/types'
import {TFunction} from 'i18next'
import {TimelineStore} from 'sanity'
import {User} from '@sanity/types'
import {ValidationMarker} from '@sanity/types'

declare interface Action extends NavbarActionBase {
  onAction: () => void
  selected: boolean
  title: string
  render?: undefined
}

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

declare interface ActionWithCustomRender extends NavbarActionBase {
  render: () => React.ReactElement
}

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

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

/**
 * @hidden
 * @beta */
declare interface ArrayInputCopyEvent<Item> {
  items: Item[]
}

/**
 * These are the props an implementation of the ArrayFunctions component will receive
 *
 *
 * @hidden
 * @beta
 */
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 */
declare interface ArrayInputInsertEvent<Item> {
  items: Item[]
  position: 'before' | 'after'
  referenceItem: KeyedSegment | number
  skipInitialValue?: boolean
  open?: boolean
}

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

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

/** @public */
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
 * @public */
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, payload?: OnPathFocusPayload) => 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 */
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 */
declare type ArrayOfObjectsMember = ArrayOfObjectsItemMember | ArrayItemError

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

/** @public */
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
 * @public */
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 */
declare interface ArrayOfPrimitivesItemMember<Node extends PrimitiveFormNode = PrimitiveFormNode> {
  kind: 'item'
  key: string
  index: number
  open: boolean
  parentSchemaType: ArraySchemaType
  /**
   * @hidden
   * @beta */
  item: Node
}

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

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

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

/**
 * Authentication options
 *
 * @public
 */
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 authentication 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
 */
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
 */
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
 */
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>
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type BackLinkProps = BackLinkProps_2

/**
 * @hidden
 * @beta */
declare interface BackLinkProps_2 {
  children?: ReactNode
}

/**
 * @hidden
 * @public */
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
  version?: string
  renderDefault: (props: FieldProps) => React.JSX.Element
}

/**
 * @hidden
 * @public
 */
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
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type BaseGenericList = BaseGenericList_2

/**
 * Interface for base generic list
 *
 * @public
 */
declare interface BaseGenericList_2 extends StructureNode_2 {
  /** List layout key. */
  defaultLayout?: PreviewLayoutKey
  /** Can handle intent. See {@link IntentChecker} */
  canHandleIntent?: IntentChecker_2
  /** List display options. See {@link ListDisplayOptions} */
  displayOptions?: ListDisplayOptions_2
  /** List child. See {@link Child} */
  child: Child_2
  /** List initial values array. See {@link InitialValueTemplateItem} and {@link InitialValueTemplateItemBuilder} */
  initialValueTemplates?: (InitialValueTemplateItem | InitialValueTemplateItemBuilder_2)[]
}

/**
 * @hidden
 * @public */
declare interface BaseInputProps {
  renderDefault: (props: InputProps) => React.JSX.Element
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type BaseIntentParams = BaseIntentParams_2

/**
 * Base intent parameters
 *
 * @public
 * @todo dedupe with core
 */
declare interface BaseIntentParams_2 {
  /**
   * 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
 */
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
  /**
   * @hidden
   * @beta */
  onCopy: (event: Omit<ArrayInputCopyEvent<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) => React.JSX.Element
}

/** @internal */
export declare interface BaseResolvedPaneNode<T extends PaneNode_2['type']> {
  id: string
  type: T
  title: string
  i18n?: I18nTextRecord<'title'>
  menuItems?: PaneMenuItem_2[]
  menuItemGroups?: PaneMenuItemGroup_2[]
  canHandleIntent?: (
    intentName: string,
    params: Record<string, string | undefined>,
    options: {
      pane: PaneNode_2
      index: number
    },
  ) => boolean
  child?: UnresolvedPaneNode_2
}

declare interface BaseStructureToolPaneProps<T extends PaneNode_2['type']> {
  paneKey: string
  index: number
  itemId: string
  childItemId?: string
  isSelected?: boolean
  isActive?: boolean
  pane: Extract<
    PaneNode_2,
    {
      type: T
    }
  >
  /**
   * TODO: COREL - Remove this after updating sanity-assist to use <PerspectiveProvider>
   *
   * Allows to override the global version with a specific version or release.
   * @deprecated use <PerspectiveProvider> instead
   * @beta
   */
  forcedVersion?: {
    selectedPerspectiveName: ReleaseId | 'published' | undefined
    isReleaseLocked: boolean
    selectedReleaseId: ReleaseId | undefined
  }
  /**
   * @deprecated Avoid specifying a key, instead use `paneKey` if need be
   */
  key?: string
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type BaseView = BaseView_2

/**
 * Interface for base view
 *
 * @public */
declare interface BaseView_2 {
  /** View id */
  id: string
  /** View Title */
  title: string
  /** View Icon */
  icon?: React.ComponentType | React.ReactNode
}

/**
 * @internal
 * Configuration for studio beta features.
 * */
declare interface BetaFeatures {
  /**
   * @beta
   * @hidden
   * @deprecated beta feature is no longer available.
   * */
  treeArrayEditing?: {
    /**
     * @deprecated beta feature is no longer available.
     */
    enabled: boolean
  }
  /**
   * @beta
   */
  create?: {
    /**
     * When true, a "Start in Sanity Create" action will be shown for all new documents, in place of regular document actions,
     * when the following are true:
     * - the origin of the current url is listed under Studios in sanity.to/manage (OR fallbackStudioOrigin is provided)
     * - [origin]/static/create-manifest.json is available over HTTP GET
     *
     * The manifest file is automatically created and deployed when deploying studios with `sanity deploy`
     *
     * @see #fallbackStudioOrigin
     */
    startInCreateEnabled?: boolean
    /**
     * To show the "Start in Create" button on localhost, or in studios not listed under Studios in sanity.io/manage
     * provide a fallback origin as a string.
     *
     * The string must be the exactly equal `name` as shown for the Studio in manage, and the studio must have create-manifest.json available.
     *
     * If the provided fallback Studio does not expose create-manifest.json "Start in Sanity Create" will fail when using the fallback.
     *
     * Example: `wonderful.sanity.studio`
     *
     * Keep in mind that when fallback origin is used, Sanity Create will used the schema types and dataset in the *deployed* Studio,
     * not from localhost.
     *
     * To see data synced from Sanity Create in your localhost Studio, you must ensure that the deployed fallback studio uses the same
     * workspace and schemas as your local configuration.
     *
     * @see #startInCreateEnabled
     */
    fallbackStudioOrigin?: string
  }
  /**
   * Config for the history events API .
   *
   * If enabled, it will use the new events API to fetch document history.
   *
   * If it is not enabled, it will continue using the legacy Timeline.
   */
  eventsAPI?: {
    documents?: boolean
    releases?: boolean
  }
}

/**
 * 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>
 *      )}
 *     </>
 *   )
 * }
 * ```
 * */
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) => React.JSX.Element
  /**
   * 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: React.JSX.Element
  /**
   * Form validation for the annotation object.
   */
  validation: FormNodeValidation[]
  /**
   * Value of the annotation object.
   */
  value: PortableTextObject
}

/**
 * Props for rendering a Portable Text block
 *
 * @public
 */
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) => React.JSX.Element
  /**
   * 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
}

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

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

/**
 * @hidden
 * @public */
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
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type BuildableComponent = BuildableComponent_2

/**
 * Interface for buildable component
 *
 * @public
 */
declare interface BuildableComponent_2 extends Partial<StructureNode_2> {
  /** Component of type {@link UserComponent} */
  component?: UserComponent_2
  /** Component child of type {@link Child} */
  child?: Child_2
  /** Component options */
  options?: {
    [key: string]: unknown
  }
  /** Component menu items. See {@link MenuItem} and {@link MenuItemBuilder}  */
  menuItems?: (MenuItem_2 | MenuItemBuilder_2)[]
  /** Component menu item groups. See {@link MenuItemGroup} and {@link MenuItemGroupBuilder} */
  menuItemGroups?: (MenuItemGroup_2 | MenuItemGroupBuilder_2)[]
  canHandleIntent?: IntentChecker_2
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type BuildableGenericList = BuildableGenericList_2

/**
 * Interface for buildable generic list
 *
 * @public
 */
declare interface BuildableGenericList_2 extends Partial<BaseGenericList_2> {
  /** List menu items array. See {@link MenuItem} and {@link MenuItemBuilder} */
  menuItems?: (MenuItem_2 | MenuItemBuilder_2)[]
  /** List menu items groups array. See {@link MenuItemGroup} and {@link MenuItemGroupBuilder} */
  menuItemGroups?: (MenuItemGroup_2 | MenuItemGroupBuilder_2)[]
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type BuildableList = BuildableList_2

/**
 * Interface for buildable list
 *
 * @public
 */
declare interface BuildableList_2 extends BuildableGenericList_2 {
  /** List items. See {@link ListItem}, {@link ListItemBuilder} and {@link Divider} */
  items?: (ListItem_2 | ListItemBuilder_2 | Divider_2)[]
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type Builder = Builder_2

/** @internal */
declare type Builder_2 =
  | CollectionBuilder_2
  | ComponentBuilder_2
  | DocumentBuilder_2
  | DocumentListBuilder_2
  | DocumentListItemBuilder_2
  | ListItemBuilder_2
  | MenuItemBuilder_2
  | MenuItemGroupBuilder_2
  | InitialValueTemplateItemBuilder_2

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type Child = Child_2

/**
 * Child of a structure node
 * See {@link Collection}, {@link CollectionBuilder} and {@link ChildResolver}
 *
 * @public
 */
declare type Child_2 = Collection_2 | CollectionBuilder_2 | ChildResolver_2

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type ChildLinkProps = ChildLinkProps_2

/**
 * @hidden
 * @beta */
declare interface ChildLinkProps_2 {
  childId: string
  childParameters?: Record<string, string>
  childPayload?: unknown
  children?: ReactNode
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type ChildObservable = ChildObservable_2

/**
 * Interface for child observable
 *
 * @public
 */
declare interface ChildObservable_2 {
  /** Subscribes to the child observable. See {@link ItemChild} */
  subscribe: (child: ItemChild_2 | Promise<ItemChild_2>) => Record<string, unknown>
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type ChildResolver = ChildResolver_2

/**
 * Interface for child resolver
 *
 * @public */
declare interface ChildResolver_2 {
  (
    itemId: string,
    options: ChildResolverOptions_2,
  ): ItemChild_2 | Promise<ItemChild_2> | ChildObservable_2 | Observable<ItemChild_2> | undefined
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type ChildResolverOptions = ChildResolverOptions_2

/**
 * Interface for child resolver options
 *
 * @public
 */
declare interface ChildResolverOptions_2 {
  /** Child parent */
  parent: unknown
  /** Child index */
  index: number
  splitIndex: number
  /** Child path */
  path: string[]
  /** Child parameters */
  params: Record<string, string | undefined>
  /** Structure context. See {@link StructureContext} */
  structureContext: StructureContext_2
  /** Serialize options. See {@link SerializeOptions} */
  serializeOptions?: SerializeOptions_2
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type Collection = Collection_2

/**
 * Collection
 * See {@link List}, {@link DocumentList}, {@link EditorNode}, {@link DocumentNode} and {@link Component}
 *
 * @public
 */
declare type Collection_2 = List_2 | DocumentList_2 | EditorNode_2 | DocumentNode_2 | Component_2

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type CollectionBuilder = CollectionBuilder_2

/**
 * Collection builder
 * See {@link ListBuilder}, {@link DocumentListBuilder}, {@link DocumentTypeListBuilder}, {@link DocumentBuilder} and {@link ComponentBuilder}
 *
 * @public
 */
declare type CollectionBuilder_2 =
  | ListBuilder_2
  | DocumentListBuilder_2
  | DocumentTypeListBuilder_2
  | DocumentBuilder_2
  | ComponentBuilder_2

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

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type Component = Component_2

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const component: (
  componentOrSpec?: UserViewComponent_2 | Partial<ComponentView_2>,
) => ComponentViewBuilder_2

/**
 * Interface for component
 *
 * @public
 */
declare interface Component_2 extends StructureNode_2 {
  /** Component of type {@link UserComponent} */
  component: UserComponent_2
  /** Component child of type {@link Child} */
  child?: Child_2
  /** Component menu items, array of type {@link MenuItem} */
  menuItems: MenuItem_2[]
  /** Component menu item group, array of type {@link MenuItemGroup} */
  menuItemGroups: MenuItemGroup_2[]
  /** Component options */
  options: {
    [key: string]: unknown
  }
  canHandleIntent?: IntentChecker_2
}

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const ComponentBuilder: typeof ComponentBuilder_2

/**
 * Class for building components
 *
 * @public
 */
declare class ComponentBuilder_2 implements Serializable<Component_2> {
  /** component builder option object */
  protected spec: BuildableComponent_2
  constructor(spec?: ComponentInput_2)
  /** Set Component ID
   * @param id - component ID
   * @returns component builder based on ID provided
   */
  id(id: string): ComponentBuilder_2
  /** Get ID
   * @returns ID
   */
  getId(): BuildableComponent_2['id']
  /** Set Component title
   * @param title - component title
   * @returns component builder based on title provided (and ID)
   */
  title(title: string): ComponentBuilder_2
  /** Get Component title
   * @returns title
   */
  getTitle(): BuildableComponent_2['title']
  /** Set the i18n key and namespace used to populate the localized title.
   * @param i18n - the key and namespaced used to populate the localized title.
   * @returns component builder based on i18n key and ns provided
   */
  i18n(i18n: I18nTextRecord<'title'>): ComponentBuilder_2
  /** Get i18n key and namespace used to populate the localized title
   * @returns the i18n key and namespace used to populate the localized title
   */
  getI18n(): I18nTextRecord<'title'> | undefined
  /** Set Component child
   * @param child - child component
   * @returns component builder based on child component provided
   */
  child(child: Child_2): ComponentBuilder_2
  /** Get Component child
   * @returns child component
   */
  getChild(): BuildableComponent_2['child']
  /** Set component
   * @param component - user built component
   * @returns component builder based on component provided
   */
  component(component: UserComponent_2): ComponentBuilder_2
  /** Get Component
   * @returns component
   */
  getComponent(): BuildableComponent_2['component']
  /** Set Component options
   * @param options - component options
   * @returns component builder based on options provided
   */
  options(options: {[key: string]: unknown}): ComponentBuilder_2
  /** Get Component options
   * @returns component options
   */
  getOptions(): NonNullable<BuildableComponent_2['options']>
  /** Set Component menu items
   * @param menuItems - component menu items
   * @returns component builder based on menuItems provided
   */
  menuItems(menuItems: (MenuItem_2 | MenuItemBuilder_2)[]): ComponentBuilder_2
  /** Get Component menu items
   * @returns menu items
   */
  getMenuItems(): BuildableComponent_2['menuItems']
  /** Set Component menu item groups
   * @param menuItemGroups - component menu item groups
   * @returns component builder based on menuItemGroups provided
   */
  menuItemGroups(menuItemGroups: (MenuItemGroup_2 | MenuItemGroupBuilder_2)[]): ComponentBuilder_2
  /** Get Component menu item groups
   * @returns menu item groups
   */
  getMenuItemGroups(): BuildableComponent_2['menuItemGroups']
  canHandleIntent(canHandleIntent: IntentChecker_2): ComponentBuilder_2
  /** Serialize component
   * @param options - serialization options
   * @returns component object based on path provided in options
   *
   */
  serialize(options?: SerializeOptions_2): Component_2
  /** Clone component builder (allows for options overriding)
   * @param withSpec - component builder options
   * @returns cloned builder
   */
  clone(withSpec?: BuildableComponent_2): ComponentBuilder_2
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type ComponentInput = ComponentInput_2

/**
 * Interface for component input
 *
 * @public
 */
declare interface ComponentInput_2 extends StructureNode_2 {
  /** Component of type {@link UserComponent} */
  component: UserComponent_2
  /** Component child of type {@link Child} */
  child?: Child_2
  /** Component options */
  options?: {
    [key: string]: unknown
  }
  /** Component menu items. See {@link MenuItem} and {@link MenuItemBuilder}  */
  menuItems?: (MenuItem_2 | MenuItemBuilder_2)[]
  /** Component menu item groups. See {@link MenuItemGroup} and {@link MenuItemGroupBuilder} */
  menuItemGroups?: (MenuItemGroup_2 | MenuItemGroupBuilder_2)[]
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type ComponentView = ComponentView_2

/**
 * Interface for component views.
 *
 * @public */
declare interface ComponentView_2<TOptions = Record<string, any>> extends BaseView_2 {
  type: 'component'
  /** Component view components. See {@link UserViewComponent} */
  component: UserViewComponent_2
  /** Component view options */
  options: TOptions
}

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const ComponentViewBuilder: typeof ComponentViewBuilder_2

/**
 * Class for building a component view.
 *
 * @public */
declare class ComponentViewBuilder_2 extends GenericViewBuilder_2<
  Partial<ComponentView_2>,
  ComponentViewBuilder_2
> {
  /** Partial Component view option object. See {@link ComponentView} */
  protected spec: Partial<ComponentView_2>
  constructor(
    /**
     * Component view component or spec
     * @param componentOrSpec - user view component or partial component view. See {@link UserViewComponent} and {@link ComponentView}
     */
    componentOrSpec?: UserViewComponent_2 | Partial<ComponentView_2>,
  )
  /** Set view Component
   * @param component - component view component. See {@link UserViewComponent}
   * @returns component view builder based on component view provided. See {@link ComponentViewBuilder}
   */
  component(component: UserViewComponent_2): ComponentViewBuilder_2
  /** Get view Component
   * @returns Partial component view. See {@link ComponentView}
   */
  getComponent(): Partial<ComponentView_2>['component']
  /** Set view Component options
   * @param options - component view options
   * @returns component view builder based on options provided. See {@link ComponentViewBuilder}
   */
  options(options: {[key: string]: any}): ComponentViewBuilder_2
  /** Get view Component options
   * @returns component view options. See {@link ComponentView}
   */
  getOptions(): ComponentView_2['options']
  /** Serialize view Component
   * @param options - serialization options. See {@link SerializeOptions}
   * @returns component view based on path provided in options. See {@link ComponentView}
   *
   */
  serialize(options?: SerializeOptions_2): ComponentView_2
  /** Clone Component view builder (allows for options overriding)
   * @param withSpec - partial for component view option. See {@link ComponentView}
   * @returns component view builder. See {@link ComponentViewBuilder}
   */
  clone(withSpec?: Partial<ComponentView_2>): ComponentViewBuilder_2
}

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

/** @public */
declare interface ConfigContext_2 {
  /**
   * 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_2
}

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const ConfirmDeleteDialog: typeof ConfirmDeleteDialogContainer

/** @internal */
declare function ConfirmDeleteDialogContainer(props: ConfirmDeleteDialogProps_2): JSX_2.Element

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type ConfirmDeleteDialogProps = ConfirmDeleteDialogProps_2

/** @internal */
declare interface ConfirmDeleteDialogProps_2 {
  /**
   * Incoming document ID used to find other referencing documents. This
   * field respects draft IDs (e.g. if you pass in a published ID when one
   * doesn't exist the document title may not show up).
   */
  id: string
  /**
   * The schema typename of the incoming document
   */
  type: string
  /**
   * The name of the action being done. (e.g. the `'unpublish'` action requires
   * the same document deletion confirmation).
   */
  action?: 'delete' | 'unpublish'
  onCancel: () => void
  onConfirm: () => void
}

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const createStructureBuilder: typeof createStructureBuilder_2

/** @internal */
declare function createStructureBuilder_2({
  defaultDocumentNode,
  source,
}: StructureBuilderOptions_2): StructureBuilder_2

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type CustomComponentPaneNode = CustomComponentPaneNode_2

/** @internal */
declare interface CustomComponentPaneNode_2 extends BaseResolvedPaneNode<'component'> {
  component: UserComponent_2
  options?: Record<string, unknown>
}

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const DEFAULT_INTENT_HANDLER: symbol

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type DefaultDocumentNodeContext = DefaultDocumentNodeContext_2

/**
 * An object holding the documentId and schemaType for the document node being resolved.
 *
 * @public
 */
declare interface DefaultDocumentNodeContext_2 extends ConfigContext {
  /**
   * The id of the sanity document
   */
  documentId?: string
  /**
   * the schema of the sanity document
   */
  schemaType: string
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type DefaultDocumentNodeResolver = DefaultDocumentNodeResolver_2

/**
 * A resolver function used to return the default document node used when editing documents.
 *
 * @public
 *
 * @returns a document node builder, or null/undefined if no document node should be returned.
 *
 */
declare type DefaultDocumentNodeResolver_2 = (
  /**
   * S - an instance of the structure builder, that can be used to build the lists/items/panes for the structure tool
   * context - an object holding various context that may be used to customize the structure, for instance the current user.
   *  Defaults to
   * ```ts
   * (S) => S.defaults()
   * ```
   * See {@link StructureBuilder}
   */
  S: StructureBuilder_2,
  /**
   * An object holding the documentId and schemaType for the document node being resolved.
   * See {@link DefaultDocumentNodeContext}
   */
  options: DefaultDocumentNodeContext_2,
) => DocumentBuilder_2 | null | undefined

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const defaultInitialValueTemplateItems: typeof defaultInitialValueTemplateItems_2

/** @internal */
declare function defaultInitialValueTemplateItems_2(
  context: StructureContext_2,
): InitialValueTemplateItemBuilder_2[]

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const defaultIntentChecker: IntentChecker_2

/** @beta */
declare type DefaultPluginsWorkspaceOptions = {
  tasks: {
    enabled: boolean
  }
  scheduledPublishing: ScheduledPublishingPluginOptions
  releases: {
    enabled: boolean
  }
}

/**
 * @deprecated Import `structureTool` from `sanity/structure` instead!
 * @hidden
 * @public
 */
export declare const deskTool: Plugin_2<void | StructureToolOptions>

/**
 * @deprecated Import `StructureToolContextValue` from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type DeskToolContextValue = StructureToolContextValue

/**
 * @deprecated Import `StructureToolFeatures` from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type DeskToolFeatures = StructureToolFeatures

/**
 * @deprecated Import `StructureToolMenuItem` from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type DeskToolMenuItem = MenuItem_2

/**
 * @deprecated Import `StructureToolOptions` from `sanity/structure` instead
 * @hidden
 * @public
 */
export declare type DeskToolOptions = StructureToolOptions

/**
 * @deprecated Import `StructureToolPaneActionHandler` from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type DeskToolPaneActionHandler = StructureToolPaneActionHandler

/**
 * @deprecated Import `StructureToolProvider` from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const DeskToolProvider: typeof StructureToolProvider

/**
 * @deprecated Import `StructureToolProviderProps` from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type DeskToolProviderProps = StructureToolProviderProps

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type Divider = Divider_2

/**
 * A `Divider` is a visual separator in the structure tree.
 *
 * @public
 */
declare interface Divider_2 {
  /**
   * The divider's ID
   */
  id: string
  type: 'divider'
}

/**
 * @hidden
 * @beta */
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'
  /**
   * For debugging purposes
   */
  displayName?: string
}

/**
 * @hidden
 * @beta */
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 */
declare interface DocumentActionCustomDialogComponentProps {
  type: 'custom'
  component: ReactNode
}

/**
 * @hidden
 * @beta */
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 */
declare type DocumentActionDialogProps =
  | DocumentActionConfirmDialogProps
  | DocumentActionPopoverDialogProps
  | DocumentActionModalDialogProps
  | DocumentActionCustomDialogComponentProps

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

/**
 * @hidden
 * @beta */
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 */
declare interface DocumentActionPopoverDialogProps {
  type: 'popover'
  content: ReactNode
  onClose: () => void
}

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

/**
 * @hidden
 * @beta
 */
declare interface DocumentActionsContext extends ConfigContext_2 {
  documentId?: string
  schemaType: string
  /** releaseId of the open document, it's undefined if it's published or the draft */
  releaseId?: string
  /** the type of the currently active document. */
  versionType?: DocumentActionsVersionType
}

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

/**
 * @hidden
 * @beta
 */
declare type DocumentActionsVersionType = 'published' | 'draft' | 'revision' | 'version'

/**
 * @hidden
 * @beta */
declare interface DocumentBadgeComponent
  extends HookCollectionActionHook<DocumentBadgeProps, DocumentBadgeDescription> {
  (props: DocumentBadgeProps): DocumentBadgeDescription | null
}

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

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

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

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

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const DocumentBuilder: typeof DocumentBuilder_2

/**
 * A `DocumentBuilder` is used to build a document node.
 *
 * @public */
declare class DocumentBuilder_2 implements Serializable<DocumentNode_2> {
  /**
   * Structure context. See {@link StructureContext}
   */
  protected _context: StructureContext_2
  /** Component builder option object See {@link PartialDocumentNode} */
  protected spec: PartialDocumentNode_2
  constructor(
    /**
     * Structure context. See {@link StructureContext}
     */
    _context: StructureContext_2,
    spec?: PartialDocumentNode_2,
  )
  /** Set Document Builder ID
   * @param id - document builder ID
   * @returns document builder based on ID provided. See {@link DocumentBuilder}
   */
  id(id: string): DocumentBuilder_2
  /** Get Document Builder ID
   * @returns document ID. See {@link PartialDocumentNode}
   */
  getId(): PartialDocumentNode_2['id']
  /** Set Document title
   * @param title - document title
   * @returns document builder based on title provided (and ID). See {@link DocumentBuilder}
   */
  title(title: string): DocumentBuilder_2
  /** Get Document title
   * @returns document title. See {@link PartialDocumentNode}
   */
  getTitle(): PartialDocumentNode_2['title']
  /** Set the i18n key and namespace used to populate the localized title.
   * @param i18n - the key and namespaced used to populate the localized title.
   * @returns component builder based on i18n key and ns provided
   */
  i18n(i18n: I18nTextRecord<'title'>): DocumentBuilder_2
  /** Get i18n key and namespace used to populate the localized title
   * @returns the i18n key and namespace used to populate the localized title
   */
  getI18n(): I18nTextRecord<'title'> | undefined
  /** Set Document child
   * @param child - document child
   * @returns document builder based on child provided. See {@link DocumentBuilder}
   */
  child(child: Child_2): DocumentBuilder_2
  /** Get Document child
   * @returns document child. See {@link PartialDocumentNode}
   */
  getChild(): PartialDocumentNode_2['child']
  /** Set Document ID
   * @param documentId - document ID
   * @returns document builder with document based on ID provided. See {@link DocumentBuilder}
   */
  documentId(documentId: string): DocumentBuilder_2
  /** Get Document ID
   * @returns document ID. See {@link DocumentOptions}
   */
  getDocumentId(): Partial<DocumentOptions_2>['id']
  /** Set Document Type
   * @param documentType - document type
   * @returns document builder with document based on type provided. See {@link DocumentBuilder}
   */
  schemaType(documentType: SchemaType | string): DocumentBuilder_2
  /** Get Document Type
   * @returns document type. See {@link DocumentOptions}
   */
  getSchemaType(): Partial<DocumentOptions_2>['type']
  /** Set Document Template
   * @param templateId - document template ID
   * @param parameters - document template parameters
   * @returns document builder with document based on template provided. See {@link DocumentBuilder}
   */
  initialValueTemplate(templateId: string, parameters?: Record<string, unknown>): DocumentBuilder_2
  /** Get Document Template
   * @returns document template. See {@link DocumentOptions}
   */
  getInitialValueTemplate(): Partial<DocumentOptions_2>['template']
  /** Get Document's initial value Template parameters
   * @returns document template parameters. See {@link DocumentOptions}
   */
  getInitialValueTemplateParameters(): Partial<DocumentOptions_2>['templateParameters']
  /** Set Document views
   * @param views - document views. See {@link ViewBuilder} and {@link View}
   * @returns document builder with document based on views provided. See {@link DocumentBuilder}
   */
  views(views: (View_2 | ViewBuilder_2)[]): DocumentBuilder_2
  /** Get Document views
   * @returns document views. See {@link ViewBuilder} and {@link View}
   */
  getViews(): (View_2 | ViewBuilder_2)[]
  /** Serialize Document builder
   * @param options - serialization options. See {@link SerializeOptions}
   * @returns document node based on path, index and hint provided in options. See {@link DocumentNode}
   */
  serialize({path, index, hint}?: SerializeOptions_2): DocumentNode_2
  /** Clone Document builder
   * @param withSpec - partial document node specification used to extend the cloned builder. See {@link PartialDocumentNode}
   * @returns document builder based on context and spec provided. See {@link DocumentBuilder}
   */
  clone(withSpec?: PartialDocumentNode_2): DocumentBuilder_2
}

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

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

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

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

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

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

/**
 * @hidden
 * @beta */
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_2<'title'>
  tone?: DocumentFieldActionTone
}

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

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

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

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

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

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

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type DocumentFieldMenuActionNode = DocumentFieldMenuActionNode_2

/**
 * @hidden
 * @beta */
declare type DocumentFieldMenuActionNode_2 = DocumentFieldActionNode & {
  intent?: Intent_2
}

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const documentFromEditor: typeof documentFromEditor_2

/** @internal */
declare function documentFromEditor_2(
  context: StructureContext_2,
  spec?: EditorNode_2,
): DocumentBuilder_2

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const documentFromEditorWithInitialValue: typeof documentFromEditorWithInitialValue_2

/** @internal */
declare function documentFromEditorWithInitialValue_2(
  {resolveDocumentNode, templates}: StructureContext_2,
  templateId: string,
  parameters?: Record<string, unknown>,
): DocumentBuilder_2

/** @hidden @beta */
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 */
declare type DocumentInspectorComponent = ComponentType<DocumentInspectorProps>

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

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const DocumentInspectorHeader: typeof DocumentInspectorHeader_2

/** @internal */
declare function DocumentInspectorHeader_2(
  props: DocumentInspectorHeaderProps & Omit<HTMLProps<HTMLDivElement>, 'as' | 'height' | 'ref'>,
): JSX_2.Element

declare interface DocumentInspectorHeaderProps {
  as?: CardProps['as']
  closeButtonLabel: string
  flex?: CardProps['flex']
  onClose: () => void
  title: ReactNode
}

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

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

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

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

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

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

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

/** @internal*/
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.JSX.Element
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type DocumentList = DocumentList_2

/**
 * Interface for document list
 *
 * @public
 */
declare interface DocumentList_2 extends GenericList_2 {
  type: 'documentList'
  /** Document list options. See {@link DocumentListOptions} */
  options: DocumentListOptions_2
  /** Document list child. See {@link Child} */
  child: Child_2
  /** Document schema type name */
  schemaTypeName?: string
}

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const DocumentListBuilder: typeof DocumentListBuilder_2

/**
 * Class for building document list
 *
 * @public
 */
declare class DocumentListBuilder_2 extends GenericListBuilder_2<
  PartialDocumentList_2,
  DocumentListBuilder_2
> {
  /**
   * Structure context. See {@link StructureContext}
   */
  protected _context: StructureContext_2
  /** Document list options. See {@link PartialDocumentList} */
  protected spec: PartialDocumentList_2
  constructor(
    /**
     * Structure context. See {@link StructureContext}
     */
    _context: StructureContext_2,
    spec?: DocumentListInput_2,
  )
  /** Set API version
   * @param apiVersion - API version
   * @returns document list builder based on the options and API version provided. See {@link DocumentListBuilder}
   */
  apiVersion(apiVersion: string): DocumentListBuilder_2
  /** Get API version
   * @returns API version
   */
  getApiVersion(): string | undefined
  /** Set Document list filter
   * @param filter - GROQ-filter used to determine which documents to display. Do not support joins, since they operate on individual documents, and will ignore order-clauses and projections. See {@link https://www.sanity.io/docs/realtime-updates}
   * @returns document list builder based on the options and filter provided. See {@link DocumentListBuilder}
   */
  filter(filter: string): DocumentListBuilder_2
  /** Get Document list filter
   * @returns filter
   */
  getFilter(): string | undefined
  /** Set Document list schema type name
   * @param type - schema type name.
   * @returns document list builder based on the schema type name provided. See {@link DocumentListBuilder}
   */
  schemaType(type: SchemaType | string): DocumentListBuilder_2
  /** Get Document list schema type name
   * @returns schema type name
   */
  getSchemaType(): string | undefined
  /** Set Document list options' parameters
   * @param params - parameters
   * @returns document list builder based on the options provided. See {@link DocumentListBuilder}
   */
  params(params: Record<string, unknown>): DocumentListBuilder_2
  /** Get Document list options' parameters
   * @returns options
   */
  getParams(): Record<string, unknown> | undefined
  /** Set Document list default ordering
   * @param ordering - default sort ordering array. See {@link SortOrderingItem}
   * @returns document list builder based on ordering provided. See {@link DocumentListBuilder}
   */
  defaultOrdering(ordering: SortOrderingItem[]): DocumentListBuilder_2
  /** Get Document list default ordering
   * @returns default ordering. See {@link SortOrderingItem}
   */
  getDefaultOrdering(): SortOrderingItem[] | undefined
  /** Serialize Document list
   * @param options - serialization options. See {@link SerializeOptions}
   * @returns document list object based on path provided in options. See {@link DocumentList}
   */
  serialize(options?: SerializeOptions_2): DocumentList_2
  /** Clone Document list builder (allows for options overriding)
   * @param withSpec - override document list spec. See {@link PartialDocumentList}
   * @returns document list builder. See {@link DocumentListBuilder}
   */
  clone(withSpec?: PartialDocumentList_2): DocumentListBuilder_2
  /** Get Document list spec
   * @returns document list spec. See {@link PartialDocumentList}
   */
  getSpec(): PartialDocumentList_2
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type DocumentListInput = DocumentListInput_2

/**
 * Interface for document list input
 *
 * @public
 */
declare interface DocumentListInput_2 extends GenericListInput_2 {
  /** Document list options. See {@link DocumentListOptions} */
  options: DocumentListOptions_2
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type DocumentListItem = DocumentListItem_2

/**
 * Interface for document list item
 *
 * @public
 */
declare interface DocumentListItem_2 extends ListItem_2 {
  /** Document schema type. See {@link SchemaType} */
  schemaType: SchemaType
  /** Document ID */
  _id: string
}

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const DocumentListItemBuilder: typeof DocumentListItemBuilder_2

/**
 * Class for building a document list item
 *
 * @public
 */
declare class DocumentListItemBuilder_2 extends ListItemBuilder_2 {
  /**
   * Structure context. See {@link StructureContext}
   */
  protected _context: StructureContext_2
  /** Document list options. See {@link PartialDocumentListItem} */
  protected spec: PartialDocumentListItem_2
  constructor(
    /**
     * Structure context. See {@link StructureContext}
     */
    _context: StructureContext_2,
    spec?: DocumentListItemInput_2,
  )
  /**
   * Serialize document list item
   * @param options - serialization options. See {@link SerializeOptions}
   * @returns document list item object based on path provided in options. See {@link DocumentListItem}
   */
  serialize(options?: SerializeOptions_2): DocumentListItem_2
  /** Clone Document list item builder (allows for options overriding)
   * @param withSpec - Document list item builder options. See {@link PartialDocumentListItem}
   * @returns document list item builder. See {@link DocumentListItemBuilder}
   */
  clone(withSpec?: PartialDocumentListItem_2): DocumentListItemBuilder_2
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type DocumentListItemInput = DocumentListItemInput_2

/**
 * Interface for document list item input
 *
 * @public
 */
declare interface DocumentListItemInput_2 extends ListItemInput_2 {
  /** Document list item input schema type. See {@link SchemaType} */
  schemaType: SchemaType | string
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type DocumentListOptions = DocumentListOptions_2

/**
 * Interface for document List options
 *
 * @public
 */
declare interface DocumentListOptions_2 {
  /** Document list filter */
  filter: string
  /** Document list parameters */
  params?: Record<string, unknown>
  /** Document list API version */
  apiVersion?: string
  /** Document list API default ordering array. */
  defaultOrdering?: SortOrderingItem[]
}

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const DocumentListPane: NamedExoticComponent<
  BaseStructureToolPaneProps<'documentList'>
>

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type DocumentListPaneNode = DocumentListPaneNode_2

/** @internal */
declare interface DocumentListPaneNode_2 extends BaseResolvedPaneNode<'documentList'> {
  defaultLayout?: GeneralPreviewLayoutKey
  displayOptions?: {
    showIcons?: boolean
  }
  initialValueTemplates?: InitialValueTemplateItem[]
  options: {
    filter: string
    defaultOrdering?: Array<{
      field: string
      direction: 'asc' | 'desc'
    }>
    params?: Record<string, unknown>
    apiVersion?: string
  }
  schemaTypeName: string
  source?: string
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type DocumentListPaneProps = DocumentListPaneProps_2

/**
 * @internal
 */
declare type DocumentListPaneProps_2 = ComponentProps<typeof PaneContainer>

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type DocumentNode = DocumentNode_2

/**
 * Interface for the document list builder (focused on the document pane)
 *
 * @public */
declare interface DocumentNode_2 extends StructureNode_2 {
  /**
   * Document children. See {@link Child}
   */
  child?: Child_2
  /**
   * Options for the document pane
   */
  options: {
    /** Document Id */
    id: string
    /** Document Type */
    type?: string
    /** Document Template */
    template?: string
    /** Template parameters */
    templateParameters?: {
      [key: string]: any
    }
  }
  /**
   * View array for the document pane. See {@link View}
   */
  views: View_2[]
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type DocumentOptions = DocumentOptions_2

/**
 * Interface for options of Partial Documents. See {@link PartialDocumentNode}
 *
 * @public */
declare interface DocumentOptions_2 {
  /** Document Id */
  id: string
  /** Document Type */
  type: string
  /** Document Template */
  template?: string
  /** Template parameters */
  templateParameters?: Record<string, unknown>
}

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const DocumentPane: NamedExoticComponent<DocumentPaneProviderProps_2>

/** @internal */
declare interface DocumentPaneContextValue {
  actions: DocumentActionComponent_2[] | null
  activeViewId: string | null
  badges: DocumentBadgeComponent_2[] | null
  changesOpen: boolean
  closeInspector: (inspectorName?: string) => void
  collapsedFieldSets: StateTree<boolean> | undefined
  collapsedPaths: StateTree<boolean> | undefined
  compareValue: Partial<SanityDocument> | null
  connectionState: 'connecting' | 'reconnecting' | 'connected'
  displayed: Partial<SanityDocument> | null
  documentId: string
  documentIdRaw: string
  documentType: string
  editState: EditStateFor_2 | null
  fieldActions: DocumentFieldAction_2[]
  focusPath: Path
  index: number
  inspectOpen: boolean
  inspector: DocumentInspector_2 | null
  inspectors: DocumentInspector_2[]
  menuItemGroups: PaneMenuItemGroup_2[]
  onBlur: (blurredPath: Path) => void
  onChange: (event: PatchEvent_2) => void
  onFocus: (pathOrEvent: Path) => void
  onHistoryClose: () => void
  onHistoryOpen: () => void
  onInspectClose: () => void
  onMenuAction: (item: PaneMenuItem_2) => void
  onPaneClose: () => void
  onPaneSplit?: () => void
  onPathOpen: (path: Path) => void
  onSetActiveFieldGroup: (path: Path, groupName: string) => void
  onSetCollapsedPath: (path: Path, expanded: boolean) => void
  onSetCollapsedFieldSet: (path: Path, expanded: boolean) => void
  openInspector: (inspectorName: string, paneParams?: Record<string, string>) => void
  openPath: Path
  paneKey: string
  previewUrl?: string | null
  ready: boolean
  schemaType: ObjectSchemaType
  /**
   * @deprecated not used anymore
   * */
  setTimelineMode?: undefined
  /**
   * @deprecated not used anymore
   * */
  timelineMode?: undefined
  setTimelineRange(since: string | null, rev: string | null): void
  setIsDeleting: (state: boolean) => void
  timelineError: Error | null
  /**
   * Soon to be deprecated with the upcoming `releases` changes.
   */
  timelineStore?: TimelineStore
  title: string | null
  validation: ValidationMarker[]
  value: SanityDocumentLike
  views: View_2[]
  formState: DocumentFormNode | null
  /**
   * TODO: COREL - Remove this after updating sanity-assist to use <PerspectiveProvider>
   *
   * @deprecated use `usePerspective()` instead
   */
  selectedReleaseId: ReleaseId | undefined
  permissions?: PermissionCheckResult | null
  isDeleting: boolean
  isDeleted: boolean
  isPermissionsLoading: boolean
  isInitialValueLoading?: boolean
  unstable_languageFilter: DocumentLanguageFilterComponent_2[]
  revisionId: string | null
  lastNonDeletedRevId: string | null
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type DocumentPaneNode = DocumentPaneNode_2

/** @internal */
declare interface DocumentPaneNode_2 extends BaseResolvedPaneNode<'document'> {
  options: {
    id: string
    type: string
    template?: string
    templateParameters?: Record<string, unknown>
  }
  source?: string
  views?: View_2[]
}

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const DocumentPaneProvider: MemoExoticComponent<
  (props: DocumentPaneProviderProps_2) => JSX_2.Element
>

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type DocumentPaneProviderProps = DocumentPaneProviderProps_2

/** @internal */
declare type DocumentPaneProviderProps_2 = {
  children?: React.ReactNode
  onFocusPath?: (path: Path) => void
} & BaseStructureToolPaneProps<'document'>

/**
 * @hidden
 * @beta
 */
declare interface DocumentPluginOptions {
  badges?: DocumentBadgeComponent[] | DocumentBadgesResolver
  actions?: DocumentActionComponent[] | DocumentActionsResolver
  /**
   * Components for the document.
   * @internal
   */
  components?: DocumentComponents
  /** @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
  /** @deprecated Use `comments` instead */
  unstable_comments?: {
    enabled: boolean | ((context: DocumentCommentsEnabledContext) => boolean)
  }
  /** @internal */
  comments?: {
    enabled: boolean | ((context: DocumentCommentsEnabledContext) => boolean)
  }
}

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const DocumentTypeListBuilder: typeof DocumentTypeListBuilder_2

/**
 * Class for building a document type list
 *
 * @public
 */
declare class DocumentTypeListBuilder_2 extends DocumentListBuilder_2 {
  /**
   * Structure context. See {@link StructureContext}
   */
  protected _context: StructureContext_2
  /** Document list options. See {@link PartialDocumentList} */
  protected spec: PartialDocumentList_2
  constructor(
    /**
     * Structure context. See {@link StructureContext}
     */
    _context: StructureContext_2,
    spec?: DocumentListInput_2,
  )
  /**
   * Set Document type list child
   * @param child - Child component. See {@link Child}
   * @returns document type list builder based on child component provided without default intent handler. See {@link DocumentTypeListBuilder}
   */
  child(child: Child_2): DocumentTypeListBuilder_2
  /** Clone Document type list builder (allows for options overriding)
   * @param withSpec - Document type list builder options. See {@link PartialDocumentList}
   * @returns document type list builder. See {@link DocumentTypeListBuilder}
   */
  clone(withSpec?: PartialDocumentList_2): DocumentTypeListBuilder_2
  /** Clone Document type list builder (allows for options overriding) and remove default intent handler
   * @param withSpec - Document type list builder options. See {@link PartialDocumentList}
   * @returns document type list builder without default intent handler. See {@link DocumentTypeListBuilder}
   */
  cloneWithoutDefaultIntentHandler(withSpec?: PartialDocumentList_2): DocumentTypeListBuilder_2
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type DocumentTypeListInput = DocumentTypeListInput_2

/**
 * Interface for document type list input
 *
 * @public
 */
declare interface DocumentTypeListInput_2 extends Partial<GenericListInput_2> {
  /** Document type list input schema type. See {@link SchemaType} */
  schemaType: SchemaType | string
}

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

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type EditorNode = EditorNode_2

/**
 * Interface for Editor node
 *
 * @public */
declare interface EditorNode_2 extends StructureNode_2 {
  /** Editor child. See {@link Child} */
  child?: Child_2
  /** Editor options */
  options: {
    /** Editor ID */
    id: string
    /** Editor type */
    type?: string
    /** Editor template */
    template?: string
    /** Template parameters */
    templateParameters?: {
      [key: string]: any
    }
  }
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type EditReferenceOptions = EditReferenceOptions_2

/**
 * @hidden
 * @beta */
declare interface EditReferenceOptions_2 {
  parentRefPath: Path
  id: string
  type: string
  version?: ReleaseId
  template: {
    id: string
    params?: Record<string, string | number | boolean>
  }
}

/**
 * @hidden
 * @beta */
declare interface EditStateFor {
  id: string
  type: string
  transactionSyncLock: TransactionSyncLockState | null
  draft: SanityDocument | null
  published: SanityDocument | null
  version: SanityDocument | null
  /**
   * Whether live edit is enabled. This may be true for various reasons:
   *
   * - The schema type has live edit enabled.
   * - A version of the document is checked out.
   */
  liveEdit: boolean
  /**
   * Whether the schema type has live edit enabled.
   */
  liveEditSchemaType: boolean
  ready: boolean
  /**
   * When editing a version, the name of the release the document belongs to.
   */
  release: string | undefined
}

/** @internal @deprecated DO NOT USE */
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.
 */
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
 */
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
 * @public */
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
 */
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 */
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)[]
}

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

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const form: (spec?: Partial<FormView_2>) => FormViewBuilder_2

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

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

/**
 * @hidden
 * @beta */
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
 */
declare interface FormDiffMatchPatch extends FormPatchBase {
  path: Path
  type: 'diffMatchPatch'
  origin?: FormPatchOrigin
  value: string
}

/**
 * @hidden
 * @beta */
declare interface FormFieldGroup {
  name: string
  selected?: boolean
  disabled?: boolean
  title?: string
  i18n?: I18nTextRecord_2<'title'>
  icon?: ComponentType
}

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

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

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

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

/**
 * @hidden
 * @beta */
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
 */
declare type FormPatchJSONValue =
  | number
  | string
  | boolean
  | {
      [key: string]: FormPatchJSONValue
    }
  | FormPatchJSONValue[]

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

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

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

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

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type FormView = FormView_2

/**
 * Interface for form views.
 *
 * @public */
declare interface FormView_2 extends BaseView_2 {
  type: 'form'
}

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const FormViewBuilder: typeof FormViewBuilder_2

/**
 * Class for building a form view.
 *
 * @public */
declare class FormViewBuilder_2 extends GenericViewBuilder_2<
  Partial<BaseView_2>,
  FormViewBuilder_2
> {
  /** Document list options. See {@link FormView} */
  protected spec: Partial<FormView_2>
  constructor(spec?: Partial<FormView_2>)
  /**
   * Serialize Form view builder
   * @param options - Serialize options. See {@link SerializeOptions}
   * @returns form view builder based on path provided in options. See {@link FormView}
   */
  serialize(options?: SerializeOptions_2): FormView_2
  /**
   * Clone Form view builder (allows for options overriding)
   * @param withSpec - Partial form view builder options. See {@link FormView}
   * @returns form view builder. See {@link FormViewBuilder}
   */
  clone(withSpec?: Partial<FormView_2>): FormViewBuilder_2
}

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

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type GenericList = GenericList_2

/**
 * Interface for generic list
 *
 * @public
 */
declare interface GenericList_2 extends BaseGenericList_2 {
  /** List type */
  type: string
  /** List menu items array. See {@link MenuItem} */
  menuItems: MenuItem_2[]
  /** List menu item groups array. See {@link MenuItemGroup} */
  menuItemGroups: MenuItemGroup_2[]
}

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const GenericListBuilder: typeof GenericListBuilder_2

/**
 * Class for building generic lists
 *
 * @public
 */
declare abstract class GenericListBuilder_2<TList extends BuildableGenericList_2, ConcreteImpl>
  implements Serializable<GenericList_2>
{
  /** Check if initial value templates are set */
  protected initialValueTemplatesSpecified: boolean
  /** Generic list option object */
  protected spec: TList
  /** Set generic list ID
   * @param id - generic list ID
   * @returns generic list builder based on ID provided.
   */
  id(id: string): ConcreteImpl
  /** Get generic list ID
   * @returns generic list ID
   */
  getId(): TList['id']
  /** Set generic list title
   * @param title - generic list title
   * @returns generic list builder based on title and ID provided.
   */
  title(title: string): ConcreteImpl
  /** Get generic list title
   * @returns generic list title
   */
  getTitle(): TList['title']
  /** Set the i18n key and namespace used to populate the localized title.
   * @param i18n - the key and namespaced used to populate the localized title.
   * @returns component builder based on i18n key and ns provided
   */
  i18n(i18n: I18nTextRecord<'title'>): ConcreteImpl
  /** Get i18n key and namespace used to populate the localized title
   * @returns the i18n key and namespace used to populate the localized title
   */
  getI18n(): TList['i18n']
  /** Set generic list layout
   * @param defaultLayout - generic list layout key.
   * @returns generic list builder based on layout provided.
   */
  defaultLayout(defaultLayout: PreviewLayoutKey): ConcreteImpl
  /** Get generic list layout
   * @returns generic list layout
   */
  getDefaultLayout(): TList['defaultLayout']
  /** Set generic list menu items
   * @param menuItems - generic list menu items. See {@link MenuItem} and {@link MenuItemBuilder}
   * @returns generic list builder based on menu items provided.
   */
  menuItems(menuItems: (MenuItem_2 | MenuItemBuilder_2)[] | undefined): ConcreteImpl
  /** Get generic list menu items
   * @returns generic list menu items
   */
  getMenuItems(): TList['menuItems']
  /** Set generic list menu item groups
   * @param menuItemGroups - generic list menu item groups. See {@link MenuItemGroup} and {@link MenuItemGroupBuilder}
   * @returns generic list builder based on menu item groups provided.
   */
  menuItemGroups(menuItemGroups: (MenuItemGroup_2 | MenuItemGroupBuilder_2)[]): ConcreteImpl
  /** Get generic list menu item groups
   * @returns generic list menu item groups
   */
  getMenuItemGroups(): TList['menuItemGroups']
  /** Set generic list child
   * @param child - generic list child. See {@link Child}
   * @returns generic list builder based on child provided (clone).
   */
  child(child: Child_2): ConcreteImpl
  /** Get generic list child
   * @returns generic list child
   */
  getChild(): TList['child']
  /** Set generic list can handle intent
   * @param canHandleIntent - generic list intent checker. See {@link IntentChecker}
   * @returns generic list builder based on can handle intent provided.
   */
  canHandleIntent(canHandleIntent?: IntentChecker_2): ConcreteImpl
  /** Get generic list can handle intent
   * @returns generic list can handle intent
   */
  getCanHandleIntent(): TList['canHandleIntent']
  /** Set generic list display options
   * @param enabled - allow / disallow for showing icons
   * @returns generic list builder based on display options (showIcons) provided.
   */
  showIcons(enabled?: boolean): ConcreteImpl
  /** Get generic list display options
   * @returns generic list display options (specifically showIcons)
   */
  getShowIcons(): boolean | undefined
  /** Set generic list initial value templates
   * @param templates - generic list initial value templates. See {@link InitialValueTemplateItemBuilder}
   * @returns generic list builder based on templates provided.
   */
  initialValueTemplates(
    templates:
      | InitialValueTemplateItem
      | InitialValueTemplateItemBuilder_2
      | Array<InitialValueTemplateItem | InitialValueTemplateItemBuilder_2>,
  ): ConcreteImpl
  /** Get generic list initial value templates
   * @returns generic list initial value templates
   */
  getInitialValueTemplates(): TList['initialValueTemplates']
  /** Serialize generic list
   * @param options - serialization options. See {@link SerializeOptions}
   * @returns generic list object based on path provided in options. See {@link GenericList}
   */
  serialize(options?: SerializeOptions_2): GenericList_2
  /** Clone generic list builder (allows for options overriding)
   * @param _withSpec - generic list options.
   * @returns generic list builder.
   */
  abstract clone(_withSpec?: object): ConcreteImpl
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type GenericListInput = GenericListInput_2

/**
 * Interface for generic list input
 * Allows builders and only requires things not inferrable
 *
 * @public */
declare interface GenericListInput_2 extends StructureNode_2 {
  /** Input id */
  id: string
  /** Input title */
  title: string
  /** Input menu items groups. See {@link MenuItem} and {@link MenuItemBuilder} */
  menuItems?: (MenuItem_2 | MenuItemBuilder_2)[]
  /** Input menu items groups. See {@link MenuItemGroup} and {@link MenuItemGroupBuilder} */
  menuItemGroups?: (MenuItemGroup_2 | MenuItemGroupBuilder_2)[]
  /** Input initial value array. See {@link InitialValueTemplateItem} and {@link InitialValueTemplateItemBuilder} */
  initialValueTemplates?: (InitialValueTemplateItem | InitialValueTemplateItemBuilder_2)[]
  /** Input default layout. */
  defaultLayout?: PreviewLayoutKey
  /** If input can handle intent. See {@link IntentChecker} */
  canHandleIntent?: IntentChecker_2
  /** Input child of type {@link Child} */
  child?: Child_2
}

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const GenericViewBuilder: typeof GenericViewBuilder_2

/**
 * Class for building generic views.
 *
 * @public
 */
declare abstract class GenericViewBuilder_2<TView extends Partial<BaseView_2>, ConcreteImpl>
  implements Serializable<BaseView_2>
{
  /** Generic view option object */
  protected spec: TView
  /** Set generic view ID
   * @param id - generic view ID
   * @returns generic view builder based on ID provided.
   */
  id(id: string): ConcreteImpl
  /** Get generic view ID
   * @returns generic view ID
   */
  getId(): TView['id']
  /** Set generic view title
   * @param title - generic view title
   * @returns generic view builder based on title provided and (if provided) its ID.
   */
  title(title: string): ConcreteImpl
  /** Get generic view title
   * @returns generic view title
   */
  getTitle(): TView['title']
  /** Set generic view icon
   * @param icon - generic view icon
   * @returns generic view builder based on icon provided.
   */
  icon(icon: React.ComponentType | React.ReactNode): ConcreteImpl
  /** Get generic view icon
   * @returns generic view icon
   */
  getIcon(): TView['icon']
  /** Serialize generic view
   * @param options - serialization options. See {@link SerializeOptions}
   * @returns generic view object based on path provided in options. See {@link BaseView}
   */
  serialize(options?: SerializeOptions_2): BaseView_2
  /** Clone generic view builder (allows for options overriding)
   * @param withSpec - Partial generic view builder options. See {@link BaseView}
   * @returns Generic view builder.
   */
  abstract clone(withSpec?: Partial<BaseView_2>): ConcreteImpl
}

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const getOrderingMenuItem: typeof getOrderingMenuItem_2

/** @internal */
declare function getOrderingMenuItem_2(
  context: StructureContext_2,
  {by, title, i18n}: SortOrdering,
  extendedProjection?: string,
): MenuItemBuilder_2

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const getOrderingMenuItemsForSchemaType: typeof getOrderingMenuItemsForSchemaType_2

/** @internal */
declare function getOrderingMenuItemsForSchemaType_2(
  context: StructureContext_2,
  typeName: SchemaType | string,
): MenuItemBuilder_2[]

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const getTypeNamesFromFilter: typeof getTypeNamesFromFilter_2

/** @internal */
declare function getTypeNamesFromFilter_2(
  filter: string,
  params?: Record<string, unknown>,
): string[]

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const HELP_URL: typeof HELP_URL_2

/** @internal */
declare enum HELP_URL_2 {
  ID_REQUIRED = 'structure-node-id-required',
  TITLE_REQUIRED = 'structure-title-required',
  FILTER_REQUIRED = 'structure-filter-required',
  INVALID_LIST_ITEM = 'structure-invalid-list-item',
  COMPONENT_REQUIRED = 'structure-view-component-required',
  DOCUMENT_ID_REQUIRED = 'structure-document-id-required',
  DOCUMENT_TYPE_REQUIRED = 'structure-document-type-required',
  SCHEMA_TYPE_REQUIRED = 'structure-schema-type-required',
  SCHEMA_TYPE_NOT_FOUND = 'structure-schema-type-not-found',
  LIST_ITEMS_MUST_BE_ARRAY = 'structure-list-items-must-be-array',
  QUERY_PROVIDED_FOR_FILTER = 'structure-query-provided-for-filter',
  ACTION_OR_INTENT_REQUIRED = 'structure-action-or-intent-required',
  LIST_ITEM_IDS_MUST_BE_UNIQUE = 'structure-list-item-ids-must-be-unique',
  ACTION_AND_INTENT_MUTUALLY_EXCLUSIVE = 'structure-action-and-intent-mutually-exclusive',
  API_VERSION_REQUIRED_FOR_CUSTOM_FILTER = 'structure-api-version-required-for-custom-filter',
}

/** @public */
declare interface HookCollectionActionHook<Args, State> {
  (args: Args): State | null
  displayName?: string | undefined
}

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

/**
 * 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
 */
declare type IncompatibleTypeError = {
  type: 'INCOMPATIBLE_TYPE'
  expectedSchemaType: SchemaType
  resolvedValueType: string
  value: unknown
}

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const InitialValueTemplateItemBuilder: typeof InitialValueTemplateItemBuilder_2

/**
 * A `InitialValueTemplateItemBuilder` is used to build a document node with an initial value set.
 *
 * @public
 */
declare class InitialValueTemplateItemBuilder_2 implements Serializable<InitialValueTemplateItem> {
  /**
   * Structure context. See {@link StructureContext}
   */
  protected _context: StructureContext_2
  /** Initial Value template item option object. See {@link InitialValueTemplateItem} */
  protected spec: Partial<InitialValueTemplateItem>
  constructor(
    /**
     * Structure context. See {@link StructureContext}
     */
    _context: StructureContext_2,
    spec?: Partial<InitialValueTemplateItem>,
  )
  /** Set initial value template item builder ID
   * @param id - initial value template item ID
   * @returns initial value template item based on ID provided. See {@link InitialValueTemplateItemBuilder}
   */
  id(id: string): InitialValueTemplateItemBuilder_2
  /** Get initial value template item builder ID
   * @returns initial value template item ID. See {@link InitialValueTemplateItem}
   */
  getId(): Partial<InitialValueTemplateItem>['id']
  /** Set initial value template item title
   * @param title - initial value template item title
   * @returns initial value template item based on title provided. See {@link InitialValueTemplateItemBuilder}
   */
  title(title: string): InitialValueTemplateItemBuilder_2
  /** Get initial value template item title
   * @returns initial value template item title. See {@link InitialValueTemplateItem}
   */
  getTitle(): Partial<InitialValueTemplateItem>['title']
  /** Set initial value template item description
   * @param description - initial value template item description
   * @returns initial value template item builder based on description provided. See {@link InitialValueTemplateItemBuilder}
   */
  description(description: string): InitialValueTemplateItemBuilder_2
  /** Get initial value template item description
   * @returns initial value template item description. See {@link InitialValueTemplateItem}
   */
  getDescription(): Partial<InitialValueTemplateItem>['description']
  /** Set initial value template ID
   * @param templateId - initial value template item template ID
   * @returns initial value template item based builder on template ID provided. See {@link InitialValueTemplateItemBuilder}
   */
  templateId(templateId: string): InitialValueTemplateItemBuilder_2
  /** Get initial value template item template ID
   * @returns initial value template item ID. See {@link InitialValueTemplateItem}
   */
  getTemplateId(): Partial<InitialValueTemplateItem>['templateId']
  /** Get initial value template item template parameters
   * @param parameters - initial value template item parameters
   * @returns initial value template item builder based on parameters provided. See {@link InitialValueTemplateItemBuilder}
   */
  parameters(parameters: {[key: string]: any}): InitialValueTemplateItemBuilder_2
  /** Get initial value template item template parameters
   * @returns initial value template item parameters. See {@link InitialValueTemplateItem}
   */
  getParameters(): Partial<InitialValueTemplateItem>['parameters']
  /** Serialize initial value template item
   * @param options - serialization options. See {@link SerializeOptions}
   * @returns initial value template item object based on the path, index and hint provided in options. See {@link InitialValueTemplateItem}
   */
  serialize({path, index, hint}?: SerializeOptions_2): InitialValueTemplateItem
  /** Clone generic view builder (allows for options overriding)
   * @param withSpec - initial value template item builder options. See {@link InitialValueTemplateItemBuilder}
   * @returns initial value template item builder based on the context and options provided. See {@link InitialValueTemplateItemBuilder}
   */
  clone(withSpec?: Partial<InitialValueTemplateItem>): InitialValueTemplateItemBuilder_2
}

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

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type Intent = Intent_2

/**
 * Interface for intents
 * @public */
declare interface Intent_2 {
  /** Intent type */
  type: string
  /** Intent parameters. See {@link IntentParams}
   */
  params?: IntentParams_2
  searchParams?: SearchParam[]
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type IntentChecker = IntentChecker_2

/**
 * Interface for intent checker
 *
 * @public
 */
declare interface IntentChecker_2 {
  (
    /** Intent name */
    intentName: string,
    /** Intent checker parameter */
    params: {
      [key: string]: any
    },
    /** Structure context. See {@link StructureNode} */
    context: {
      pane: StructureNode_2
      index: number
    },
  ): boolean
  /** intent checker identify */
  identity?: symbol
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type IntentJsonParams = IntentJsonParams_2

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

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type IntentParams = IntentParams_2

/**
 * Intent parameters
 * See {@link structure.BaseIntentParams} and {@link structure.IntentJsonParams}
 *
 * @public
 */
declare type IntentParams_2 = BaseIntentParams_2 | [BaseIntentParams_2, IntentJsonParams_2]

/**
 * 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
 */
declare type InvalidItemTypeError = {
  type: 'INVALID_ITEM_TYPE'
  validTypes: SchemaType[]
  resolvedValueType: string
  value: unknown
}

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const isDocumentListItem: typeof isDocumentListItem_2

/** @internal */
declare function isDocumentListItem_2(item: unknown): item is DocumentListItem_2

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type ItemChild = ItemChild_2

/**
 * Item Child. See {@link CollectionBuilder} and {@link Collection}
 *
 * @public
 */
declare type ItemChild_2 = CollectionBuilder_2 | Collection_2 | undefined

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

/**
 * @hidden
 * @beta */
declare interface LayoutProps {
  renderDefault: (props: LayoutProps) => React.JSX.Element
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type List = List_2

/**
 * Interface for List
 *
 * @public
 */
declare interface List_2 extends GenericList_2 {
  type: 'list'
  /** List items. See {@link ListItem} and {@link Divider} */
  items: (ListItem_2 | Divider_2)[]
}

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const ListBuilder: typeof ListBuilder_2

/**
 * A `ListBuilder` is used to build a list of items in the structure tool.
 *
 * @public */
declare class ListBuilder_2 extends GenericListBuilder_2<BuildableList_2, ListBuilder_2> {
  /**
   * Structure context. See {@link StructureContext}
   */
  protected _context: StructureContext_2
  /** buildable list option object. See {@link BuildableList} */
  protected spec: BuildableList_2
  constructor(
    /**
     * Structure context. See {@link StructureContext}
     */
    _context: StructureContext_2,
    spec?: ListInput_2,
  )
  /**
   * Set list builder based on items provided
   * @param items - list items. See {@link ListItemBuilder}, {@link ListItem} and {@link Divider}
   * @returns list builder based on items provided. See {@link ListBuilder}
   */
  items(items: (ListItemBuilder_2 | ListItem_2 | Divider_2)[]): ListBuilder_2
  /** Get list builder items
   * @returns list items. See {@link BuildableList}
   */
  getItems(): BuildableList_2['items']
  /** Serialize list builder
   * @param options - serialization options. See {@link SerializeOptions}
   * @returns list based on path in options. See {@link List}
   */
  serialize(options?: SerializeOptions_2): List_2
  /**
   * Clone list builder and return new list builder based on context and spec provided
   * @param withSpec - list options. See {@link BuildableList}
   * @returns new list builder based on context and spec provided. See {@link ListBuilder}
   */
  clone(withSpec?: BuildableList_2): ListBuilder_2
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type ListDisplayOptions = ListDisplayOptions_2

/**
 * Interface for list display options
 *
 * @public */
declare interface ListDisplayOptions_2 {
  /** Check if list display should show icons */
  showIcons?: boolean
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type ListInput = ListInput_2

/**
 * Interface for list input
 *
 * @public
 */
declare interface ListInput_2 extends GenericListInput_2 {
  /** List input items array. See {@link ListItem}, {@link ListItemBuilder} and {@link Divider} */
  items?: (ListItem_2 | ListItemBuilder_2 | Divider_2)[]
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type ListItem = ListItem_2

/**
 * Interface for List Item
 *
 * @public */
declare interface ListItem_2 {
  /** List item id */
  id: string
  /** List item type */
  type: string
  /**
   * The i18n key and namespace used to populate the localized title. This is
   * the recommend way to set the title if you are localizing your studio.
   */
  i18n?: I18nTextRecord<'title'>
  /** List item title. Note that the `i18n` key and namespace will take precedence. */
  title?: string
  /** List item icon */
  icon?: React.ComponentType | React.ReactNode
  /** List item child. See {@link ListItemChild} */
  child?: ListItemChild_2
  /** List item display options. See {@link ListItemDisplayOptions} */
  displayOptions?: ListItemDisplayOptions_2
  /** List item schema type. See {@link SchemaType} */
  schemaType?: SchemaType
}

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const ListItemBuilder: typeof ListItemBuilder_2

/**
 * Class for building list items
 *
 * @public */
declare class ListItemBuilder_2 implements Serializable<ListItem_2> {
  /**
   * Structure context. See {@link StructureContext}
   */
  protected _context: StructureContext_2
  /** List item option object. See {@link PartialListItem} */
  protected spec: PartialListItem_2
  constructor(
    /**
     * Structure context. See {@link StructureContext}
     */
    _context: StructureContext_2,
    spec?: ListItemInput_2,
  )
  /**
   * Set list item ID
   * @returns list item builder based on ID provided. See {@link ListItemBuilder}
   */
  id(id: string): ListItemBuilder_2
  /**
   * Get list item ID
   * @returns list item ID. See {@link PartialListItem}
   */
  getId(): PartialListItem_2['id']
  /**
   * Set list item title
   * @returns list item builder based on title provided. See {@link ListItemBuilder}
   */
  title(title: string): ListItemBuilder_2
  /**
   * Get list item title
   * @returns list item title. See {@link PartialListItem}
   */
  getTitle(): PartialListItem_2['title']
  /** Set the i18n key and namespace used to populate the localized title.
   * @param i18n - the key and namespaced used to populate the localized title.
   * @returns component builder based on i18n key and ns provided
   */
  i18n(i18n: I18nTextRecord<'title'>): ListItemBuilder_2
  /** Get i18n key and namespace used to populate the localized title
   * @returns the i18n key and namespace used to populate the localized title
   */
  getI18n(): I18nTextRecord<'title'> | undefined
  /**
   * Set list item icon
   * @returns list item builder based on icon provided. See {@link ListItemBuilder}
   */
  icon(icon: React.ComponentType | React.ReactNode): ListItemBuilder_2
  /**
   * Set if list item should show icon
   * @returns list item builder based on showIcon provided. See {@link ListItemBuilder}
   */
  showIcon(enabled?: boolean): ListItemBuilder_2
  /**
   * Check if list item should show icon
   * @returns true if it should show the icon, false if not, undefined if not set
   */
  getShowIcon(): boolean | undefined
  /**
   *Get list item icon
   * @returns list item icon. See {@link PartialListItem}
   */
  getIcon(): PartialListItem_2['icon']
  /**
   * Set list item child
   * @param child - list item child. See {@link UnserializedListItemChild}
   * @returns list item builder based on child provided. See {@link ListItemBuilder}
   */
  child(child: UnserializedListItemChild_2): ListItemBuilder_2
  /**
   * Get list item child
   * @returns list item child. See {@link PartialListItem}
   */
  getChild(): PartialListItem_2['child']
  /**
   * Set list item schema type
   * @param schemaType - list item schema type. See {@link SchemaType}
   * @returns list item builder based on schema type provided. See {@link ListItemBuilder}
   */
  schemaType(schemaType: SchemaType | string): ListItemBuilder_2
  /**
   * Get list item schema type
   * @returns list item schema type. See {@link PartialListItem}
   */
  getSchemaType(): PartialListItem_2['schemaType']
  /** Serialize list item builder
   * @param options - serialization options. See {@link ListItemSerializeOptions}
   * @returns list item node based on path provided in options. See {@link ListItem}
   */
  serialize(options?: ListItemSerializeOptions_2): ListItem_2
  /** Clone list item builder
   * @param withSpec - partial list item options. See {@link PartialListItem}
   * @returns list item builder based on context and spec provided. See {@link ListItemBuilder}
   */
  clone(withSpec?: PartialListItem_2): ListItemBuilder_2
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type ListItemChild = ListItemChild_2

/**
 * Child of List Item
 * See {@link Collection}, {@link ChildResolver}, {@link ItemChild}
 * @public
 */
declare type ListItemChild_2 = Collection_2 | ChildResolver_2 | Observable<ItemChild_2> | undefined

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type ListItemDisplayOptions = ListItemDisplayOptions_2

/**
 * Interface for ist item display options
 *
 * @public */
declare interface ListItemDisplayOptions_2 {
  /** Check if list item display should show icon */
  showIcon?: boolean
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type ListItemInput = ListItemInput_2

/**
 * interface for list item input
 *
 * @public */
declare interface ListItemInput_2 {
  /** List item id */
  id: string
  /** List item title */
  title?: string
  /** List item icon */
  icon?: React.ComponentType | React.ReactNode
  /** List item child. See {@link ListItemChild} */
  child?: ListItemChild_2
  /** List item display options. See {@link ListItemDisplayOptions} */
  displayOptions?: ListItemDisplayOptions_2
  /** List item schema type. See {@link SchemaType} */
  schemaType?: SchemaType | string
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type ListItemSerializeOptions = ListItemSerializeOptions_2

/**
 * Interface for serialize list item options
 *
 * @public
 */
declare interface ListItemSerializeOptions_2 extends SerializeOptions_2 {
  /** Check if list item title is optional */
  titleIsOptional?: boolean
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type ListPaneNode = ListPaneNode_2

/** @internal */
declare interface ListPaneNode_2 extends BaseResolvedPaneNode<'list'> {
  defaultLayout?: GeneralPreviewLayoutKey
  displayOptions?: {
    showIcons?: boolean
  }
  items?: Array<PaneListItem_2 | PaneListItemDivider_2>
  source?: string
}

/**
 * A locale representation
 *
 * @public
 */
declare interface Locale_2 {
  /**
   * 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
 */
declare interface LocaleConfigContext {
  projectId: string
  dataset: string
}

/**
 * A locale definition, which describes a locale and its resources.
 *
 * @public
 */
declare interface LocaleDefinition extends Locale_2 {
  /**
   * 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
 */
declare type LocaleNestedResource = LocaleResourceRecord | string[]

/**
 * Options that defines or adds resources to existing locales
 *
 * @public
 */
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
}

/**
 * A collection of locale resources for a given locale and namespace.
 * In other words, an object of translated locale strings.
 *
 * @public
 */
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
 */
declare type LocaleResourceKey = string | LocaleNestedResource

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

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

/**
 * Either an array of locale definitions, or a resolver that returns one.
 *
 * @public
 */
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
 */
declare interface LocaleSource_2 {
  /**
   * Current locale ID (eg `en-US`, `nb-NO`, `th-TH`…)
   */
  currentLocale: Locale_2
  /**
   * Array of locale definitions
   */
  locales: Locale_2[]
  /**
   * 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
 */
declare interface LocaleWeekInfo {
  /**
   * An integer indicating the first day of the week for the locale.
   * Can be either 1 (Monday), 6 (Saturday) or 7 (Sunday).
   */
  firstDay: 1 | 6 | 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
}

/**
 * @beta
 * @hidden
 */
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
 */
declare type LoginMethod = 'dual' | 'cookie' | 'token'

/**
 * @hidden
 * @beta */
declare interface LogoProps {
  title: string
  renderDefault: (props: LogoProps) => React.JSX.Element
}

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const maybeSerializeInitialValueTemplateItem: typeof maybeSerializeInitialValueTemplateItem_2

/** @internal */
declare function maybeSerializeInitialValueTemplateItem_2(
  item: InitialValueTemplateItem | InitialValueTemplateItemBuilder_2,
  index: number,
  path: SerializePath_2,
): InitialValueTemplateItem

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const maybeSerializeMenuItem: typeof maybeSerializeMenuItem_2

/** @internal */
declare function maybeSerializeMenuItem_2(
  item: MenuItem_2 | MenuItemBuilder_2,
  index: number,
  path: SerializePath_2,
): MenuItem_2

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const maybeSerializeMenuItemGroup: typeof maybeSerializeMenuItemGroup_2

/** @internal */
declare function maybeSerializeMenuItemGroup_2(
  item: MenuItemGroup_2 | MenuItemGroupBuilder_2,
  index: number,
  path: SerializePath_2,
): MenuItemGroup_2

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const maybeSerializeView: typeof maybeSerializeView_2

/** @internal */
declare function maybeSerializeView_2(
  item: View_2 | Serializable<View_2>,
  index: number,
  path: SerializePath_2,
): View_2

/**
 * Config for the Sanity Media Library asset source integration.
 * @beta
 */
declare interface MediaLibraryConfig {
  /**
   * Whether the Media Library is enabled.
   */
  enabled?: boolean
  /**
   * The ID of the Media Library that is connected to the Studio.
   * If not provided, the Media Library will be automatically detected.
   */
  libraryId?: string
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type MenuItem = MenuItem_2

/**
 * Interface for menu items
 *
 * @public */
declare interface MenuItem_2 {
  /**
   * The i18n key and namespace used to populate the localized title. This is
   * the recommend way to set the title if you are localizing your studio.
   */
  i18n?: I18nTextRecord<'title'>
  /**
   * Menu Item title. Note that the `i18n` configuration will take
   * precedence and this title is left here as a fallback if no i18n key is
   * provided and compatibility with older plugins
   */
  title: string
  /** Menu Item action */
  action?: MenuItemActionType_2
  /** Menu Item intent */
  intent?: Intent_2
  /** Menu Item group */
  group?: string
  /** Menu Item icon */
  icon?: React.ComponentType | React.ReactNode
  /** Menu Item parameters. See {@link MenuItemParamsType} */
  params?: MenuItemParamsType_2
  /** Determine if it will show the MenuItem as action */
  showAsAction?: boolean
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type MenuItemActionType = MenuItemActionType_2

/**
 * Menu item action type
 * @public */
declare type MenuItemActionType_2 =
  | string
  | ((params: Record<string, string> | undefined, scope?: any) => void)

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const MenuItemBuilder: typeof MenuItemBuilder_2

/**
 * Class for building menu items.
 *
 * @public */
declare class MenuItemBuilder_2 implements Serializable<MenuItem_2> {
  /**
   * Structure context. See {@link StructureContext}
   */
  protected _context: StructureContext_2
  /** menu item option object. See {@link PartialMenuItem} */
  protected spec: PartialMenuItem_2
  constructor(
    /**
     * Structure context. See {@link StructureContext}
     */
    _context: StructureContext_2,
    spec?: MenuItem_2,
  )
  /**
   * Set menu item action
   * @param action - menu item action. See {@link MenuItemActionType}
   * @returns menu item builder based on action provided. See {@link MenuItemBuilder}
   */
  action(action: MenuItemActionType_2): MenuItemBuilder_2
  /**
   * Get menu item action
   * @returns menu item builder action. See {@link PartialMenuItem}
   */
  getAction(): PartialMenuItem_2['action']
  /**
   * Set menu item intent
   * @param intent - menu item intent. See {@link Intent}
   * @returns menu item builder based on intent provided. See {@link MenuItemBuilder}
   */
  intent(intent: Intent_2): MenuItemBuilder_2
  /**
   * Get menu item intent
   * @returns menu item intent. See {@link PartialMenuItem}
   */
  getIntent(): PartialMenuItem_2['intent']
  /**
   * Set menu item title
   * @param title - menu item title
   * @returns menu item builder based on title provided. See {@link MenuItemBuilder}
   */
  title(title: string): MenuItemBuilder_2
  /**
   * Get menu item title. Note that the `i18n` configuration will take
   * precedence and this title is left here for compatibility.
   * @returns menu item title
   */
  getTitle(): string | undefined
  /**
   * Set the i18n key and namespace used to populate the localized title.
   * @param i18n - object with i18n key and related namespace
   * @returns menu item builder based on i18n config provided. See {@link MenuItemBuilder}
   */
  i18n(i18n: I18nTextRecord<'title'>): MenuItemBuilder_2
  /**
   * Get the i18n key and namespace used to populate the localized title.
   * @returns the i18n key and namespace used to populate the localized title.
   */
  getI18n(): I18nTextRecord<'title'> | undefined
  /**
   * Set menu item group
   * @param group - menu item group
   * @returns menu item builder based on group provided. See {@link MenuItemBuilder}
   */
  group(group: string): MenuItemBuilder_2
  /**
   * Get menu item group
   * @returns menu item group. See {@link PartialMenuItem}
   */
  getGroup(): PartialMenuItem_2['group']
  /**
   * Set menu item icon
   * @param icon - menu item icon
   * @returns menu item builder based on icon provided. See {@link MenuItemBuilder}
   */
  icon(icon: React.ComponentType | React.ReactNode): MenuItemBuilder_2
  /**
   * Get menu item icon
   * @returns menu item icon. See {@link PartialMenuItem}
   */
  getIcon(): PartialMenuItem_2['icon']
  /**
   * Set menu item parameters
   * @param params - menu item parameters. See {@link MenuItemParamsType}
   * @returns menu item builder based on parameters provided. See {@link MenuItemBuilder}
   */
  params(params: MenuItemParamsType_2): MenuItemBuilder_2
  /**
   * Get meny item parameters
   * @returns menu item parameters. See {@link PartialMenuItem}
   */
  getParams(): PartialMenuItem_2['params']
  /**
   * Set menu item to show as action
   * @param showAsAction - determine if menu item should show as action
   * @returns menu item builder based on if it should show as action. See {@link MenuItemBuilder}
   */
  showAsAction(showAsAction?: boolean): MenuItemBuilder_2
  /**
   * Check if menu item should show as action
   * @returns true if menu item should show as action, false if not. See {@link PartialMenuItem}
   */
  getShowAsAction(): PartialMenuItem_2['showAsAction']
  /** Serialize menu item builder
   * @param options - serialization options. See {@link SerializeOptions}
   * @returns menu item node based on path provided in options. See {@link MenuItem}
   */
  serialize(options?: SerializeOptions_2): MenuItem_2
  /** Clone menu item builder
   * @param withSpec - menu item options. See {@link PartialMenuItem}
   * @returns menu item builder based on context and spec provided. See {@link MenuItemBuilder}
   */
  clone(withSpec?: PartialMenuItem_2): MenuItemBuilder_2
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type MenuItemGroup = MenuItemGroup_2

/**
 * Interface for menu item groups
 * @public
 */
declare interface MenuItemGroup_2 {
  /** Menu group Id */
  id: string
  /** Menu group title */
  title: string
  i18n?: I18nTextRecord<'title'>
}

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const MenuItemGroupBuilder: typeof MenuItemGroupBuilder_2

/**
 * Class for building menu item groups.
 *
 * @public
 */
declare class MenuItemGroupBuilder_2 implements Serializable<MenuItemGroup_2> {
  /**
   * Structure context. See {@link StructureContext}
   */
  protected _context: StructureContext_2
  /** Menu item group ID */
  protected _id: string
  /** Menu item group title */
  protected _title: string
  protected _i18n?: I18nTextRecord<'title'>
  constructor(
    /**
     * Structure context. See {@link StructureContext}
     */
    _context: StructureContext_2,
    spec?: MenuItemGroup_2,
  )
  /**
   * Set menu item group ID
   * @param id - menu item group ID
   * @returns menu item group builder based on ID provided. See {@link MenuItemGroupBuilder}
   */
  id(id: string): MenuItemGroupBuilder_2
  /**
   * Get menu item group ID
   * @returns menu item group ID
   */
  getId(): string
  /**
   * Set menu item group title
   * @param title - menu item group title
   * @returns menu item group builder based on title provided. See {@link MenuItemGroupBuilder}
   */
  title(title: string): MenuItemGroupBuilder_2
  /**
   * Get menu item group title
   * @returns menu item group title
   */
  getTitle(): string
  /**
   * Set the i18n key and namespace used to populate the localized title.
   * @param i18n - object with i18n key and related namespace
   * @returns menu item group builder based on i18n info provided. See {@link MenuItemGroupBuilder}
   */
  i18n(i18n: I18nTextRecord<'title'>): MenuItemGroupBuilder_2
  /**
   * Get the i18n key and namespace used to populate the localized title.
   * @returns the i18n key and namespace used to populate the localized title.
   */
  getI18n(): I18nTextRecord<'title'> | undefined
  /**
   * Serialize menu item group builder
   * @param options - serialization options (path). See {@link SerializeOptions}
   * @returns menu item group based on path provided in options. See {@link MenuItemGroup}
   */
  serialize(options?: SerializeOptions_2): MenuItemGroup_2
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type MenuItemParamsType = MenuItemParamsType_2

/**
 * Menu items parameters
 *
 * @public */
declare type MenuItemParamsType_2 = Record<string, string | unknown | undefined>

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const menuItemsFromInitialValueTemplateItems: typeof menuItemsFromInitialValueTemplateItems_2

/** @internal */
declare function menuItemsFromInitialValueTemplateItems_2(
  context: StructureContext_2,
  templateItems: InitialValueTemplateItem[],
): MenuItem_2[]

/**
 * This error may happen for arrays of objects where one or more of the members are missing a _key
 *
 * @public
 */
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
 */
declare type MixedArrayError = {
  type: 'MIXED_ARRAY'
  schemaType: ArraySchemaType
  value: unknown[]
}

/**
 * @internal
 * @beta
 * An internal API for defining actions in the navbar.
 */
declare type NavbarAction = Action | ActionWithCustomRender

declare interface NavbarActionBase {
  icon?: React.ComponentType
  location: 'topbar' | 'sidebar'
  name: string
}

/**
 * @hidden
 * @beta */
declare interface NavbarProps {
  renderDefault: (props: NavbarProps) => React.JSX.Element
  /**
   * @internal
   * @beta */
  __internal_actions?: NavbarAction[]
}

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

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

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

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

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

/**
 * @hidden
 * @public */
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 */
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
 * @public */
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 */
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
 * @public */
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
  /**
   * @deprecated – DO NOT USE
   *
   * The node for the array editing modal.
   * This node renders the array editing modal as a child of the root input.
   * It is necessary for the array editing dialog to be a child of the root input
   * because the root input may be wrapped in a React context using the Components API,
   * which is utilized by inputs in the form.
   */
  __internal_arrayEditingModal?: ReactNode
}

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

/**
 * Props for the ObjectItem component.
 * @public
 */
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 */
declare type ObjectMember = FieldMember | FieldSetMember | FieldError

/**
 * @hidden
 * @beta */
declare interface OnPathFocusPayload {
  selection?: EditorSelection
}

/**
 * @internal
 */
declare const PaneContainer: NamedExoticComponent<BaseStructureToolPaneProps<'documentList'>>

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const PaneLayout: typeof PaneLayout_2

/**
 *
 * @hidden
 * @beta This API will change. DO NOT USE IN PRODUCTION.
 */
declare function PaneLayout_2(
  props: PaneLayoutProps &
    CardProps &
    Omit<HTMLProps<HTMLDivElement>, 'as' | 'height' | 'ref' | 'wrap'>,
): JSX_2.Element

/**
 *
 * @hidden
 * @beta This API will change. DO NOT USE IN PRODUCTION.
 */
declare interface PaneLayoutProps {
  minWidth?: number
  onCollapse?: () => void
  onExpand?: () => void
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type PaneListItem = PaneListItem_2

/** @internal */
declare interface PaneListItem_2<TParams = unknown> {
  type: 'listItem'
  id: string
  _id?: string
  schemaType?: SchemaType
  title: string
  i18n?: I18nTextRecord<'title'>
  icon?: React.ComponentType | false
  displayOptions?: {
    showIcon?: boolean
  }
  action?: (t: TParams) => unknown
  params?: TParams
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type PaneListItemDivider = PaneListItemDivider_2

/** @internal */
declare interface PaneListItemDivider_2 {
  type: 'divider'
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type PaneMenuItem = PaneMenuItem_2

/**
 * Represents what can be passed into `menuItems` inside of structure-tool panes
 *
 * @see BaseResolvedPaneNode
 *
 * @internal
 */
declare interface PaneMenuItem_2 extends MenuItem_2 {
  isDisabled?: boolean
  shortcut?: string
  selected?: boolean
  tone?: 'primary' | 'positive' | 'caution' | 'critical'
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type PaneMenuItemGroup = PaneMenuItemGroup_2

/** @internal */
declare interface PaneMenuItemGroup_2 {
  id: string
  title?: string
  i18n?: I18nTextRecord<'title'>
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type PaneNode = PaneNode_2

/** @internal */
declare type PaneNode_2 =
  | CustomComponentPaneNode_2
  | DocumentPaneNode_2
  | DocumentListPaneNode_2
  | ListPaneNode_2

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type PaneNodeResolver = PaneNodeResolver_2

/** @internal */
declare type PaneNodeResolver_2 = (
  id: string,
  context: RouterPaneSiblingContext_2,
) => UnresolvedPaneNode_2

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type PaneRouterContextValue = PaneRouterContextValue_2

/**
 * @hidden
 * @beta */
declare interface PaneRouterContextValue_2 {
  /**
   * Zero-based index (position) of pane, visually
   */
  index: number
  /**
   * Zero-based index of pane group (within URL structure)
   */
  groupIndex: number
  /**
   * Zero-based index of pane within sibling group
   */
  siblingIndex: number
  /**
   * Payload of the current pane
   */
  payload?: unknown
  /**
   * Params of the current pane
   */
  params?: RouterPaneSibling_2['params']
  /**
   * Whether or not the pane has any siblings (within the same group)
   */
  hasGroupSiblings: boolean
  /**
   * The length of the current group
   */
  groupLength: number
  /**
   * Current router state for the "panes" property
   */
  routerPanesState: RouterPanes_2
  /**
   * Curried StateLink that passes the correct state automatically
   */
  ChildLink: ComponentType<ChildLinkProps_2>
  /**
   * Curried StateLink that pops off the last pane group
   */
  BackLink?: ComponentType<BackLinkProps_2>
  /**
   * A specialized `ChildLink` that takes in the needed props to open a
   * referenced document to the right
   */
  ReferenceChildLink: ComponentType<ReferenceChildLinkProps_2>
  /**
   * Similar to `ReferenceChildLink` expect without the wrapping component
   */
  handleEditReference: (options: EditReferenceOptions_2) => void
  /**
   * Curried StateLink that passed the correct state, but merges params/payload
   */
  ParameterizedLink: ComponentType<ParameterizedLinkProps_2>
  /**
   * Replaces the current pane with a new one
   */
  replaceCurrent: (pane: {id?: string; payload?: unknown; params?: Record<string, string>}) => void
  /**
   * Removes the current pane from the group
   */
  closeCurrent: () => void
  /**
   * Removes all panes to the right including current pane
   */
  closeCurrentAndAfter: (expandLast?: boolean) => void
  /**
   * Duplicate the current pane, with optional overrides for item ID and parameters
   */
  duplicateCurrent: (pane?: {payload?: unknown; params?: Record<string, string>}) => void
  /**
   * Set the current "view" for the pane
   */
  setView: (viewId: string | null) => void
  /**
   * Set the parameters for the current pane
   */
  setParams: (params: Record<string, string | undefined>) => void
  /**
   * Set the payload for the current pane
   */
  setPayload: (payload: unknown) => void
  /**
   * A function that creates a path with the given parameters without navigating to it.
   * Useful for creating links that can be e.g. copied to clipboard and shared.
   */
  createPathWithParams: (params: Record<string, string | undefined>) => string
  /**
   * Proxied navigation to a given intent. Consider just exposing `router` instead?
   */
  navigateIntent: (
    intentName: string,
    params: Record<string, string>,
    options?: {
      replace?: boolean
    },
  ) => void
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type ParameterizedLinkProps = ParameterizedLinkProps_2

/**
 * @hidden
 * @beta */
declare interface ParameterizedLinkProps_2 {
  params?: Record<string, string>
  payload?: unknown
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type PartialDocumentList = PartialDocumentList_2

/**
 * Partial document list
 *
 * @public
 */
declare interface PartialDocumentList_2 extends BuildableGenericList_2 {
  /** Document list options. See {@link DocumentListOptions} */
  options?: DocumentListOptions_2
  /** Schema type name */
  schemaTypeName?: string
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type PartialDocumentListItem = PartialDocumentListItem_2

/**
 * Partial document list item
 *
 * @public
 */
declare type PartialDocumentListItem_2 = Partial<UnserializedListItem_2>

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type PartialDocumentNode = PartialDocumentNode_2

/**
 * Interface for partial document (focused on the document pane)
 *
 * @public */
declare interface PartialDocumentNode_2 {
  /** Document Id */
  id?: string
  /** Document title */
  title?: string
  /** I18n key and namespace used to populate the localized title */
  i18n?: I18nTextRecord<'title'>
  /** Document children of type {@link Child} */
  child?: Child_2
  /**
   * Views for the document pane. See {@link ViewBuilder} and {@link View}
   */
  views?: (View_2 | ViewBuilder_2)[]
  /**
   * Document options. See {@link DocumentOptions}
   */
  options?: Partial<DocumentOptions_2>
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type PartialListItem = PartialListItem_2

/**
 * Partial list item. See {@link UnserializedListItem}
 *
 * @public */
declare type PartialListItem_2 = Partial<UnserializedListItem_2>

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type PartialMenuItem = PartialMenuItem_2

/**
 * Partial menu items
 * @public
 */
declare type PartialMenuItem_2 = Partial<MenuItem_2>

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

/**
 *
 * @hidden
 * @beta
 */
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
 */
declare type Plugin_2<TOptions = void> = (options: TOptions) => PluginOptions

/** @beta */
declare interface PluginOptions {
  name: string
  plugins?: PluginOptions[]
  schema?: SchemaPluginOptions
  document?: DocumentPluginOptions
  tools?: Tool[] | ComposableOption<Tool[], ConfigContext_2>
  form?: SanityFormConfig
  __internal_tasks?: {
    footerAction: ReactNode
  }
  studio?: {
    /**
     * Components for the studio.
     * @hidden
     * @beta
     */
    components?: StudioComponentsPluginOptions
  }
  /**
   * Config for the Sanity Media Library asset source integration.
   * @beta
   */
  mediaLibrary?: MediaLibraryConfig
  /** @beta @hidden */
  i18n?: LocalePluginOptions
  search?: {
    unstable_partialIndexing?: {
      enabled: boolean
    }
    /**
     * Control the strategy used for searching documents. This should generally only be used if you
     * wish to try experimental search strategies.
     *
     * This option takes precedence over the deprecated `search.enableLegacySearch` option.
     *
     * Can be one of:
     *
     * - `"groqLegacy"` (default): Use client-side tokenization and schema introspection to search
     *   using the GROQ Query API.
     * - `"groq2024"`: (experimental) Perform full text searching using the GROQ Query API and its
     *   new `text::matchQuery` function.
     */
    strategy?: SearchStrategy
    /**
     * Enables the legacy Query API search strategy.
     *
     * @deprecated Use `search.strategy` instead.
     */
    enableLegacySearch?: boolean
  }
  /** @internal */
  __internal_serverDocumentActions?: WorkspaceOptions['__internal_serverDocumentActions']
  /** Configuration for studio beta features.
   * @internal
   */
  beta?: BetaFeatures
  /** Configuration for error handling.
   * @beta
   */
  onUncaughtError?: (error: Error, errorInfo: ErrorInfo) => void
  /**
   * @hidden
   * @internal
   */
  announcements?: {
    enabled: boolean
  }
}

/**
 * Component props for the {@link PortableTextInput} React component.
 *
 * Extends {@link ArrayOfObjectsInputProps}.
 *
 * @public
 * */
declare interface PortableTextInputProps
  extends ArrayOfObjectsInputProps<PortableTextBlock, ArraySchemaType<PortableTextBlock>> {
  /**
   * A React Ref that can reference the underlying editor instance
   */
  editorRef?: React.MutableRefObject<PortableTextEditor | null>
  /**
   * Option to hide the default toolbar
   */
  hideToolbar?: boolean
  /**
   * Assign hotkeys that can be attached to custom editing functions
   */
  hotkeys?: HotkeyOptions
  /**
   * Whether the input is activated and should receive events on mount.
   * By default, PTE inputs need to be manually activated by focusing them.
   */
  initialActive?: boolean
  /**
   * Whether the input is _initially_ open in fullscreen mode
   */
  initialFullscreen?: boolean
  /**
   * 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
  /**
   * Function to render the PortableTextInput's editable component.
   * This is the actual contentEditable element that users type into.
   * @hidden
   * @beta
   */
  renderEditable?: (props: RenderPortableTextInputEditableProps) => React.JSX.Element
  /**
   * 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
 */
declare interface PortableTextMarker {
  type: string
  data?: unknown
  path: Path
}

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

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

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

/**
 * @hidden
 * @beta
 */
declare interface PreviewProps<TLayoutKey = PreviewLayoutKey_2> {
  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) => React.JSX.Element
}

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

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

/** @public */
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
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type ReferenceChildLinkProps = ReferenceChildLinkProps_2

/**
 * @hidden
 * @beta */
declare interface ReferenceChildLinkProps_2 {
  documentId: string
  documentType: string
  parentRefPath: Path
  template?: {
    id: string
    params?: Record<string, string | number | boolean>
  }
  children: ReactNode
}

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

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

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

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

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

/**
 * @hidden
 * @public */
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
 */
declare type RenderCustomMarkers = (markers: PortableTextMarker[]) => ReactNode

/**
 * @hidden
 * @public */
declare type RenderFieldCallback<T extends FieldProps = FieldProps> = (
  fieldProps: Omit<T, 'renderDefault'>,
) => ReactNode

/**
 * @hidden
 * @public */
declare type RenderInputCallback<T extends InputProps = InputProps> = (
  inputProps: Omit<T, 'renderDefault'>,
) => ReactNode

/** @public */
declare interface RenderPortableTextInputEditableProps extends PortableTextEditableProps {
  renderDefault: RenderEditableFunction
}

/**
 * @hidden
 * @public */
declare type RenderPreviewCallback = (props: RenderPreviewCallbackProps) => ReactNode

/**
 *
 * @hidden
 * @public
 */
declare interface RenderPreviewCallbackProps<TLayoutKey = PreviewLayoutKey_2> {
  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
}

/**
 * @hidden
 * @beta
 */
declare interface ResolveProductionUrlContext extends ConfigContext_2 {
  document: SanityDocumentLike
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type RouterPaneGroup = RouterPaneGroup_2

/**
 * Represents a "pane group" in the router.
 *
 * @see RouterPanes
 *
 *
 * @hidden
 * @beta
 */
declare type RouterPaneGroup_2 = RouterPaneSibling_2[]

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type RouterPanes = RouterPanes_2

/**
 * Represents the state of the `panes` inside the structure-tool router
 *
 * - The structure tool stores the state of the current panes inside of the router.
 * - The panes are stored in groups delimited in the URL by `;`.
 * - In each group, there can be one or more sibling (aka split) panes delimited
 *   by `|`.
 * - Each item pane can contain it's own parameters and payloads
 * - Per item pane in each group, if not specified separately, the ID, params,
 *   and payload will be inherited from the first item pane in the pane group
 *   (unless it's an `exclusiveParam`)
 *
 * E.g. `/structure/books;book-123|,view=preview` will parse to:
 *
 * ```js
 * [
 *   // first pane group
 *   [{id: 'book'}],
 *
 *   // second pane group
 *   [
 *     [
 *       // first pane item
 *       {id: 'book-123'},
 *       // second pane item
 *       {id: 'book-123', params: {view: 'preview'}},
 *     ],
 *   ],
 * ]
 * ```
 *
 * @hidden
 * @beta
 */
declare type RouterPanes_2 = RouterPaneGroup_2[]

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type RouterPaneSibling = RouterPaneSibling_2

/**
 * Represents a "sibling pane" or "split pane" in the router.
 *
 * @see RouterPanes
 *
 *
 * @hidden
 * @beta
 */
declare interface RouterPaneSibling_2 {
  id: string
  params?: Record<string, string | undefined>
  payload?: unknown
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type RouterPaneSiblingContext = RouterPaneSiblingContext_2

/**
 * Passed as the second argument to the item of resolving pane children
 *
 * @see RouterPanes
 *
 * @internal
 */
declare interface RouterPaneSiblingContext_2 {
  id: string
  parent: PaneNode_2 | null
  index: number
  splitIndex: number
  path: string[]
  params: Record<string, string | undefined>
  payload: unknown
  structureContext: StructureContext_2
  serializeOptions?: {
    path: (string | number)[]
    index?: number
    hint?: string
  }
}

/**
 * @public
 */
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
  }
}

/**
 * @public
 */
declare interface ScheduledPublishingPluginOptions {
  /**
   * Whether scheduled publishing is enabled for this workspace.
   */
  enabled: boolean
  /**
   * Date format to use for input fields. This must be a valid `date-fns` {@link https://date-fns.org/docs/format | formatted string}.
   * @defaultValue 'dd/MM/yyyy HH:mm' make sure to specify minutes and hours if you are specifying a custom format
   */
  inputDateTimeFormat?: string
  /**
   * @hidden
   * Whether scheduled publishing is enabled by the workspace.
   * Sanity is enabling it by default in the config, {@link "../scheduledPublishing/constants.ts"}
   */
  __internal__workspaceEnabled?: boolean
  /**
   * Whether to show the use releases warning banner in the tool.
   * @defaultValue true
   */
  showReleasesBanner?: boolean
}

/**
 * @hidden
 * @beta
 */
declare interface SchemaPluginOptions {
  name?: string
  types?:
    | SchemaTypeDefinition[]
    | ComposableOption<
        SchemaTypeDefinition[],
        Omit<ConfigContext_2, 'schema' | 'currentUser' | 'getClient' | 'client' | 'i18n'>
      >
  templates?: Template[] | TemplateResolver
}

/**
 *  A interface for serializing a structure node to a plain JavaScript object.
 *
 * @public
 */
export declare interface Serializable<T> {
  serialize(options: SerializeOptions_2): T
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type SerializablePaneNode = SerializablePaneNode_2

/** @internal */
declare type SerializablePaneNode_2 = {
  serialize(context: RouterPaneSiblingContext_2): UnresolvedPaneNode_2
}

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const SerializeError: typeof SerializeError_2

/** @internal */
declare class SerializeError_2 extends Error {
  readonly path: SerializePath_2
  helpId?: HELP_URL_2
  constructor(
    message: string,
    parentPath: SerializePath_2,
    pathSegment: string | number | undefined,
    hint?: string,
  )
  withHelpUrl(id: HELP_URL_2): SerializeError_2
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type SerializeOptions = SerializeOptions_2

/**
 * Interface for seraializing a structure node
 * @public */
declare interface SerializeOptions_2 {
  /** path. See {@link SerializePath} */
  path: SerializePath_2
  /** index */
  index?: number
  /** hint */
  hint?: string
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type SerializePath = SerializePath_2

/**
 * Path of a serialized structure node
 *
 * @public
 */
declare type SerializePath_2 = (string | number)[]

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const shallowIntentChecker: IntentChecker_2

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type SortMenuItem = SortMenuItem_2

/** @internal */
declare interface SortMenuItem_2 extends MenuItem_2 {
  params: {
    by: SortOrderingItem[]
  }
}

/** @public */
declare interface SourceClientOptions {
  /**
   * API version to use. See {@link https://www.sanity.io/docs/api-versioning | api-versioning}
   */
  apiVersion: string
}

/**
 * @hidden
 * @beta
 */
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
}

/**
 * @hidden
 * @public */
declare interface StringFieldProps extends BaseFieldProps {
  schemaType: StringSchemaType
  value: string | undefined
  inputProps: StringInputProps
}

/** @public */
declare type StringFormNode<S extends StringSchemaType = StringSchemaType> = BaseFormNode<string, S>

/**
 * @hidden
 * @public */
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
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type StructureBuilder = StructureBuilder_2

/**
 * Interface for the structure builder.
 *
 * @public
 */
declare interface StructureBuilder_2 {
  /**
   * @internal
   */
  component: (spec?: ComponentInput_2 | UserComponent_2) => ComponentBuilder_2
  /** By giving an object of options with documentID and its schema type receive the the respective Document builder
   * @param options - an object holding the documentId and schemaType for the document node being resolved.
   * @returns a Document builder. See {@link DocumentBuilder}
   */
  defaultDocument: (options: {documentId?: string; schemaType: string}) => DocumentBuilder_2
  /** Get an array of Item builders that take Initial Value template into consideration
   * @returns an array of initial value template item builders. See {@link ListItemBuilder}
   */
  defaultInitialValueTemplateItems: () => InitialValueTemplateItemBuilder_2[]
  /** Get the default List builder
   * @returns a List builder. See {@link ListBuilder}
   */
  defaults: () => ListBuilder_2
  /** Get a structure Divider
   * @returns a Divider. See {@link Divider}
   */
  divider: () => Divider_2
  /** By giving a partial Document Node receive the respective Document Builder
   * @param spec - a partial document node. See {@link PartialDocumentNode}
   * @returns a Document builder. See {@link DocumentBuilder}
   */
  document: (spec?: PartialDocumentNode_2) => DocumentBuilder_2
  /** By giving a Document List Input receive the respective Document List Builder
   * @param spec - a document list input. See {@link DocumentListInput}
   * @returns a Document List builder. See {@link DocumentListBuilder}
   */
  documentList: (spec?: DocumentListInput_2) => DocumentListBuilder_2
  /** By giving a Document List Item Input receive the respective Document List Item builder
   * @param spec - a document list item input. See {@link DocumentListItemInput}
   * @returns a Document List Item builder. See {@link DocumentListItemBuilder}
   */
  documentListItem: (spec?: DocumentListItemInput_2) => DocumentListItemBuilder_2
  /** By giving a type name or Document Type List Input receive the respective Document List Builder
   * @param typeNameOrSpec - a type name or a document type list input. See {@link DocumentTypeListInput}
   * @returns a Document List builder. See {@link DocumentListBuilder}
   */
  documentTypeList: (typeNameOrSpec: string | DocumentTypeListInput_2) => DocumentListBuilder_2
  /** By providing a type name receive a List Item builder
   * @param typeName - a type name
   * @returns a List Item builder. See {@link ListItemBuilder}
   */
  documentTypeListItem: (typeName: string) => ListItemBuilder_2
  /** Get an array of List Item builders
   * @returns an array of list item builders. See {@link ListItemBuilder}
   */
  documentTypeListItems: () => ListItemBuilder_2[]
  /** By giving a templateID and a set of parameters receive a Document builder that takes InitialValueTemplate into account
   * @param templateId - a template ID
   * @param parameters - an object of parameters
   * @returns a Document builder. See {@link DocumentBuilder}
   */
  documentWithInitialValueTemplate: (
    templateId: string,
    parameters?: Record<string, unknown>,
  ) => DocumentBuilder_2
  /** By giving a Editor Node receive the respective Document Builder
   * @param spec - an editor node. See {@link EditorNode}
   * @returns a Document builder. See {@link DocumentBuilder}
   */
  editor: (spec?: EditorNode_2) => DocumentBuilder_2
  /** By giving a templateID and a set of parameters receive an Item Builder that takes InitialValueTemplate into account
   * @param templateId - a template ID
   * @param parameters - an object of parameters
   * @returns an Item builder. See {@link ListItemBuilder}
   */
  initialValueTemplateItem: (
    templateId: string,
    parameters?: Record<string, any>,
  ) => InitialValueTemplateItemBuilder_2
  /** By giving a List Input receive the respective Builder, otherwise return default ListBuilder builder
   * @param spec - a list input. See {@link ListInput}
   * @returns a List builder. See {@link ListBuilder}
   */
  list: (spec?: ListInput_2) => ListBuilder_2
  /** By giving a List Item Input receive the respective Builder, otherwise return default ListItem builder
   * @param spec - a list item input. See {@link ListItemInput}
   * @returns a List Item builder. See {@link ListItemBuilder}
   */
  listItem: (spec?: ListItemInput_2) => ListItemBuilder_2
  /** By giving a Menu Item receive the respective Builder, otherwise return default MenuItem builder
   * @param spec - a menu item. See {@link MenuItem}
   * @returns a Menu Item builder. See {@link MenuItemBuilder}
   */
  menuItem: (spec?: MenuItem_2) => MenuItemBuilder_2
  /** By giving a Menu Item Group receive the respective Builder
   * @param spec - a menu item group. See {@link MenuItemGroup}
   * @returns a Menu Item Group builder. See {@link MenuItemGroupBuilder}
   */
  menuItemGroup: (spec?: MenuItemGroup_2) => MenuItemGroupBuilder_2
  /** By giving an array of initial value template receive an array of Menu Items, otherwise return default MenuItem builder
   * @param templateItems - an array of initial value template items. See {@link InitialValueTemplateItem}
   * @returns an array of Menu Items. See {@link MenuItem}
   */
  menuItemsFromInitialValueTemplateItems: (
    templateItems: InitialValueTemplateItem[],
  ) => MenuItem_2[]
  /** By giving a sort ordering object receive a Menu Item Builder
   * @param ordering - a sort ordering object. See {@link SortOrdering}
   * @returns a Menu Item builder. See {@link MenuItemBuilder}
   */
  orderingMenuItem: (ordering: SortOrdering) => MenuItemBuilder_2
  /** By giving a type receive a list of Menu Items ordered by it
   * @param type - a type
   * @returns an array of Menu Items. See {@link MenuItem}
   */
  orderingMenuItemsForType: (type: string) => MenuItemBuilder_2[]
  /** View for structure */
  view: {
    /** form for view
     * @param spec - a partial form view. See {@link FormView}
     * @returns a Form View builder. See {@link FormViewBuilder}
     */
    form: (spec?: Partial<FormView_2>) => FormViewBuilder_2
    /** component for view
     * @param componentOrSpec - a partial component view or a React component. See {@link ComponentView}
     * @returns a Component View builder. See {@link ComponentViewBuilder}
     */
    component: (
      componentOrSpec?: Partial<ComponentView_2> | React.ComponentType<any>,
    ) => ComponentViewBuilder_2
  }
  /** Context for the structure builder. See {@link StructureContext} */
  context: StructureContext_2
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type StructureBuilderOptions = StructureBuilderOptions_2

/** @internal */
declare interface StructureBuilderOptions_2 {
  source: Source
  defaultDocumentNode?: DefaultDocumentNodeResolver_2
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type StructureContext = StructureContext_2

/**
 * Interface for the structure builder context.
 *
 * @public
 */
declare interface StructureContext_2 extends Source {
  /** Resolve document method
   * @returns a document node builder, or null/undefined if no document node should be returned.
   * See {@link DocumentBuilder}
   */
  resolveDocumentNode: (
    /** an object holding the documentId and schemaType for the document node being resolved. */
    options: {
      documentId?: string
      schemaType: string
    },
  ) => DocumentBuilder_2
  /** Get structure builder
   * @returns a structure builder. See {@link StructureBuilder}
   */
  getStructureBuilder: () => StructureBuilder_2
}

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const structureLocaleNamespace: 'structure'

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type StructureLocaleResourceKeys = StructureLocaleResourceKeys_2

/**
 * @alpha
 */
declare type StructureLocaleResourceKeys_2 = keyof typeof structureLocaleStrings

/**
 * Defined locale strings for the structure tool, in US English.
 *
 * @internal
 */
declare const structureLocaleStrings: {
  /** Label for the "Copy Document URL" document action */
  'action.copy-document-url.label': string
  /** Tooltip when action button is disabled because the operation is not ready   */
  'action.delete.disabled.not-ready': string
  /** Tooltip when action button is disabled because the document does not exist */
  'action.delete.disabled.nothing-to-delete': string
  /** Label for the "Delete" document action button */
  'action.delete.label': string
  /** Label for the "Delete" document action while the document is being deleted */
  'action.delete.running.label': string
  /** Message prompting the user to confirm discarding changes */
  'action.discard-changes.confirm-dialog.confirm-discard-changes': string
  /** Tooltip when action is disabled because the document has no unpublished changes */
  'action.discard-changes.disabled.no-change': string
  /** Tooltip when action is disabled because the document is not published */
  'action.discard-changes.disabled.not-published': string
  /** Tooltip when action button is disabled because the operation is not ready   */
  'action.discard-changes.disabled.not-ready': string
  /** Label for the "Discard changes" document action */
  'action.discard-changes.label': string
  /** Tooltip when action is disabled because the operation is not ready   */
  'action.duplicate.disabled.not-ready': string
  /** Tooltip when action is disabled because the document doesn't exist */
  'action.duplicate.disabled.nothing-to-duplicate': string
  /** Label for the "Duplicate" document action */
  'action.duplicate.label': string
  /** Label for the "Duplicate" document action while the document is being duplicated */
  'action.duplicate.running.label': string
  /** Tooltip when publish button is disabled because the document is already published, and published time is unavailable.*/
  'action.publish.already-published.no-time-ago.tooltip': string
  /** Tooltip when publish button is disabled because the document is already published.*/
  'action.publish.already-published.tooltip': string
  /** Tooltip when action is disabled because the studio is not ready.*/
  'action.publish.disabled.not-ready': string
  /** Label for action when there are pending changes.*/
  'action.publish.draft.label': string
  /** Label for the "Publish" document action */
  'action.publish.label': string
  /** Label for the "Publish" document action when the document has live edit enabled.*/
  'action.publish.live-edit.label': string
  /** Fallback tooltip for the "Publish" document action when publish is invoked for a document with live edit enabled.*/
  'action.publish.live-edit.publish-disabled': string
  /** Tooltip for the "Publish" document action when the document has live edit enabled.*/
  'action.publish.live-edit.tooltip': string
  /** Tooltip when publish button is disabled because there are no changes.*/
  'action.publish.no-changes.tooltip': string
  /** Label for the "Publish" document action when there are no changes.*/
  'action.publish.published.label': string
  /** Label for the "Publish" document action while publish is being executed.*/
  'action.publish.running.label': string
  /** Tooltip when the "Publish" document action is disabled due to validation issues */
  'action.publish.validation-issues.tooltip': string
  /** Tooltip when publish button is waiting for validation and async tasks to complete.*/
  'action.publish.waiting': string
  /** Message prompting the user to confirm that they want to restore to an earlier revision*/
  'action.restore.confirm.message': string
  /** Fallback tooltip for when user is looking at the initial revision */
  'action.restore.disabled.cannot-restore-initial': string
  /** Label for the "Restore" document action */
  'action.restore.label': string
  /** Default tooltip for the action */
  'action.restore.tooltip': string
  /** Tooltip when action is disabled because the document is not already published */
  'action.unpublish.disabled.not-published': string
  /** Tooltip when action is disabled because the operation is not ready   */
  'action.unpublish.disabled.not-ready': string
  /** Label for the "Unpublish" document action */
  'action.unpublish.label': string
  /** Fallback tooltip for the Unpublish document action when publish is invoked for a document with live edit enabled.*/
  'action.unpublish.live-edit.disabled': string
  /** Description for the archived release banner, rendered when viewing the history of a version document from the publihed view */
  'banners.archived-release.description': string
  /** The text for the restore button on the deleted document banner */
  'banners.deleted-document-banner.restore-button.text': string
  /** The text content for the deleted document banner */
  'banners.deleted-document-banner.text': string
  /** The text content for the deprecated document type banner */
  'banners.deprecated-document-type-banner.text': string
  /** The text for publish action for discarding the version */
  'banners.live-edit-draft-banner.discard.tooltip': string
  /** The text for publish action for the draft banner */
  'banners.live-edit-draft-banner.publish.tooltip': string
  /** The text content for the live edit document when it's a draft */
  'banners.live-edit-draft-banner.text': string
  /** The text for the permission check banner if the user only has one role, and it does not allow publishing this document */
  'banners.permission-check-banner.missing-permission_create_one': string
  /** The text for the permission check banner if the user only has multiple roles, but they do not allow publishing this document */
  'banners.permission-check-banner.missing-permission_create_other': string
  /** The text for the permission check banner if the user only has one role, and it does not allow editing this document */
  'banners.permission-check-banner.missing-permission_update_one': string
  /** The text for the permission check banner if the user only has multiple roles, but they do not allow editing this document */
  'banners.permission-check-banner.missing-permission_update_other': string
  /** The pending text for the request permission button that appears for viewer roles */
  'banners.permission-check-banner.request-permission-button.sent': string
  /** The text for the request permission button that appears for viewer roles */
  'banners.permission-check-banner.request-permission-button.text': string
  /** Description for the archived release banner, rendered when viewing the history of a version document from the published view */
  'banners.published-release.description': string
  /** The text for the reload button */
  'banners.reference-changed-banner.reason-changed.reload-button.text': string
  /** The text for the reference change banner if the reason is that the reference has been changed */
  'banners.reference-changed-banner.reason-changed.text': string
  /** The text for the close button */
  'banners.reference-changed-banner.reason-removed.close-button.text': string
  /** The text for the reference change banner if the reason is that the reference has been deleted */
  'banners.reference-changed-banner.reason-removed.text': string
  /** The text that appears for the action button to add the current document to the global release */
  'banners.release.action.add-to-release': string
  /** The text that appears for the action button to add the current document to the global release */
  'banners.release.action.open-to-edit': string
  /** Toast description in case an error occurs when adding a document to a release  */
  'banners.release.error.description': string
  /** Toast title in case an error occurs when adding a document to a release  */
  'banners.release.error.title': string
  /** The text for the banner that appears when a document only has versions but is in a draft or published pinned release */
  'banners.release.navigate-to-edit-description': string
  /** The text for the banner that appears when a document only has versions but is in a draft or published pinned release */
  'banners.release.navigate-to-edit-description-end_one': string
  /** The text for the banner that appears when a document only has versions but is in a draft or published pinned release */
  'banners.release.navigate-to-edit-description-end_other': string
  /** The text for the banner that appears when there are multiple versions but no drafts or published, only one extra releases */
  'banners.release.navigate-to-edit-description-multiple_one': string
  /** The text for the banner that appears when there are multiple versions but no drafts or published, more than one extra releases */
  'banners.release.navigate-to-edit-description-multiple_other': string
  /** The text for the banner that appears when a document only has one version but is in a draft or published pinned release */
  'banners.release.navigate-to-edit-description-single': string
  /** The text for the banner that appears when a document is not in the current global release */
  'banners.release.not-in-release': string
  /** Description of toast that will appear in case of latency between the user adding a document to a release and the UI reflecting it */
  'banners.release.waiting.description': string
  /** Title of toast that will appear in case of latency between the user adding a document to a release and the UI reflecting it */
  'banners.release.waiting.title': string
  /** The text content for the unpublished document banner when is part of a release */
  'banners.unpublished-release-banner.text': string
  /** Browser/tab title when creating a new document of a given type */
  'browser-document-title.new-document': string
  /** Browser/tab title when editing a document where the title cannot be resolved from preview configuration */
  'browser-document-title.untitled-document': string
  /** The action menu button aria-label */
  'buttons.action-menu-button.aria-label': string
  /** The action menu button tooltip */
  'buttons.action-menu-button.tooltip': string
  /** The aria-label for the split pane button on the document panel header */
  'buttons.split-pane-button.aria-label': string
  /** The tool tip for the split pane button on the document panel header */
  'buttons.split-pane-button.tooltip': string
  /** The title for the close button on the split pane on the document panel header */
  'buttons.split-pane-close-button.title': string
  /** The title for the close group button on the split pane on the document panel header */
  'buttons.split-pane-close-group-button.title': string
  /** The label used in the changes inspector for the from selector */
  'changes.from.label': string
  'changes.tab.history': string
  'changes.tab.review-changes': string
  /** The label used in the changes inspector for the to selector */
  'changes.to.label': string
  /** The error message shown when the specified document comparison mode is not supported */
  'compare-version.error.invalidModeParam': string
  /** The error message shown when the next document for comparison could not be extracted from the URL */
  'compare-version.error.invalidNextDocumentParam': string
  /** The error message shown when the document comparison URL could not be parsed */
  'compare-version.error.invalidParams.title': string
  /** The error message shown when the previous document for comparison could not be extracted from the URL */
  'compare-version.error.invalidPreviousDocumentParam': string
  /** The text for the "Compare versions" action for a document */
  'compare-versions.menu-item.title': string
  /** The string used to label draft documents */
  'compare-versions.status.draft': string
  /** The string used to label published documents */
  'compare-versions.status.published': string
  /** The title used when comparing versions of a document */
  'compare-versions.title': string
  /** The text in the "Cancel" button in the confirm delete dialog that cancels the action and closes the dialog */
  'confirm-delete-dialog.cancel-button.text': string
  /** Used in `confirm-delete-dialog.cdr-summary.title` */
  'confirm-delete-dialog.cdr-summary.document-count_one': string
  /** Used in `confirm-delete-dialog.cdr-summary.title` */
  'confirm-delete-dialog.cdr-summary.document-count_other': string
  /** The text that appears in the subtitle `<summary>` that lists the datasets below the title */
  'confirm-delete-dialog.cdr-summary.subtitle_one': string
  /** The text that appears in the subtitle `<summary>` that lists the datasets below the title */
  'confirm-delete-dialog.cdr-summary.subtitle_other': string
  /** The text that appears in the subtitle `<summary>` that lists the datasets below the title */
  'confirm-delete-dialog.cdr-summary.subtitle_unavailable_one': string
  /** The text that appears in the subtitle `<summary>` that lists the datasets below the title */
  'confirm-delete-dialog.cdr-summary.subtitle_unavailable_other': string
  /** The text that appears in the title `<summary>` that includes the list of CDRs (singular) */
  'confirm-delete-dialog.cdr-summary.title_one': string
  /** The text that appears in the title `<summary>` that includes the list of CDRs (plural) */
  'confirm-delete-dialog.cdr-summary.title_other': string
  /** Appears when hovering over the copy button to copy */
  'confirm-delete-dialog.cdr-table.copy-id-button.tooltip': string
  /** The header for the dataset column in the list of cross-dataset references found */
  'confirm-delete-dialog.cdr-table.dataset.label': string
  /** The header for the document ID column in the list of cross-dataset references found */
  'confirm-delete-dialog.cdr-table.document-id.label': string
  /** The toast title when the copy button has been clicked but copying failed */
  'confirm-delete-dialog.cdr-table.id-copied-toast.title-failed': string
  /** The header for the project ID column in the list of cross-dataset references found */
  'confirm-delete-dialog.cdr-table.project-id.label': string
  /** The text in the "Delete anyway" button in the confirm delete dialog that confirms the action */
  'confirm-delete-dialog.confirm-anyway-button.text_delete': string
  /** The text in the "Unpublish anyway" button in the confirm delete dialog that confirms the action */
  'confirm-delete-dialog.confirm-anyway-button.text_unpublish': string
  /** The text in the "Delete now" button in the confirm delete dialog that confirms the action */
  'confirm-delete-dialog.confirm-button.text_delete': string
  /** The text in the "Unpublish now" button in the confirm delete dialog that confirms the action */
  'confirm-delete-dialog.confirm-button.text_unpublish': string
  /** If no referring documents are found, this text appears above the cancel and confirmation buttons */
  'confirm-delete-dialog.confirmation.text_delete': string
  /** If no referring documents are found, this text appears above the cancel and confirmation buttons */
  'confirm-delete-dialog.confirmation.text_unpublish': string
  /** The text body of the error dialog. */
  'confirm-delete-dialog.error.message.text': string
  /** The text in the retry button of the confirm delete dialog if an error occurred. */
  'confirm-delete-dialog.error.retry-button.text': string
  /** The header of the confirm delete dialog if an error occurred while the confirm delete dialog was open. */
  'confirm-delete-dialog.error.title.text': string
  /** The header of the confirm delete dialog */
  'confirm-delete-dialog.header.text_delete': string
  /** The header of the confirm delete dialog */
  'confirm-delete-dialog.header.text_unpublish': string
  /** The text that appears while the referring documents are queried */
  'confirm-delete-dialog.loading.text': string
  /** Shown if there are references to other documents but the user does not have the permission to see the relevant document IDs */
  'confirm-delete-dialog.other-reference-count.title_one': string
  /** Shown if there are references to other documents but the user does not have the permission to see the relevant document IDs */
  'confirm-delete-dialog.other-reference-count.title_other': string
  /** Text in the tooltip of this component if hovering over the info icon */
  'confirm-delete-dialog.other-reference-count.tooltip': string
  /** Appears when unable to render a document preview in the referring document list */
  'confirm-delete-dialog.preview-item.preview-unavailable.subtitle': string
  /** Appears when unable to render a document preview in the referring document list */
  'confirm-delete-dialog.preview-item.preview-unavailable.title': string
  /** Warns the user of affects to other documents if the action is confirmed (delete) */
  'confirm-delete-dialog.referential-integrity-disclaimer.text_delete': string
  /** Warns the user of affects to other documents if the action is confirmed (unpublish) */
  'confirm-delete-dialog.referential-integrity-disclaimer.text_unpublish': string
  /** Tells the user the count of how many other referring documents there are before listing them. (singular) */
  'confirm-delete-dialog.referring-document-count.text_one': string
  /** Tells the user the count of how many other referring documents there are before listing them. (plural) */
  'confirm-delete-dialog.referring-document-count.text_other': string
  /** Describes the list of documents that refer to the one trying to be deleted (delete) */
  'confirm-delete-dialog.referring-documents-descriptor.text_delete': string
  /** Describes the list of documents that refer to the one trying to be deleted (unpublish) */
  'confirm-delete-dialog.referring-documents-descriptor.text_unpublish': string
  /** The text for the cancel button in the confirm dialog used in document action shortcuts if none is provided */
  'confirm-dialog.cancel-button.fallback-text': string
  /** The text for the confirm button in the confirm dialog used in document action shortcuts if none is provided */
  'confirm-dialog.confirm-button.fallback-text': string
  /** For the default structure definition, the title for the "Content" pane */
  'default-definition.content-title': string
  /** The text shown if there was an error while getting the document's title via a preview value */
  'doc-title.error.text': string
  /** The text shown if the preview value for a document is non-existent or empty */
  'doc-title.fallback.text': string
  /** The text shown if a document's title via a preview value cannot be determined due to an unknown schema type */
  'doc-title.unknown-schema-type.text': string
  /** Tooltip text shown for the close button of the document inspector */
  'document-inspector.close-button.tooltip': string
  /** The title shown in the dialog header, when inspecting a valid document */
  'document-inspector.dialog.title': string
  /** The title shown in the dialog header, when the document being inspected is not created yet/has no value */
  'document-inspector.dialog.title-no-value': string
  /** Title shown for menu item that opens the "Inspect" dialog */
  'document-inspector.menu-item.title': string
  /** the placeholder text for the search input on the inspect dialog */
  'document-inspector.search.placeholder': string
  /** The "parsed" view mode, meaning the JSON is searchable, collapsible etc */
  'document-inspector.view-mode.parsed': string
  /** The "raw" view mode, meaning the JSON is presented syntax-highlighted, but with no other features - optimal for copying */
  'document-inspector.view-mode.raw-json': string
  /** The text for when a form is hidden */
  'document-view.form-view.form-hidden': string
  /** Fallback title shown when a form title is not provided */
  'document-view.form-view.form-title-fallback': string
  /** The text for when the form view is loading a document */
  'document-view.form-view.loading': string
  /** The description of the sync lock toast on the form view */
  'document-view.form-view.sync-lock-toast.description': string
  /** The title of the sync lock toast on the form view */
  'document-view.form-view.sync-lock-toast.title': string
  /**The title for the menu items that will be shown when expanding a publish release event to inspect the document */
  'events.inspect.release': string
  /**The title for the menu items that will be shown when expanding a publish draft event to inspect the draft document*/
  'events.open.draft': string
  /**The title for the menu items that will be shown when expanding a publish release event to inspect the release*/
  'events.open.release': string
  /** The loading messaging for when the tooltip is still loading permission info */
  'insufficient-permissions-message-tooltip.loading-text': string
  /** --- Menu items --- */
  /** The menu item group title to use for the Action menu items */
  'menu-item-groups.actions-group': string
  /** The menu item group title to use for the Layout menu items */
  'menu-item-groups.layout-group': string
  /** The menu item group title to use for the Sort menu items */
  'menu-item-groups.sorting-group': string
  /** The menu item title to use the compact view */
  'menu-items.layout.compact-view': string
  /** The menu item title to use the detailed view */
  'menu-items.layout.detailed-view': string
  /** The menu item title to Sort by Created */
  'menu-items.sort-by.created': string
  /** The menu item title to Sort by Last Edited */
  'menu-items.sort-by.last-edited': string
  /** The link text of the no document type screen that appears directly below the subtitle */
  'no-document-types-screen.link-text': string
  /** The subtitle of the no document type screen that appears directly below the title */
  'no-document-types-screen.subtitle': string
  /** The title of the no document type screen */
  'no-document-types-screen.title': string
  /** Text shown on back button visible on smaller breakpoints */
  'pane-header.back-button.text': string
  /** tooltip text (via `title` attribute) for the menu button */
  'pane-header.context-menu-button.tooltip': string
  /** Appears in a document list pane header if there are more than one option for create. This is the label for that menu */
  'pane-header.create-menu.label': string
  /** Tooltip displayed on the create new button in document lists */
  'pane-header.create-new-button.tooltip': string
  /** The `aria-label` for the disabled button in the pane header if create permissions are granted */
  'pane-header.disabled-created-button.aria-label': string
  /** The text shown in the tooltip of pane item previews of documents if there are unpublished edits */
  'pane-item.draft-status.has-draft.tooltip': string
  /** The text shown in the tooltip of pane item previews of documents if there are no unpublished edits */
  'pane-item.draft-status.no-draft.tooltip': string
  /** The subtitle tor pane item previews if there isn't a matching schema type found */
  'pane-item.missing-schema-type.subtitle': string
  /** The title tor pane item previews if there isn't a matching schema type found */
  'pane-item.missing-schema-type.title': string
  /** The text shown in the tooltip of pane item previews of documents if there are unpublished edits */
  'pane-item.published-status.has-published.tooltip': string
  /** The text shown in the tooltip of pane item previews of documents if there are no unpublished edits */
  'pane-item.published-status.no-published.tooltip': string
  /** The text used in the document header title if there is an error */
  'panes.document-header-title.error.text': string
  /** The text used in the document header title if creating a new item */
  'panes.document-header-title.new.text': string
  /** The text used in the document header title if no other title can be determined */
  'panes.document-header-title.untitled.text': string
  /** The error text on the document list pane */
  'panes.document-list-pane.error.text': string
  /** The error title on the document list pane */
  'panes.document-list-pane.error.title': string
  /** The text of the document list pane if more than a maximum number of documents are returned */
  'panes.document-list-pane.max-items.text': string
  /** The text of the document list pane if no documents are found for a specified type */
  'panes.document-list-pane.no-documents-of-type.text': string
  /** The text of the document list pane if no documents are found */
  'panes.document-list-pane.no-documents.text': string
  /** The text of the document list pane if no documents are found matching specified criteria */
  'panes.document-list-pane.no-matching-documents.text': string
  /** The aria-label for the search input on the document list pane */
  'panes.document-list-pane.search-input.aria-label': string
  /** The search input for the search input on the document list pane */
  'panes.document-list-pane.search-input.placeholder': string
  /** The summary title when displaying an error for a document operation result */
  'panes.document-operation-results.error.summary.title': string
  /** The text when a generic operation failed (fallback, generally not shown)  */
  'panes.document-operation-results.operation-error': string
  /** The text when a delete operation failed  */
  'panes.document-operation-results.operation-error_delete': string
  /** The text when an unpublish operation failed  */
  'panes.document-operation-results.operation-error_unpublish': string
  /** The text when a generic operation succeeded (fallback, generally not shown)  */
  'panes.document-operation-results.operation-success': string
  /** The text when copy URL operation succeeded  */
  'panes.document-operation-results.operation-success_copy-url': string
  /**  */
  'panes.document-operation-results.operation-success_createVersion': string
  /** The text when a delete operation succeeded  */
  'panes.document-operation-results.operation-success_delete': string
  /** The text when a discard changes operation succeeded  */
  'panes.document-operation-results.operation-success_discardChanges': string
  /** The text when a duplicate operation succeeded  */
  'panes.document-operation-results.operation-success_duplicate': string
  /** The text when a publish operation succeeded  */
  'panes.document-operation-results.operation-success_publish': string
  /** The text when a restore operation succeeded  */
  'panes.document-operation-results.operation-success_restore': string
  /** The text when an unpublish operation succeeded  */
  'panes.document-operation-results.operation-success_unpublish': string
  /** The document title shown when document title is "undefined" in operation message */
  'panes.document-operation-results.operation-undefined-title': string
  /** The loading message for the document not found pane */
  'panes.document-pane.document-not-found.loading': string
  /** The text of the document not found pane if the schema is known */
  'panes.document-pane.document-not-found.text': string
  /** The title of the document not found pane if the schema is known */
  'panes.document-pane.document-not-found.title': string
  /** The text of the document not found pane if the schema is not found */
  'panes.document-pane.document-unknown-type.text': string
  /** The title of the document not found pane if the schema is not found or unknown */
  'panes.document-pane.document-unknown-type.title': string
  /** The title of the document not found pane if the schema is unknown */
  'panes.document-pane.document-unknown-type.without-schema.text': string
  /** Default message shown while resolving the structure definition for an asynchronous node */
  'panes.resolving.default-message': string
  /** Message shown while resolving the structure definition for an asynchronous node and it is taking a while (more than 5s) */
  'panes.resolving.slow-resolve-message': string
  /** The text to display when type is missing */
  'panes.unknown-pane-type.missing-type.text': string
  /** The title of the unknown pane */
  'panes.unknown-pane-type.title': string
  /** The text to display when type is unknown */
  'panes.unknown-pane-type.unknown-type.text': string
  /** The text for the "Open preview" action for a document */
  'production-preview.menu-item.title': string
  /** The text for the confirm button in the request permission dialog used in the permissions banner */
  'request-permission-dialog.confirm-button.text': string
  /** The description text for the request permission dialog used in the permissions banner */
  'request-permission-dialog.description.text': string
  /** The header/title for the request permission dialog used in the permissions banner */
  'request-permission-dialog.header.text': string
  /** The text describing the note input for the request permission dialog used in the permissions banner */
  'request-permission-dialog.note-input.description.text': string
  /** The placeholder for the note input in the request permission dialog used in the permissions banner */
  'request-permission-dialog.note-input.placeholder.text': string
  /** The error/warning text in the request permission dialog when the user's request has been declined */
  'request-permission-dialog.warning.denied.text': string
  /** The error/warning text in the request permission dialog when the user's request has been denied due to too many outstanding requests */
  'request-permission-dialog.warning.limit-reached.text': string
  /** Label for button when status is saved */
  'status-bar.document-status-pulse.status.saved.text': string
  /** Label for button when status is syncing */
  'status-bar.document-status-pulse.status.syncing.text': string
  /** Accessibility label indicating when the document was last published, in relative time, eg "3 weeks ago" */
  'status-bar.publish-status-button.last-published-time.aria-label': string
  /** Text for tooltip showing explanation of timestamp/relative time, eg "Last published <RelativeTime/>" */
  'status-bar.publish-status-button.last-published-time.tooltip': string
  /** Accessibility label indicating when the document was last updated, in relative time, eg "2 hours ago" */
  'status-bar.publish-status-button.last-updated-time.aria-label': string
  /** Text for tooltip showing explanation of timestamp/relative time, eg "Last updated <RelativeTime/>" */
  'status-bar.publish-status-button.last-updated-time.tooltip': string
  /** Aria label for the button */
  'status-bar.review-changes-button.aria-label': string
  /** Label for button when status is saved */
  'status-bar.review-changes-button.status.saved.text': string
  /** Label for button when status is syncing */
  'status-bar.review-changes-button.status.syncing.text': string
  /** Text for the secondary text for tooltip for the button */
  'status-bar.review-changes-button.tooltip.changes-saved': string
  /** Primary text for tooltip for the button */
  'status-bar.review-changes-button.tooltip.text': string
  /** The text that appears in side the documentation link */
  'structure-error.docs-link.text': string
  /** Labels the error message or error stack of the structure error screen */
  'structure-error.error.label': string
  /** The header that appears at the top of the error screen */
  'structure-error.header.text': string
  /** The text in the reload button to retry rendering the structure */
  'structure-error.reload-button.text': string
  /** Labels the structure path of the structure error screen */
  'structure-error.structure-path.label': string
  /** The aria label for the menu button in the timeline item */
  'timeline-item.menu-button.aria-label': string
  /** The text for the tooltip in menu button the timeline item */
  'timeline-item.menu-button.tooltip': string
  /** The text for the collapse action in the timeline item menu */
  'timeline-item.menu.action-collapse': string
  /** The text for the expand action in the timeline item menu */
  'timeline-item.menu.action-expand': string
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type StructureNode = StructureNode_2

/**
 * Interface for the structure builder node.
 *
 * @public
 */
declare interface StructureNode_2 {
  /** Node ID */
  id: string
  /** Node ID */
  title?: string
  i18n?: I18nTextRecord<'title'>
  /** Node type */
  type?: string
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type StructureResolver = StructureResolver_2

/**
 * Lets you configure how lists, documents, views, menus, and initial value templates are organized in the Sanity Studio’s structure-tool.
 *
 * @public
 *
 * @returns A structure builder, or null/undefined if no structure should be returned. See {@link StructureBuilder}
 * @example Configuring structure
 * ```ts
 * // sanity.config.js
 *
 * import {defineConfig} from 'sanity'
 * import {structureTool} from 'sanity/structure'
 * import {schemaTypes} from './schema'
 *
 * export default defineConfig({
 *  name: 'default',
 *  title: 'My Cool Project',
 *  projectId: 'my-project-id',
 *  dataset: 'production',
 *  plugins: [
 *    structureTool({
 *      structure: (S, context) => {
 *        console.log(context) // returns { currentUser, dataset, projectId, schema, getClient, documentStore }
 *        return S.documentTypeList('post')
 *      },
 *    })
 *  ],
 *  schema: schemaTypes
 * })
 * ```
 *
 */
declare type StructureResolver_2 = (
  /**
   * S - An instance of the structure builder, that can be used to build the lists/items/panes for the structure tool
   * context - an object holding various context that may be used to customize the structure, for instance the current user.
   *  Defaults to
   * ```ts
   * (S) => S.defaults()
   * ```
   * See {@link StructureBuilder}
   */
  S: StructureBuilder_2,
  /**
   * An object containing pane and index information for the current structure tool.
   * See {@link StructureResolverContext}
   */
  context: StructureResolverContext_2,
) => unknown

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type StructureResolverContext = StructureResolverContext_2

/**
 *  Structure tool context. Extends from {@link ConfigContext}.
 *  @hidden
 *  @public
 */
declare interface StructureResolverContext_2 extends ConfigContext {
  /**
   * This can be replaced by a different API in the future.
   * It is provided as-is to support common structure patterns found in V2 in V3.
   * @alpha
   * */
  documentStore: DocumentStore
  /** @alpha */
  i18n: LocaleSource
}

/** @internal */
declare interface StructureToolContextValue {
  features: StructureToolFeatures
  layoutCollapsed: boolean
  setLayoutCollapsed: (layoutCollapsed: boolean) => void
  rootPaneNode: UnresolvedPaneNode_2
  structureContext: StructureContext_2
}

/** @internal */
declare interface StructureToolFeatures {
  /**
   * @hidden
   * @beta
   */
  backButton: boolean
  resizablePanes: boolean
  reviewChanges: boolean
  splitPanes: boolean
  splitViews: boolean
}

/**
 * The params for the `structureTool` api. See {@link structureTool}
 *
 * @public */
declare interface StructureToolOptions {
  icon?: React.ComponentType
  name?: string
  /**
     * A workspace can have different "sources". These sources were meant to allow using multiple datasets within the same workspace, for instance.
     * This is not supported yet, but the API is still here.
     *
     @hidden
     @alpha
     */
  source?: string
  /**
   * A structure resolver function. See {@link StructureResolver}
   */
  structure?: StructureResolver_2
  /**
   * A resolver function used to return the default document node used when editing documents. See {@link DefaultDocumentNodeResolver}
   */
  defaultDocumentNode?: DefaultDocumentNodeResolver_2
  /**
   * The title that will be displayed for the tool. Defaults to Structure
   */
  title?: string
}

/** @internal */
declare type StructureToolPaneActionHandler = (params: any, scope?: unknown) => void

/** @internal */
declare function StructureToolProvider({
  defaultDocumentNode,
  structure: resolveStructure,
  children,
}: StructureToolProviderProps): React.JSX.Element

/** @internal */
declare interface StructureToolProviderProps {
  structure?: StructureResolver_2
  defaultDocumentNode?: DefaultDocumentNodeResolver_2
  children: ReactNode
}

/**
 * @hidden
 * @beta */
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>
}

/** @public */
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']
}

/**
 * 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
 */
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_2<'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 */
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
 */
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
 */
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_2<'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?: React.ElementType | React.JSX.Element
  /**
   * 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
}

/**
 * Parameter for a template. Closely resembles API used to define fields for object schema types.
 * See {@link TemplateFieldDefinition} and {@link TemplateArrayFieldDefinition}
 * @public
 */
declare type TemplateParameter = TemplateFieldDefinition | TemplateArrayFieldDefinition

/** @public */
declare interface TemplateReferenceTarget {
  type: 'reference'
  /** Type to reference. See {@link TypeTarget} */
  to: TypeTarget | TypeTarget[]
}

/** @public */
declare type TemplateResolver = ComposableOption<Template[], ConfigContext_2>

/**
 * 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
 */
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.
   */
  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 */
declare interface ToolMenuProps {
  activeToolName?: string
  closeSidebar: () => void
  context: 'sidebar' | 'topbar'
  isSidebarOpen: boolean
  tools: Tool[]
  renderDefault: (props: ToolMenuProps) => React.JSX.Element
}

declare interface TransactionSyncLockState {
  enabled: boolean
}

/**
 * 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
 */
declare type TypeAnnotationMismatchError = {
  type: 'TYPE_ANNOTATION_MISMATCH'
  expectedSchemaType: SchemaType
  resolvedValueType: string
}

/**
 * @public
 */
declare interface TypeTarget {
  type: string
}

/**
 * This error may happen for objects if we encounter fields that are not declared in the schema
 *
 * @public
 */
declare type UndeclaredMembersError = {
  type: 'UNDECLARED_MEMBERS'
  schemaType: ArraySchemaType
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type UnresolvedPaneNode = UnresolvedPaneNode_2

/** @internal */
declare type UnresolvedPaneNode_2 =
  | PaneNodeResolver_2
  | SerializablePaneNode_2
  | Observable<UnresolvedPaneNode_2>
  | PromiseLike<UnresolvedPaneNode_2>
  | PaneNode_2

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type UnserializedListItem = UnserializedListItem_2

/**
 * Interface for unserialized list items.
 *
 * @public
 */
declare interface UnserializedListItem_2 {
  /** List item ID */
  id: string
  /** List item title */
  title: string
  /**
   * The i18n key and namespace used to populate the localized title. This is
   * the recommend way to set the title if you are localizing your studio.
   */
  i18n?: I18nTextRecord<'title'>
  /** List item icon */
  icon?: React.ComponentType | React.ReactNode
  /** List item child. See {@link UnserializedListItemChild} */
  child?: UnserializedListItemChild_2
  /** List item display options. See {@link ListItemDisplayOptions} */
  displayOptions?: ListItemDisplayOptions_2
  /** List item schema. See {@link SchemaType} */
  schemaType?: SchemaType | string
}

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type UnserializedListItemChild = UnserializedListItemChild_2

/**
 * Unserialized list item child.
 * See {@link Collection}, {@link CollectionBuilder}, {@link ChildResolver} and {@link ItemChild}
 *
 * @public
 */
declare type UnserializedListItemChild_2 =
  | Collection_2
  | CollectionBuilder_2
  | ChildResolver_2
  | Observable<ItemChild_2>

/**
 *
 * @hidden
 * @beta
 */
declare type Uploader<S extends SchemaType = SchemaType> = {
  type: string
  accepts: string
  upload: (
    client: SanityClient,
    file: File,
    type: S,
    options?: UploadOptions,
  ) => Observable<UploadProgressEvent>
  priority: number
}

/**
 *
 * @hidden
 * @beta
 */
declare type UploaderResolver<S extends SchemaType = SchemaType> = (
  type: S,
  file: FileLike,
) => Uploader<S> | null

/**
 * @hidden
 * @beta */
declare interface UploadEvent {
  file: File
  schemaType: SchemaType
  uploader: Uploader
}

/**
 *
 * @hidden
 * @beta
 */
declare type UploadOptions = {
  metadata?: AssetMetadataType[]
  storeOriginalFilename?: boolean
  label?: string
  title?: string
  description?: string
  creditLine?: string
  source?: AssetSourceSpec
}

/**
 *
 * @hidden
 * @beta
 */
declare type UploadProgressEvent = {
  type: 'uploadProgress'
  patches: FormPatch[] | null
}

/**
 * @deprecated Import `useStructureTool` from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const useDeskTool: typeof useStructureTool

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const useDocumentPane: typeof useDocumentPane_2

/** @internal */
declare function useDocumentPane_2(): DocumentPaneContextValue

/**
 * useDocumentTitle hook return type.
 *
 * @beta
 * @hidden
 */
declare interface UseDocumentTitle {
  error?: string
  title?: string
}

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const useDocumentTitle: typeof useDocumentTitle_2

/**
 * React hook that returns the document title for the current document in the document pane.
 *
 * @beta
 * @hidden
 *
 * @returns The document title or error. See {@link UseDocumentTitle}
 */
declare function useDocumentTitle_2(): UseDocumentTitle

/**
 * @deprecated Import from `sanity/structure` instead!
 * @hidden
 * @beta
 */
export declare const usePaneRouter: typeof usePaneRouter_2

/**
 *
 * @hidden
 * @beta
 */
declare function usePaneRouter_2(): PaneRouterContextValue_2

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type UserComponent = UserComponent_2

/**
 * User defined component
 *
 * @public
 */
declare type UserComponent_2 = React.ComponentType<{
  /** Component child. See {@link ComponentBuilder} */
  child?: ComponentBuilder_2
  /** Component child item ID */
  childItemId?: string
  /** Component ID */
  id: string
  /** Is component active */
  isActive?: boolean
  /** Is component selected */
  isSelected?: boolean
  /** item ID */
  itemId: string
  /** Component options */
  options?: Record<string, unknown>
  /** Pane key */
  paneKey: string
  /** URL parameters */
  urlParams: Record<string, string | undefined> | undefined
}>

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type UserViewComponent = UserViewComponent_2

/**
 * User view component
 *
 * @public */
declare type UserViewComponent_2<TOptions = Record<string, any>> = React.ComponentType<{
  document: {
    draft: SanityDocument | null
    displayed: Partial<SanityDocument>
    historical: Partial<SanityDocument> | null
    published: SanityDocument | null
  }
  documentId: string
  options: TOptions
  schemaType: SchemaType
}>

/** @internal */
declare function useStructureTool(): StructureToolContextValue

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type View = View_2

/**
 * View. See {@link FormView} and {@link ComponentView}
 *
 * @public
 */
declare type View_2 = FormView_2 | ComponentView_2

/**
 * @deprecated Import from `sanity/structure` instead
 * @hidden
 * @beta
 */
export declare type ViewBuilder = ViewBuilder_2

/**
 * View builder. See {@link ComponentViewBuilder} and {@link FormViewBuilder}
 *
 * @public
 */
declare type ViewBuilder_2 = ComponentViewBuilder_2 | FormViewBuilder_2

/**
 * @hidden
 * @beta
 */
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[]
  /**
   * @deprecated Use `tasks` instead
   */
  unstable_tasks?: DefaultPluginsWorkspaceOptions['tasks']
  /**
   * @internal
   */
  tasks?: DefaultPluginsWorkspaceOptions['tasks']
  /**
   * @internal
   */
  releases?: DefaultPluginsWorkspaceOptions['releases']
  /**
   * @hidden
   * @internal
   */
  __internal_serverDocumentActions?: {
    enabled?: boolean
  }
  scheduledPublishing?: DefaultPluginsWorkspaceOptions['scheduledPublishing']
}

export {}

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
  }
}

declare module '@sanity/types' {
  /**
   *
   * @hidden
   * @beta
   */
  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>
  }
  /**
   *
   * @hidden
   * @beta
   */
  interface ArrayOfPrimitivesComponents {
    diff?: ComponentType<any>
    field?: ComponentType<ArrayOfPrimitivesFieldProps>
    input?: ComponentType<ArrayOfPrimitivesInputProps>
    item?: ComponentType<PrimitiveItemProps>
    preview?: ComponentType<PreviewProps>
  }
  /**
   *
   * @hidden
   * @beta
   */
  interface BooleanComponents {
    diff?: ComponentType<any>
    field?: ComponentType<BooleanFieldProps>
    input?: ComponentType<BooleanInputProps>
    item?: ComponentType<PrimitiveItemProps>
    preview?: ComponentType<PreviewProps>
  }
  /**
   *
   * @hidden
   * @beta
   */
  interface DateComponents {
    diff?: ComponentType<any>
    field?: ComponentType<StringFieldProps>
    input?: ComponentType<StringInputProps>
    item?: ComponentType<PrimitiveItemProps>
    preview?: ComponentType<PreviewProps>
  }
  /**
   *
   * @hidden
   * @beta
   */
  interface DatetimeComponents {
    diff?: ComponentType<any>
    field?: ComponentType<StringFieldProps>
    input?: ComponentType<StringInputProps>
    item?: ComponentType<PrimitiveItemProps>
    preview?: ComponentType<PreviewProps>
  }
  /**
   *
   * @hidden
   * @beta
   */
  interface DocumentComponents {
    diff?: ComponentType<any>
    field?: ComponentType<ObjectFieldProps>
    input?: ComponentType<ObjectInputProps>
    item?: ComponentType<ObjectItemProps>
    preview?: ComponentType<PreviewProps>
  }
  /**
   *
   * @hidden
   * @beta
   */
  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
   */
  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>
  }
  /**
   *
   * @hidden
   * @beta
   */
  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
   */
  interface NumberComponents {
    diff?: ComponentType<any>
    field?: ComponentType<NumberFieldProps>
    input?: ComponentType<NumberInputProps>
    item?: ComponentType<PrimitiveItemProps>
    preview?: ComponentType<PreviewProps>
  }
  /**
   *
   * @hidden
   * @beta
   */
  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>
  }
  /**
   *
   * @hidden
   * @beta
   */
  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>
  }
  /**
   *
   * @hidden
   * @beta
   */
  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
   */
  interface SlugComponents {
    diff?: ComponentType<any>
    field?: ComponentType<ObjectFieldProps<SlugValue>>
    input?: ComponentType<ObjectInputProps<SlugValue>>
    item?: ComponentType<ObjectItemProps<SlugValue & ObjectItem>>
    preview?: ComponentType<PreviewProps>
  }
  /**
   *
   * @hidden
   * @beta
   */
  interface SpanComponents {
    diff?: ComponentType<any>
    field?: ComponentType<ObjectFieldProps>
    input?: ComponentType<ObjectInputProps>
    item?: ComponentType<ObjectItemProps>
    preview?: ComponentType<PreviewProps>
  }
  /**
   *
   * @hidden
   * @beta
   */
  interface StringComponents {
    diff?: ComponentType<any>
    field?: ComponentType<StringFieldProps>
    input?: ComponentType<StringInputProps>
    item?: ComponentType<PrimitiveItemProps>
    preview?: ComponentType<PreviewProps>
  }
  /**
   *
   * @hidden
   * @beta
   */
  interface TextComponents {
    diff?: ComponentType<any>
    field?: ComponentType<StringFieldProps>
    input?: ComponentType<StringInputProps>
    item?: ComponentType<PrimitiveItemProps>
    preview?: ComponentType<PreviewProps>
  }
  /**
   *
   * @hidden
   * @beta
   */
  interface UrlComponents {
    diff?: ComponentType<any>
    field?: ComponentType<StringFieldProps>
    input?: ComponentType<StringInputProps>
    item?: ComponentType<PrimitiveItemProps>
    preview?: ComponentType<PreviewProps>
  }
  /**
   *
   * @hidden
   * @beta
   */
  interface EmailComponents {
    diff?: ComponentType<any>
    field?: ComponentType<StringFieldProps>
    input?: ComponentType<StringInputProps>
    item?: ComponentType<PrimitiveItemProps>
    preview?: ComponentType<PreviewProps>
  }
  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
  }
}
