1 | import { Operator, Filter as IFilter } from './query';
|
2 | import { entity } from './entity';
|
3 | import Key = entity.Key;
|
4 | declare enum CompositeOperator {
|
5 | AND = "AND",
|
6 | OR = "OR"
|
7 | }
|
8 | export declare function and(filters: EntityFilter[]): CompositeFilter;
|
9 | export declare function or(filters: EntityFilter[]): CompositeFilter;
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | export declare abstract class EntityFilter {
|
18 | |
19 |
|
20 |
|
21 |
|
22 | abstract toProto(): any;
|
23 | }
|
24 | export type AllowedFilterValueType<T> = T extends '__key__' ? Key | Key[] : unknown;
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 | export declare class PropertyFilter<T extends string> extends EntityFilter implements IFilter {
|
33 | name: T;
|
34 | op: Operator;
|
35 | val: AllowedFilterValueType<T>;
|
36 | |
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 | constructor(name: T, op: Operator, val: AllowedFilterValueType<T>);
|
44 | /**
|
45 | * Gets the proto for the filter.
|
46 | *
|
47 | */
|
48 | toProto(): any;
|
49 | }
|
50 | /**
|
51 | * A CompositeFilter is a filter that combines other filters and applies that
|
52 | * combination to a query.
|
53 | *
|
54 | * @see {@link https:
|
55 | *
|
56 | * @class
|
57 | */
|
58 | declare class CompositeFilter extends EntityFilter {
|
59 | filters: EntityFilter[];
|
60 | op: string;
|
61 | |
62 |
|
63 |
|
64 |
|
65 |
|
66 | constructor(filters: EntityFilter[], op: CompositeOperator);
|
67 | /**
|
68 | * Gets the proto for the filter.
|
69 | *
|
70 | */
|
71 | toProto(): any;
|
72 | }
|
73 | export declare function isFilter(filter: any): filter is EntityFilter;
|
74 | export {};
|