@arenarium/maps 1.0.29 → 1.0.31

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
@@ -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<{
@@ -97,11 +130,102 @@ declare const mapOptionsSchema: z.ZodObject<{
97
130
  };
98
131
  };
99
132
  }>;
133
+ declare const mapPopupSchema: z.ZodObject<{
134
+ id: z.ZodString;
135
+ index: z.ZodNumber;
136
+ lat: z.ZodNumber;
137
+ lng: z.ZodNumber;
138
+ width: z.ZodNumber;
139
+ height: z.ZodNumber;
140
+ }, "strip", z.ZodTypeAny, {
141
+ lat: number;
142
+ lng: number;
143
+ id: string;
144
+ index: number;
145
+ width: number;
146
+ height: number;
147
+ }, {
148
+ lat: number;
149
+ lng: number;
150
+ id: string;
151
+ index: number;
152
+ width: number;
153
+ height: number;
154
+ }>;
100
155
  export type MapOptions = z.infer<typeof mapOptionsSchema>;
101
- export declare function mountMap(options: MapOptions): {
102
- $on?(type: string, callback: (e: any) => void): () => void;
103
- $set?(props: Partial<Record<string, any>>): void;
104
- } & Record<string, any>;
156
+ export type MapTheme = z.infer<typeof mapThemeSchema>;
157
+ export type MapPopup = z.infer<typeof mapPopupSchema>;
158
+ declare namespace Types {
159
+ export interface Popup {
160
+ id: string;
161
+ index: number;
162
+ lat: number;
163
+ lng: number;
164
+ width: number;
165
+ height: number;
166
+ }
167
+ export interface Marker {
168
+ id: string;
169
+ lat: number;
170
+ lng: number;
171
+ width: number;
172
+ height: number;
173
+ zet: number;
174
+ angs: [
175
+ number,
176
+ number
177
+ ][];
178
+ }
179
+ export interface Block {
180
+ id: string;
181
+ sw: {
182
+ lat: number;
183
+ lng: number;
184
+ };
185
+ ne: {
186
+ lat: number;
187
+ lng: number;
188
+ };
189
+ zs: number;
190
+ ze: number;
191
+ markers: Marker[];
192
+ }
193
+ }
194
+ declare namespace MapComponent {
195
+ interface Position {
196
+ lat: number;
197
+ lng: number;
198
+ zoom: number;
199
+ }
200
+ interface Bounds {
201
+ sw: {
202
+ lat: number;
203
+ lng: number;
204
+ };
205
+ ne: {
206
+ lat: number;
207
+ lng: number;
208
+ };
209
+ }
210
+ type PopupContentCallback = (ids: string[]) => Promise<string[]>;
211
+ type SetPopupsContentCallbackFunction = (callback: PopupContentCallback) => void;
212
+ type SetPopupsFunction = (popups: Types.Popup[]) => void;
213
+ }
214
+ export interface MapComponent {
215
+ zoomIn: () => void;
216
+ zoomOut: () => void;
217
+ getCenter: () => {
218
+ lat: number;
219
+ lng: number;
220
+ };
221
+ getBounds: () => MapComponent.Bounds;
222
+ getZoom: () => number;
223
+ getTheme: () => MapTheme;
224
+ setTheme: (theme: MapTheme) => void;
225
+ setPopupsContentCallback: (callback: MapComponent.PopupContentCallback) => void;
226
+ setPopups: (popups: Types.Popup[]) => void;
227
+ }
228
+ export declare function mountMap(options: MapOptions): MapComponent;
105
229
  export declare function unmountMap(map: ReturnType<typeof mountMap>): void;
106
230
 
107
231
  export as namespace arenarium;