/
IndexingPolicy.ts
50 lines (45 loc) · 1.46 KB
/
IndexingPolicy.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
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { DataType, IndexingMode, IndexKind } from "./index";
export interface IndexingPolicy {
/** The indexing mode (consistent or lazy) {@link IndexingMode}. */
indexingMode?: keyof typeof IndexingMode;
automatic?: boolean;
/** An array of {@link IncludedPath} represents the paths to be included for indexing. */
includedPaths?: IndexedPath[];
/** An array of {@link IncludedPath} represents the paths to be excluded for indexing. */
excludedPaths?: IndexedPath[];
spatialIndexes?: SpatialIndex[];
}
/* The target data type of a spatial path */
export enum SpatialType {
LineString = "LineString",
MultiPolygon = "MultiPolygon",
Point = "Point",
Polygon = "Polygon"
}
export interface SpatialIndex {
/* Path in JSON document to index */
path: string;
types: SpatialType[];
/* Bounding box for geometry spatial path */
boundingBox: {
/* X-coordinate of the lower-left corner of the bounding box. */
xmin: number;
/* Y-coordinate of the lower-left corner of the bounding box. */
ymin: number;
/* X-coordinate of the upper-right corner of the bounding box. */
xmax: number;
/* Y-coordinate of the upper-right corner of the bounding box. */
ymax: number;
};
}
export interface IndexedPath {
path: string;
indexes?: Index[];
}
export interface Index {
kind: keyof typeof IndexKind;
dataType: keyof typeof DataType;
precision?: number;
}