UNPKG

1.69 kBTypeScriptView Raw
1/** @module data */
2import { StringValueMap } from './StringValueMap';
3/**
4 * Data transfer object used to pass filter parameters as simple key-value pairs.
5 *
6 * @see [[StringValueMap]]
7 *
8 * ### Example ###
9 *
10 * let filter = FilterParams.fromTuples(
11 * "type", "Type1",
12 * "from_create_time", new Date(2000, 0, 1),
13 * "to_create_time", new Date(),
14 * "completed", true
15 * );
16 * let paging = new PagingParams(0, 100);
17 *
18 * myDataClient.getDataByFilter(filter, paging, (err, page) => {...});
19 */
20export declare class FilterParams extends StringValueMap {
21 /**
22 * Creates a new instance and initalizes it with elements from the specified map.
23 *
24 * @param map a map to initialize this instance.
25 */
26 constructor(map?: any);
27 /**
28 * Converts specified value into FilterParams.
29 *
30 * @param value value to be converted
31 * @returns a newly created FilterParams.
32 */
33 static fromValue(value: any): FilterParams;
34 /**
35 * Creates a new FilterParams from a list of key-value pairs called tuples.
36 *
37 * @param tuples a list of values where odd elements are keys and the following even elements are values
38 * @returns a newly created FilterParams.
39 */
40 static fromTuples(...tuples: any[]): FilterParams;
41 /**
42 * Parses semicolon-separated key-value pairs and returns them as a FilterParams.
43 *
44 * @param line semicolon-separated key-value list to initialize FilterParams.
45 * @returns a newly created FilterParams.
46 *
47 * @see [[StringValueMap.fromString]]
48 */
49 static fromString(line: string): FilterParams;
50}