Skip to content

Commit 299d3cd

Browse files
authored
Merge pull request #132 from HeneryHawk/master
2 parents dbd5a3a + 27ae0c5 commit 299d3cd

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

types.d.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
11
declare module 'api-query-params' {
2+
type PopulateOptions = {
3+
path: string;
4+
select?: any;
5+
}
6+
7+
type Query = {
8+
[key: string]: undefined | string | string[] | Query | Query[]
9+
}
10+
211
export type AqpQuery = {
312
filter: Record<string, any>;
413
skip: number;
514
limit: number;
615
sort: Record<string, number>;
716
projection: Record<string, number>;
17+
population: PopulateOptions[];
818
};
919

1020
function aqp(
11-
query: string | Record<string, string>,
21+
query: string | Query,
1222
opt?: {
1323
skipKey?: string;
1424
limitKey?: string;
@@ -26,4 +36,4 @@ declare module 'api-query-params' {
2636
): AqpQuery;
2737

2838
export default aqp;
29-
}
39+
}

0 commit comments

Comments
 (0)