@arenarium/maps 1.0.25 → 1.0.30
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 +105 -4
- package/dist/{index.es.js → index.js} +2373 -2351
- package/dist/{index.umd.js → index.umd.cjs} +36 -36
- package/dist/style.css +1 -1
- package/node_modules/@workspace/shared/package.json +6 -0
- package/node_modules/@workspace/shared/src/constants.ts +11 -0
- package/node_modules/@workspace/shared/src/marker/blocks/blocks.ts +129 -0
- package/node_modules/@workspace/shared/src/marker/blocks/bounds.ts +58 -0
- package/node_modules/@workspace/shared/src/marker/blocks/thresholds.ts +546 -0
- package/node_modules/@workspace/shared/src/marker/position.ts +44 -0
- package/node_modules/@workspace/shared/src/marker/projection.ts +16 -0
- package/node_modules/@workspace/shared/src/marker/rectangle.ts +49 -0
- package/node_modules/@workspace/shared/src/types.ts +29 -0
- package/node_modules/@workspace/shared/tsconfig.json +12 -0
- package/package.json +7 -4
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,39 @@
|
|
|
2
2
|
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
|
+
declare const mapThemeSchema: z.ZodObject<{
|
|
6
|
+
name: z.ZodUnion<[
|
|
7
|
+
z.ZodLiteral<"dark">,
|
|
8
|
+
z.ZodLiteral<"light">
|
|
9
|
+
]>;
|
|
10
|
+
colors: z.ZodObject<{
|
|
11
|
+
primary: z.ZodString;
|
|
12
|
+
background: z.ZodString;
|
|
13
|
+
text: z.ZodString;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
primary: string;
|
|
16
|
+
background: string;
|
|
17
|
+
text: string;
|
|
18
|
+
}, {
|
|
19
|
+
primary: string;
|
|
20
|
+
background: string;
|
|
21
|
+
text: string;
|
|
22
|
+
}>;
|
|
23
|
+
}, "strip", z.ZodTypeAny, {
|
|
24
|
+
name: "dark" | "light";
|
|
25
|
+
colors: {
|
|
26
|
+
primary: string;
|
|
27
|
+
background: string;
|
|
28
|
+
text: string;
|
|
29
|
+
};
|
|
30
|
+
}, {
|
|
31
|
+
name: "dark" | "light";
|
|
32
|
+
colors: {
|
|
33
|
+
primary: string;
|
|
34
|
+
background: string;
|
|
35
|
+
text: string;
|
|
36
|
+
};
|
|
37
|
+
}>;
|
|
5
38
|
declare const mapOptionsSchema: z.ZodObject<{
|
|
6
39
|
container: z.ZodString;
|
|
7
40
|
position: z.ZodObject<{
|
|
@@ -98,10 +131,78 @@ declare const mapOptionsSchema: z.ZodObject<{
|
|
|
98
131
|
};
|
|
99
132
|
}>;
|
|
100
133
|
export type MapOptions = z.infer<typeof mapOptionsSchema>;
|
|
101
|
-
export
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
134
|
+
export type MapTheme = z.infer<typeof mapThemeSchema>;
|
|
135
|
+
declare namespace Types {
|
|
136
|
+
export interface Popup {
|
|
137
|
+
id: string;
|
|
138
|
+
index: number;
|
|
139
|
+
lat: number;
|
|
140
|
+
lng: number;
|
|
141
|
+
width: number;
|
|
142
|
+
height: number;
|
|
143
|
+
}
|
|
144
|
+
export interface Marker {
|
|
145
|
+
id: string;
|
|
146
|
+
lat: number;
|
|
147
|
+
lng: number;
|
|
148
|
+
width: number;
|
|
149
|
+
height: number;
|
|
150
|
+
zet: number;
|
|
151
|
+
angs: [
|
|
152
|
+
number,
|
|
153
|
+
number
|
|
154
|
+
][];
|
|
155
|
+
}
|
|
156
|
+
export interface Block {
|
|
157
|
+
id: string;
|
|
158
|
+
sw: {
|
|
159
|
+
lat: number;
|
|
160
|
+
lng: number;
|
|
161
|
+
};
|
|
162
|
+
ne: {
|
|
163
|
+
lat: number;
|
|
164
|
+
lng: number;
|
|
165
|
+
};
|
|
166
|
+
zs: number;
|
|
167
|
+
ze: number;
|
|
168
|
+
markers: Marker[];
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
declare namespace MapComponent {
|
|
172
|
+
interface Position {
|
|
173
|
+
lat: number;
|
|
174
|
+
lng: number;
|
|
175
|
+
zoom: number;
|
|
176
|
+
}
|
|
177
|
+
interface Bounds {
|
|
178
|
+
sw: {
|
|
179
|
+
lat: number;
|
|
180
|
+
lng: number;
|
|
181
|
+
};
|
|
182
|
+
ne: {
|
|
183
|
+
lat: number;
|
|
184
|
+
lng: number;
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
type PopupContentCallback = (ids: string[]) => Promise<string[]>;
|
|
188
|
+
type SetPopupsContentCallbackFunction = (callback: PopupContentCallback) => void;
|
|
189
|
+
type SetPopupsFunction = (popups: Types.Popup[]) => void;
|
|
190
|
+
}
|
|
191
|
+
export interface MapComponent {
|
|
192
|
+
zoomIn: () => void;
|
|
193
|
+
zoomOut: () => void;
|
|
194
|
+
getCenter: () => {
|
|
195
|
+
lat: number;
|
|
196
|
+
lng: number;
|
|
197
|
+
};
|
|
198
|
+
getBounds: () => MapComponent.Bounds;
|
|
199
|
+
getZoom: () => number;
|
|
200
|
+
getTheme: () => MapTheme;
|
|
201
|
+
setTheme: (theme: MapTheme) => void;
|
|
202
|
+
setPopupsContentCallback: (callback: MapComponent.PopupContentCallback) => void;
|
|
203
|
+
setPopups: (popups: Types.Popup[]) => void;
|
|
204
|
+
}
|
|
205
|
+
export declare function mountMap(options: MapOptions): MapComponent;
|
|
105
206
|
export declare function unmountMap(map: ReturnType<typeof mountMap>): void;
|
|
106
207
|
|
|
107
208
|
export as namespace arenarium;
|