@kizmann/pico-js 2.0.12 → 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 +67 -4
- package/src/now/NowDuration.ts +122 -0
- package/src/now/NowFormat.ts +1 -0
- package/src/now/NowGrid.ts +25 -25
- package/src/now/NowHuman.ts +2 -2
- 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 +6 -3
- 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/now/NowGrid.d.ts +19 -19
- 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 +3 -3
- package/types/wip/Element.d.ts +119 -0
- package/types/wip/Map.d.ts +281 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { PicoNowInterface } from "../utils/Now.ts";
|
|
2
|
+
import PicoNowDefault from "./NowDefault.ts";
|
|
3
|
+
import PicoNowFormat from "./NowFormat.ts";
|
|
4
|
+
export interface PicoNowDuration extends PicoNowInterface, PicoNowDefault, PicoNowFormat {
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* @memberof PicoNow
|
|
8
|
+
*/
|
|
9
|
+
export declare class PicoNowDuration {
|
|
10
|
+
/**
|
|
11
|
+
* Calculate duration between two dates
|
|
12
|
+
*
|
|
13
|
+
* @example Now.make("2026-01-01").duration("2026-02-01") // => { years: 0, months: 1, ... }
|
|
14
|
+
*
|
|
15
|
+
* @param {any} value End date
|
|
16
|
+
* @returns {any} Duration object
|
|
17
|
+
*/
|
|
18
|
+
duration(value: any): any;
|
|
19
|
+
/**
|
|
20
|
+
* Normalize seconds into duration parts
|
|
21
|
+
*
|
|
22
|
+
* @example Now.make().safeDuration(3661) // => { dates: 0, hours: 1, minutes: 1, seconds: 1 }
|
|
23
|
+
*
|
|
24
|
+
* @param {number} value Seconds value
|
|
25
|
+
* @returns {any} Duration object
|
|
26
|
+
*/
|
|
27
|
+
safeDuration(value: number): any;
|
|
28
|
+
/**
|
|
29
|
+
* Get difference between two dates in seconds
|
|
30
|
+
*
|
|
31
|
+
* @example Now.make("2026-01-02").diffrence("2026-01-01") // => 86400
|
|
32
|
+
*
|
|
33
|
+
* @param {any} [value=null] Compare date
|
|
34
|
+
* @returns {number} Seconds difference
|
|
35
|
+
*/
|
|
36
|
+
diffrence(value?: any): number;
|
|
37
|
+
}
|
|
38
|
+
export default PicoNowDuration;
|
package/types/now/NowGrid.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PicoNowInterface } from "../utils/Now.ts";
|
|
1
|
+
import { PicoNow, PicoNowInterface } from "../utils/Now.ts";
|
|
2
2
|
import PicoNowWalker from "./NowWalker.js";
|
|
3
3
|
export interface PicoNowGrid extends PicoNowInterface, PicoNowWalker {
|
|
4
4
|
}
|
|
@@ -12,75 +12,75 @@ export declare class PicoNowGrid {
|
|
|
12
12
|
* @example Now.grid("month") // => [Now, Now, ...]
|
|
13
13
|
*
|
|
14
14
|
* @param {string} [scope] Grid scope
|
|
15
|
-
* @returns {Array<
|
|
15
|
+
* @returns {Array<PicoNow>} Array of dates
|
|
16
16
|
*/
|
|
17
|
-
grid(scope?: string): Array<
|
|
17
|
+
grid(scope?: string): Array<PicoNow>;
|
|
18
18
|
/**
|
|
19
19
|
* Get seconds grid
|
|
20
20
|
*
|
|
21
21
|
* @example Now.getSecondsGrid(10)
|
|
22
22
|
*
|
|
23
23
|
* @param {number} [interval] Step interval
|
|
24
|
-
* @returns {Array<
|
|
24
|
+
* @returns {Array<PicoNow>} Array of dates
|
|
25
25
|
*/
|
|
26
|
-
getSecondsGrid(interval?: number): Array<
|
|
26
|
+
getSecondsGrid(interval?: number): Array<PicoNow>;
|
|
27
27
|
/**
|
|
28
28
|
* Get minutes grid
|
|
29
29
|
*
|
|
30
30
|
* @example Now.getMinutesGrid(10)
|
|
31
31
|
*
|
|
32
32
|
* @param {number} [interval] Step interval
|
|
33
|
-
* @returns {Array<
|
|
33
|
+
* @returns {Array<PicoNow>} Array of dates
|
|
34
34
|
*/
|
|
35
|
-
getMinutesGrid(interval?: number): Array<
|
|
35
|
+
getMinutesGrid(interval?: number): Array<PicoNow>;
|
|
36
36
|
/**
|
|
37
37
|
* Get hours grid
|
|
38
38
|
*
|
|
39
39
|
* @example Now.getHoursGrid(2)
|
|
40
40
|
*
|
|
41
41
|
* @param {number} [interval] Step interval
|
|
42
|
-
* @returns {Array<
|
|
42
|
+
* @returns {Array<PicoNow>} Array of dates
|
|
43
43
|
*/
|
|
44
|
-
getHoursGrid(interval?: number): Array<
|
|
44
|
+
getHoursGrid(interval?: number): Array<PicoNow>;
|
|
45
45
|
/**
|
|
46
46
|
* Get days grid
|
|
47
47
|
*
|
|
48
48
|
* @example Now.getDaysGrid()
|
|
49
49
|
*
|
|
50
|
-
* @returns {Array<
|
|
50
|
+
* @returns {Array<PicoNow>} Array of dates
|
|
51
51
|
*/
|
|
52
|
-
getDaysGrid(): Array<
|
|
52
|
+
getDaysGrid(): Array<PicoNow>;
|
|
53
53
|
/**
|
|
54
54
|
* Get dates grid
|
|
55
55
|
*
|
|
56
56
|
* @example Now.getDatesGrid()
|
|
57
57
|
*
|
|
58
|
-
* @returns {Array<
|
|
58
|
+
* @returns {Array<PicoNow>} Array of dates
|
|
59
59
|
*/
|
|
60
|
-
getDatesGrid(): Array<
|
|
60
|
+
getDatesGrid(): Array<PicoNow>;
|
|
61
61
|
/**
|
|
62
62
|
* Get months grid
|
|
63
63
|
*
|
|
64
64
|
* @example Now.getMonthsGrid()
|
|
65
65
|
*
|
|
66
|
-
* @returns {Array<
|
|
66
|
+
* @returns {Array<PicoNow>} Array of dates
|
|
67
67
|
*/
|
|
68
|
-
getMonthsGrid(): Array<
|
|
68
|
+
getMonthsGrid(): Array<PicoNow>;
|
|
69
69
|
/**
|
|
70
70
|
* Get years grid
|
|
71
71
|
*
|
|
72
72
|
* @example Now.getYearsGrid()
|
|
73
73
|
*
|
|
74
|
-
* @returns {Array<
|
|
74
|
+
* @returns {Array<PicoNow>} Array of dates
|
|
75
75
|
*/
|
|
76
|
-
getYearsGrid(): Array<
|
|
76
|
+
getYearsGrid(): Array<PicoNow>;
|
|
77
77
|
/**
|
|
78
78
|
* Get decades grid
|
|
79
79
|
*
|
|
80
80
|
* @example Now.getDecadesGrid()
|
|
81
81
|
*
|
|
82
|
-
* @returns {Array<
|
|
82
|
+
* @returns {Array<PicoNow>} Array of dates
|
|
83
83
|
*/
|
|
84
|
-
getDecadesGrid(): Array<
|
|
84
|
+
getDecadesGrid(): Array<PicoNow>;
|
|
85
85
|
}
|
|
86
86
|
export default PicoNowGrid;
|
package/types/utils/Dom.d.ts
CHANGED
|
@@ -11,11 +11,30 @@ import { PicoDomObserver } from "../dom/DomObserver.ts";
|
|
|
11
11
|
import { PicoDomPopover } from "../dom/DomPopover.ts";
|
|
12
12
|
export declare const PicoDomPlugins: (typeof PicoDomObserver)[];
|
|
13
13
|
export interface PicoDomInterface {
|
|
14
|
+
/**
|
|
15
|
+
* @type {any}
|
|
16
|
+
*/
|
|
14
17
|
el: any;
|
|
18
|
+
/**
|
|
19
|
+
* @type {any[]}
|
|
20
|
+
*/
|
|
15
21
|
els: any[];
|
|
22
|
+
/**
|
|
23
|
+
* @param {Function} plugin
|
|
24
|
+
* @returns {void}
|
|
25
|
+
*/
|
|
16
26
|
extend(plugin: Function): void;
|
|
27
|
+
/**
|
|
28
|
+
* @returns {any}
|
|
29
|
+
*/
|
|
17
30
|
win(): any;
|
|
31
|
+
/**
|
|
32
|
+
* @returns {any}
|
|
33
|
+
*/
|
|
18
34
|
doc(): any;
|
|
35
|
+
/**
|
|
36
|
+
* @returns {any}
|
|
37
|
+
*/
|
|
19
38
|
body(): any;
|
|
20
39
|
}
|
|
21
40
|
export interface PicoDom extends PicoDomFinder, PicoDomGlobal, PicoDomForm, PicoDomEvent, PicoDomBuilder, PicoDomRectangle, PicoDomAttribute, PicoDomInview, PicoDomMeta, PicoDomObserver, PicoDomPopover {
|
|
@@ -107,5 +126,13 @@ export declare class PicoDom extends PicoDom_base {
|
|
|
107
126
|
* @returns {any} Body or {}
|
|
108
127
|
*/
|
|
109
128
|
static body(): any;
|
|
129
|
+
/**
|
|
130
|
+
* Remove elements from DOM
|
|
131
|
+
*
|
|
132
|
+
* @example Dom.find("div").remove()
|
|
133
|
+
*
|
|
134
|
+
* @returns {void} No return value
|
|
135
|
+
*/
|
|
136
|
+
remove(): void;
|
|
110
137
|
}
|
|
111
138
|
export default PicoDom;
|
package/types/utils/Format.d.ts
CHANGED
|
@@ -10,6 +10,13 @@ export interface PicoFormatInterface {
|
|
|
10
10
|
export interface PicoFormat extends PicoFormatParser, PicoFormatParam, PicoFormatOption, PicoFormatUrl, PicoFormatFile {
|
|
11
11
|
}
|
|
12
12
|
declare const PicoFormat_base: any;
|
|
13
|
+
/**
|
|
14
|
+
* @class PicoFormat
|
|
15
|
+
* @extends PicoFormatParam
|
|
16
|
+
* @extends PicoFormatOption
|
|
17
|
+
* @extends PicoFormatUrl
|
|
18
|
+
* @extends PicoFormatFile
|
|
19
|
+
*/
|
|
13
20
|
export declare class PicoFormat extends PicoFormat_base {
|
|
14
21
|
/**
|
|
15
22
|
* Extend format with a plugin
|
package/types/utils/Hash.d.ts
CHANGED
|
@@ -77,5 +77,14 @@ export declare class PicoHash {
|
|
|
77
77
|
* @returns {string} A random password with fixed length
|
|
78
78
|
*/
|
|
79
79
|
static password(length?: number, symbols?: string[]): string;
|
|
80
|
+
/**
|
|
81
|
+
* Get a numeric hash for object
|
|
82
|
+
*
|
|
83
|
+
* @example Hash.object({ a: 1 }) // => '8823432'
|
|
84
|
+
*
|
|
85
|
+
* @param {any} value Object to hash
|
|
86
|
+
* @returns {string} String numeric hash
|
|
87
|
+
*/
|
|
88
|
+
static object(value: any): string;
|
|
80
89
|
}
|
|
81
90
|
export default PicoHash;
|
package/types/utils/Now.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { PicoNowGrid } from "../now/NowGrid.ts";
|
|
|
5
5
|
import { PicoNowWalker } from "../now/NowWalker.ts";
|
|
6
6
|
import { PicoNowRange } from "../now/NowRange.ts";
|
|
7
7
|
import { PicoNowHuman } from "../now/NowHuman.ts";
|
|
8
|
-
export declare const PicoNowPlugins: (typeof PicoNowDefault | typeof
|
|
8
|
+
export declare const PicoNowPlugins: (typeof PicoNowDefault | typeof PicoNowRange)[];
|
|
9
9
|
export interface PicoNowInterface {
|
|
10
10
|
value: Date;
|
|
11
11
|
input: any;
|
|
@@ -38,9 +38,9 @@ export declare class PicoNow extends PicoNow_base {
|
|
|
38
38
|
/**
|
|
39
39
|
* Original input value
|
|
40
40
|
*
|
|
41
|
-
* @type {
|
|
41
|
+
* @type {Date}
|
|
42
42
|
*/
|
|
43
|
-
input:
|
|
43
|
+
input: Date;
|
|
44
44
|
/**
|
|
45
45
|
* Current Date instance
|
|
46
46
|
*
|
|
@@ -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;
|