@unmap/sdk 0.0.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.
@@ -0,0 +1,31 @@
1
+ import { Map } from '@unmap/maps';
2
+ export { DEMO_CITIES, DemoCity, Map, UnmapMapOptions, createMap, maplibregl, unmapStyle } from '@unmap/maps';
3
+ import { Geocoder } from '@unmap/geocoder';
4
+ export * from '@unmap/geocoder';
5
+ import { Router } from '@unmap/router';
6
+ export * from '@unmap/router';
7
+
8
+ interface UnmapOptions {
9
+ key: string;
10
+ gateway?: string;
11
+ /** If provided, a map is mounted in this container. */
12
+ container?: string | HTMLElement;
13
+ style?: string;
14
+ flavor?: string;
15
+ center?: [number, number];
16
+ zoom?: number;
17
+ }
18
+ /**
19
+ * One Stripe-style key, the whole platform. With a `container` you get a rendered map;
20
+ * `geocoder` and `router` are always available.
21
+ *
22
+ * const map = new Unmap({ key: "um_live_...", container: "#map", center: [-75.69, 45.42] });
23
+ */
24
+ declare class Unmap {
25
+ readonly geocoder: Geocoder;
26
+ readonly router: Router;
27
+ readonly map?: Map;
28
+ constructor(opts: UnmapOptions);
29
+ }
30
+
31
+ export { Unmap, type UnmapOptions };
package/dist/index.js ADDED
@@ -0,0 +1,27 @@
1
+ // src/index.ts
2
+ import { createMap } from "@unmap/maps";
3
+ import { Geocoder } from "@unmap/geocoder";
4
+ import { Router } from "@unmap/router";
5
+ export * from "@unmap/geocoder";
6
+ export * from "@unmap/router";
7
+ import { createMap as createMap2, unmapStyle, DEMO_CITIES, maplibregl } from "@unmap/maps";
8
+ var Unmap = class {
9
+ geocoder;
10
+ router;
11
+ map;
12
+ constructor(opts) {
13
+ this.geocoder = new Geocoder(opts);
14
+ this.router = new Router(opts);
15
+ if (opts.container) {
16
+ this.map = createMap({ ...opts, container: opts.container });
17
+ }
18
+ }
19
+ };
20
+ export {
21
+ DEMO_CITIES,
22
+ Unmap,
23
+ createMap2 as createMap,
24
+ maplibregl,
25
+ unmapStyle
26
+ };
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { createMap, type Map as MaplibreMap, type UnmapMapOptions } from \"@unmap/maps\";\nimport { Geocoder } from \"@unmap/geocoder\";\nimport { Router } from \"@unmap/router\";\n\nexport * from \"@unmap/geocoder\";\nexport * from \"@unmap/router\";\nexport { createMap, unmapStyle, DEMO_CITIES, maplibregl } from \"@unmap/maps\";\nexport type { Map, UnmapMapOptions, DemoCity } from \"@unmap/maps\";\n\nexport interface UnmapOptions {\n key: string;\n gateway?: string;\n /** If provided, a map is mounted in this container. */\n container?: string | HTMLElement;\n style?: string;\n flavor?: string;\n center?: [number, number];\n zoom?: number;\n}\n\n/**\n * One Stripe-style key, the whole platform. With a `container` you get a rendered map;\n * `geocoder` and `router` are always available.\n *\n * const map = new Unmap({ key: \"um_live_...\", container: \"#map\", center: [-75.69, 45.42] });\n */\nexport class Unmap {\n readonly geocoder: Geocoder;\n readonly router: Router;\n readonly map?: MaplibreMap;\n\n constructor(opts: UnmapOptions) {\n this.geocoder = new Geocoder(opts);\n this.router = new Router(opts);\n if (opts.container) {\n this.map = createMap({ ...opts, container: opts.container } as UnmapMapOptions);\n }\n }\n}\n"],"mappings":";AAAA,SAAS,iBAAgE;AACzE,SAAS,gBAAgB;AACzB,SAAS,cAAc;AAEvB,cAAc;AACd,cAAc;AACd,SAAS,aAAAA,YAAW,YAAY,aAAa,kBAAkB;AAoBxD,IAAM,QAAN,MAAY;AAAA,EACR;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY,MAAoB;AAC9B,SAAK,WAAW,IAAI,SAAS,IAAI;AACjC,SAAK,SAAS,IAAI,OAAO,IAAI;AAC7B,QAAI,KAAK,WAAW;AAClB,WAAK,MAAM,UAAU,EAAE,GAAG,MAAM,WAAW,KAAK,UAAU,CAAoB;AAAA,IAChF;AAAA,EACF;AACF;","names":["createMap"]}
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@unmap/sdk",
3
+ "version": "0.0.1",
4
+ "description": "One key, the whole unmap platform: map + geocoder + router",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "sideEffects": false,
19
+ "publishConfig": {
20
+ "access": "public"
21
+ },
22
+ "dependencies": {
23
+ "@unmap/maps": "0.0.1",
24
+ "@unmap/geocoder": "0.0.1",
25
+ "@unmap/router": "0.0.1",
26
+ "@unmap/core": "0.0.1"
27
+ },
28
+ "devDependencies": {
29
+ "tsup": "^8.3.0",
30
+ "typescript": "^5.6.0",
31
+ "vitest": "^2.1.0"
32
+ },
33
+ "scripts": {
34
+ "build": "tsup",
35
+ "test": "vitest run",
36
+ "typecheck": "tsc --noEmit"
37
+ }
38
+ }