@versatiles/container 1.0.1 → 1.0.2

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/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" resolution-mode="require"/>
2
- import type { Block, Header, Options, Reader, TileIndex } from './interfaces.js';
3
- export type { Compression, Format, Header, Options, Reader } from './interfaces.js';
2
+ import type { Block, Header, OpenOptions, Reader, TileIndex } from './interfaces.js';
3
+ export type { Compression, Format, Header, OpenOptions, Reader } from './interfaces.js';
4
4
  /**
5
5
  * The `VersaTiles` class is a wrapper around a `.versatiles` container file. It provides methods
6
6
  * to access tile data, metadata, and other properties within the container.
@@ -15,7 +15,7 @@ export declare class VersaTiles {
15
15
  * @param options - Optional settings that configure tile handling.
16
16
  * @throws Will throw an error if the provided source is neither a string nor a Reader function.
17
17
  */
18
- constructor(source: Reader | string, options?: Options);
18
+ constructor(source: Reader | string, options?: OpenOptions);
19
19
  /**
20
20
  * Asynchronously retrieves the header information from the `.versatiles` container.
21
21
  *
@@ -28,9 +28,9 @@ export declare class VersaTiles {
28
28
  * Metadata typically includes information about `vector_layers` for vector tiles.
29
29
  * If the container does not include metadata, this method returns `null`.
30
30
  *
31
- * @returns A promise that resolves with an object representing the metadata, or null if no metadata is present.
31
+ * @returns A promise that resolves with an object representing the metadata.
32
32
  */
33
- getMetadata(): Promise<object | null>;
33
+ getMetadata(): Promise<unknown>;
34
34
  /**
35
35
  * Asynchronously retrieves a specific tile's data as a Buffer. If the tile data is compressed as
36
36
  * defined in the container header, the returned Buffer will contain the compressed data.
package/dist/index.js CHANGED
@@ -108,7 +108,7 @@ export class VersaTiles {
108
108
  * Metadata typically includes information about `vector_layers` for vector tiles.
109
109
  * If the container does not include metadata, this method returns `null`.
110
110
  *
111
- * @returns A promise that resolves with an object representing the metadata, or null if no metadata is present.
111
+ * @returns A promise that resolves with an object representing the metadata.
112
112
  */
113
113
  async getMetadata() {
114
114
  if (this.#metadata !== undefined)
@@ -102,6 +102,6 @@ export interface TileIndex {
102
102
  * Interface for defining the options available for reading a container.
103
103
  * @property {boolean} tms - If set to true, uses the [TMS (Tile Map Service) tile ordering](https://wiki.openstreetmap.org/wiki/TMS) where y=0 is the southernmost point.
104
104
  */
105
- export interface Options {
105
+ export interface OpenOptions {
106
106
  tms: boolean;
107
107
  }
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@versatiles/container",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "A client library for reading VersaTiles containers",
5
5
  "scripts": {
6
6
  "build": "rm -rf dist && tsc -p tsconfig.build.json",
7
- "check": "cd ..; npm run check",
7
+ "check": "npm run lint && npm run test && npm run build",
8
8
  "doc": "npx vrt ts2md src/index.ts tsconfig.build.json | npx vrt insertmd README.md '# API' true",
9
- "lint": "cd ..; npm run lint",
9
+ "lint": "eslint . --color",
10
10
  "prepublish": "npm run build && npm run doc",
11
- "test": "cd ..; npm run test"
11
+ "test": "cd ..; NODE_OPTIONS=--experimental-vm-modules jest --testPathPattern versatiles-container"
12
12
  },
13
13
  "files": [
14
14
  "dist/**/*.js",