import {SchemaValidationProblem} from '@sanity/types'
import {SchemaValidationProblemGroup} from '@sanity/types'

/**
 * Contains debug information about the serialized schema.
 *
 * @internal
 **/
export declare type SeralizedSchemaDebug = {
  size: number
  parent?: SeralizedSchemaDebug
  types: Record<string, SerializedTypeDebug>
  hoisted: Record<string, SerializedTypeDebug>
}

/**
 * Contains debug information about a serialized type.
 *
 * @internal
 **/
export declare type SerializedTypeDebug = {
  size: number
  extends: string
  fields?: Record<string, SerializedTypeDebug>
  of?: Record<string, SerializedTypeDebug>
}

/** @internal */
export declare interface ValidateSchemaWorkerData {
  workDir: string
  workspace?: string
  level?: SchemaValidationProblem['severity']
  debugSerialize?: boolean
}

/** @internal */
export declare interface ValidateSchemaWorkerResult {
  validation: SchemaValidationProblemGroup[]
  serializedDebug?: SeralizedSchemaDebug
}

export {}
