import { Operator, Filter as IFilter } from './query'; import { entity } from './entity'; import Key = entity.Key; declare enum CompositeOperator { AND = "AND", OR = "OR" } /** * Returns an AND composite filter. * * @param {EntityFilter[]} filters The filters that make up the AND filter. */ export declare function and(filters: EntityFilter[]): CompositeFilter; /** * Returns an OR composite filter. * * @param {EntityFilter[]} filters The filters that make up the OR filter. */ export declare function or(filters: EntityFilter[]): CompositeFilter; /** * A Filter is a class that contains data for a filter that can be translated * into a proto when needed. * * @see {@link https://cloud.google.com/datastore/docs/concepts/queries#filters| Filters Reference} * */ export declare abstract class EntityFilter { /** * Gets the proto for the filter. * */ abstract toProto(): any; } export type AllowedFilterValueType = T extends '__key__' ? Key | Key[] : unknown; /** * A PropertyFilter is a filter that gets applied to a query directly. * * @see {@link https://cloud.google.com/datastore/docs/concepts/queries#property_filters| Property filters Reference} * * @class */ export declare class PropertyFilter extends EntityFilter implements IFilter { name: T; op: Operator; val: AllowedFilterValueType; /** * Build a Property Filter object. * * @param {string} Property The property name that the filter will be applied to. * @param {Operator} operator The comparison operator that the filter applies. * @param {any} val The value that the filter compares the property to. */ constructor(name: T, op: Operator, val: AllowedFilterValueType); /** * Gets the proto for the filter. * */ toProto(): any; } /** * A CompositeFilter is a filter that combines other filters and applies that * combination to a query. * * @see {@link https://cloud.google.com/datastore/docs/concepts/queries#composite_filters| Composite filters Reference} * * @class */ declare class CompositeFilter extends EntityFilter { filters: EntityFilter[]; op: string; /** * Build a Composite Filter object. * * @param {EntityFilter[]} filters The filters that make up the composite filter. */ constructor(filters: EntityFilter[], op: CompositeOperator); /** * Gets the proto for the filter. * */ toProto(): any; } export declare function isFilter(filter: any): filter is EntityFilter; export {};