@kizmann/pico-js 2.0.13 → 2.1.0
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/pico-js.browser.js +1 -1
- package/dist/pico-js.browser.js.map +1 -1
- package/dist/pico-js.esm.js +1 -1
- package/dist/pico-js.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/index.esm.ts +5 -5
- package/src/now/NowDefault.ts +63 -4
- package/src/now/NowDuration.ts +122 -0
- package/src/utils/Array.ts +1 -1
- package/src/utils/Dom.ts +36 -0
- package/src/utils/Format.ts +7 -0
- package/src/utils/Hash.ts +20 -1
- package/src/utils/Now.ts +2 -0
- package/src/utils/Number.ts +14 -2
- package/src/utils/Runner.ts +8 -2
- package/src/utils/String.ts +4 -0
- package/types/index.esm.d.ts +3 -0
- package/types/now/NowDefault.d.ts +1 -1
- package/types/now/NowDuration.d.ts +38 -0
- package/types/utils/Dom.d.ts +27 -0
- package/types/utils/Format.d.ts +7 -0
- package/types/utils/Hash.d.ts +9 -0
- package/types/utils/Now.d.ts +1 -1
- package/types/wip/Element.d.ts +119 -0
- package/types/wip/Map.d.ts +281 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
export declare class PicoElement {
|
|
2
|
+
/**
|
|
3
|
+
* Prefix for attribute selector.
|
|
4
|
+
*/
|
|
5
|
+
static prefix: string;
|
|
6
|
+
/**
|
|
7
|
+
* Mounted identifier.
|
|
8
|
+
*/
|
|
9
|
+
static mount: string;
|
|
10
|
+
/**
|
|
11
|
+
* Instance storage.
|
|
12
|
+
*/
|
|
13
|
+
static inis: {};
|
|
14
|
+
/**
|
|
15
|
+
* Runtime storage.
|
|
16
|
+
*/
|
|
17
|
+
static runs: any[];
|
|
18
|
+
/**
|
|
19
|
+
* Instance storage.
|
|
20
|
+
*/
|
|
21
|
+
static invi: any[];
|
|
22
|
+
/**
|
|
23
|
+
* Listen to scroll events
|
|
24
|
+
*
|
|
25
|
+
* @example PicoElement.listen()
|
|
26
|
+
*
|
|
27
|
+
* @returns {void} No return value
|
|
28
|
+
*/
|
|
29
|
+
static listen(): void;
|
|
30
|
+
/**
|
|
31
|
+
* Handle scroll visibility
|
|
32
|
+
*
|
|
33
|
+
* @example PicoElement.scroll()
|
|
34
|
+
*
|
|
35
|
+
* @returns {void} No return value
|
|
36
|
+
*/
|
|
37
|
+
static scroll(): void;
|
|
38
|
+
/**
|
|
39
|
+
* Register element alias
|
|
40
|
+
*
|
|
41
|
+
* @example PicoElement.alias("tab", Tab)
|
|
42
|
+
*
|
|
43
|
+
* @param {string} key Alias key
|
|
44
|
+
* @param {any} instance Class instance
|
|
45
|
+
* @returns {PicoElement} Current class
|
|
46
|
+
*/
|
|
47
|
+
static alias(key: any, instance: any): typeof PicoElement;
|
|
48
|
+
/**
|
|
49
|
+
* Bind element to selector
|
|
50
|
+
*
|
|
51
|
+
* @example PicoElement.bind("tab", ".tabs")
|
|
52
|
+
*
|
|
53
|
+
* @param {string} key Alias key
|
|
54
|
+
* @param {any} selector Dom selector
|
|
55
|
+
* @param {any} [options] Init options
|
|
56
|
+
* @returns {PicoElement} Current class
|
|
57
|
+
*/
|
|
58
|
+
static bind(key: any, selector: any, options?: {}): void | typeof PicoElement;
|
|
59
|
+
/**
|
|
60
|
+
* Unbind element from selector
|
|
61
|
+
*
|
|
62
|
+
* @example PicoElement.unbind("tab", ".tabs")
|
|
63
|
+
*
|
|
64
|
+
* @param {string} key Alias key
|
|
65
|
+
* @param {any} selector Dom selector
|
|
66
|
+
* @param {any} [options] Init options
|
|
67
|
+
* @returns {PicoElement} Current class
|
|
68
|
+
*/
|
|
69
|
+
static unbind(key: any, selector: any, options?: {}): void | typeof PicoElement;
|
|
70
|
+
/**
|
|
71
|
+
* Observe DOM changes
|
|
72
|
+
*
|
|
73
|
+
* @example PicoElement.observe("tab")
|
|
74
|
+
*
|
|
75
|
+
* @param {string} key Alias key
|
|
76
|
+
* @param {boolean} [plain] Plain options
|
|
77
|
+
* @returns {PicoElement} Current class
|
|
78
|
+
*/
|
|
79
|
+
static observe(key: any, plain?: boolean): typeof PicoElement;
|
|
80
|
+
/**
|
|
81
|
+
* Bind element on inview
|
|
82
|
+
*
|
|
83
|
+
* @example PicoElement.bindInview(el, cb)
|
|
84
|
+
*
|
|
85
|
+
* @param {Element} el Target element
|
|
86
|
+
* @param {function} cb Callback fn
|
|
87
|
+
* @returns {void} No return value
|
|
88
|
+
*/
|
|
89
|
+
static bindInview(el: any, cb: any): void;
|
|
90
|
+
/**
|
|
91
|
+
* Unbind element on inview
|
|
92
|
+
*
|
|
93
|
+
* @example PicoElement.unbindInview(el, cb)
|
|
94
|
+
*
|
|
95
|
+
* @param {Element} el Target element
|
|
96
|
+
* @param {function} cb Callback fn
|
|
97
|
+
* @returns {void} No return value
|
|
98
|
+
*/
|
|
99
|
+
static unbindInview(el: any, cb: any): void;
|
|
100
|
+
/**
|
|
101
|
+
* Get attribute prefix
|
|
102
|
+
*
|
|
103
|
+
* @example PicoElement.getPrefix("tab") // => "js-tab"
|
|
104
|
+
*
|
|
105
|
+
* @param {string} [key] Alias key
|
|
106
|
+
* @returns {string} Attribute prefix
|
|
107
|
+
*/
|
|
108
|
+
static getPrefix(key: any): string;
|
|
109
|
+
/**
|
|
110
|
+
* Set attribute prefix
|
|
111
|
+
*
|
|
112
|
+
* @example PicoElement.setPrefix("pi")
|
|
113
|
+
*
|
|
114
|
+
* @param {string} prefix New prefix
|
|
115
|
+
* @returns {void} No return value
|
|
116
|
+
*/
|
|
117
|
+
static setPrefix(prefix: any): void;
|
|
118
|
+
}
|
|
119
|
+
export default PicoElement;
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @const {object} google
|
|
3
|
+
*/
|
|
4
|
+
export declare class PicoMap {
|
|
5
|
+
/**
|
|
6
|
+
* @type {any[]}
|
|
7
|
+
*/
|
|
8
|
+
static mapStyle: any[];
|
|
9
|
+
/**
|
|
10
|
+
* @type {object}
|
|
11
|
+
*/
|
|
12
|
+
static markerStyles: any;
|
|
13
|
+
/**
|
|
14
|
+
* @type {boolean}
|
|
15
|
+
*/
|
|
16
|
+
static hideMarkers: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* @type {boolean}
|
|
19
|
+
*/
|
|
20
|
+
static closeInfoWindows: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* @type {any}
|
|
23
|
+
*/
|
|
24
|
+
map: any;
|
|
25
|
+
/**
|
|
26
|
+
* @type {any}
|
|
27
|
+
*/
|
|
28
|
+
markers: any;
|
|
29
|
+
/**
|
|
30
|
+
* @type {any}
|
|
31
|
+
*/
|
|
32
|
+
cluster: any;
|
|
33
|
+
/**
|
|
34
|
+
* @type {any}
|
|
35
|
+
*/
|
|
36
|
+
clusterFilter: any;
|
|
37
|
+
/**
|
|
38
|
+
* @type {any}
|
|
39
|
+
*/
|
|
40
|
+
clusterOptions: any;
|
|
41
|
+
/**
|
|
42
|
+
* Create map instance
|
|
43
|
+
*
|
|
44
|
+
* @example new Map("#map", { lat: 0, lng: 0 })
|
|
45
|
+
*
|
|
46
|
+
* @param {any} el Target element
|
|
47
|
+
* @param {any} [options] Map options
|
|
48
|
+
*/
|
|
49
|
+
constructor(el: any, options?: any);
|
|
50
|
+
/**
|
|
51
|
+
* Set global map style
|
|
52
|
+
*
|
|
53
|
+
* @example Map.setMapStyle(style)
|
|
54
|
+
*
|
|
55
|
+
* @param {any[]} [style] Style array
|
|
56
|
+
* @returns {PicoMap} Current class
|
|
57
|
+
*/
|
|
58
|
+
static setMapStyle(style?: any[]): typeof PicoMap;
|
|
59
|
+
/**
|
|
60
|
+
* Set marker style
|
|
61
|
+
*
|
|
62
|
+
* @example Map.setMarkerStyle("default", { default: "icon.png" })
|
|
63
|
+
*
|
|
64
|
+
* @param {string} key Style key
|
|
65
|
+
* @param {any} [style] Style options
|
|
66
|
+
* @param {any} [extra] Extra options
|
|
67
|
+
* @returns {typeof PicoMap} Current class
|
|
68
|
+
*/
|
|
69
|
+
static setMarkerStyle(key: string, style?: any, extra?: any): typeof PicoMap;
|
|
70
|
+
/**
|
|
71
|
+
* Cluster map markers
|
|
72
|
+
*
|
|
73
|
+
* @example map.clusterMarkers()
|
|
74
|
+
*
|
|
75
|
+
* @param {any} [options] Cluster options
|
|
76
|
+
* @param {any} [filter] Marker filter
|
|
77
|
+
* @param {boolean} [allowCreate] Create cluster
|
|
78
|
+
* @returns {void} No return value
|
|
79
|
+
*/
|
|
80
|
+
clusterMarkers(options?: any, filter?: any, allowCreate?: boolean): void;
|
|
81
|
+
/**
|
|
82
|
+
* Apply style to marker
|
|
83
|
+
*
|
|
84
|
+
* @example map.styleMarker("m1", "hover")
|
|
85
|
+
*
|
|
86
|
+
* @param {string} key Marker key
|
|
87
|
+
* @param {any} [type] Style type
|
|
88
|
+
* @returns {void} No return value
|
|
89
|
+
*/
|
|
90
|
+
styleMarker(key: string, type?: any): void;
|
|
91
|
+
/**
|
|
92
|
+
* Get marker by key
|
|
93
|
+
*
|
|
94
|
+
* @example map.getMarker("m1")
|
|
95
|
+
*
|
|
96
|
+
* @param {string} key Marker key
|
|
97
|
+
* @returns {any} Marker object
|
|
98
|
+
*/
|
|
99
|
+
getMarker(key: string): any;
|
|
100
|
+
/**
|
|
101
|
+
* Check if marker is visible
|
|
102
|
+
*
|
|
103
|
+
* @example map.getMarkerVisibility("m1") // => true
|
|
104
|
+
*
|
|
105
|
+
* @param {string} key Marker key
|
|
106
|
+
* @param {boolean} [fallback] Fallback value
|
|
107
|
+
* @returns {boolean} Visibility state
|
|
108
|
+
*/
|
|
109
|
+
getMarkerVisibility(key: string, fallback?: boolean): boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Get marker position
|
|
112
|
+
*
|
|
113
|
+
* @example map.getMarkerPositon("m1") // => LatLng
|
|
114
|
+
*
|
|
115
|
+
* @param {string} key Marker key
|
|
116
|
+
* @param {any} [fallback] Fallback value
|
|
117
|
+
* @returns {any} Position object
|
|
118
|
+
*/
|
|
119
|
+
getMarkerPositon(key: string, fallback?: any): any;
|
|
120
|
+
/**
|
|
121
|
+
* Toggle marker visibility
|
|
122
|
+
*
|
|
123
|
+
* @example map.toggleMarker("m1")
|
|
124
|
+
*
|
|
125
|
+
* @param {string} key Marker key
|
|
126
|
+
* @returns {boolean} Visibility state
|
|
127
|
+
*/
|
|
128
|
+
toggleMarker(key: string): boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Show marker on map
|
|
131
|
+
*
|
|
132
|
+
* @example map.showMarker("m1")
|
|
133
|
+
*
|
|
134
|
+
* @param {string} key Marker key
|
|
135
|
+
* @returns {boolean} Previous state
|
|
136
|
+
*/
|
|
137
|
+
showMarker(key: string): boolean;
|
|
138
|
+
/**
|
|
139
|
+
* Hide marker on map
|
|
140
|
+
*
|
|
141
|
+
* @example map.hideMarker("m1")
|
|
142
|
+
*
|
|
143
|
+
* @param {string} key Marker key
|
|
144
|
+
* @returns {boolean} Previous state
|
|
145
|
+
*/
|
|
146
|
+
hideMarker(key: string): boolean;
|
|
147
|
+
/**
|
|
148
|
+
* Marker hover enter
|
|
149
|
+
*
|
|
150
|
+
* @example map.enterMarker("m1")
|
|
151
|
+
*
|
|
152
|
+
* @param {string} key Marker key
|
|
153
|
+
* @returns {PicoMap} Current instance
|
|
154
|
+
*/
|
|
155
|
+
enterMarker(key: string): PicoMap;
|
|
156
|
+
/**
|
|
157
|
+
* Marker hover leave
|
|
158
|
+
*
|
|
159
|
+
* @example map.leaveMarker("m1")
|
|
160
|
+
*
|
|
161
|
+
* @param {string} key Marker key
|
|
162
|
+
* @returns {PicoMap} Current instance
|
|
163
|
+
*/
|
|
164
|
+
leaveMarker(key: string): PicoMap;
|
|
165
|
+
/**
|
|
166
|
+
* Check if info is open
|
|
167
|
+
*
|
|
168
|
+
* @example map.getInfoVisibility("m1") // => true
|
|
169
|
+
*
|
|
170
|
+
* @param {string} key Marker key
|
|
171
|
+
* @param {boolean} [fallback] Fallback value
|
|
172
|
+
* @returns {boolean} Visibility state
|
|
173
|
+
*/
|
|
174
|
+
getInfoVisibility(key: string, fallback?: boolean): boolean;
|
|
175
|
+
/**
|
|
176
|
+
* Toggle info window
|
|
177
|
+
*
|
|
178
|
+
* @example map.toggleInfo("m1")
|
|
179
|
+
*
|
|
180
|
+
* @param {string} key Marker key
|
|
181
|
+
* @returns {boolean} Visibility state
|
|
182
|
+
*/
|
|
183
|
+
toggleInfo(key: string): boolean;
|
|
184
|
+
/**
|
|
185
|
+
* Open info window
|
|
186
|
+
*
|
|
187
|
+
* @example map.openInfo("m1")
|
|
188
|
+
*
|
|
189
|
+
* @param {string} key Marker key
|
|
190
|
+
* @returns {boolean} Previous state
|
|
191
|
+
*/
|
|
192
|
+
openInfo(key: string): boolean;
|
|
193
|
+
/**
|
|
194
|
+
* Close info window
|
|
195
|
+
*
|
|
196
|
+
* @example map.closeInfo("m1")
|
|
197
|
+
*
|
|
198
|
+
* @param {string} key Marker key
|
|
199
|
+
* @returns {boolean} Previous state
|
|
200
|
+
*/
|
|
201
|
+
closeInfo(key: string): boolean;
|
|
202
|
+
/**
|
|
203
|
+
* Create map marker
|
|
204
|
+
*
|
|
205
|
+
* @example map.createMarker("m1", { lat: 0, lng: 0 })
|
|
206
|
+
*
|
|
207
|
+
* @param {any} [key] Marker key
|
|
208
|
+
* @param {any} [options] Marker options
|
|
209
|
+
* @returns {any} Marker object
|
|
210
|
+
*/
|
|
211
|
+
createMarker(key?: any, options?: any): any;
|
|
212
|
+
/**
|
|
213
|
+
* Set marker position
|
|
214
|
+
*
|
|
215
|
+
* @example map.setMarkerPosition("m1", { lat: 0, lng: 0 })
|
|
216
|
+
*
|
|
217
|
+
* @param {string} key Marker key
|
|
218
|
+
* @param {any} [options] Position options
|
|
219
|
+
* @returns {void} No return value
|
|
220
|
+
*/
|
|
221
|
+
setMarkerPosition(key: string, options?: any): void;
|
|
222
|
+
/**
|
|
223
|
+
* Set marker by address
|
|
224
|
+
*
|
|
225
|
+
* @example map.setMarkerByAddress("m1", "Address")
|
|
226
|
+
*
|
|
227
|
+
* @param {string} key Marker key
|
|
228
|
+
* @param {any} address Search address
|
|
229
|
+
* @returns {Promise<any>} Response promise
|
|
230
|
+
*/
|
|
231
|
+
setMarkerByAddress(key: string, address: any): Promise<any>;
|
|
232
|
+
/**
|
|
233
|
+
* Get location by address
|
|
234
|
+
*
|
|
235
|
+
* @example map.getLocationByAddress("Address")
|
|
236
|
+
*
|
|
237
|
+
* @param {any} address Search address
|
|
238
|
+
* @param {Function} [callback] Success callback
|
|
239
|
+
* @returns {Promise<any>} Response promise
|
|
240
|
+
*/
|
|
241
|
+
getLocationByAddress(address: any, callback?: Function): Promise<any>;
|
|
242
|
+
/**
|
|
243
|
+
* Show markers on map
|
|
244
|
+
*
|
|
245
|
+
* @example map.showMarkers()
|
|
246
|
+
*
|
|
247
|
+
* @param {any} [filter] Marker filter
|
|
248
|
+
* @returns {PicoMap} Current instance
|
|
249
|
+
*/
|
|
250
|
+
showMarkers(filter?: any): PicoMap;
|
|
251
|
+
/**
|
|
252
|
+
* Get marker boundary
|
|
253
|
+
*
|
|
254
|
+
* @example map.getMarkerBoundry() // => LatLngBounds
|
|
255
|
+
*
|
|
256
|
+
* @param {any} [filter] Marker filter
|
|
257
|
+
* @returns {any} Boundary object
|
|
258
|
+
*/
|
|
259
|
+
getMarkerBoundry(filter?: any): any;
|
|
260
|
+
/**
|
|
261
|
+
* Focus markers on map
|
|
262
|
+
*
|
|
263
|
+
* @example map.focusMarkers()
|
|
264
|
+
*
|
|
265
|
+
* @param {any} [filter] Marker filter
|
|
266
|
+
* @param {number} [maxZoom] Max zoom level
|
|
267
|
+
* @param {number} [boundSpace] Viewport space
|
|
268
|
+
* @returns {PicoMap} Current instance
|
|
269
|
+
*/
|
|
270
|
+
focusMarkers(filter?: any, maxZoom?: number, boundSpace?: number): PicoMap;
|
|
271
|
+
/**
|
|
272
|
+
* Render directions on map
|
|
273
|
+
*
|
|
274
|
+
* @example map.renderDirections({ origin: "A", destination: "B" })
|
|
275
|
+
*
|
|
276
|
+
* @param {any} options Render options
|
|
277
|
+
* @returns {Promise<any>} Response promise
|
|
278
|
+
*/
|
|
279
|
+
renderDirections(options: any): Promise<any>;
|
|
280
|
+
}
|
|
281
|
+
export default PicoMap;
|