import { IsAny } from "type-fest"; import { ParametersWith$Sign } from "./parameter-types"; import { Override, Simplify } 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?: {}; /** * Represents all variables that are currently in-scope. * * This might include: * - Results of the `score()` function (`_score`) * - Parent selector (`^`) * - All parameters (`$id` or `$slug`) */ scope?: {}; }; export type ConfigAddParameters = Override>; scope: Simplify>>; }>; /** * Creates a new nested scope, with a current value ("@"), * and existing scope gets hoisted to parent ("^") */ export type ConfigCreateNestedScope = IsAny extends true ? any : Override; } : { "@": TCurrent; }>>; }>; type PickMaybe = Pick>; export type ConfigGetScope = TQueryConfig["scope"]; export {};