import { ResultItem } from "../../types/result-types"; import { Simplify } from "../../types/utils"; import { ExtractSelectByTypeResult, SelectByTypeProjections } from "./select-types"; import { IGroqBuilder, InferResultType } from "../../groq-builder"; declare module "../../groq-builder" { interface GroqBuilderSubquery { /** * Applies GROQ's `select` function, for conditional logic, * based on the `_type` field. * * This is similar to `.select`, * but provides stronger types and auto-completion. * * @example * const qContent = q.star.filterByType("movie", "actor").project(sub => ({ * name: sub.selectByType({ * movie: sub => sub.field("title"), * actor: sub => sub.field("name"), * }) * })); */ selectByType, TQueryConfig>, TDefaultSelection extends IGroqBuilder | null = null>(typeQueries: TSelectByTypeProjections, defaultSelection?: TDefaultSelection): GroqBuilder> | (TDefaultSelection extends null | undefined ? null : InferResultType>), TQueryConfig>; } }