@maplat/ui 0.11.0 → 0.11.2

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/src/types.ts CHANGED
@@ -1,202 +1,202 @@
1
- // Type definitions for Maplat UI
2
-
3
- import { Swiper as SwiperClass } from "swiper";
4
- import type { Control } from "ol/control";
5
-
6
- export interface MaplatAppOption {
7
- appid?: string;
8
- fake?: boolean;
9
- pwaManifest?: boolean | string;
10
- pwaWorker?: string;
11
- pwaScope?: string;
12
- overlay?: boolean;
13
- enableHideMarker?: boolean;
14
- enableMarkerList?: boolean;
15
- enableBorder?: boolean;
16
- enableCache?: boolean;
17
- stateUrl?: boolean;
18
- enableShare?: boolean;
19
- enablePoiHtmlNoScroll?: boolean;
20
- disableNoimage?: boolean;
21
- alwaysGpsOn?: boolean;
22
- mobileIF?: boolean;
23
- debug?: boolean;
24
- appEnvelope?: boolean;
25
- mapboxToken?: string;
26
- googleApiKey?: string;
27
- lang?: string;
28
- restore?: RestoreState;
29
- restoreSession?: boolean;
30
- presentationMode?: boolean;
31
- northTop?: boolean;
32
- mapboxgl?: unknown;
33
- maplibregl?: unknown;
34
- markerList?: boolean;
35
- icon?: string;
36
- translateUI?: boolean;
37
- }
38
-
39
- export interface RestoreState {
40
- mapID?: string;
41
- backgroundID?: string;
42
- transparency?: number;
43
- position?: {
44
- rotation?: number;
45
- zoom?: number;
46
- x?: number;
47
- y?: number;
48
- };
49
- showBorder?: boolean;
50
- hideMarker?: boolean;
51
- hideLayer?: string;
52
- openedMarker?: string;
53
- }
54
-
55
- export interface MapSource {
56
- mapID: string;
57
- title?: string;
58
- officialTitle?: string;
59
- label?: string;
60
- width?: number;
61
- height?: number;
62
- envelope?: {
63
- geometry: {
64
- coordinates: number[][][];
65
- };
66
- };
67
- envelopeColor?: string;
68
- envelopeAreaIndex?: number;
69
- xy2SysCoord?: (xy: number[]) => Promise<number[]> | number[];
70
- thumbnail?: string;
71
- }
72
-
73
- export type MediaObject = {
74
- src: string;
75
- thumbnail?: string;
76
- type?: string;
77
- caption?: string;
78
- desc?: string; // backward compatibility for caption
79
- // Viewer specific attributes
80
- "fit-to-container"?: boolean;
81
- "debug-mode"?: boolean;
82
- "camera-position"?: string;
83
- "camera-target"?: string;
84
- "show-texture"?: boolean;
85
- [key: string]: unknown;
86
- };
87
-
88
- export type MediaSetting = string | MediaObject;
89
-
90
- export interface MarkerData {
91
- markerId: string;
92
- lnglat?: number[];
93
- title?: string;
94
- icon?: string;
95
- description?: string;
96
- images?: string[];
97
- image?: MediaSetting | MediaSetting[];
98
- media?: MediaSetting | MediaSetting[];
99
- address?: string;
100
- desc?: string;
101
- url?: string;
102
- html?: string;
103
- directgo?: string | { href: string; blank?: boolean };
104
- namespaceID?: string;
105
- name?: string;
106
- }
107
-
108
- export interface ClickMarkersEvent {
109
- pixel: number[];
110
- coord: number[];
111
- list: MarkerData[];
112
- }
113
-
114
- export interface ContextMenuInterface {
115
- clear: () => void;
116
- extend: (items: unknown[]) => void;
117
- on: (event: string, handler: (e: unknown) => void) => void;
118
- un: (event: string, handler: (e: unknown) => void) => void;
119
- Internal?: {
120
- openMenu: (pixel: number[], coord: number[]) => void;
121
- closeMenu: () => void;
122
- opened: boolean;
123
- };
124
- }
125
-
126
- export interface ClickMarkersEvent {
127
- pixel: number[];
128
- coord: number[];
129
- list: MarkerData[];
130
- }
131
-
132
- export type EventCallback = (event: unknown) => void;
133
- export type SwiperInstance = SwiperClass;
134
- export type SliderControl = Control & {
135
- get(prop: string): number;
136
- set(prop: string, value: number): void;
137
- element?: HTMLElement; // Changed from HTMLInputElement to HTMLElement to match common control pattern or just optional
138
- setEnable(flag: boolean): void;
139
- };
140
-
141
- export interface RGB {
142
- red: number;
143
- green: number;
144
- blue: number;
145
- }
146
-
147
- import type { MaplatUi } from "./index";
148
-
149
- export interface ControlOptions {
150
- target?: HTMLElement | string;
151
- render?: (event: import("ol").MapEvent) => void;
152
- className?: string;
153
- tipLabel?: string;
154
- initialValue?: number;
155
- character?: string;
156
- callback?: (this: Control) => void;
157
- long_callback?: (this: Control) => void;
158
- cls?: string;
159
- ui?: MaplatUi;
160
- zoomInLabel?: string | HTMLElement;
161
- zoomOutLabel?: string | HTMLElement;
162
- autoHide?: boolean;
163
- label?: string | HTMLElement;
164
- reverse?: boolean;
165
- }
166
-
167
- export interface ContextMenuItem {
168
- text?: string;
169
- classname?: string;
170
- icon?: string;
171
- callback?: (
172
- obj: { coordinate: number[]; data: unknown },
173
- map: unknown
174
- ) => void;
175
- data?: unknown;
176
- items?: ContextMenuItem[];
177
- separator?: boolean;
178
- }
179
-
180
- export interface ContextMenuOptions {
181
- width?: number;
182
- defaultItems?: boolean;
183
- items?: ContextMenuItem[];
184
- eventType?: string;
185
- }
186
-
187
- export interface ContextMenuInternalItem {
188
- id: string;
189
- submenu: number;
190
- separator: boolean;
191
- callback?: (
192
- obj: { coordinate: number[]; data: unknown },
193
- map: unknown
194
- ) => void;
195
- data?: unknown;
196
- }
197
-
198
- export interface ContextMenuEvent {
199
- type: string;
200
- pixel?: number[];
201
- coordinate?: number[];
202
- }
1
+ // Type definitions for Maplat UI
2
+
3
+ import { Swiper as SwiperClass } from "swiper";
4
+ import type { Control } from "ol/control";
5
+
6
+ export interface MaplatAppOption {
7
+ appid?: string;
8
+ fake?: boolean;
9
+ pwaManifest?: boolean | string;
10
+ pwaWorker?: string;
11
+ pwaScope?: string;
12
+ overlay?: boolean;
13
+ enableHideMarker?: boolean;
14
+ enableMarkerList?: boolean;
15
+ enableBorder?: boolean;
16
+ enableCache?: boolean;
17
+ stateUrl?: boolean;
18
+ enableShare?: boolean;
19
+ enablePoiHtmlNoScroll?: boolean;
20
+ disableNoimage?: boolean;
21
+ alwaysGpsOn?: boolean;
22
+ mobileIF?: boolean;
23
+ debug?: boolean;
24
+ appEnvelope?: boolean;
25
+ mapboxToken?: string;
26
+ googleApiKey?: string;
27
+ lang?: string;
28
+ restore?: RestoreState;
29
+ restoreSession?: boolean;
30
+ presentationMode?: boolean;
31
+ northTop?: boolean;
32
+ mapboxgl?: unknown;
33
+ maplibregl?: unknown;
34
+ markerList?: boolean;
35
+ icon?: string;
36
+ translateUI?: boolean;
37
+ }
38
+
39
+ export interface RestoreState {
40
+ mapID?: string;
41
+ backgroundID?: string;
42
+ transparency?: number;
43
+ position?: {
44
+ rotation?: number;
45
+ zoom?: number;
46
+ x?: number;
47
+ y?: number;
48
+ };
49
+ showBorder?: boolean;
50
+ hideMarker?: boolean;
51
+ hideLayer?: string;
52
+ openedMarker?: string;
53
+ }
54
+
55
+ export interface MapSource {
56
+ mapID: string;
57
+ title?: string;
58
+ officialTitle?: string;
59
+ label?: string;
60
+ width?: number;
61
+ height?: number;
62
+ envelope?: {
63
+ geometry: {
64
+ coordinates: number[][][];
65
+ };
66
+ };
67
+ envelopeColor?: string;
68
+ envelopeAreaIndex?: number;
69
+ xy2SysCoord?: (xy: number[]) => Promise<number[]> | number[];
70
+ thumbnail?: string;
71
+ }
72
+
73
+ export type MediaObject = {
74
+ src: string;
75
+ thumbnail?: string;
76
+ type?: string;
77
+ caption?: string;
78
+ desc?: string; // backward compatibility for caption
79
+ // Viewer specific attributes
80
+ "fit-to-container"?: boolean;
81
+ "debug-mode"?: boolean;
82
+ "camera-position"?: string;
83
+ "camera-target"?: string;
84
+ "show-texture"?: boolean;
85
+ [key: string]: unknown;
86
+ };
87
+
88
+ export type MediaSetting = string | MediaObject;
89
+
90
+ export interface MarkerData {
91
+ markerId: string;
92
+ lnglat?: number[];
93
+ title?: string;
94
+ icon?: string;
95
+ description?: string;
96
+ images?: string[];
97
+ image?: MediaSetting | MediaSetting[];
98
+ media?: MediaSetting | MediaSetting[];
99
+ address?: string;
100
+ desc?: string;
101
+ url?: string;
102
+ html?: string;
103
+ directgo?: string | { href: string; blank?: boolean };
104
+ namespaceID?: string;
105
+ name?: string;
106
+ }
107
+
108
+ export interface ClickMarkersEvent {
109
+ pixel: number[];
110
+ coord: number[];
111
+ list: MarkerData[];
112
+ }
113
+
114
+ export interface ContextMenuInterface {
115
+ clear: () => void;
116
+ extend: (items: unknown[]) => void;
117
+ on: (event: string, handler: (e: unknown) => void) => void;
118
+ un: (event: string, handler: (e: unknown) => void) => void;
119
+ Internal?: {
120
+ openMenu: (pixel: number[], coord: number[]) => void;
121
+ closeMenu: () => void;
122
+ opened: boolean;
123
+ };
124
+ }
125
+
126
+ export interface ClickMarkersEvent {
127
+ pixel: number[];
128
+ coord: number[];
129
+ list: MarkerData[];
130
+ }
131
+
132
+ export type EventCallback = (event: unknown) => void;
133
+ export type SwiperInstance = SwiperClass;
134
+ export type SliderControl = Control & {
135
+ get(prop: string): number;
136
+ set(prop: string, value: number): void;
137
+ element?: HTMLElement; // Changed from HTMLInputElement to HTMLElement to match common control pattern or just optional
138
+ setEnable(flag: boolean): void;
139
+ };
140
+
141
+ export interface RGB {
142
+ red: number;
143
+ green: number;
144
+ blue: number;
145
+ }
146
+
147
+ import type { MaplatUi } from "./index";
148
+
149
+ export interface ControlOptions {
150
+ target?: HTMLElement | string;
151
+ render?: (event: import("ol").MapEvent) => void;
152
+ className?: string;
153
+ tipLabel?: string;
154
+ initialValue?: number;
155
+ character?: string;
156
+ callback?: (this: Control) => void;
157
+ long_callback?: (this: Control) => void;
158
+ cls?: string;
159
+ ui?: MaplatUi;
160
+ zoomInLabel?: string | HTMLElement;
161
+ zoomOutLabel?: string | HTMLElement;
162
+ autoHide?: boolean;
163
+ label?: string | HTMLElement;
164
+ reverse?: boolean;
165
+ }
166
+
167
+ export interface ContextMenuItem {
168
+ text?: string;
169
+ classname?: string;
170
+ icon?: string;
171
+ callback?: (
172
+ obj: { coordinate: number[]; data: unknown },
173
+ map: unknown
174
+ ) => void;
175
+ data?: unknown;
176
+ items?: ContextMenuItem[];
177
+ separator?: boolean;
178
+ }
179
+
180
+ export interface ContextMenuOptions {
181
+ width?: number;
182
+ defaultItems?: boolean;
183
+ items?: ContextMenuItem[];
184
+ eventType?: string;
185
+ }
186
+
187
+ export interface ContextMenuInternalItem {
188
+ id: string;
189
+ submenu: number;
190
+ separator: boolean;
191
+ callback?: (
192
+ obj: { coordinate: number[]; data: unknown },
193
+ map: unknown
194
+ ) => void;
195
+ data?: unknown;
196
+ }
197
+
198
+ export interface ContextMenuEvent {
199
+ type: string;
200
+ pixel?: number[];
201
+ coordinate?: number[];
202
+ }