import { Operator, Filter as IFilter } from './query'; import { entity } from './entity'; import Key = entity.Key; declare enum CompositeOperator { AND = "AND", OR = "OR" } export declare function and(filters: EntityFilter[]): CompositeFilter; 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 * @param {Operator} operator * @param {any} val */ 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 */ constructor(filters: EntityFilter[], op: CompositeOperator); /** * Gets the proto for the filter. * */ toProto(): any; } export declare function isFilter(filter: any): filter is EntityFilter; export {};