1 | 'use strict';
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 | const NUMBER = 'number';
|
23 | const BOOLEAN = NUMBER;
|
24 | const H3_LOWER = NUMBER;
|
25 | const H3_UPPER = NUMBER;
|
26 | const RESOLUTION = NUMBER;
|
27 | const POINTER = NUMBER;
|
28 |
|
29 |
|
30 |
|
31 |
|
32 | var BINDINGS = [
|
33 |
|
34 | ['sizeOfH3Index', NUMBER],
|
35 | ['sizeOfGeoCoord', NUMBER],
|
36 | ['sizeOfGeoBoundary', NUMBER],
|
37 | ['sizeOfGeoPolygon', NUMBER],
|
38 | ['sizeOfGeofence', NUMBER],
|
39 | ['sizeOfLinkedGeoPolygon', NUMBER],
|
40 | ['sizeOfCoordIJ', NUMBER],
|
41 |
|
42 | ['h3IsValid', BOOLEAN, [H3_LOWER, H3_UPPER]],
|
43 | ['geoToH3', H3_LOWER, [NUMBER, NUMBER, RESOLUTION]],
|
44 | ['h3ToGeo', null, [H3_LOWER, H3_UPPER, POINTER]],
|
45 | ['h3ToGeoBoundary', null, [H3_LOWER, H3_UPPER, POINTER]],
|
46 | ['maxKringSize', NUMBER, [NUMBER]],
|
47 | ['kRing', null, [H3_LOWER, H3_UPPER, NUMBER, POINTER]],
|
48 | ['kRingDistances', null, [H3_LOWER, H3_UPPER, NUMBER, POINTER, POINTER]],
|
49 | ['hexRing', null, [H3_LOWER, H3_UPPER, NUMBER, POINTER]],
|
50 | ['maxPolyfillSize', NUMBER, [POINTER, RESOLUTION]],
|
51 | ['polyfill', null, [POINTER, RESOLUTION, POINTER]],
|
52 | ['h3SetToLinkedGeo', null, [POINTER, NUMBER, POINTER]],
|
53 | ['destroyLinkedPolygon', null, [POINTER]],
|
54 | ['compact', NUMBER, [POINTER, POINTER, NUMBER]],
|
55 | ['uncompact', NUMBER, [POINTER, NUMBER, POINTER, NUMBER, RESOLUTION]],
|
56 | ['maxUncompactSize', NUMBER, [POINTER, NUMBER, RESOLUTION]],
|
57 | ['h3IsPentagon', BOOLEAN, [H3_LOWER, H3_UPPER]],
|
58 | ['h3IsResClassIII', BOOLEAN, [H3_LOWER, H3_UPPER]],
|
59 | ['h3GetBaseCell', NUMBER, [H3_LOWER, H3_UPPER]],
|
60 | ['maxFaceCount', NUMBER, [H3_LOWER, H3_UPPER]],
|
61 | ['h3GetFaces', null, [H3_LOWER, H3_UPPER, POINTER]],
|
62 | ['h3ToParent', H3_LOWER, [H3_LOWER, H3_UPPER, RESOLUTION]],
|
63 | ['h3ToChildren', null, [H3_LOWER, H3_UPPER, RESOLUTION, POINTER]],
|
64 | ['h3ToCenterChild', H3_LOWER, [H3_LOWER, H3_UPPER, RESOLUTION]],
|
65 | ['maxH3ToChildrenSize', NUMBER, [H3_LOWER, H3_UPPER, RESOLUTION]],
|
66 | ['h3IndexesAreNeighbors', BOOLEAN, [H3_LOWER, H3_UPPER, H3_LOWER, H3_UPPER]],
|
67 | ['getH3UnidirectionalEdge', H3_LOWER, [H3_LOWER, H3_UPPER, H3_LOWER, H3_UPPER]],
|
68 | ['getOriginH3IndexFromUnidirectionalEdge', H3_LOWER, [H3_LOWER, H3_UPPER]],
|
69 | ['getDestinationH3IndexFromUnidirectionalEdge', H3_LOWER, [H3_LOWER, H3_UPPER]],
|
70 | ['h3UnidirectionalEdgeIsValid', BOOLEAN, [H3_LOWER, H3_UPPER]],
|
71 | ['getH3IndexesFromUnidirectionalEdge', null, [H3_LOWER, H3_UPPER, POINTER]],
|
72 | ['getH3UnidirectionalEdgesFromHexagon', null, [H3_LOWER, H3_UPPER, POINTER]],
|
73 | ['getH3UnidirectionalEdgeBoundary', null, [H3_LOWER, H3_UPPER, POINTER]],
|
74 | ['h3Distance', NUMBER, [H3_LOWER, H3_UPPER, H3_LOWER, H3_UPPER]],
|
75 | ['h3Line', NUMBER, [H3_LOWER, H3_UPPER, H3_LOWER, H3_UPPER, POINTER]],
|
76 | ['h3LineSize', NUMBER, [H3_LOWER, H3_UPPER, H3_LOWER, H3_UPPER]],
|
77 | ['experimentalH3ToLocalIj', NUMBER, [H3_LOWER, H3_UPPER, H3_LOWER, H3_UPPER, POINTER]],
|
78 | ['experimentalLocalIjToH3', NUMBER, [H3_LOWER, H3_UPPER, POINTER, POINTER]],
|
79 | ['hexAreaM2', NUMBER, [RESOLUTION]],
|
80 | ['hexAreaKm2', NUMBER, [RESOLUTION]],
|
81 | ['edgeLengthM', NUMBER, [RESOLUTION]],
|
82 | ['edgeLengthKm', NUMBER, [RESOLUTION]],
|
83 | ['numHexagons', NUMBER, [RESOLUTION]],
|
84 | ['getRes0Indexes', null, [POINTER]],
|
85 | ['res0IndexCount', NUMBER],
|
86 | ['getPentagonIndexes', null, [NUMBER, POINTER]],
|
87 | ['pentagonIndexCount', NUMBER]
|
88 | ];
|
89 |
|
90 |
|
91 |
|
92 |
|
93 |
|
94 |
|
95 |
|
96 |
|
97 |
|
98 |
|
99 |
|
100 |
|
101 |
|
102 |
|
103 |
|
104 |
|
105 |
|
106 | const bindingNames = BINDINGS
|
107 |
|
108 | .map(def => `_${def[0]}`)
|
109 |
|
110 | .concat(['_malloc', '_calloc']);
|
111 |
|
112 | console.log(JSON.stringify(bindingNames));
|