import { TypeMismatchError } from "./utils"; export type QueryConfig = { /** * This is a union of all possible document types, * coming from your Sanity-generated types. */ schemaTypes: {}; /** * This symbol is exported by the generated Sanity types. * It's used to extract document types from a reference object. */ referenceSymbol: symbol; /** * Represents a map of input parameter names, and their types. * To set this, use the `q.parameters<{ id: string }>()` syntax */ parameters?: {}; }; export type SchemaDocument = { _type: string; }; export type ExtractDocumentTypes = Extract["_type"]; export type RefType = { [P in referenceSymbol]?: TTypeName; }; export type ExtractRefType = TResultItem extends RefType ? Extract : TypeMismatchError<{ error: "⛔️ Expected the object to be a reference type ⛔️"; expected: RefType>; actual: TResultItem; }>;