import {SchemaType} from '@sanity/types'

/** @alpha */
export declare function InsertMenu(props: InsertMenuProps): React.JSX.Element

/** @alpha This API may change */
export declare interface InsertMenuOptions {
  /**
   * @defaultValue `'auto'`
   * `filter: 'auto'` automatically turns on filtering if there are more than 5
   * schema types added to the menu.
   */
  filter?: 'auto' | boolean | undefined
  groups?:
    | Array<{
        name: string
        title?: string
        of?: Array<string>
      }>
    | undefined
  /** defaultValue `true` */
  showIcons?: boolean | undefined
  /** @defaultValue `[{name: 'list'}]` */
  views?:
    | Array<
        | {
            name: 'list'
          }
        | {
            name: 'grid'
            previewImageUrl?: (schemaTypeName: string) => string | undefined
          }
      >
    | undefined
}

/** @alpha */
export declare type InsertMenuProps = InsertMenuOptions & {
  schemaTypes: Array<SchemaType>
  onSelect: (schemaType: SchemaType) => void
  labels: {
    'insert-menu.filter.all-items': string
    'insert-menu.search.no-results': string
    'insert-menu.search.placeholder': string
    'insert-menu.toggle-grid-view.tooltip': string
    'insert-menu.toggle-list-view.tooltip': string
  }
}

export {}
