@geolith/glx 0.1.1 → 0.2.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/dist/glx_bg.wasm CHANGED
Binary file
Binary file
package/dist/index.d.ts CHANGED
@@ -204,9 +204,10 @@ export declare class GlxFile {
204
204
  #private;
205
205
  private constructor();
206
206
  /**
207
- * Reads the header and the boot sections (dictionary root, spatial
208
- * directory, id directory) and opens the index. Call `init` (the wasm
209
- * module) first.
207
+ * Reads the file header and the search header (the first 512 bytes),
208
+ * then the boot sections (dictionary root, spatial directory, id
209
+ * directory) and opens the index. Rejects a file without a search
210
+ * part, naming the parts it holds. Call `init` (the wasm module) first.
210
211
  */
211
212
  static open(source: Source, read?: ReadOptions): Promise<GlxFile>;
212
213
  /** Places in the file. */
package/dist/index.js CHANGED
@@ -173,11 +173,13 @@ var Query = class Query {
173
173
  };
174
174
  if (Symbol.dispose) Query.prototype[Symbol.dispose] = Query.prototype.free;
175
175
  /**
176
- * `[offset, length]` of the boot bytes, from the header bytes.
176
+ * `[offset, length]` of the boot bytes, from the [`header_length`] bytes
177
+ * at the start of the file.
177
178
  *
178
179
  * # Errors
179
- * When the bytes are not a `.glx` version 1 header, or the file lacks a
180
- * record feature this reader needs.
180
+ * When the file header is refused, the file holds no search part (the
181
+ * message names the kinds it holds), or the search header is refused (the
182
+ * part lacks a record feature this reader needs).
181
183
  * @param {Uint8Array | number[]} header
182
184
  * @returns {Float64Array}
183
185
  */
@@ -239,7 +241,8 @@ function collection(query, features, name, version) {
239
241
  }
240
242
  }
241
243
  /**
242
- * Header length in bytes.
244
+ * Bytes to fetch first, from the start of the file: the file header and
245
+ * the search header (512).
243
246
  * @returns {number}
244
247
  */
245
248
  function headerLength() {
@@ -462,9 +465,10 @@ var GlxFile = class GlxFile {
462
465
  this.#read = read;
463
466
  }
464
467
  /**
465
- * Reads the header and the boot sections (dictionary root, spatial
466
- * directory, id directory) and opens the index. Call `init` (the wasm
467
- * module) first.
468
+ * Reads the file header and the search header (the first 512 bytes),
469
+ * then the boot sections (dictionary root, spatial directory, id
470
+ * directory) and opens the index. Rejects a file without a search
471
+ * part, naming the parts it holds. Call `init` (the wasm module) first.
468
472
  */
469
473
  static async open(source, read = {}) {
470
474
  const header = await source.getBytes(0, headerLength());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geolith/glx",
3
- "version": "0.1.1",
3
+ "version": "0.2.1",
4
4
  "description": "Reads .glx geocoding files from R2 or HTTP range requests: search, autocomplete, structured, reverse, nearby and place lookup.",
5
5
  "keywords": [
6
6
  "autocomplete",