@stadiamaps/ferrostar 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/ferrostar.d.ts +126 -0
- package/ferrostar.js +864 -0
- package/ferrostar_bg.wasm +0 -0
- package/package.json +32 -0
package/README.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Ferrostar Core
|
|
2
|
+
|
|
3
|
+
Ferrostar is a modern SDK for building turn-by-turn navigation applications.
|
|
4
|
+
|
|
5
|
+
The Ferrostar core includes the navigation state machine, common business logic, spatial algorithms, and models.
|
|
6
|
+
|
|
7
|
+
If you're porting Ferrostar to a new platform or want to build your own UI from scratch, you're in the right spot.
|
|
8
|
+
|
|
9
|
+
Refer to the [Ferrostar User Guide](https://stadiamaps.github.io/ferrostar/)
|
|
10
|
+
for info and tutorials on the high-level UI + wrappers available for common platforms.
|
package/ferrostar.d.ts
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* JavaScript wrapper for `location_simulation_from_coordinates`.
|
|
5
|
+
* @param {any} coordinates
|
|
6
|
+
* @param {number | undefined} [resample_distance]
|
|
7
|
+
* @returns {any}
|
|
8
|
+
*/
|
|
9
|
+
export function locationSimulationFromCoordinates(coordinates: any, resample_distance?: number): any;
|
|
10
|
+
/**
|
|
11
|
+
* JavaScript wrapper for `location_simulation_from_route`.
|
|
12
|
+
* @param {any} route
|
|
13
|
+
* @param {number | undefined} [resample_distance]
|
|
14
|
+
* @returns {any}
|
|
15
|
+
*/
|
|
16
|
+
export function locationSimulationFromRoute(route: any, resample_distance?: number): any;
|
|
17
|
+
/**
|
|
18
|
+
* JavaScript wrapper for `location_simulation_from_polyline`.
|
|
19
|
+
* @param {string} polyline
|
|
20
|
+
* @param {number} precision
|
|
21
|
+
* @param {number | undefined} [resample_distance]
|
|
22
|
+
* @returns {any}
|
|
23
|
+
*/
|
|
24
|
+
export function locationSimulationFromPolyline(polyline: string, precision: number, resample_distance?: number): any;
|
|
25
|
+
/**
|
|
26
|
+
* JavaScript wrapper for `advance_location_simulation`.
|
|
27
|
+
* @param {any} state
|
|
28
|
+
* @returns {any}
|
|
29
|
+
*/
|
|
30
|
+
export function advanceLocationSimulation(state: any): any;
|
|
31
|
+
/**
|
|
32
|
+
* JavaScript wrapper for `NavigationController`.
|
|
33
|
+
*/
|
|
34
|
+
export class NavigationController {
|
|
35
|
+
free(): void;
|
|
36
|
+
/**
|
|
37
|
+
* @param {any} route
|
|
38
|
+
* @param {any} config
|
|
39
|
+
*/
|
|
40
|
+
constructor(route: any, config: any);
|
|
41
|
+
/**
|
|
42
|
+
* @param {any} location
|
|
43
|
+
* @returns {any}
|
|
44
|
+
*/
|
|
45
|
+
getInitialState(location: any): any;
|
|
46
|
+
/**
|
|
47
|
+
* @param {any} state
|
|
48
|
+
* @returns {any}
|
|
49
|
+
*/
|
|
50
|
+
advance_to_next_step(state: any): any;
|
|
51
|
+
/**
|
|
52
|
+
* @param {any} location
|
|
53
|
+
* @param {any} state
|
|
54
|
+
* @returns {any}
|
|
55
|
+
*/
|
|
56
|
+
updateUserLocation(location: any, state: any): any;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* JavaScript wrapper for `RouteAdapter`.
|
|
60
|
+
*/
|
|
61
|
+
export class RouteAdapter {
|
|
62
|
+
free(): void;
|
|
63
|
+
/**
|
|
64
|
+
* Creates a new RouteAdapter with a Valhalla HTTP request generator and an OSRM response parser.
|
|
65
|
+
* At the moment, this is the only supported combination.
|
|
66
|
+
* @param {string} endpoint_url
|
|
67
|
+
* @param {string} profile
|
|
68
|
+
* @param {string | undefined} [costing_options_json]
|
|
69
|
+
*/
|
|
70
|
+
constructor(endpoint_url: string, profile: string, costing_options_json?: string);
|
|
71
|
+
/**
|
|
72
|
+
* @param {any} user_location
|
|
73
|
+
* @param {any} waypoints
|
|
74
|
+
* @returns {any}
|
|
75
|
+
*/
|
|
76
|
+
generateRequest(user_location: any, waypoints: any): any;
|
|
77
|
+
/**
|
|
78
|
+
* @param {Uint8Array} response
|
|
79
|
+
* @returns {any}
|
|
80
|
+
*/
|
|
81
|
+
parseResponse(response: Uint8Array): any;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
85
|
+
|
|
86
|
+
export interface InitOutput {
|
|
87
|
+
readonly memory: WebAssembly.Memory;
|
|
88
|
+
readonly locationSimulationFromCoordinates: (a: number, b: number, c: number, d: number) => void;
|
|
89
|
+
readonly locationSimulationFromRoute: (a: number, b: number, c: number, d: number) => void;
|
|
90
|
+
readonly locationSimulationFromPolyline: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
91
|
+
readonly advanceLocationSimulation: (a: number) => number;
|
|
92
|
+
readonly __wbg_navigationcontroller_free: (a: number) => void;
|
|
93
|
+
readonly navigationcontroller_new: (a: number, b: number, c: number) => void;
|
|
94
|
+
readonly navigationcontroller_getInitialState: (a: number, b: number, c: number) => void;
|
|
95
|
+
readonly navigationcontroller_advance_to_next_step: (a: number, b: number, c: number) => void;
|
|
96
|
+
readonly navigationcontroller_updateUserLocation: (a: number, b: number, c: number, d: number) => void;
|
|
97
|
+
readonly __wbg_routeadapter_free: (a: number) => void;
|
|
98
|
+
readonly routeadapter_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
99
|
+
readonly routeadapter_generateRequest: (a: number, b: number, c: number, d: number) => void;
|
|
100
|
+
readonly routeadapter_parseResponse: (a: number, b: number, c: number, d: number) => void;
|
|
101
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
102
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
103
|
+
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
104
|
+
readonly __wbindgen_exn_store: (a: number) => void;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
108
|
+
/**
|
|
109
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
110
|
+
* a precompiled `WebAssembly.Module`.
|
|
111
|
+
*
|
|
112
|
+
* @param {SyncInitInput} module
|
|
113
|
+
*
|
|
114
|
+
* @returns {InitOutput}
|
|
115
|
+
*/
|
|
116
|
+
export function initSync(module: SyncInitInput): InitOutput;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
120
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
121
|
+
*
|
|
122
|
+
* @param {InitInput | Promise<InitInput>} module_or_path
|
|
123
|
+
*
|
|
124
|
+
* @returns {Promise<InitOutput>}
|
|
125
|
+
*/
|
|
126
|
+
export default function __wbg_init (module_or_path?: InitInput | Promise<InitInput>): Promise<InitOutput>;
|
package/ferrostar.js
ADDED
|
@@ -0,0 +1,864 @@
|
|
|
1
|
+
let wasm;
|
|
2
|
+
|
|
3
|
+
const heap = new Array(128).fill(undefined);
|
|
4
|
+
|
|
5
|
+
heap.push(undefined, null, true, false);
|
|
6
|
+
|
|
7
|
+
function getObject(idx) { return heap[idx]; }
|
|
8
|
+
|
|
9
|
+
let heap_next = heap.length;
|
|
10
|
+
|
|
11
|
+
function dropObject(idx) {
|
|
12
|
+
if (idx < 132) return;
|
|
13
|
+
heap[idx] = heap_next;
|
|
14
|
+
heap_next = idx;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function takeObject(idx) {
|
|
18
|
+
const ret = getObject(idx);
|
|
19
|
+
dropObject(idx);
|
|
20
|
+
return ret;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function isLikeNone(x) {
|
|
24
|
+
return x === undefined || x === null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
let cachedFloat64Memory0 = null;
|
|
28
|
+
|
|
29
|
+
function getFloat64Memory0() {
|
|
30
|
+
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
|
|
31
|
+
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
|
|
32
|
+
}
|
|
33
|
+
return cachedFloat64Memory0;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
let cachedInt32Memory0 = null;
|
|
37
|
+
|
|
38
|
+
function getInt32Memory0() {
|
|
39
|
+
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
|
|
40
|
+
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
41
|
+
}
|
|
42
|
+
return cachedInt32Memory0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function addHeapObject(obj) {
|
|
46
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
47
|
+
const idx = heap_next;
|
|
48
|
+
heap_next = heap[idx];
|
|
49
|
+
|
|
50
|
+
heap[idx] = obj;
|
|
51
|
+
return idx;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
let WASM_VECTOR_LEN = 0;
|
|
55
|
+
|
|
56
|
+
let cachedUint8Memory0 = null;
|
|
57
|
+
|
|
58
|
+
function getUint8Memory0() {
|
|
59
|
+
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
60
|
+
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
61
|
+
}
|
|
62
|
+
return cachedUint8Memory0;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
|
|
66
|
+
|
|
67
|
+
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
68
|
+
? function (arg, view) {
|
|
69
|
+
return cachedTextEncoder.encodeInto(arg, view);
|
|
70
|
+
}
|
|
71
|
+
: function (arg, view) {
|
|
72
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
73
|
+
view.set(buf);
|
|
74
|
+
return {
|
|
75
|
+
read: arg.length,
|
|
76
|
+
written: buf.length
|
|
77
|
+
};
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
81
|
+
|
|
82
|
+
if (realloc === undefined) {
|
|
83
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
84
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
85
|
+
getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
86
|
+
WASM_VECTOR_LEN = buf.length;
|
|
87
|
+
return ptr;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
let len = arg.length;
|
|
91
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
92
|
+
|
|
93
|
+
const mem = getUint8Memory0();
|
|
94
|
+
|
|
95
|
+
let offset = 0;
|
|
96
|
+
|
|
97
|
+
for (; offset < len; offset++) {
|
|
98
|
+
const code = arg.charCodeAt(offset);
|
|
99
|
+
if (code > 0x7F) break;
|
|
100
|
+
mem[ptr + offset] = code;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if (offset !== len) {
|
|
104
|
+
if (offset !== 0) {
|
|
105
|
+
arg = arg.slice(offset);
|
|
106
|
+
}
|
|
107
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
108
|
+
const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
|
|
109
|
+
const ret = encodeString(arg, view);
|
|
110
|
+
|
|
111
|
+
offset += ret.written;
|
|
112
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
WASM_VECTOR_LEN = offset;
|
|
116
|
+
return ptr;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
120
|
+
|
|
121
|
+
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
122
|
+
|
|
123
|
+
function getStringFromWasm0(ptr, len) {
|
|
124
|
+
ptr = ptr >>> 0;
|
|
125
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
let cachedBigInt64Memory0 = null;
|
|
129
|
+
|
|
130
|
+
function getBigInt64Memory0() {
|
|
131
|
+
if (cachedBigInt64Memory0 === null || cachedBigInt64Memory0.byteLength === 0) {
|
|
132
|
+
cachedBigInt64Memory0 = new BigInt64Array(wasm.memory.buffer);
|
|
133
|
+
}
|
|
134
|
+
return cachedBigInt64Memory0;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function debugString(val) {
|
|
138
|
+
// primitive types
|
|
139
|
+
const type = typeof val;
|
|
140
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
141
|
+
return `${val}`;
|
|
142
|
+
}
|
|
143
|
+
if (type == 'string') {
|
|
144
|
+
return `"${val}"`;
|
|
145
|
+
}
|
|
146
|
+
if (type == 'symbol') {
|
|
147
|
+
const description = val.description;
|
|
148
|
+
if (description == null) {
|
|
149
|
+
return 'Symbol';
|
|
150
|
+
} else {
|
|
151
|
+
return `Symbol(${description})`;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
if (type == 'function') {
|
|
155
|
+
const name = val.name;
|
|
156
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
157
|
+
return `Function(${name})`;
|
|
158
|
+
} else {
|
|
159
|
+
return 'Function';
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
// objects
|
|
163
|
+
if (Array.isArray(val)) {
|
|
164
|
+
const length = val.length;
|
|
165
|
+
let debug = '[';
|
|
166
|
+
if (length > 0) {
|
|
167
|
+
debug += debugString(val[0]);
|
|
168
|
+
}
|
|
169
|
+
for(let i = 1; i < length; i++) {
|
|
170
|
+
debug += ', ' + debugString(val[i]);
|
|
171
|
+
}
|
|
172
|
+
debug += ']';
|
|
173
|
+
return debug;
|
|
174
|
+
}
|
|
175
|
+
// Test for built-in
|
|
176
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
177
|
+
let className;
|
|
178
|
+
if (builtInMatches.length > 1) {
|
|
179
|
+
className = builtInMatches[1];
|
|
180
|
+
} else {
|
|
181
|
+
// Failed to match the standard '[object ClassName]'
|
|
182
|
+
return toString.call(val);
|
|
183
|
+
}
|
|
184
|
+
if (className == 'Object') {
|
|
185
|
+
// we're a user defined class or Object
|
|
186
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
187
|
+
// easier than looping through ownProperties of `val`.
|
|
188
|
+
try {
|
|
189
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
190
|
+
} catch (_) {
|
|
191
|
+
return 'Object';
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
// errors
|
|
195
|
+
if (val instanceof Error) {
|
|
196
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
197
|
+
}
|
|
198
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
199
|
+
return className;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* JavaScript wrapper for `location_simulation_from_coordinates`.
|
|
203
|
+
* @param {any} coordinates
|
|
204
|
+
* @param {number | undefined} [resample_distance]
|
|
205
|
+
* @returns {any}
|
|
206
|
+
*/
|
|
207
|
+
export function locationSimulationFromCoordinates(coordinates, resample_distance) {
|
|
208
|
+
try {
|
|
209
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
210
|
+
wasm.locationSimulationFromCoordinates(retptr, addHeapObject(coordinates), !isLikeNone(resample_distance), isLikeNone(resample_distance) ? 0 : resample_distance);
|
|
211
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
212
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
213
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
214
|
+
if (r2) {
|
|
215
|
+
throw takeObject(r1);
|
|
216
|
+
}
|
|
217
|
+
return takeObject(r0);
|
|
218
|
+
} finally {
|
|
219
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* JavaScript wrapper for `location_simulation_from_route`.
|
|
225
|
+
* @param {any} route
|
|
226
|
+
* @param {number | undefined} [resample_distance]
|
|
227
|
+
* @returns {any}
|
|
228
|
+
*/
|
|
229
|
+
export function locationSimulationFromRoute(route, resample_distance) {
|
|
230
|
+
try {
|
|
231
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
232
|
+
wasm.locationSimulationFromRoute(retptr, addHeapObject(route), !isLikeNone(resample_distance), isLikeNone(resample_distance) ? 0 : resample_distance);
|
|
233
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
234
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
235
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
236
|
+
if (r2) {
|
|
237
|
+
throw takeObject(r1);
|
|
238
|
+
}
|
|
239
|
+
return takeObject(r0);
|
|
240
|
+
} finally {
|
|
241
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* JavaScript wrapper for `location_simulation_from_polyline`.
|
|
247
|
+
* @param {string} polyline
|
|
248
|
+
* @param {number} precision
|
|
249
|
+
* @param {number | undefined} [resample_distance]
|
|
250
|
+
* @returns {any}
|
|
251
|
+
*/
|
|
252
|
+
export function locationSimulationFromPolyline(polyline, precision, resample_distance) {
|
|
253
|
+
try {
|
|
254
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
255
|
+
const ptr0 = passStringToWasm0(polyline, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
256
|
+
const len0 = WASM_VECTOR_LEN;
|
|
257
|
+
wasm.locationSimulationFromPolyline(retptr, ptr0, len0, precision, !isLikeNone(resample_distance), isLikeNone(resample_distance) ? 0 : resample_distance);
|
|
258
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
259
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
260
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
261
|
+
if (r2) {
|
|
262
|
+
throw takeObject(r1);
|
|
263
|
+
}
|
|
264
|
+
return takeObject(r0);
|
|
265
|
+
} finally {
|
|
266
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* JavaScript wrapper for `advance_location_simulation`.
|
|
272
|
+
* @param {any} state
|
|
273
|
+
* @returns {any}
|
|
274
|
+
*/
|
|
275
|
+
export function advanceLocationSimulation(state) {
|
|
276
|
+
const ret = wasm.advanceLocationSimulation(addHeapObject(state));
|
|
277
|
+
return takeObject(ret);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
281
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
282
|
+
getUint8Memory0().set(arg, ptr / 1);
|
|
283
|
+
WASM_VECTOR_LEN = arg.length;
|
|
284
|
+
return ptr;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
function handleError(f, args) {
|
|
288
|
+
try {
|
|
289
|
+
return f.apply(this, args);
|
|
290
|
+
} catch (e) {
|
|
291
|
+
wasm.__wbindgen_exn_store(addHeapObject(e));
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
const NavigationControllerFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
296
|
+
? { register: () => {}, unregister: () => {} }
|
|
297
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_navigationcontroller_free(ptr >>> 0));
|
|
298
|
+
/**
|
|
299
|
+
* JavaScript wrapper for `NavigationController`.
|
|
300
|
+
*/
|
|
301
|
+
export class NavigationController {
|
|
302
|
+
|
|
303
|
+
__destroy_into_raw() {
|
|
304
|
+
const ptr = this.__wbg_ptr;
|
|
305
|
+
this.__wbg_ptr = 0;
|
|
306
|
+
NavigationControllerFinalization.unregister(this);
|
|
307
|
+
return ptr;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
free() {
|
|
311
|
+
const ptr = this.__destroy_into_raw();
|
|
312
|
+
wasm.__wbg_navigationcontroller_free(ptr);
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* @param {any} route
|
|
316
|
+
* @param {any} config
|
|
317
|
+
*/
|
|
318
|
+
constructor(route, config) {
|
|
319
|
+
try {
|
|
320
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
321
|
+
wasm.navigationcontroller_new(retptr, addHeapObject(route), addHeapObject(config));
|
|
322
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
323
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
324
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
325
|
+
if (r2) {
|
|
326
|
+
throw takeObject(r1);
|
|
327
|
+
}
|
|
328
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
329
|
+
return this;
|
|
330
|
+
} finally {
|
|
331
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* @param {any} location
|
|
336
|
+
* @returns {any}
|
|
337
|
+
*/
|
|
338
|
+
getInitialState(location) {
|
|
339
|
+
try {
|
|
340
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
341
|
+
wasm.navigationcontroller_getInitialState(retptr, this.__wbg_ptr, addHeapObject(location));
|
|
342
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
343
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
344
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
345
|
+
if (r2) {
|
|
346
|
+
throw takeObject(r1);
|
|
347
|
+
}
|
|
348
|
+
return takeObject(r0);
|
|
349
|
+
} finally {
|
|
350
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* @param {any} state
|
|
355
|
+
* @returns {any}
|
|
356
|
+
*/
|
|
357
|
+
advance_to_next_step(state) {
|
|
358
|
+
try {
|
|
359
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
360
|
+
wasm.navigationcontroller_advance_to_next_step(retptr, this.__wbg_ptr, addHeapObject(state));
|
|
361
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
362
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
363
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
364
|
+
if (r2) {
|
|
365
|
+
throw takeObject(r1);
|
|
366
|
+
}
|
|
367
|
+
return takeObject(r0);
|
|
368
|
+
} finally {
|
|
369
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* @param {any} location
|
|
374
|
+
* @param {any} state
|
|
375
|
+
* @returns {any}
|
|
376
|
+
*/
|
|
377
|
+
updateUserLocation(location, state) {
|
|
378
|
+
try {
|
|
379
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
380
|
+
wasm.navigationcontroller_updateUserLocation(retptr, this.__wbg_ptr, addHeapObject(location), addHeapObject(state));
|
|
381
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
382
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
383
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
384
|
+
if (r2) {
|
|
385
|
+
throw takeObject(r1);
|
|
386
|
+
}
|
|
387
|
+
return takeObject(r0);
|
|
388
|
+
} finally {
|
|
389
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
const RouteAdapterFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
395
|
+
? { register: () => {}, unregister: () => {} }
|
|
396
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_routeadapter_free(ptr >>> 0));
|
|
397
|
+
/**
|
|
398
|
+
* JavaScript wrapper for `RouteAdapter`.
|
|
399
|
+
*/
|
|
400
|
+
export class RouteAdapter {
|
|
401
|
+
|
|
402
|
+
__destroy_into_raw() {
|
|
403
|
+
const ptr = this.__wbg_ptr;
|
|
404
|
+
this.__wbg_ptr = 0;
|
|
405
|
+
RouteAdapterFinalization.unregister(this);
|
|
406
|
+
return ptr;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
free() {
|
|
410
|
+
const ptr = this.__destroy_into_raw();
|
|
411
|
+
wasm.__wbg_routeadapter_free(ptr);
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* Creates a new RouteAdapter with a Valhalla HTTP request generator and an OSRM response parser.
|
|
415
|
+
* At the moment, this is the only supported combination.
|
|
416
|
+
* @param {string} endpoint_url
|
|
417
|
+
* @param {string} profile
|
|
418
|
+
* @param {string | undefined} [costing_options_json]
|
|
419
|
+
*/
|
|
420
|
+
constructor(endpoint_url, profile, costing_options_json) {
|
|
421
|
+
try {
|
|
422
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
423
|
+
const ptr0 = passStringToWasm0(endpoint_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
424
|
+
const len0 = WASM_VECTOR_LEN;
|
|
425
|
+
const ptr1 = passStringToWasm0(profile, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
426
|
+
const len1 = WASM_VECTOR_LEN;
|
|
427
|
+
var ptr2 = isLikeNone(costing_options_json) ? 0 : passStringToWasm0(costing_options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
428
|
+
var len2 = WASM_VECTOR_LEN;
|
|
429
|
+
wasm.routeadapter_new(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
430
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
431
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
432
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
433
|
+
if (r2) {
|
|
434
|
+
throw takeObject(r1);
|
|
435
|
+
}
|
|
436
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
437
|
+
return this;
|
|
438
|
+
} finally {
|
|
439
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* @param {any} user_location
|
|
444
|
+
* @param {any} waypoints
|
|
445
|
+
* @returns {any}
|
|
446
|
+
*/
|
|
447
|
+
generateRequest(user_location, waypoints) {
|
|
448
|
+
try {
|
|
449
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
450
|
+
wasm.routeadapter_generateRequest(retptr, this.__wbg_ptr, addHeapObject(user_location), addHeapObject(waypoints));
|
|
451
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
452
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
453
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
454
|
+
if (r2) {
|
|
455
|
+
throw takeObject(r1);
|
|
456
|
+
}
|
|
457
|
+
return takeObject(r0);
|
|
458
|
+
} finally {
|
|
459
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
* @param {Uint8Array} response
|
|
464
|
+
* @returns {any}
|
|
465
|
+
*/
|
|
466
|
+
parseResponse(response) {
|
|
467
|
+
try {
|
|
468
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
469
|
+
const ptr0 = passArray8ToWasm0(response, wasm.__wbindgen_malloc);
|
|
470
|
+
const len0 = WASM_VECTOR_LEN;
|
|
471
|
+
wasm.routeadapter_parseResponse(retptr, this.__wbg_ptr, ptr0, len0);
|
|
472
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
473
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
474
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
475
|
+
if (r2) {
|
|
476
|
+
throw takeObject(r1);
|
|
477
|
+
}
|
|
478
|
+
return takeObject(r0);
|
|
479
|
+
} finally {
|
|
480
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
async function __wbg_load(module, imports) {
|
|
486
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
487
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
488
|
+
try {
|
|
489
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
490
|
+
|
|
491
|
+
} catch (e) {
|
|
492
|
+
if (module.headers.get('Content-Type') != 'application/wasm') {
|
|
493
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
494
|
+
|
|
495
|
+
} else {
|
|
496
|
+
throw e;
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
const bytes = await module.arrayBuffer();
|
|
502
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
503
|
+
|
|
504
|
+
} else {
|
|
505
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
506
|
+
|
|
507
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
508
|
+
return { instance, module };
|
|
509
|
+
|
|
510
|
+
} else {
|
|
511
|
+
return instance;
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
function __wbg_get_imports() {
|
|
517
|
+
const imports = {};
|
|
518
|
+
imports.wbg = {};
|
|
519
|
+
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
520
|
+
takeObject(arg0);
|
|
521
|
+
};
|
|
522
|
+
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
|
523
|
+
const ret = getObject(arg0) === undefined;
|
|
524
|
+
return ret;
|
|
525
|
+
};
|
|
526
|
+
imports.wbg.__wbindgen_in = function(arg0, arg1) {
|
|
527
|
+
const ret = getObject(arg0) in getObject(arg1);
|
|
528
|
+
return ret;
|
|
529
|
+
};
|
|
530
|
+
imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
|
|
531
|
+
const obj = getObject(arg1);
|
|
532
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
533
|
+
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
|
|
534
|
+
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
535
|
+
};
|
|
536
|
+
imports.wbg.__wbindgen_is_bigint = function(arg0) {
|
|
537
|
+
const ret = typeof(getObject(arg0)) === 'bigint';
|
|
538
|
+
return ret;
|
|
539
|
+
};
|
|
540
|
+
imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
|
|
541
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
542
|
+
return addHeapObject(ret);
|
|
543
|
+
};
|
|
544
|
+
imports.wbg.__wbindgen_jsval_eq = function(arg0, arg1) {
|
|
545
|
+
const ret = getObject(arg0) === getObject(arg1);
|
|
546
|
+
return ret;
|
|
547
|
+
};
|
|
548
|
+
imports.wbg.__wbindgen_is_string = function(arg0) {
|
|
549
|
+
const ret = typeof(getObject(arg0)) === 'string';
|
|
550
|
+
return ret;
|
|
551
|
+
};
|
|
552
|
+
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
553
|
+
const obj = getObject(arg1);
|
|
554
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
555
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
556
|
+
var len1 = WASM_VECTOR_LEN;
|
|
557
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
558
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
559
|
+
};
|
|
560
|
+
imports.wbg.__wbindgen_is_object = function(arg0) {
|
|
561
|
+
const val = getObject(arg0);
|
|
562
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
563
|
+
return ret;
|
|
564
|
+
};
|
|
565
|
+
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
566
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
567
|
+
return addHeapObject(ret);
|
|
568
|
+
};
|
|
569
|
+
imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
|
|
570
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
571
|
+
return addHeapObject(ret);
|
|
572
|
+
};
|
|
573
|
+
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
|
574
|
+
const ret = getObject(arg0);
|
|
575
|
+
return addHeapObject(ret);
|
|
576
|
+
};
|
|
577
|
+
imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
|
|
578
|
+
const ret = getObject(arg0) == getObject(arg1);
|
|
579
|
+
return ret;
|
|
580
|
+
};
|
|
581
|
+
imports.wbg.__wbindgen_boolean_get = function(arg0) {
|
|
582
|
+
const v = getObject(arg0);
|
|
583
|
+
const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
|
|
584
|
+
return ret;
|
|
585
|
+
};
|
|
586
|
+
imports.wbg.__wbindgen_as_number = function(arg0) {
|
|
587
|
+
const ret = +getObject(arg0);
|
|
588
|
+
return ret;
|
|
589
|
+
};
|
|
590
|
+
imports.wbg.__wbg_String_b9412f8799faab3e = function(arg0, arg1) {
|
|
591
|
+
const ret = String(getObject(arg1));
|
|
592
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
593
|
+
const len1 = WASM_VECTOR_LEN;
|
|
594
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
595
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
596
|
+
};
|
|
597
|
+
imports.wbg.__wbindgen_number_new = function(arg0) {
|
|
598
|
+
const ret = arg0;
|
|
599
|
+
return addHeapObject(ret);
|
|
600
|
+
};
|
|
601
|
+
imports.wbg.__wbindgen_bigint_from_i64 = function(arg0) {
|
|
602
|
+
const ret = arg0;
|
|
603
|
+
return addHeapObject(ret);
|
|
604
|
+
};
|
|
605
|
+
imports.wbg.__wbg_getwithrefkey_edc2c8960f0f1191 = function(arg0, arg1) {
|
|
606
|
+
const ret = getObject(arg0)[getObject(arg1)];
|
|
607
|
+
return addHeapObject(ret);
|
|
608
|
+
};
|
|
609
|
+
imports.wbg.__wbg_set_f975102236d3c502 = function(arg0, arg1, arg2) {
|
|
610
|
+
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
611
|
+
};
|
|
612
|
+
imports.wbg.__wbg_crypto_1d1f22824a6a080c = function(arg0) {
|
|
613
|
+
const ret = getObject(arg0).crypto;
|
|
614
|
+
return addHeapObject(ret);
|
|
615
|
+
};
|
|
616
|
+
imports.wbg.__wbg_process_4a72847cc503995b = function(arg0) {
|
|
617
|
+
const ret = getObject(arg0).process;
|
|
618
|
+
return addHeapObject(ret);
|
|
619
|
+
};
|
|
620
|
+
imports.wbg.__wbg_versions_f686565e586dd935 = function(arg0) {
|
|
621
|
+
const ret = getObject(arg0).versions;
|
|
622
|
+
return addHeapObject(ret);
|
|
623
|
+
};
|
|
624
|
+
imports.wbg.__wbg_node_104a2ff8d6ea03a2 = function(arg0) {
|
|
625
|
+
const ret = getObject(arg0).node;
|
|
626
|
+
return addHeapObject(ret);
|
|
627
|
+
};
|
|
628
|
+
imports.wbg.__wbg_require_cca90b1a94a0255b = function() { return handleError(function () {
|
|
629
|
+
const ret = module.require;
|
|
630
|
+
return addHeapObject(ret);
|
|
631
|
+
}, arguments) };
|
|
632
|
+
imports.wbg.__wbg_msCrypto_eb05e62b530a1508 = function(arg0) {
|
|
633
|
+
const ret = getObject(arg0).msCrypto;
|
|
634
|
+
return addHeapObject(ret);
|
|
635
|
+
};
|
|
636
|
+
imports.wbg.__wbg_randomFillSync_5c9c955aa56b6049 = function() { return handleError(function (arg0, arg1) {
|
|
637
|
+
getObject(arg0).randomFillSync(takeObject(arg1));
|
|
638
|
+
}, arguments) };
|
|
639
|
+
imports.wbg.__wbg_getRandomValues_3aa56aa6edec874c = function() { return handleError(function (arg0, arg1) {
|
|
640
|
+
getObject(arg0).getRandomValues(getObject(arg1));
|
|
641
|
+
}, arguments) };
|
|
642
|
+
imports.wbg.__wbg_get_bd8e338fbd5f5cc8 = function(arg0, arg1) {
|
|
643
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
644
|
+
return addHeapObject(ret);
|
|
645
|
+
};
|
|
646
|
+
imports.wbg.__wbg_length_cd7af8117672b8b8 = function(arg0) {
|
|
647
|
+
const ret = getObject(arg0).length;
|
|
648
|
+
return ret;
|
|
649
|
+
};
|
|
650
|
+
imports.wbg.__wbg_new_16b304a2cfa7ff4a = function() {
|
|
651
|
+
const ret = new Array();
|
|
652
|
+
return addHeapObject(ret);
|
|
653
|
+
};
|
|
654
|
+
imports.wbg.__wbindgen_is_function = function(arg0) {
|
|
655
|
+
const ret = typeof(getObject(arg0)) === 'function';
|
|
656
|
+
return ret;
|
|
657
|
+
};
|
|
658
|
+
imports.wbg.__wbg_newnoargs_e258087cd0daa0ea = function(arg0, arg1) {
|
|
659
|
+
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
660
|
+
return addHeapObject(ret);
|
|
661
|
+
};
|
|
662
|
+
imports.wbg.__wbg_new_d9bc3a0147634640 = function() {
|
|
663
|
+
const ret = new Map();
|
|
664
|
+
return addHeapObject(ret);
|
|
665
|
+
};
|
|
666
|
+
imports.wbg.__wbg_next_40fc327bfc8770e6 = function(arg0) {
|
|
667
|
+
const ret = getObject(arg0).next;
|
|
668
|
+
return addHeapObject(ret);
|
|
669
|
+
};
|
|
670
|
+
imports.wbg.__wbg_next_196c84450b364254 = function() { return handleError(function (arg0) {
|
|
671
|
+
const ret = getObject(arg0).next();
|
|
672
|
+
return addHeapObject(ret);
|
|
673
|
+
}, arguments) };
|
|
674
|
+
imports.wbg.__wbg_done_298b57d23c0fc80c = function(arg0) {
|
|
675
|
+
const ret = getObject(arg0).done;
|
|
676
|
+
return ret;
|
|
677
|
+
};
|
|
678
|
+
imports.wbg.__wbg_value_d93c65011f51a456 = function(arg0) {
|
|
679
|
+
const ret = getObject(arg0).value;
|
|
680
|
+
return addHeapObject(ret);
|
|
681
|
+
};
|
|
682
|
+
imports.wbg.__wbg_iterator_2cee6dadfd956dfa = function() {
|
|
683
|
+
const ret = Symbol.iterator;
|
|
684
|
+
return addHeapObject(ret);
|
|
685
|
+
};
|
|
686
|
+
imports.wbg.__wbg_get_e3c254076557e348 = function() { return handleError(function (arg0, arg1) {
|
|
687
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
688
|
+
return addHeapObject(ret);
|
|
689
|
+
}, arguments) };
|
|
690
|
+
imports.wbg.__wbg_call_27c0f87801dedf93 = function() { return handleError(function (arg0, arg1) {
|
|
691
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
692
|
+
return addHeapObject(ret);
|
|
693
|
+
}, arguments) };
|
|
694
|
+
imports.wbg.__wbg_new_72fb9a18b5ae2624 = function() {
|
|
695
|
+
const ret = new Object();
|
|
696
|
+
return addHeapObject(ret);
|
|
697
|
+
};
|
|
698
|
+
imports.wbg.__wbg_self_ce0dbfc45cf2f5be = function() { return handleError(function () {
|
|
699
|
+
const ret = self.self;
|
|
700
|
+
return addHeapObject(ret);
|
|
701
|
+
}, arguments) };
|
|
702
|
+
imports.wbg.__wbg_window_c6fb939a7f436783 = function() { return handleError(function () {
|
|
703
|
+
const ret = window.window;
|
|
704
|
+
return addHeapObject(ret);
|
|
705
|
+
}, arguments) };
|
|
706
|
+
imports.wbg.__wbg_globalThis_d1e6af4856ba331b = function() { return handleError(function () {
|
|
707
|
+
const ret = globalThis.globalThis;
|
|
708
|
+
return addHeapObject(ret);
|
|
709
|
+
}, arguments) };
|
|
710
|
+
imports.wbg.__wbg_global_207b558942527489 = function() { return handleError(function () {
|
|
711
|
+
const ret = global.global;
|
|
712
|
+
return addHeapObject(ret);
|
|
713
|
+
}, arguments) };
|
|
714
|
+
imports.wbg.__wbg_set_d4638f722068f043 = function(arg0, arg1, arg2) {
|
|
715
|
+
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
716
|
+
};
|
|
717
|
+
imports.wbg.__wbg_isArray_2ab64d95e09ea0ae = function(arg0) {
|
|
718
|
+
const ret = Array.isArray(getObject(arg0));
|
|
719
|
+
return ret;
|
|
720
|
+
};
|
|
721
|
+
imports.wbg.__wbg_instanceof_ArrayBuffer_836825be07d4c9d2 = function(arg0) {
|
|
722
|
+
let result;
|
|
723
|
+
try {
|
|
724
|
+
result = getObject(arg0) instanceof ArrayBuffer;
|
|
725
|
+
} catch (_) {
|
|
726
|
+
result = false;
|
|
727
|
+
}
|
|
728
|
+
const ret = result;
|
|
729
|
+
return ret;
|
|
730
|
+
};
|
|
731
|
+
imports.wbg.__wbg_call_b3ca7c6051f9bec1 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
732
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
733
|
+
return addHeapObject(ret);
|
|
734
|
+
}, arguments) };
|
|
735
|
+
imports.wbg.__wbg_set_8417257aaedc936b = function(arg0, arg1, arg2) {
|
|
736
|
+
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
|
|
737
|
+
return addHeapObject(ret);
|
|
738
|
+
};
|
|
739
|
+
imports.wbg.__wbg_isSafeInteger_f7b04ef02296c4d2 = function(arg0) {
|
|
740
|
+
const ret = Number.isSafeInteger(getObject(arg0));
|
|
741
|
+
return ret;
|
|
742
|
+
};
|
|
743
|
+
imports.wbg.__wbg_now_3014639a94423537 = function() {
|
|
744
|
+
const ret = Date.now();
|
|
745
|
+
return ret;
|
|
746
|
+
};
|
|
747
|
+
imports.wbg.__wbg_entries_95cc2c823b285a09 = function(arg0) {
|
|
748
|
+
const ret = Object.entries(getObject(arg0));
|
|
749
|
+
return addHeapObject(ret);
|
|
750
|
+
};
|
|
751
|
+
imports.wbg.__wbg_buffer_12d079cc21e14bdb = function(arg0) {
|
|
752
|
+
const ret = getObject(arg0).buffer;
|
|
753
|
+
return addHeapObject(ret);
|
|
754
|
+
};
|
|
755
|
+
imports.wbg.__wbg_newwithbyteoffsetandlength_aa4a17c33a06e5cb = function(arg0, arg1, arg2) {
|
|
756
|
+
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
|
757
|
+
return addHeapObject(ret);
|
|
758
|
+
};
|
|
759
|
+
imports.wbg.__wbg_new_63b92bc8671ed464 = function(arg0) {
|
|
760
|
+
const ret = new Uint8Array(getObject(arg0));
|
|
761
|
+
return addHeapObject(ret);
|
|
762
|
+
};
|
|
763
|
+
imports.wbg.__wbg_set_a47bac70306a19a7 = function(arg0, arg1, arg2) {
|
|
764
|
+
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
765
|
+
};
|
|
766
|
+
imports.wbg.__wbg_length_c20a40f15020d68a = function(arg0) {
|
|
767
|
+
const ret = getObject(arg0).length;
|
|
768
|
+
return ret;
|
|
769
|
+
};
|
|
770
|
+
imports.wbg.__wbg_instanceof_Uint8Array_2b3bbecd033d19f6 = function(arg0) {
|
|
771
|
+
let result;
|
|
772
|
+
try {
|
|
773
|
+
result = getObject(arg0) instanceof Uint8Array;
|
|
774
|
+
} catch (_) {
|
|
775
|
+
result = false;
|
|
776
|
+
}
|
|
777
|
+
const ret = result;
|
|
778
|
+
return ret;
|
|
779
|
+
};
|
|
780
|
+
imports.wbg.__wbg_newwithlength_e9b4878cebadb3d3 = function(arg0) {
|
|
781
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
782
|
+
return addHeapObject(ret);
|
|
783
|
+
};
|
|
784
|
+
imports.wbg.__wbg_subarray_a1f73cd4b5b42fe1 = function(arg0, arg1, arg2) {
|
|
785
|
+
const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
|
|
786
|
+
return addHeapObject(ret);
|
|
787
|
+
};
|
|
788
|
+
imports.wbg.__wbindgen_bigint_get_as_i64 = function(arg0, arg1) {
|
|
789
|
+
const v = getObject(arg1);
|
|
790
|
+
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
791
|
+
getBigInt64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? BigInt(0) : ret;
|
|
792
|
+
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
793
|
+
};
|
|
794
|
+
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
|
795
|
+
const ret = debugString(getObject(arg1));
|
|
796
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
797
|
+
const len1 = WASM_VECTOR_LEN;
|
|
798
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
799
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
800
|
+
};
|
|
801
|
+
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
802
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
803
|
+
};
|
|
804
|
+
imports.wbg.__wbindgen_memory = function() {
|
|
805
|
+
const ret = wasm.memory;
|
|
806
|
+
return addHeapObject(ret);
|
|
807
|
+
};
|
|
808
|
+
|
|
809
|
+
return imports;
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
function __wbg_init_memory(imports, maybe_memory) {
|
|
813
|
+
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
function __wbg_finalize_init(instance, module) {
|
|
817
|
+
wasm = instance.exports;
|
|
818
|
+
__wbg_init.__wbindgen_wasm_module = module;
|
|
819
|
+
cachedBigInt64Memory0 = null;
|
|
820
|
+
cachedFloat64Memory0 = null;
|
|
821
|
+
cachedInt32Memory0 = null;
|
|
822
|
+
cachedUint8Memory0 = null;
|
|
823
|
+
|
|
824
|
+
|
|
825
|
+
return wasm;
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
function initSync(module) {
|
|
829
|
+
if (wasm !== undefined) return wasm;
|
|
830
|
+
|
|
831
|
+
const imports = __wbg_get_imports();
|
|
832
|
+
|
|
833
|
+
__wbg_init_memory(imports);
|
|
834
|
+
|
|
835
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
836
|
+
module = new WebAssembly.Module(module);
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
840
|
+
|
|
841
|
+
return __wbg_finalize_init(instance, module);
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
async function __wbg_init(input) {
|
|
845
|
+
if (wasm !== undefined) return wasm;
|
|
846
|
+
|
|
847
|
+
if (typeof input === 'undefined') {
|
|
848
|
+
input = new URL('ferrostar_bg.wasm', import.meta.url);
|
|
849
|
+
}
|
|
850
|
+
const imports = __wbg_get_imports();
|
|
851
|
+
|
|
852
|
+
if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) {
|
|
853
|
+
input = fetch(input);
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
__wbg_init_memory(imports);
|
|
857
|
+
|
|
858
|
+
const { instance, module } = await __wbg_load(await input, imports);
|
|
859
|
+
|
|
860
|
+
return __wbg_finalize_init(instance, module);
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
export { initSync }
|
|
864
|
+
export default __wbg_init;
|
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@stadiamaps/ferrostar",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"collaborators": [
|
|
5
|
+
"Ian Wagner <ian@stadiamaps.com>",
|
|
6
|
+
"Jacob Fielding <jacob@rallista.app>",
|
|
7
|
+
"Luke Seelenbinder <luke@stadiamaps.com>"
|
|
8
|
+
],
|
|
9
|
+
"description": "The core of modern turn-by-turn navigation.",
|
|
10
|
+
"version": "0.9.1",
|
|
11
|
+
"license": "BSD-3-Clause",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://github.com/stadiamaps/ferrostar"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"ferrostar_bg.wasm",
|
|
18
|
+
"ferrostar.js",
|
|
19
|
+
"ferrostar.d.ts"
|
|
20
|
+
],
|
|
21
|
+
"main": "ferrostar.js",
|
|
22
|
+
"types": "ferrostar.d.ts",
|
|
23
|
+
"sideEffects": [
|
|
24
|
+
"./snippets/*"
|
|
25
|
+
],
|
|
26
|
+
"keywords": [
|
|
27
|
+
"navigation",
|
|
28
|
+
"routing",
|
|
29
|
+
"valhalla",
|
|
30
|
+
"osrm"
|
|
31
|
+
]
|
|
32
|
+
}
|