mahal_map 1.0.1 → 1.0.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mahal_map",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "mahal_map",
5
5
  "keywords": [
6
6
  "map",
@@ -22,9 +22,13 @@
22
22
  "exports": {
23
23
  ".": {
24
24
  "import": "./dist/mahal_map.esm.js",
25
- "require": "./dist/mahal_map.umd.js"
25
+ "require": "./dist/mahal_map.umd.js",
26
+ "types": "./dist/index.d.ts"
26
27
  }
27
28
  },
29
+ "peerDependencies": {
30
+ "maplibre-gl": "^2.0.0"
31
+ },
28
32
  "main": "dist/mahal_map.umd.js",
29
33
  "types": "dist/index.d.ts",
30
34
  "scripts": {
package/rollup.config.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import resolve from "@rollup/plugin-node-resolve";
2
2
  import typescript from "@rollup/plugin-typescript";
3
- import { terser } from "rollup-plugin-terser";
4
3
  import commonjs from "@rollup/plugin-commonjs";
4
+ import { terser } from "rollup-plugin-terser";
5
5
 
6
6
  export default {
7
7
  input: "src/index.ts",
@@ -30,6 +30,8 @@ export default {
30
30
  tsconfig: "./tsconfig.json",
31
31
  declaration: true,
32
32
  declarationDir: "dist",
33
+ rootDir: "src",
34
+ emitDeclarationOnly: true,
33
35
  }),
34
36
  terser(),
35
37
  ],
package/src/index.d.ts CHANGED
@@ -1,4 +1,21 @@
1
- declare module "mahal_map" {
2
- export const MahalMap: any;
3
- export default MahalMap;
4
- }
1
+ export * from "./app/types/map";
2
+ export * from "./app/types/search-param";
3
+ export * from "./app/types/additional-param";
4
+ export * from "./app/types/router-param";
5
+
6
+ import * as Map from "../src/lib/map/utils";
7
+ import * as keyUtils from "./app/lib/saveKey";
8
+ import * as searchUtils from "./lib/search/utils";
9
+ import * as routerUtils from "./lib/routing/utils";
10
+
11
+ export { Map, keyUtils, searchUtils, routerUtils };
12
+
13
+ declare const MahalMap: {
14
+ Map: typeof Map;
15
+ keyUtils: typeof keyUtils;
16
+ searchUtils: typeof searchUtils;
17
+ routerUtils: typeof routerUtils;
18
+ loadKeyFromScriptUrl: () => string;
19
+ };
20
+
21
+ export default MahalMap;
package/src/index.ts CHANGED
@@ -11,9 +11,7 @@ const MahalMap = {
11
11
  searchUtils,
12
12
  routerUtils,
13
13
  loadKeyFromScriptUrl: () => {
14
- const scripts: HTMLCollectionOf<HTMLScriptElement> =
15
- document.getElementsByTagName("script");
16
-
14
+ const scripts = document.getElementsByTagName("script");
17
15
  for (const script of scripts) {
18
16
  if (script.src.includes("mahal_map.umd.js")) {
19
17
  const url = new URL(script.src);
@@ -21,11 +19,8 @@ const MahalMap = {
21
19
  if (apikey) return apikey;
22
20
  }
23
21
  }
24
-
25
22
  return "";
26
23
  },
27
24
  };
28
25
 
29
- keyUtils.saveKey(MahalMap.loadKeyFromScriptUrl());
30
-
31
26
  export default MahalMap;
package/tsconfig.json CHANGED
@@ -11,15 +11,13 @@
11
11
  "strict": true,
12
12
  "sourceMap": true,
13
13
  "skipLibCheck": true,
14
- "emitDeclarationOnly": false,
14
+ "emitDeclarationOnly": true,
15
15
  "forceConsistentCasingInFileNames": true,
16
16
  "allowSyntheticDefaultImports": true,
17
17
  "paths": {
18
18
  "@app/*": ["./src/app/*"],
19
- "@lib/*": ["./src/lib/*"],
20
- "*": ["./src/*"]
19
+ "@lib/*": ["./src/lib/*"]
21
20
  }
22
21
  },
23
- "include": ["src/**/*.ts"],
24
- "exclude": ["node_modules"]
22
+ "include": ["src/**/*.ts"]
25
23
  }