@kizmann/pico-js 2.0.7 → 2.0.9

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.
Files changed (97) hide show
  1. package/dist/pico-js.browser.js +1 -1
  2. package/dist/pico-js.browser.js.map +1 -1
  3. package/dist/pico-js.esm.js +1 -1
  4. package/dist/pico-js.esm.js.map +1 -1
  5. package/package.json +4 -6
  6. package/src/dom/{DomAttribute.js → DomAttribute.ts} +40 -63
  7. package/src/dom/{DomBuilder.js → DomBuilder.ts} +27 -44
  8. package/src/dom/{DomEvent.js → DomEvent.ts} +101 -76
  9. package/src/dom/{DomFinder.js → DomFinder.ts} +103 -139
  10. package/src/dom/DomForm.ts +38 -0
  11. package/src/dom/{DomGlobal.js → DomGlobal.ts} +34 -51
  12. package/src/dom/{DomInview.js → DomInview.ts} +37 -57
  13. package/src/dom/DomMeta.ts +48 -0
  14. package/src/dom/DomObserver.ts +17 -0
  15. package/src/dom/{DomPopover.js → DomPopover.ts} +20 -39
  16. package/src/dom/{DomRectangle.js → DomRectangle.ts} +70 -87
  17. package/src/format/{FormatFile.js → FormatFile.ts} +12 -23
  18. package/src/format/{FormatOption.js → FormatOption.ts} +15 -24
  19. package/src/format/{FormatParam.js → FormatParam.ts} +14 -25
  20. package/src/format/{FormatParser.js → FormatParser.ts} +29 -39
  21. package/src/format/{FormatUrl.js → FormatUrl.ts} +9 -21
  22. package/src/index.browser.ts +32 -0
  23. package/src/index.esm.ts +64 -0
  24. package/src/now/{NowDefault.js → NowDefault.ts} +86 -121
  25. package/src/now/{NowFormat.js → NowFormat.ts} +23 -28
  26. package/src/now/{NowGrid.js → NowGrid.ts} +41 -58
  27. package/src/now/{NowHuman.js → NowHuman.ts} +18 -27
  28. package/src/now/{NowMatch.js → NowMatch.ts} +22 -28
  29. package/src/now/{NowRange.js → NowRange.ts} +13 -22
  30. package/src/now/{NowWalker.js → NowWalker.ts} +65 -71
  31. package/src/tool/{scope.js → scope.ts} +41 -11
  32. package/src/utils/{Array.js → Array.ts} +187 -152
  33. package/src/utils/{Cookie.js → Cookie.ts} +15 -12
  34. package/src/utils/{Data.js → Data.ts} +17 -17
  35. package/src/utils/Dom.ts +204 -0
  36. package/src/utils/Format.ts +48 -0
  37. package/src/utils/{Hash.js → Hash.ts} +20 -20
  38. package/src/utils/{Locale.js → Locale.ts} +21 -21
  39. package/src/utils/{Mixed.js → Mixed.ts} +104 -61
  40. package/src/utils/{Now.js → Now.ts} +68 -69
  41. package/src/utils/{Number.js → Number.ts} +34 -36
  42. package/src/utils/{Object.js → Object.ts} +68 -122
  43. package/src/utils/{Route.js → Route.ts} +11 -9
  44. package/src/utils/{Runner.js → Runner.ts} +89 -77
  45. package/src/utils/{Signal.js → Signal.ts} +35 -22
  46. package/src/utils/{String.js → String.ts} +79 -69
  47. package/src/wip/{Element.js → Element.ts} +2 -2
  48. package/src/wip/{Map.js → Map.ts} +1 -1
  49. package/types/dom/DomAttribute.d.ts +16 -27
  50. package/types/dom/DomBuilder.d.ts +6 -9
  51. package/types/dom/DomEvent.d.ts +19 -24
  52. package/types/dom/DomFinder.d.ts +38 -61
  53. package/types/dom/DomForm.d.ts +7 -10
  54. package/types/dom/DomGlobal.d.ts +8 -15
  55. package/types/dom/DomInview.d.ts +9 -19
  56. package/types/dom/DomMeta.d.ts +9 -16
  57. package/types/dom/DomObserver.d.ts +4 -8
  58. package/types/dom/DomPopover.d.ts +8 -11
  59. package/types/dom/DomRectangle.d.ts +21 -35
  60. package/types/format/FormatFile.d.ts +5 -8
  61. package/types/format/FormatOption.d.ts +6 -8
  62. package/types/format/FormatParam.d.ts +6 -9
  63. package/types/format/FormatParser.d.ts +10 -18
  64. package/types/format/FormatUrl.d.ts +5 -8
  65. package/types/index.esm.d.ts +25 -37
  66. package/types/now/NowDefault.d.ts +30 -99
  67. package/types/now/NowFormat.d.ts +8 -21
  68. package/types/now/NowGrid.d.ts +24 -46
  69. package/types/now/NowHuman.d.ts +10 -11
  70. package/types/now/NowMatch.d.ts +6 -4
  71. package/types/now/NowRange.d.ts +5 -8
  72. package/types/now/NowWalker.d.ts +6 -4
  73. package/types/tool/scope.d.ts +11 -3
  74. package/types/utils/Array.d.ts +83 -101
  75. package/types/utils/Cookie.d.ts +11 -8
  76. package/types/utils/Data.d.ts +7 -7
  77. package/types/utils/Dom.d.ts +63 -96
  78. package/types/utils/Format.d.ts +15 -28
  79. package/types/utils/Hash.d.ts +21 -21
  80. package/types/utils/Locale.d.ts +9 -9
  81. package/types/utils/Mixed.d.ts +19 -32
  82. package/types/utils/Now.d.ts +51 -56
  83. package/types/utils/Number.d.ts +9 -20
  84. package/types/utils/Object.d.ts +21 -36
  85. package/types/utils/Route.d.ts +5 -2
  86. package/types/utils/Runner.d.ts +45 -38
  87. package/types/utils/Signal.d.ts +16 -16
  88. package/types/utils/String.d.ts +40 -76
  89. package/src/dom/DomForm.js +0 -59
  90. package/src/dom/DomMeta.js +0 -68
  91. package/src/dom/DomObserver.js +0 -38
  92. package/src/index.browser.js +0 -36
  93. package/src/index.esm.js +0 -80
  94. package/src/utils/Dom.js +0 -214
  95. package/src/utils/Format.js +0 -62
  96. package/types/wip/Element.d.ts +0 -119
  97. package/types/wip/Map.d.ts +0 -254
package/src/utils/Dom.js DELETED
@@ -1,214 +0,0 @@
1
- import { Arr, Mix, Dom } from "../index.esm.js";
2
- import { PicoDomFinderPlugin } from "../dom/DomFinder.js";
3
- import { PicoDomFormPlugin } from "../dom/DomForm.js";
4
- import { PicoDomEventPlugin } from "../dom/DomEvent.js";
5
- import { PicoDomBuilderPlugin } from "../dom/DomBuilder.js";
6
- import { PicoDomGlobalPlugin } from "../dom/DomGlobal.js";
7
- import { PicoDomRectanglePlugin } from "../dom/DomRectangle.js";
8
- import { PicoDomAttributePlugin } from "../dom/DomAttribute.js";
9
- import { PicoDomInviewPlugin } from "../dom/DomInview.js";
10
- import { PicoDomMetaPlugin } from "../dom/DomMeta.js";
11
- import { PicoDomObserverPlugin } from "../dom/DomObserver.js";
12
- import { PicoDomPopoverPlugin } from "../dom/DomPopover.js";
13
-
14
- export const PicoDomPlugins = [
15
- PicoDomFinderPlugin,
16
- PicoDomGlobalPlugin,
17
- PicoDomFormPlugin,
18
- PicoDomEventPlugin,
19
- PicoDomBuilderPlugin,
20
- PicoDomRectanglePlugin,
21
- PicoDomAttributePlugin,
22
- PicoDomInviewPlugin,
23
- PicoDomMetaPlugin,
24
- PicoDomObserverPlugin,
25
- PicoDomPopoverPlugin,
26
- ];
27
-
28
- /**
29
- * @class PicoDom
30
- *
31
- * @typedef {import('../dom/DomFinder.js').PicoDomFinderInstance} PicoDomFinderInstance
32
- * @typedef {import('../dom/DomGlobal.js').PicoDomGlobalStatic} PicoDomGlobalStatic
33
- * @typedef {import('../dom/DomGlobal.js').PicoDomGlobalInstance} PicoDomGlobalInstance
34
- * @typedef {import('../dom/DomEvent.js').PicoDomEventStatic} PicoDomEventStatic
35
- * @typedef {import('../dom/DomEvent.js').PicoDomEventInstance} PicoDomEventInstance
36
- * @typedef {import('../dom/DomBuilder.js').PicoDomBuilderStatic} PicoDomBuilderStatic
37
- * @typedef {import('../dom/DomBuilder.js').PicoDomBuilderInstance} PicoDomBuilderInstance
38
- * @typedef {import('../dom/DomRectangle.js').PicoDomRectangleStatic} PicoDomRectangleStatic
39
- * @typedef {import('../dom/DomRectangle.js').PicoDomRectangleInstance} PicoDomRectangleInstance
40
- * @typedef {import('../dom/DomAttribute.js').PicoDomAttributeStatic} PicoDomAttributeStatic
41
- * @typedef {import('../dom/DomAttribute.js').PicoDomAttributeInstance} PicoDomAttributeInstance
42
- * @typedef {import('../dom/DomInview.js').PicoDomInviewStatic} PicoDomInviewStatic
43
- * @typedef {import('../dom/DomInview.js').PicoDomInviewInstance} PicoDomInviewInstance
44
- * @typedef {import('../dom/DomMeta.js').PicoDomMetaStatic} PicoDomMetaStatic
45
- * @typedef {import('../dom/DomMeta.js').PicoDomMetaInstance} PicoDomMetaInstance
46
- * @typedef {import('../dom/DomObserver.js').PicoDomObserverStatic} PicoDomObserverStatic
47
- * @typedef {import('../dom/DomObserver.js').PicoDomObserverInstance} PicoDomObserverInstance
48
- * @typedef {import('../dom/DomPopover.js').PicoDomPopoverStatic} PicoDomPopoverStatic
49
- * @typedef {import('../dom/DomPopover.js').PicoDomPopoverInstance} PicoDomPopoverInstance
50
- *
51
- * @mixes PicoDomFinderStatic
52
- * @mixes PicoDomGlobalStatic
53
- * @mixes PicoDomFormStatic
54
- * @mixes PicoDomEventStatic
55
- * @mixes PicoDomBuilderStatic
56
- * @mixes PicoDomRectangleStatic
57
- * @mixes PicoDomAttributeStatic
58
- * @mixes PicoDomInviewStatic
59
- * @mixes PicoDomMetaStatic
60
- * @mixes PicoDomObserverStatic
61
- * @mixes PicoDomPopoverStatic
62
- *
63
- * @extends PicoDomFinderInstance
64
- * @extends PicoDomGlobalInstance
65
- * @extends PicoDomFormInstance
66
- * @extends PicoDomEventInstance
67
- * @extends PicoDomBuilderInstance
68
- * @extends PicoDomRectangleInstance
69
- * @extends PicoDomAttributeInstance
70
- * @extends PicoDomInviewInstance
71
- * @extends PicoDomMetaInstance
72
- * @extends PicoDomObserverInstance
73
- * @extends PicoDomPopoverInstance
74
- */
75
- export class PicoDom {
76
-
77
- /**
78
- * Init hooks for constructor
79
- *
80
- * @type {Array<function>}
81
- */
82
- static init = [];
83
-
84
- /**
85
- * First selected element
86
- *
87
- * @type {HTMLElement}
88
- */
89
- el = null;
90
-
91
- /**
92
- * All selected elements
93
- *
94
- * @type {Array<HTMLElement>}
95
- */
96
- els = [];
97
-
98
- /**
99
- * Create Dom wrapper from input
100
- *
101
- * @example new Dom("body").get(0) // => HTMLElement
102
- *
103
- * @param {any} el Element or selector
104
- * @param {...any} args Plugin args
105
- */
106
- constructor(el, ...args)
107
- {
108
- Arr.each(Dom.init, (fn) => {
109
- el = fn.call(this, el, ...args);
110
- });
111
-
112
- if ( el instanceof Dom ) {
113
- el = el.el;
114
- }
115
-
116
- if ( ! Mix.isArr(el) ) {
117
- el = [el];
118
- }
119
-
120
- (this.el = el[0], this.els = el);
121
- }
122
-
123
- /**
124
- * Create new Dom wrapper
125
- *
126
- * @example Dom.find("body") // => Dom
127
- *
128
- * @param {any} el Element or selector
129
- * @param {...any} args Plugin args
130
- * @returns {PicoDom} Dom wrapper
131
- */
132
- static find(el, ...args)
133
- {
134
- return new Dom(el, ...args);
135
- }
136
-
137
- /**
138
- * Extend Dom with a plugin
139
- *
140
- * @example Dom.extend(fn)
141
- *
142
- * @param {function} plugin Plugin function
143
- * @returns {void} No return value
144
- */
145
- static extend(plugin)
146
- {
147
- plugin.call({}, this);
148
- }
149
-
150
- /**
151
- * Get window or empty object
152
- *
153
- * @example Dom.win().innerWidth // => number|undefined
154
- *
155
- * @returns {any} Window or {}
156
- */
157
- static win()
158
- {
159
- if ( globalThis.window == null ) {
160
- return {};
161
- }
162
-
163
- return window;
164
- }
165
-
166
- /**
167
- * Get document or empty object
168
- *
169
- * @example Dom.doc().body // => HTMLElement|undefined
170
- *
171
- * @returns {any} Document or {}
172
- */
173
- static doc()
174
- {
175
- if ( globalThis.document == null ) {
176
- return {};
177
- }
178
-
179
- return document;
180
- }
181
-
182
- /**
183
- * Get document.body or empty
184
- *
185
- * @example Dom.body().nodeType // => 1|undefined
186
- *
187
- * @returns {any} Body or {}
188
- */
189
- static body()
190
- {
191
- if ( ! this.doc().body ) {
192
- return {};
193
- }
194
-
195
- return this.doc().body;
196
- }
197
-
198
- }
199
-
200
- /**
201
- * @returns {typeof PicoDom}
202
- */
203
- export function PicoDomBuilder() {
204
-
205
- let cls = PicoDom;
206
-
207
- for ( const plugin of PicoDomPlugins ) {
208
- cls = plugin.call(cls, cls);
209
- }
210
-
211
- return cls;
212
- }
213
-
214
- export default PicoDomBuilder;
@@ -1,62 +0,0 @@
1
- import { PicoFormatParserPlugin } from "../format/FormatParser.js";
2
- import { PicoFormatParamPlugin } from "../format/FormatParam.js";
3
- import { PicoFormatOptionPlugin } from "../format/FormatOption.js";
4
- import { PicoFormatUrlPlugin } from "../format/FormatUrl.js";
5
- import { PicoFormatFilePlugin } from "../format/FormatFile.js";
6
-
7
- export const PicoFormatPlugins = [
8
- PicoFormatParserPlugin,
9
- PicoFormatParamPlugin,
10
- PicoFormatOptionPlugin,
11
- PicoFormatUrlPlugin,
12
- PicoFormatFilePlugin,
13
- ];
14
-
15
- /**
16
- * @class PicoFormat
17
- *
18
- * @typedef {import('../format/FormatParser.js').PicoFormatParserStatic} PicoFormatParserStatic
19
- * @typedef {import('../format/FormatParam.js').PicoFormatParamStatic} PicoFormatParamStatic
20
- * @typedef {import('../format/FormatOption.js').PicoFormatOptionStatic} PicoFormatOptionStatic
21
- * @typedef {import('../format/FormatUrl.js').PicoFormatUrlStatic} PicoFormatUrlStatic
22
- * @typedef {import('../format/FormatFile.js').PicoFormatFileStatic} PicoFormatFileStatic
23
- *
24
- * @mixes PicoFormatParserStatic
25
- * @mixes PicoFormatParamStatic
26
- * @mixes PicoFormatOptionStatic
27
- * @mixes PicoFormatUrlStatic
28
- * @mixes PicoFormatFileStatic
29
- */
30
- export class PicoFormat
31
- {
32
-
33
- /**
34
- * Extend format with a plugin
35
- *
36
- * @example For.extend(fn)
37
- *
38
- * @param {function} plugin Plugin function
39
- * @returns {void} No return value
40
- */
41
- static extend(plugin)
42
- {
43
- plugin.call({}, this);
44
- }
45
-
46
- }
47
-
48
- /**
49
- * @returns {typeof PicoFormat}
50
- */
51
- export function PicoFormatBuilder() {
52
-
53
- let cls = PicoFormat;
54
-
55
- for ( const plugin of PicoFormatPlugins ) {
56
- cls = plugin.call(cls, cls);
57
- }
58
-
59
- return cls;
60
- }
61
-
62
- export default PicoFormatBuilder;
@@ -1,119 +0,0 @@
1
- export 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: string, instance: any): 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: string, selector: any, options?: any): 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: string, selector: any, options?: any): 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: string, plain?: boolean): 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: Element, cb: Function): 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: Element, cb: Function): 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?: string): 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: string): void;
118
- }
119
- export default PicoElement;
@@ -1,254 +0,0 @@
1
- /**
2
- * @const {object} google
3
- */
4
- export class PicoMap {
5
- static mapStyle: any[];
6
- static markerStyles: {};
7
- static hideMarkers: boolean;
8
- static closeInfoWindows: boolean;
9
- /**
10
- * Set global map style
11
- *
12
- * @example Map.setMapStyle(style)
13
- *
14
- * @param {Array<any>} [style] Style array
15
- * @returns {PicoMap} Current class
16
- */
17
- static setMapStyle(style?: Array<any>): PicoMap;
18
- /**
19
- * Set marker style
20
- *
21
- * @example Map.setMarkerStyle("default", { default: "icon.png" })
22
- *
23
- * @param {string} key Style key
24
- * @param {any} [style] Style options
25
- * @param {any} [extra] Extra options
26
- * @returns {PicoMap} Current class
27
- */
28
- static setMarkerStyle(key: string, style?: any, extra?: any): PicoMap;
29
- /**
30
- * Create map instance
31
- *
32
- * @example new Map("#map", { lat: 0, lng: 0 })
33
- *
34
- * @param {any} el Target element
35
- * @param {any} [options] Map options
36
- */
37
- constructor(el: any, options?: any);
38
- map: any;
39
- markers: {};
40
- cluster: any;
41
- clusterFilter: any;
42
- clusterOptions: {};
43
- /**
44
- * Cluster map markers
45
- *
46
- * @example map.clusterMarkers()
47
- *
48
- * @param {any} [options] Cluster options
49
- * @param {any} [filter] Marker filter
50
- * @param {boolean} [allowCreate] Create cluster
51
- * @returns {void} No return value
52
- */
53
- clusterMarkers(options?: any, filter?: any, allowCreate?: boolean): void;
54
- /**
55
- * Apply style to marker
56
- *
57
- * @example map.styleMarker("m1", "hover")
58
- *
59
- * @param {string} key Marker key
60
- * @param {any} [type] Style type
61
- * @returns {void} No return value
62
- */
63
- styleMarker(key: string, type?: any): void;
64
- /**
65
- * Get marker by key
66
- *
67
- * @example map.getMarker("m1")
68
- *
69
- * @param {string} key Marker key
70
- * @returns {any} Marker object
71
- */
72
- getMarker(key: string): any;
73
- /**
74
- * Check if marker is visible
75
- *
76
- * @example map.getMarkerVisibility("m1") // => true
77
- *
78
- * @param {string} key Marker key
79
- * @param {boolean} [fallback] Fallback value
80
- * @returns {boolean} Visibility state
81
- */
82
- getMarkerVisibility(key: string, fallback?: boolean): boolean;
83
- /**
84
- * Get marker position
85
- *
86
- * @example map.getMarkerPositon("m1") // => LatLng
87
- *
88
- * @param {string} key Marker key
89
- * @param {any} [fallback] Fallback value
90
- * @returns {any} Position object
91
- */
92
- getMarkerPositon(key: string, fallback?: any): any;
93
- /**
94
- * Toggle marker visibility
95
- *
96
- * @example map.toggleMarker("m1")
97
- *
98
- * @param {string} key Marker key
99
- * @returns {boolean|void} Visibility state
100
- */
101
- toggleMarker(key: string): boolean | void;
102
- /**
103
- * Show marker on map
104
- *
105
- * @example map.showMarker("m1")
106
- *
107
- * @param {string} key Marker key
108
- * @returns {boolean|void} Previous state
109
- */
110
- showMarker(key: string): boolean | void;
111
- /**
112
- * Hide marker on map
113
- *
114
- * @example map.hideMarker("m1")
115
- *
116
- * @param {string} key Marker key
117
- * @returns {boolean|void} Previous state
118
- */
119
- hideMarker(key: string): boolean | void;
120
- /**
121
- * Marker hover enter
122
- *
123
- * @example map.enterMarker("m1")
124
- *
125
- * @param {string} key Marker key
126
- * @returns {this|void} Current instance
127
- */
128
- enterMarker(key: string): this | void;
129
- /**
130
- * Marker hover leave
131
- *
132
- * @example map.leaveMarker("m1")
133
- *
134
- * @param {string} key Marker key
135
- * @returns {this|void} Current instance
136
- */
137
- leaveMarker(key: string): this | void;
138
- /**
139
- * Check if info is open
140
- *
141
- * @example map.getInfoVisibility("m1") // => true
142
- *
143
- * @param {string} key Marker key
144
- * @param {boolean} [fallback] Fallback value
145
- * @returns {boolean} Visibility state
146
- */
147
- getInfoVisibility(key: string, fallback?: boolean): boolean;
148
- /**
149
- * Toggle info window
150
- *
151
- * @example map.toggleInfo("m1")
152
- *
153
- * @param {string} key Marker key
154
- * @returns {boolean|void} Visibility state
155
- */
156
- toggleInfo(key: string): boolean | void;
157
- /**
158
- * Open info window
159
- *
160
- * @example map.openInfo("m1")
161
- *
162
- * @param {string} key Marker key
163
- * @returns {boolean|void} Previous state
164
- */
165
- openInfo(key: string): boolean | void;
166
- /**
167
- * Close info window
168
- *
169
- * @example map.closeInfo("m1")
170
- *
171
- * @param {string} key Marker key
172
- * @returns {boolean|void} Previous state
173
- */
174
- closeInfo(key: string): boolean | void;
175
- /**
176
- * Create map marker
177
- *
178
- * @example map.createMarker("m1", { lat: 0, lng: 0 })
179
- *
180
- * @param {any} [key] Marker key
181
- * @param {any} [options] Marker options
182
- * @returns {any} Marker object
183
- */
184
- createMarker(key?: any, options?: any): any;
185
- /**
186
- * Set marker position
187
- *
188
- * @example map.setMarkerPosition("m1", { lat: 0, lng: 0 })
189
- *
190
- * @param {string} key Marker key
191
- * @param {any} [options] Position options
192
- * @returns {void} No return value
193
- */
194
- setMarkerPosition(key: string, options?: any): void;
195
- /**
196
- * Set marker by address
197
- *
198
- * @example map.setMarkerByAddress("m1", "Address")
199
- *
200
- * @param {string} key Marker key
201
- * @param {any} address Search address
202
- * @returns {Promise<any>} Response promise
203
- */
204
- setMarkerByAddress(key: string, address: any): Promise<any>;
205
- /**
206
- * Get location by address
207
- *
208
- * @example map.getLocationByAddress("Address")
209
- *
210
- * @param {any} address Search address
211
- * @param {function} [callback] Success callback
212
- * @returns {Promise<any>} Response promise
213
- */
214
- getLocationByAddress(address: any, callback?: Function): Promise<any>;
215
- /**
216
- * Show markers on map
217
- *
218
- * @example map.showMarkers()
219
- *
220
- * @param {any} [filter] Marker filter
221
- * @returns {PicoMap} Current instance
222
- */
223
- showMarkers(filter?: any): PicoMap;
224
- /**
225
- * Get marker boundary
226
- *
227
- * @example map.getMarkerBoundry() // => LatLngBounds
228
- *
229
- * @param {any} [filter] Marker filter
230
- * @returns {any} Boundary object
231
- */
232
- getMarkerBoundry(filter?: any): any;
233
- /**
234
- * Focus markers on map
235
- *
236
- * @example map.focusMarkers()
237
- *
238
- * @param {any} [filter] Marker filter
239
- * @param {number} [maxZoom] Max zoom level
240
- * @param {number} [boundSpace] Viewport space
241
- * @returns {PicoMap} Current instance
242
- */
243
- focusMarkers(filter?: any, maxZoom?: number, boundSpace?: number): PicoMap;
244
- /**
245
- * Render directions on map
246
- *
247
- * @example map.renderDirections({ origin: "A", destination: "B" })
248
- *
249
- * @param {any} options Render options
250
- * @returns {Promise<any>} Response promise
251
- */
252
- renderDirections(options: any): Promise<any>;
253
- }
254
- export default PicoMap;