-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathtypes.d.ts
More file actions
40 lines (34 loc) · 810 Bytes
/
types.d.ts
File metadata and controls
40 lines (34 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
declare module 'api-query-params' {
type PopulateOptions = {
path: string;
select?: any;
}
type Query = {
[key: string]: undefined | string | string[] | Query | Query[]
}
export type AqpQuery = {
filter: Record<string, any>;
skip: number;
limit: number;
sort: Record<string, number>;
projection: Record<string, number>;
population: PopulateOptions[];
};
function aqp(
query: string | Query,
opt?: {
skipKey?: string;
limitKey?: string;
projectionKey?: string;
sortKey?: string;
filterKey?: string;
populationKey?: string;
populationMaxDepth?: number;
blacklist?: string[];
whitelist?: string[];
castParams?: unknown;
casters?: unknown;
}
): AqpQuery;
export default aqp;
}