import { Expressions } from "../types/groq-expressions"; import { ConfigCreateNestedScope } from "../types/query-config"; import { ResultItem } from "../types/result-types"; declare module "../groq-builder" { interface GroqBuilder { /** * This is an alias for the `filterRaw` method; please use that instead. * * Filters based on any raw filter expression. * This method is NOT type-checked, but does provide suggestions. * * @deprecated Please use `filterRaw` instead! * * @example * q.star.filterRaw("count(items[]) > 5") * * @param filterExpression - Any valid GROQ expression that can be used for filtering */ filter(...filterExpression: NonEmptyArray, TQueryConfig>>): GroqBuilder; /** * Filters based on any raw filter expression(s). * This method is NOT type-checked, but does provide suggestions. * * Multiple expressions will be combined with "OR" logic. * * @example * q.star.filterRaw("count(items[]) > 5") * * @param filterExpression - Any valid GROQ expression that can be used for filtering */ filterRaw(...filterExpression: NonEmptyArray, ConfigCreateNestedScope>>>): GroqBuilder; /** * Filters the results based on a simple, * strongly-typed equality expression. * * Multiple calls will result in "AND" logic. * Multiple arguments will be combined with "OR" logic. * * This method is strongly-typed, but only supports common expressions. * If you'd like to filter based off more complex logic, use `filterRaw` instead. * * @example * q.star.filterByType("product") * .filterBy("image.url != null") * .filterBy('category == "food"') * .filterBy("price < 50", "msrp < 50") * .filterBy("references(^._id)") */ filterBy(...filterExpression: NonEmptyArray, ConfigCreateNestedScope>>>): GroqBuilder; } } type NonEmptyArray = [T, ...T[]]; export {};