-
Notifications
You must be signed in to change notification settings - Fork 1
/
MPQuery.ts
69 lines (65 loc) · 1.65 KB
/
MPQuery.ts
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import { MPPoint, MPLocationPropertyNames } from "../../index";
/**
* A collection of query parameters used to query entities in MapsIndoors.
*
* @export
* @class MPQuery
* @typedef {MPQuery}
*/
export default class MPQuery {
/**
* Creates an instance of MPQuery.
*
* @constructor
* @private
* @param {?string} [query] The queried text (search text).
* @param {?MPPoint} [near] The query is restricted to entities near this point.
* @param {?string[]} [queryProperties] A list of properties for this query, Uses {@link MPLocationPropertyNames}.
*/
private constructor(
public readonly query?: string,
public readonly near?: MPPoint,
public readonly queryProperties?: string[],
) { }
/**
* Creator for MPQuery, used to decode JSON from the MapsIndoors SDK.
*
* @static
* @param {?MPQueryParams} [object]
* @returns {MPQuery}
*/
static create(object?: MPQueryParams): MPQuery {
return new MPQuery(
object?.query,
object?.near,
object?.queryProperties
);
}
}
/**
* Parameter interface for {@link MPQuery}.
*
* @export
* @interface MPQueryParams
* @typedef {MPQueryParams}
*/
export interface MPQueryParams {
/**
* The queried text (search text).
*
* @type {?string}
*/
query?: string,
/**
* The query is restricted to entities near this point.
*
* @type {?MPPoint}
*/
near?: MPPoint,
/**
* A list of properties for this query, Uses {@link MPLocationPropertyNames}.
*
* @type {?string[]}
*/
queryProperties?: string[],
}