@maptiler/sdk 3.0.1 → 3.2.0-rc.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/.husky/pre-commit +1 -0
- package/README.md +24 -6
- package/dist/eslint.config.d.mts +2 -0
- package/dist/maptiler-sdk.mjs +2499 -1984
- package/dist/maptiler-sdk.mjs.map +1 -1
- package/dist/src/MLAdapters/MapMouseEvent.d.ts +1 -1
- package/dist/src/MLAdapters/ScaleControl.d.ts +3 -0
- package/dist/src/Map.d.ts +13 -0
- package/dist/src/MaptilerGeolocateControl.d.ts +11 -0
- package/dist/src/MaptilerLogoControl.d.ts +4 -0
- package/dist/src/MaptilerNavigationControl.d.ts +15 -2
- package/dist/src/MaptilerProjectionControl.d.ts +10 -0
- package/dist/src/MaptilerScaleControl.d.ts +15 -0
- package/dist/src/MaptilerTerrainControl.d.ts +12 -3
- package/dist/src/config.d.ts +1 -1
- package/dist/src/index.d.ts +2 -1
- package/dist/src/tools.d.ts +4 -6
- package/eslint.config.mjs +60 -0
- package/package.json +21 -9
- package/tsconfig.json +10 -6
- package/biome.json +0 -50
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as maplibregl, Map as MapMLGL } from 'maplibre-gl';
|
|
2
2
|
import { Map as SDKMap } from '../Map';
|
|
3
3
|
export declare class MapMouseEvent extends maplibregl.MapMouseEvent {
|
|
4
|
-
constructor(type: string, map: SDKMap | MapMLGL, originalEvent: MouseEvent, data?:
|
|
4
|
+
constructor(type: string, map: SDKMap | MapMLGL, originalEvent: MouseEvent, data?: Record<string, unknown>);
|
|
5
5
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { default as maplibregl, Map as MapMLGL } from 'maplibre-gl';
|
|
2
2
|
import { Map as SDKMap } from '../Map';
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Please use MaptilerScaleControl from '@maptiler/sdk' instead.
|
|
5
|
+
*/
|
|
3
6
|
export declare class ScaleControl extends maplibregl.ScaleControl {
|
|
4
7
|
onAdd(map: SDKMap | MapMLGL): HTMLElement;
|
|
5
8
|
}
|
package/dist/src/Map.d.ts
CHANGED
|
@@ -125,11 +125,18 @@ export type MapOptions = Omit<MapOptionsML, "style" | "maplibreLogo"> & {
|
|
|
125
125
|
* If not provided, the style takes precedence. If provided, overwrite the style.
|
|
126
126
|
*/
|
|
127
127
|
projection?: ProjectionTypes;
|
|
128
|
+
/**
|
|
129
|
+
* Enable or disable all default controls. When false, no default controls will be added.
|
|
130
|
+
* Individual controls can still be added manually using addControl().
|
|
131
|
+
* @default true
|
|
132
|
+
*/
|
|
133
|
+
defaultControls?: boolean;
|
|
128
134
|
};
|
|
129
135
|
/**
|
|
130
136
|
* The Map class can be instanciated to display a map in a `<div>`
|
|
131
137
|
*/
|
|
132
138
|
export declare class Map extends maplibregl.Map {
|
|
139
|
+
private options;
|
|
133
140
|
readonly telemetry: Telemetry;
|
|
134
141
|
private isTerrainEnabled;
|
|
135
142
|
private terrainExaggeration;
|
|
@@ -148,6 +155,12 @@ export declare class Map extends maplibregl.Map {
|
|
|
148
155
|
private isStyleLocalized;
|
|
149
156
|
private languageIsUpdated;
|
|
150
157
|
constructor(options: MapOptions);
|
|
158
|
+
private checkControlsConfiguration;
|
|
159
|
+
/**
|
|
160
|
+
* Recreates the map instance with the same options.
|
|
161
|
+
* Useful for WebGL context loss.
|
|
162
|
+
*/
|
|
163
|
+
recreate(): void;
|
|
151
164
|
/**
|
|
152
165
|
* Set the duration (millisec) of the terrain animation for growing or flattening.
|
|
153
166
|
* Must be positive. (Built-in default: `1000` milliseconds)
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
+
import { GeolocateControlOptions, Map as MapMLGL } from 'maplibre-gl';
|
|
1
2
|
import { GeolocateControl } from './MLAdapters/GeolocateControl';
|
|
3
|
+
import { Map as SDKMap } from './Map';
|
|
4
|
+
type MaptilerGeolocateControlOptions = GeolocateControlOptions & {
|
|
5
|
+
geolocateElement?: HTMLElement;
|
|
6
|
+
removeDefaultDOM?: boolean;
|
|
7
|
+
};
|
|
2
8
|
/**
|
|
3
9
|
* The MaptilerGeolocateControl is an extension of the original GeolocateControl
|
|
4
10
|
* with a few changes. In this version, the active mode persists as long as the
|
|
@@ -7,6 +13,10 @@ import { GeolocateControl } from './MLAdapters/GeolocateControl';
|
|
|
7
13
|
*/
|
|
8
14
|
export declare class MaptilerGeolocateControl extends GeolocateControl {
|
|
9
15
|
private lastUpdatedCenter;
|
|
16
|
+
private removeDefaultDOM;
|
|
17
|
+
private externalGeolocateElement?;
|
|
18
|
+
constructor(options?: MaptilerGeolocateControlOptions);
|
|
19
|
+
onAdd(map: SDKMap | MapMLGL): HTMLElement;
|
|
10
20
|
/**
|
|
11
21
|
* Update the camera location to center on the current position
|
|
12
22
|
*
|
|
@@ -19,3 +29,4 @@ export declare class MaptilerGeolocateControl extends GeolocateControl {
|
|
|
19
29
|
_onZoom: () => void;
|
|
20
30
|
_setErrorState(): void;
|
|
21
31
|
}
|
|
32
|
+
export {};
|
|
@@ -4,6 +4,7 @@ import { Map as SDKMap } from './Map';
|
|
|
4
4
|
type LogoControlOptions = LogoControlOptionsML & {
|
|
5
5
|
logoURL?: string;
|
|
6
6
|
linkURL?: string;
|
|
7
|
+
defaultControlsEnabled?: boolean;
|
|
7
8
|
};
|
|
8
9
|
/**
|
|
9
10
|
* This LogoControl extends the MapLibre LogoControl but instead can use any image URL and
|
|
@@ -13,7 +14,10 @@ export declare class MaptilerLogoControl extends LogoControl {
|
|
|
13
14
|
_compact: boolean;
|
|
14
15
|
private logoURL;
|
|
15
16
|
private linkURL;
|
|
17
|
+
private defaultControlsEnabled;
|
|
16
18
|
constructor(options?: LogoControlOptions);
|
|
17
19
|
onAdd(map: SDKMap): HTMLElement;
|
|
20
|
+
_createAnchor(): HTMLAnchorElement;
|
|
21
|
+
_externalControlsEnabled(): void;
|
|
18
22
|
}
|
|
19
23
|
export {};
|
|
@@ -1,10 +1,23 @@
|
|
|
1
|
-
import { NavigationControlOptions } from 'maplibre-gl';
|
|
2
1
|
import { NavigationControl } from './MLAdapters/NavigationControl';
|
|
2
|
+
import { Map as MapMLGL, NavigationControlOptions } from 'maplibre-gl';
|
|
3
|
+
import { Map as SDKMap } from './Map';
|
|
3
4
|
type HTMLButtonElementPlus = HTMLButtonElement & {
|
|
4
5
|
clickFunction: (e?: Event) => unknown;
|
|
5
6
|
};
|
|
7
|
+
type MaptilerNavigationControlOptions = NavigationControlOptions & {
|
|
8
|
+
compassElement?: HTMLElement;
|
|
9
|
+
zoomInElement?: HTMLElement;
|
|
10
|
+
zoomOutElement?: HTMLElement;
|
|
11
|
+
removeDefaultDOM?: boolean;
|
|
12
|
+
};
|
|
6
13
|
export declare class MaptilerNavigationControl extends NavigationControl {
|
|
7
|
-
|
|
14
|
+
private externalCompass?;
|
|
15
|
+
private externalZoomIn?;
|
|
16
|
+
private externalZoomOut?;
|
|
17
|
+
private removeDefaultDOM?;
|
|
18
|
+
constructor(options?: MaptilerNavigationControlOptions);
|
|
19
|
+
onAdd(map: SDKMap | MapMLGL): HTMLElement;
|
|
20
|
+
private setupExternalElements;
|
|
8
21
|
/**
|
|
9
22
|
* Overloading: the button now stores its click callback so that we can later on delete it and replace it
|
|
10
23
|
*/
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { Map as SDKMap } from './Map';
|
|
2
2
|
import { IControl } from 'maplibre-gl';
|
|
3
|
+
type MaptilerProjectionControlOptions = {
|
|
4
|
+
removeDefaultDOM?: boolean;
|
|
5
|
+
projectionElement?: HTMLElement;
|
|
6
|
+
};
|
|
3
7
|
/**
|
|
4
8
|
* A `MaptilerProjectionControl` control adds a button to switch from Mercator to Globe projection.
|
|
5
9
|
*/
|
|
@@ -7,8 +11,14 @@ export declare class MaptilerProjectionControl implements IControl {
|
|
|
7
11
|
map: SDKMap;
|
|
8
12
|
container: HTMLElement;
|
|
9
13
|
projectionButton: HTMLButtonElement;
|
|
14
|
+
private externalProjection?;
|
|
15
|
+
private options;
|
|
16
|
+
constructor(options?: MaptilerProjectionControlOptions);
|
|
10
17
|
onAdd(map: SDKMap): HTMLElement;
|
|
11
18
|
onRemove(): void;
|
|
19
|
+
private setupExternalElements;
|
|
12
20
|
private toggleProjection;
|
|
21
|
+
private updateExternalTitle;
|
|
13
22
|
private updateProjectionIcon;
|
|
14
23
|
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as maplibregl, Map as MapMLGL, ScaleControlOptions } from 'maplibre-gl';
|
|
2
|
+
import { Map as SDKMap } from './Map';
|
|
3
|
+
type MaptilerScaleControlOptions = ScaleControlOptions & {
|
|
4
|
+
removeDefaultDOM?: boolean;
|
|
5
|
+
scaleElement?: HTMLElement;
|
|
6
|
+
};
|
|
7
|
+
export declare class MaptilerScaleControl extends maplibregl.ScaleControl {
|
|
8
|
+
private externalScale?;
|
|
9
|
+
private removeDefaultDOM?;
|
|
10
|
+
constructor(options?: MaptilerScaleControlOptions);
|
|
11
|
+
_onMove: () => void;
|
|
12
|
+
onAdd(map: SDKMap | MapMLGL): HTMLElement;
|
|
13
|
+
onRemove(): void;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
@@ -4,13 +4,22 @@ import { IControl } from 'maplibre-gl';
|
|
|
4
4
|
* A `MaptilerTerrainControl` control adds a button to turn terrain on and off
|
|
5
5
|
* by triggering the terrain logic that is already deployed in the Map object.
|
|
6
6
|
*/
|
|
7
|
+
type MaptilerTerrainControlOptions = {
|
|
8
|
+
removeDefaultDOM?: boolean;
|
|
9
|
+
terrainElement?: HTMLElement;
|
|
10
|
+
};
|
|
7
11
|
export declare class MaptilerTerrainControl implements IControl {
|
|
8
12
|
_map: SDKMap;
|
|
9
13
|
_container: HTMLElement;
|
|
10
14
|
_terrainButton: HTMLButtonElement;
|
|
11
|
-
|
|
15
|
+
private externalTerrain?;
|
|
16
|
+
private options;
|
|
17
|
+
constructor(options?: MaptilerTerrainControlOptions);
|
|
12
18
|
onAdd(map: SDKMap): HTMLElement;
|
|
19
|
+
private setupInternalElements;
|
|
20
|
+
private setupExternalElements;
|
|
13
21
|
onRemove(): void;
|
|
14
|
-
_toggleTerrain()
|
|
15
|
-
_updateTerrainIcon()
|
|
22
|
+
_toggleTerrain: () => void;
|
|
23
|
+
_updateTerrainIcon: () => void;
|
|
16
24
|
}
|
|
25
|
+
export {};
|
package/dist/src/config.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ declare class SdkConfig extends EventEmitter {
|
|
|
45
45
|
* - if terrain is activated at initialization [boolean]
|
|
46
46
|
* - if globe projection is activated at initialization [boolean]
|
|
47
47
|
*
|
|
48
|
-
* In addition, each official module will be
|
|
48
|
+
* In addition, each official module will be added to a list, alongside its version number.
|
|
49
49
|
*/
|
|
50
50
|
telemetry: boolean;
|
|
51
51
|
/**
|
package/dist/src/index.d.ts
CHANGED
|
@@ -79,8 +79,9 @@ export * from './MaptilerLogoControl';
|
|
|
79
79
|
export * from './MaptilerTerrainControl';
|
|
80
80
|
export * from './MaptilerNavigationControl';
|
|
81
81
|
export * from './MaptilerProjectionControl';
|
|
82
|
+
export * from './MaptilerScaleControl';
|
|
82
83
|
export { type AutomaticStaticMapOptions, type BoundedStaticMapOptions, type BufferToPixelDataFunction, type ByIdGeocodingOptions, type CenteredStaticMapOptions, type CommonForwardAndReverseGeocodingOptions, type CoordinateExport, type CoordinateGrid, type CoordinateId, type CoordinateSearch, type CoordinateSearchResult, type CoordinateTransformResult, type CoordinateTransformation, type Coordinates, type CoordinatesSearchOptions, type CoordinatesTransformOptions, type DefaultTransformation, type ElevationAtOptions, type ElevationBatchOptions, type FeatureHierarchy, type FetchFunction, type GeocodingFeature, type GeocodingOptions, type GeocodingSearchResult, type GeolocationInfoOptions, type GeolocationResult, type GetDataOptions, type LanguageGeocodingOptions, MapStyle, type MapStylePreset, type MapStyleType, MapStyleVariant, type PixelData, ReferenceMapStyle, type ReverseGeocodingOptions, ServiceError, type StaticMapBaseOptions, type StaticMapMarker, type TileJSON, type XYZ, bufferToPixelDataBrowser, circumferenceAtLatitude, coordinates, data, elevation, expandMapStyle, geocoding, geolocation, getBufferToPixelDataParser, getTileCache, mapStylePresetList, math, misc, staticMaps, styleToStyle, type LanguageInfo, areSameLanguages, toLanguageInfo, isLanguageInfo, getAutoLanguage, getLanguageInfoFromFlag, getLanguageInfoFromCode, getLanguageInfoFromKey, } from '@maptiler/client';
|
|
83
|
-
export { getWebGLSupportError } from './tools';
|
|
84
|
+
export { getWebGLSupportError, displayWebGLContextLostWarning } from './tools';
|
|
84
85
|
export { config, SdkConfig } from './config';
|
|
85
86
|
export * from './language';
|
|
86
87
|
export type { Unit } from './unit';
|
package/dist/src/tools.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { Map as MapSDK } from './Map';
|
|
|
3
3
|
export declare function enableRTL(): void;
|
|
4
4
|
export declare function bindAll(fns: Array<string>, context: any): void;
|
|
5
5
|
export declare function DOMcreate<K extends keyof HTMLElementTagNameMap>(tagName: K, className?: string, container?: HTMLElement): HTMLElementTagNameMap[K];
|
|
6
|
-
export declare function
|
|
6
|
+
export declare function DOMRemove(node: HTMLElement): void;
|
|
7
7
|
/**
|
|
8
8
|
* This function is meant to be used as transformRequest by any Map instance created.
|
|
9
9
|
* It adds the session ID as well as the MapTiler Cloud key from the config to all the requests
|
|
@@ -45,9 +45,9 @@ export declare function getWebGLSupportError(): string | null;
|
|
|
45
45
|
*/
|
|
46
46
|
export declare function displayNoWebGlWarning(container: HTMLElement | string): void;
|
|
47
47
|
/**
|
|
48
|
-
* Display
|
|
48
|
+
* Display a warning message in the Map div if the WebGL context was lost
|
|
49
49
|
*/
|
|
50
|
-
export declare function displayWebGLContextLostWarning(
|
|
50
|
+
export declare function displayWebGLContextLostWarning(map: MapSDK): void;
|
|
51
51
|
/**
|
|
52
52
|
* In a text-field style property (as an object, not a string) the languages that are specified as
|
|
53
53
|
* ["get", "name:XX"] are replaced by the proved replacer (also an object).
|
|
@@ -82,7 +82,5 @@ export declare function findLanguageStr(str: string): Array<string | null>;
|
|
|
82
82
|
export declare function findLanguageObj(origExpr: maplibregl.ExpressionSpecification): Array<string | null>;
|
|
83
83
|
export declare function computeLabelsLocalizationMetrics(layers: maplibregl.LayerSpecification[], map: MapSDK): {
|
|
84
84
|
unlocalized: number;
|
|
85
|
-
localized:
|
|
86
|
-
[k: string]: number;
|
|
87
|
-
};
|
|
85
|
+
localized: Record<string, number>;
|
|
88
86
|
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
import tseslint from "typescript-eslint";
|
|
4
|
+
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
|
|
5
|
+
|
|
6
|
+
export default tseslint.config(
|
|
7
|
+
// https://typescript-eslint.io/getting-started/typed-linting/
|
|
8
|
+
tseslint.configs.strictTypeChecked,
|
|
9
|
+
tseslint.configs.stylisticTypeChecked,
|
|
10
|
+
tseslint.configs.recommendedTypeChecked,
|
|
11
|
+
{
|
|
12
|
+
languageOptions: {
|
|
13
|
+
parserOptions: {
|
|
14
|
+
projectService: true,
|
|
15
|
+
tsconfigRootDir: import.meta.dirname,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
// https://github.com/prettier/eslint-plugin-prettier
|
|
20
|
+
eslintPluginPrettierRecommended,
|
|
21
|
+
//
|
|
22
|
+
{
|
|
23
|
+
rules: {
|
|
24
|
+
"@typescript-eslint/array-type": "off",
|
|
25
|
+
"@typescript-eslint/consistent-indexed-object-style": "warn",
|
|
26
|
+
"@typescript-eslint/consistent-type-definitions": "off",
|
|
27
|
+
"@typescript-eslint/no-base-to-string": "warn",
|
|
28
|
+
"@typescript-eslint/no-confusing-void-expression": "warn",
|
|
29
|
+
"@typescript-eslint/no-explicit-any": "warn",
|
|
30
|
+
"@typescript-eslint/no-floating-promises": "warn",
|
|
31
|
+
"@typescript-eslint/no-inferrable-types": "off",
|
|
32
|
+
"@typescript-eslint/no-misused-promises": "warn",
|
|
33
|
+
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "off",
|
|
34
|
+
"@typescript-eslint/no-unnecessary-condition": "warn",
|
|
35
|
+
"@typescript-eslint/no-unnecessary-type-arguments": "off",
|
|
36
|
+
"@typescript-eslint/no-unnecessary-type-assertion": "off",
|
|
37
|
+
"@typescript-eslint/no-unnecessary-type-parameters": "warn",
|
|
38
|
+
"@typescript-eslint/no-unused-vars": "warn",
|
|
39
|
+
"@typescript-eslint/no-unsafe-argument": "warn",
|
|
40
|
+
"@typescript-eslint/no-unsafe-assignment": "warn",
|
|
41
|
+
"@typescript-eslint/no-unsafe-call": "warn",
|
|
42
|
+
"@typescript-eslint/no-unsafe-enum-comparison": "off",
|
|
43
|
+
"@typescript-eslint/no-unsafe-member-access": "warn",
|
|
44
|
+
"@typescript-eslint/no-unsafe-return": "warn",
|
|
45
|
+
"@typescript-eslint/no-non-null-assertion": "warn",
|
|
46
|
+
"@typescript-eslint/non-nullable-type-assertion-style": "warn",
|
|
47
|
+
"@typescript-eslint/prefer-for-of": "off",
|
|
48
|
+
"@typescript-eslint/prefer-nullish-coalescing": "warn",
|
|
49
|
+
"@typescript-eslint/prefer-optional-chain": "off",
|
|
50
|
+
"@typescript-eslint/prefer-return-this-type": "off",
|
|
51
|
+
"@typescript-eslint/prefer-string-starts-ends-with": "warn",
|
|
52
|
+
"@typescript-eslint/restrict-plus-operands": "warn",
|
|
53
|
+
"@typescript-eslint/restrict-template-expressions": "warn",
|
|
54
|
+
"@typescript-eslint/related-getter-setter-pairs": "off",
|
|
55
|
+
"@typescript-eslint/unbound-method": "warn",
|
|
56
|
+
"@typescript-eslint/use-unknown-in-catch-callback-variable": "warn",
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
//
|
|
60
|
+
);
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maptiler/sdk",
|
|
3
|
-
"version": "3.0.1",
|
|
3
|
+
"version": "3.2.0-rc.1",
|
|
4
4
|
"description": "The Javascript & TypeScript map SDK tailored for MapTiler Cloud",
|
|
5
|
+
"author": "MapTiler",
|
|
5
6
|
"module": "dist/maptiler-sdk.mjs",
|
|
6
7
|
"types": "dist/maptiler-sdk.d.ts",
|
|
7
8
|
"style": "dist/maptiler-sdk.css",
|
|
@@ -34,28 +35,39 @@
|
|
|
34
35
|
"url": "https://github.com/maptiler/maptiler-sdk-js.git"
|
|
35
36
|
},
|
|
36
37
|
"scripts": {
|
|
37
|
-
"
|
|
38
|
-
"biome:fix": "npx @biomejs/biome check --max-diagnostics=1000 --write",
|
|
38
|
+
"prepare": "husky",
|
|
39
39
|
"doc": "rm -rf docs/* && typedoc --out docs && cp -r images docs/",
|
|
40
|
+
"ncu": "npx npm-check-updates",
|
|
41
|
+
"lint": "npx eslint src",
|
|
42
|
+
"lint:fix": "npx eslint src --fix",
|
|
40
43
|
"test": "vitest run -c vite.config-test.ts",
|
|
44
|
+
"install:clean": "rm -rf build/ dist/ node_modules/ && npm ci",
|
|
45
|
+
"dev": "concurrently \"vite -c vite.config-dev.ts\" \"npm run dev-umd\"",
|
|
46
|
+
"dev-umd": "npm run build-css && tsc && NODE_ENV=development vite build -w -c vite.config-umd.ts",
|
|
41
47
|
"build-css": "mkdir -p dist build && node scripts/replace-path-with-content.js src/style/style_template.css dist/tmp_maptiler-sdk.css && cat node_modules/maplibre-gl/dist/maplibre-gl.css dist/tmp_maptiler-sdk.css > dist/maptiler-sdk.css && rm dist/tmp_maptiler-sdk.css && cp dist/maptiler-sdk.css build/maptiler-sdk.css",
|
|
42
48
|
"build-umd": "tsc && NODE_ENV=production vite build -c vite.config-umd.ts",
|
|
43
49
|
"build-es": "tsc && NODE_ENV=production vite build -c vite.config-es.ts",
|
|
44
50
|
"build": "npm run build-es; npm run build-umd; npm run build-css",
|
|
45
|
-
"make": "npm run
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"
|
|
51
|
+
"make": "npm run install:clean && npm run build"
|
|
52
|
+
},
|
|
53
|
+
"lint-staged": {
|
|
54
|
+
"*.ts": "npm run lint:fix"
|
|
49
55
|
},
|
|
50
|
-
"author": "MapTiler",
|
|
51
56
|
"devDependencies": {
|
|
52
|
-
"@
|
|
57
|
+
"@eslint/js": "^9.21.0",
|
|
53
58
|
"@types/uuid": "^10.0.0",
|
|
54
59
|
"@types/xmldom": "^0.1.31",
|
|
55
60
|
"@xmldom/xmldom": "^0.8.10",
|
|
56
61
|
"concurrently": "^9.1.2",
|
|
62
|
+
"eslint": "^9.21.0",
|
|
63
|
+
"eslint-config-prettier": "^10.0.2",
|
|
64
|
+
"eslint-plugin-prettier": "^5.2.3",
|
|
65
|
+
"husky": "^8.0.0",
|
|
66
|
+
"lint-staged": "^15.4.3",
|
|
67
|
+
"prettier": "3.5.2",
|
|
57
68
|
"typedoc": "^0.27.6",
|
|
58
69
|
"typescript": "^5.7.3",
|
|
70
|
+
"typescript-eslint": "^8.25.0",
|
|
59
71
|
"vite": "^6.0.7",
|
|
60
72
|
"vite-plugin-dts": "^4.5.0",
|
|
61
73
|
"vitest": "^2.1.8"
|
package/tsconfig.json
CHANGED
|
@@ -5,23 +5,27 @@
|
|
|
5
5
|
"target": "es2021",
|
|
6
6
|
"useDefineForClassFields": true,
|
|
7
7
|
"module": "ESNext",
|
|
8
|
-
"lib": [
|
|
8
|
+
"lib": [
|
|
9
|
+
"es2021",
|
|
10
|
+
"DOM",
|
|
11
|
+
"DOM.Iterable"
|
|
12
|
+
],
|
|
9
13
|
"skipLibCheck": true,
|
|
10
|
-
|
|
11
14
|
/* Bundler mode */
|
|
12
15
|
"resolveJsonModule": true,
|
|
13
16
|
"isolatedModules": true,
|
|
14
17
|
"noEmit": true,
|
|
15
|
-
|
|
16
18
|
/* Linting */
|
|
17
19
|
"strict": true,
|
|
18
20
|
"noUnusedLocals": true,
|
|
19
21
|
"noUnusedParameters": true,
|
|
20
22
|
"noFallthroughCasesInSwitch": true,
|
|
21
|
-
|
|
22
|
-
|
|
23
23
|
"declaration": true,
|
|
24
24
|
"allowSyntheticDefaultImports": true,
|
|
25
|
+
"allowJs": true,
|
|
25
26
|
},
|
|
26
|
-
"include": [
|
|
27
|
+
"include": [
|
|
28
|
+
"src",
|
|
29
|
+
"./eslint.config.mjs"
|
|
30
|
+
],
|
|
27
31
|
}
|
package/biome.json
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"files": {
|
|
3
|
-
"include": ["./src/**/*.js", "./src/**/*.ts"],
|
|
4
|
-
"ignore": ["dist", "build"]
|
|
5
|
-
},
|
|
6
|
-
"organizeImports": {
|
|
7
|
-
"enabled": false
|
|
8
|
-
},
|
|
9
|
-
"formatter": {
|
|
10
|
-
"indentStyle": "space",
|
|
11
|
-
"indentWidth": 2,
|
|
12
|
-
"lineWidth": 120
|
|
13
|
-
},
|
|
14
|
-
"javascript": {
|
|
15
|
-
"formatter": {
|
|
16
|
-
"arrowParentheses": "always",
|
|
17
|
-
"bracketSameLine": false,
|
|
18
|
-
"bracketSpacing": true,
|
|
19
|
-
"jsxQuoteStyle": "double",
|
|
20
|
-
"quoteProperties": "asNeeded",
|
|
21
|
-
"semicolons": "always",
|
|
22
|
-
"trailingCommas": "all"
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
"json": {
|
|
26
|
-
"formatter": {
|
|
27
|
-
"trailingCommas": "none"
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
"linter": {
|
|
31
|
-
"rules": {
|
|
32
|
-
"style": {
|
|
33
|
-
"noInferrableTypes": "off"
|
|
34
|
-
},
|
|
35
|
-
"suspicious": {
|
|
36
|
-
"noExplicitAny": {
|
|
37
|
-
"level": "off"
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
"complexity": {
|
|
41
|
-
"noUselessTernary": {
|
|
42
|
-
"level": "off"
|
|
43
|
-
},
|
|
44
|
-
"useOptionalChain": {
|
|
45
|
-
"level": "off"
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|