@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 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 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>;
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;