@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.
- 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 +4 -6
- package/src/dom/{DomAttribute.js → DomAttribute.ts} +40 -63
- package/src/dom/{DomBuilder.js → DomBuilder.ts} +27 -44
- package/src/dom/{DomEvent.js → DomEvent.ts} +101 -76
- package/src/dom/{DomFinder.js → DomFinder.ts} +103 -139
- package/src/dom/DomForm.ts +38 -0
- package/src/dom/{DomGlobal.js → DomGlobal.ts} +34 -51
- package/src/dom/{DomInview.js → DomInview.ts} +37 -57
- package/src/dom/DomMeta.ts +48 -0
- package/src/dom/DomObserver.ts +17 -0
- package/src/dom/{DomPopover.js → DomPopover.ts} +20 -39
- package/src/dom/{DomRectangle.js → DomRectangle.ts} +70 -87
- package/src/format/{FormatFile.js → FormatFile.ts} +12 -23
- package/src/format/{FormatOption.js → FormatOption.ts} +15 -24
- package/src/format/{FormatParam.js → FormatParam.ts} +14 -25
- package/src/format/{FormatParser.js → FormatParser.ts} +29 -39
- package/src/format/{FormatUrl.js → FormatUrl.ts} +9 -21
- package/src/index.browser.ts +32 -0
- package/src/index.esm.ts +64 -0
- package/src/now/{NowDefault.js → NowDefault.ts} +86 -121
- package/src/now/{NowFormat.js → NowFormat.ts} +23 -28
- package/src/now/{NowGrid.js → NowGrid.ts} +41 -58
- package/src/now/{NowHuman.js → NowHuman.ts} +18 -27
- package/src/now/{NowMatch.js → NowMatch.ts} +22 -28
- package/src/now/{NowRange.js → NowRange.ts} +13 -22
- package/src/now/{NowWalker.js → NowWalker.ts} +65 -71
- package/src/tool/{scope.js → scope.ts} +41 -11
- package/src/utils/{Array.js → Array.ts} +187 -152
- package/src/utils/{Cookie.js → Cookie.ts} +15 -12
- package/src/utils/{Data.js → Data.ts} +17 -17
- package/src/utils/Dom.ts +204 -0
- package/src/utils/Format.ts +48 -0
- package/src/utils/{Hash.js → Hash.ts} +20 -20
- package/src/utils/{Locale.js → Locale.ts} +21 -21
- package/src/utils/{Mixed.js → Mixed.ts} +104 -61
- package/src/utils/{Now.js → Now.ts} +68 -69
- package/src/utils/{Number.js → Number.ts} +34 -36
- package/src/utils/{Object.js → Object.ts} +68 -122
- package/src/utils/{Route.js → Route.ts} +11 -9
- package/src/utils/{Runner.js → Runner.ts} +89 -77
- package/src/utils/{Signal.js → Signal.ts} +35 -22
- package/src/utils/{String.js → String.ts} +79 -69
- package/src/wip/{Element.js → Element.ts} +2 -2
- package/src/wip/{Map.js → Map.ts} +1 -1
- package/types/dom/DomAttribute.d.ts +16 -27
- package/types/dom/DomBuilder.d.ts +6 -9
- package/types/dom/DomEvent.d.ts +19 -24
- package/types/dom/DomFinder.d.ts +38 -61
- package/types/dom/DomForm.d.ts +7 -10
- package/types/dom/DomGlobal.d.ts +8 -15
- package/types/dom/DomInview.d.ts +9 -19
- package/types/dom/DomMeta.d.ts +9 -16
- package/types/dom/DomObserver.d.ts +4 -8
- package/types/dom/DomPopover.d.ts +8 -11
- package/types/dom/DomRectangle.d.ts +21 -35
- package/types/format/FormatFile.d.ts +5 -8
- package/types/format/FormatOption.d.ts +6 -8
- package/types/format/FormatParam.d.ts +6 -9
- package/types/format/FormatParser.d.ts +10 -18
- package/types/format/FormatUrl.d.ts +5 -8
- package/types/index.esm.d.ts +25 -37
- package/types/now/NowDefault.d.ts +30 -99
- package/types/now/NowFormat.d.ts +8 -21
- package/types/now/NowGrid.d.ts +24 -46
- package/types/now/NowHuman.d.ts +10 -11
- package/types/now/NowMatch.d.ts +6 -4
- package/types/now/NowRange.d.ts +5 -8
- package/types/now/NowWalker.d.ts +6 -4
- package/types/tool/scope.d.ts +11 -3
- package/types/utils/Array.d.ts +83 -101
- package/types/utils/Cookie.d.ts +11 -8
- package/types/utils/Data.d.ts +7 -7
- package/types/utils/Dom.d.ts +63 -96
- package/types/utils/Format.d.ts +15 -28
- package/types/utils/Hash.d.ts +21 -21
- package/types/utils/Locale.d.ts +9 -9
- package/types/utils/Mixed.d.ts +19 -32
- package/types/utils/Now.d.ts +51 -56
- package/types/utils/Number.d.ts +9 -20
- package/types/utils/Object.d.ts +21 -36
- package/types/utils/Route.d.ts +5 -2
- package/types/utils/Runner.d.ts +45 -38
- package/types/utils/Signal.d.ts +16 -16
- package/types/utils/String.d.ts +40 -76
- package/src/dom/DomForm.js +0 -59
- package/src/dom/DomMeta.js +0 -68
- package/src/dom/DomObserver.js +0 -38
- package/src/index.browser.js +0 -36
- package/src/index.esm.js +0 -80
- package/src/utils/Dom.js +0 -214
- package/src/utils/Format.js +0 -62
- package/types/wip/Element.d.ts +0 -119
- package/types/wip/Map.d.ts +0 -254
package/types/utils/Dom.d.ts
CHANGED
|
@@ -1,78 +1,85 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { PicoDomFinder } from "../dom/DomFinder.ts";
|
|
2
|
+
import { PicoDomForm } from "../dom/DomForm.ts";
|
|
3
|
+
import { PicoDomEvent } from "../dom/DomEvent.ts";
|
|
4
|
+
import { PicoDomBuilder } from "../dom/DomBuilder.ts";
|
|
5
|
+
import { PicoDomGlobal } from "../dom/DomGlobal.ts";
|
|
6
|
+
import { PicoDomRectangle } from "../dom/DomRectangle.ts";
|
|
7
|
+
import { PicoDomAttribute } from "../dom/DomAttribute.ts";
|
|
8
|
+
import { PicoDomInview } from "../dom/DomInview.ts";
|
|
9
|
+
import { PicoDomMeta } from "../dom/DomMeta.ts";
|
|
10
|
+
import { PicoDomObserver } from "../dom/DomObserver.ts";
|
|
11
|
+
import { PicoDomPopover } from "../dom/DomPopover.ts";
|
|
12
|
+
export declare const PicoDomPlugins: (typeof PicoDomObserver)[];
|
|
13
|
+
export interface PicoDomInterface {
|
|
14
|
+
el: any;
|
|
15
|
+
els: any[];
|
|
16
|
+
extend(plugin: Function): void;
|
|
17
|
+
win(): any;
|
|
18
|
+
doc(): any;
|
|
19
|
+
body(): any;
|
|
20
|
+
}
|
|
21
|
+
export interface PicoDom extends PicoDomFinder, PicoDomGlobal, PicoDomForm, PicoDomEvent, PicoDomBuilder, PicoDomRectangle, PicoDomAttribute, PicoDomInview, PicoDomMeta, PicoDomObserver, PicoDomPopover {
|
|
22
|
+
}
|
|
23
|
+
declare const PicoDom_base: any;
|
|
6
24
|
/**
|
|
7
25
|
* @class PicoDom
|
|
8
26
|
*
|
|
9
|
-
* @
|
|
10
|
-
* @
|
|
11
|
-
* @
|
|
12
|
-
* @
|
|
13
|
-
* @
|
|
14
|
-
* @
|
|
15
|
-
* @
|
|
16
|
-
* @
|
|
17
|
-
* @
|
|
18
|
-
* @
|
|
19
|
-
* @
|
|
20
|
-
* @typedef {import('../dom/DomInview.js').PicoDomInviewStatic} PicoDomInviewStatic
|
|
21
|
-
* @typedef {import('../dom/DomInview.js').PicoDomInviewInstance} PicoDomInviewInstance
|
|
22
|
-
* @typedef {import('../dom/DomMeta.js').PicoDomMetaStatic} PicoDomMetaStatic
|
|
23
|
-
* @typedef {import('../dom/DomMeta.js').PicoDomMetaInstance} PicoDomMetaInstance
|
|
24
|
-
* @typedef {import('../dom/DomObserver.js').PicoDomObserverStatic} PicoDomObserverStatic
|
|
25
|
-
* @typedef {import('../dom/DomObserver.js').PicoDomObserverInstance} PicoDomObserverInstance
|
|
26
|
-
* @typedef {import('../dom/DomPopover.js').PicoDomPopoverStatic} PicoDomPopoverStatic
|
|
27
|
-
* @typedef {import('../dom/DomPopover.js').PicoDomPopoverInstance} PicoDomPopoverInstance
|
|
28
|
-
*
|
|
29
|
-
* @mixes PicoDomFinderStatic
|
|
30
|
-
* @mixes PicoDomGlobalStatic
|
|
31
|
-
* @mixes PicoDomFormStatic
|
|
32
|
-
* @mixes PicoDomEventStatic
|
|
33
|
-
* @mixes PicoDomBuilderStatic
|
|
34
|
-
* @mixes PicoDomRectangleStatic
|
|
35
|
-
* @mixes PicoDomAttributeStatic
|
|
36
|
-
* @mixes PicoDomInviewStatic
|
|
37
|
-
* @mixes PicoDomMetaStatic
|
|
38
|
-
* @mixes PicoDomObserverStatic
|
|
39
|
-
* @mixes PicoDomPopoverStatic
|
|
40
|
-
*
|
|
41
|
-
* @extends PicoDomFinderInstance
|
|
42
|
-
* @extends PicoDomGlobalInstance
|
|
43
|
-
* @extends PicoDomFormInstance
|
|
44
|
-
* @extends PicoDomEventInstance
|
|
45
|
-
* @extends PicoDomBuilderInstance
|
|
46
|
-
* @extends PicoDomRectangleInstance
|
|
47
|
-
* @extends PicoDomAttributeInstance
|
|
48
|
-
* @extends PicoDomInviewInstance
|
|
49
|
-
* @extends PicoDomMetaInstance
|
|
50
|
-
* @extends PicoDomObserverInstance
|
|
51
|
-
* @extends PicoDomPopoverInstance
|
|
27
|
+
* @mixes PicoDomFinder
|
|
28
|
+
* @mixes PicoDomGlobal
|
|
29
|
+
* @mixes PicoDomForm
|
|
30
|
+
* @mixes PicoDomEvent
|
|
31
|
+
* @mixes PicoDomBuilder
|
|
32
|
+
* @mixes PicoDomRectangle
|
|
33
|
+
* @mixes PicoDomAttribute
|
|
34
|
+
* @mixes PicoDomInview
|
|
35
|
+
* @mixes PicoDomMeta
|
|
36
|
+
* @mixes PicoDomObserver
|
|
37
|
+
* @mixes PicoDomPopover
|
|
52
38
|
*/
|
|
53
|
-
export class PicoDom {
|
|
39
|
+
export declare class PicoDom extends PicoDom_base {
|
|
54
40
|
/**
|
|
55
41
|
* Init hooks for constructor
|
|
56
42
|
*
|
|
57
|
-
* @type {
|
|
43
|
+
* @type {Function[]}
|
|
44
|
+
*/
|
|
45
|
+
static init: Function[];
|
|
46
|
+
/**
|
|
47
|
+
* First selected element
|
|
48
|
+
*
|
|
49
|
+
* @type {any}
|
|
50
|
+
*/
|
|
51
|
+
el: any;
|
|
52
|
+
/**
|
|
53
|
+
* All selected elements
|
|
54
|
+
*
|
|
55
|
+
* @type {any[]}
|
|
56
|
+
*/
|
|
57
|
+
els: any[];
|
|
58
|
+
/**
|
|
59
|
+
* Create Dom wrapper from input
|
|
60
|
+
*
|
|
61
|
+
* @example new Dom("body").get(0) // => HTMLElement
|
|
62
|
+
*
|
|
63
|
+
* @param {any} el Element or selector
|
|
64
|
+
* @param {[...any]} args Plugin args
|
|
58
65
|
*/
|
|
59
|
-
|
|
66
|
+
constructor(el: any, ...args: [...any]);
|
|
60
67
|
/**
|
|
61
68
|
* Create new Dom wrapper
|
|
62
69
|
*
|
|
63
70
|
* @example Dom.find("body") // => Dom
|
|
64
71
|
*
|
|
65
72
|
* @param {any} el Element or selector
|
|
66
|
-
* @param {...any} args Plugin args
|
|
73
|
+
* @param {[...any]} args Plugin args
|
|
67
74
|
* @returns {PicoDom} Dom wrapper
|
|
68
75
|
*/
|
|
69
|
-
static find(el: any, ...args: any
|
|
76
|
+
static find(el: any, ...args: [...any]): PicoDom;
|
|
70
77
|
/**
|
|
71
78
|
* Extend Dom with a plugin
|
|
72
79
|
*
|
|
73
80
|
* @example Dom.extend(fn)
|
|
74
81
|
*
|
|
75
|
-
* @param {
|
|
82
|
+
* @param {Function} plugin Plugin function
|
|
76
83
|
* @returns {void} No return value
|
|
77
84
|
*/
|
|
78
85
|
static extend(plugin: Function): void;
|
|
@@ -87,7 +94,7 @@ export class PicoDom {
|
|
|
87
94
|
/**
|
|
88
95
|
* Get document or empty object
|
|
89
96
|
*
|
|
90
|
-
* @example Dom.doc().body // => HTMLElement
|
|
97
|
+
* @example Dom.doc().body // => HTMLElement
|
|
91
98
|
*
|
|
92
99
|
* @returns {any} Document or {}
|
|
93
100
|
*/
|
|
@@ -100,45 +107,5 @@ export class PicoDom {
|
|
|
100
107
|
* @returns {any} Body or {}
|
|
101
108
|
*/
|
|
102
109
|
static body(): any;
|
|
103
|
-
/**
|
|
104
|
-
* Create Dom wrapper from input
|
|
105
|
-
*
|
|
106
|
-
* @example new Dom("body").get(0) // => HTMLElement
|
|
107
|
-
*
|
|
108
|
-
* @param {any} el Element or selector
|
|
109
|
-
* @param {...any} args Plugin args
|
|
110
|
-
*/
|
|
111
|
-
constructor(el: any, ...args: any[]);
|
|
112
|
-
/**
|
|
113
|
-
* First selected element
|
|
114
|
-
*
|
|
115
|
-
* @type {HTMLElement}
|
|
116
|
-
*/
|
|
117
|
-
el: HTMLElement;
|
|
118
|
-
/**
|
|
119
|
-
* All selected elements
|
|
120
|
-
*
|
|
121
|
-
* @type {Array<HTMLElement>}
|
|
122
|
-
*/
|
|
123
|
-
els: Array<HTMLElement>;
|
|
124
110
|
}
|
|
125
|
-
export default
|
|
126
|
-
export type PicoDomFinderInstance = import("../dom/DomFinder.js").PicoDomFinderInstance;
|
|
127
|
-
export type PicoDomGlobalStatic = import("../dom/DomGlobal.js").PicoDomGlobalStatic;
|
|
128
|
-
export type PicoDomGlobalInstance = import("../dom/DomGlobal.js").PicoDomGlobalInstance;
|
|
129
|
-
export type PicoDomEventStatic = import("../dom/DomEvent.js").PicoDomEventStatic;
|
|
130
|
-
export type PicoDomEventInstance = import("../dom/DomEvent.js").PicoDomEventInstance;
|
|
131
|
-
export type PicoDomBuilderStatic = import("../dom/DomBuilder.js").PicoDomBuilderStatic;
|
|
132
|
-
export type PicoDomBuilderInstance = import("../dom/DomBuilder.js").PicoDomBuilderInstance;
|
|
133
|
-
export type PicoDomRectangleStatic = import("../dom/DomRectangle.js").PicoDomRectangleStatic;
|
|
134
|
-
export type PicoDomRectangleInstance = import("../dom/DomRectangle.js").PicoDomRectangleInstance;
|
|
135
|
-
export type PicoDomAttributeStatic = import("../dom/DomAttribute.js").PicoDomAttributeStatic;
|
|
136
|
-
export type PicoDomAttributeInstance = import("../dom/DomAttribute.js").PicoDomAttributeInstance;
|
|
137
|
-
export type PicoDomInviewStatic = import("../dom/DomInview.js").PicoDomInviewStatic;
|
|
138
|
-
export type PicoDomInviewInstance = import("../dom/DomInview.js").PicoDomInviewInstance;
|
|
139
|
-
export type PicoDomMetaStatic = import("../dom/DomMeta.js").PicoDomMetaStatic;
|
|
140
|
-
export type PicoDomMetaInstance = import("../dom/DomMeta.js").PicoDomMetaInstance;
|
|
141
|
-
export type PicoDomObserverStatic = import("../dom/DomObserver.js").PicoDomObserverStatic;
|
|
142
|
-
export type PicoDomObserverInstance = import("../dom/DomObserver.js").PicoDomObserverInstance;
|
|
143
|
-
export type PicoDomPopoverStatic = import("../dom/DomPopover.js").PicoDomPopoverStatic;
|
|
144
|
-
export type PicoDomPopoverInstance = import("../dom/DomPopover.js").PicoDomPopoverInstance;
|
|
111
|
+
export default PicoDom;
|
package/types/utils/Format.d.ts
CHANGED
|
@@ -1,37 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
*
|
|
15
|
-
* @mixes PicoFormatParserStatic
|
|
16
|
-
* @mixes PicoFormatParamStatic
|
|
17
|
-
* @mixes PicoFormatOptionStatic
|
|
18
|
-
* @mixes PicoFormatUrlStatic
|
|
19
|
-
* @mixes PicoFormatFileStatic
|
|
20
|
-
*/
|
|
21
|
-
export class PicoFormat {
|
|
1
|
+
import { PicoFormatParser } from "../format/FormatParser.ts";
|
|
2
|
+
import { PicoFormatParam } from "../format/FormatParam.ts";
|
|
3
|
+
import { PicoFormatOption } from "../format/FormatOption.ts";
|
|
4
|
+
import { PicoFormatUrl } from "../format/FormatUrl.ts";
|
|
5
|
+
import { PicoFormatFile } from "../format/FormatFile.ts";
|
|
6
|
+
export declare const PicoFormatPlugins: (typeof PicoFormatParser | typeof PicoFormatParam | typeof PicoFormatOption | typeof PicoFormatUrl | typeof PicoFormatFile)[];
|
|
7
|
+
export interface PicoFormatInterface {
|
|
8
|
+
extend(plugin: Function): void;
|
|
9
|
+
}
|
|
10
|
+
export interface PicoFormat extends PicoFormatParser, PicoFormatParam, PicoFormatOption, PicoFormatUrl, PicoFormatFile {
|
|
11
|
+
}
|
|
12
|
+
declare const PicoFormat_base: any;
|
|
13
|
+
export declare class PicoFormat extends PicoFormat_base {
|
|
22
14
|
/**
|
|
23
15
|
* Extend format with a plugin
|
|
24
16
|
*
|
|
25
17
|
* @example For.extend(fn)
|
|
26
18
|
*
|
|
27
|
-
* @param {
|
|
19
|
+
* @param {Function} plugin Plugin function
|
|
28
20
|
* @returns {void} No return value
|
|
29
21
|
*/
|
|
30
22
|
static extend(plugin: Function): void;
|
|
31
23
|
}
|
|
32
|
-
export default
|
|
33
|
-
export type PicoFormatParserStatic = import("../format/FormatParser.js").PicoFormatParserStatic;
|
|
34
|
-
export type PicoFormatParamStatic = import("../format/FormatParam.js").PicoFormatParamStatic;
|
|
35
|
-
export type PicoFormatOptionStatic = import("../format/FormatOption.js").PicoFormatOptionStatic;
|
|
36
|
-
export type PicoFormatUrlStatic = import("../format/FormatUrl.js").PicoFormatUrlStatic;
|
|
37
|
-
export type PicoFormatFileStatic = import("../format/FormatFile.js").PicoFormatFileStatic;
|
|
24
|
+
export default PicoFormat;
|
package/types/utils/Hash.d.ts
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @var {
|
|
2
|
+
* @var {string[]} RADIX_NUMBER Radix from 0 to 9
|
|
3
3
|
*/
|
|
4
|
-
export const RADIX_NUMBER: string[];
|
|
4
|
+
export declare const RADIX_NUMBER: string[];
|
|
5
5
|
/**
|
|
6
|
-
* @var {
|
|
6
|
+
* @var {string[]} RADIX_LETTER_LC Radix from a to z
|
|
7
7
|
*/
|
|
8
|
-
export const RADIX_LETTER_LC: string[];
|
|
8
|
+
export declare const RADIX_LETTER_LC: string[];
|
|
9
9
|
/**
|
|
10
|
-
* @var {
|
|
10
|
+
* @var {string[]} RADIX_LETTER_UC Radix from A to Z
|
|
11
11
|
*/
|
|
12
|
-
export const RADIX_LETTER_UC: string[];
|
|
12
|
+
export declare const RADIX_LETTER_UC: string[];
|
|
13
13
|
/**
|
|
14
|
-
* @var {
|
|
14
|
+
* @var {string[]} RADIX_UUID Radix from 0-9, a-f and A-F
|
|
15
15
|
*/
|
|
16
|
-
export const RADIX_UUID: string[];
|
|
16
|
+
export declare const RADIX_UUID: string[];
|
|
17
17
|
/**
|
|
18
|
-
* @var {
|
|
18
|
+
* @var {string[]} RADIX_UP19 Radix with 8, 9, a and b
|
|
19
19
|
*/
|
|
20
|
-
export const RADIX_UP19: string[];
|
|
20
|
+
export declare const RADIX_UP19: string[];
|
|
21
21
|
/**
|
|
22
|
-
* @var {
|
|
22
|
+
* @var {string[]} radix_symbol_pass Radix for passwords
|
|
23
23
|
*/
|
|
24
|
-
export const radix_symbol_pass: string[];
|
|
25
|
-
export class PicoHash {
|
|
24
|
+
export declare const radix_symbol_pass: string[];
|
|
25
|
+
export declare class PicoHash {
|
|
26
26
|
/**
|
|
27
|
-
* @
|
|
27
|
+
* @type {string[]}
|
|
28
28
|
*/
|
|
29
29
|
static RADIX: string[];
|
|
30
30
|
/**
|
|
@@ -33,10 +33,10 @@ export class PicoHash {
|
|
|
33
33
|
* @example Hash.radix(2, ['R', 'f']) // => 'R' or 'f'
|
|
34
34
|
*
|
|
35
35
|
* @param {number} [limit=60] Maximum radix char index
|
|
36
|
-
* @param {
|
|
36
|
+
* @param {string[]} [radix=null] A defined radix or null for default
|
|
37
37
|
* @returns {string} Returns random char from radix
|
|
38
38
|
*/
|
|
39
|
-
static radix(limit?: number, radix?:
|
|
39
|
+
static radix(limit?: number, radix?: string[]): string;
|
|
40
40
|
/**
|
|
41
41
|
* Get random number
|
|
42
42
|
*
|
|
@@ -54,10 +54,10 @@ export class PicoHash {
|
|
|
54
54
|
*
|
|
55
55
|
* @param {number} [length] Length of generated hash
|
|
56
56
|
* @param {number} [radix] Maximum radix char index (10 for 0-9, 36 incl. a-z, 62 incl. A-Z)
|
|
57
|
-
* @param {
|
|
57
|
+
* @param {any} [map] Remap for generated string
|
|
58
58
|
* @returns {string} Returns a random hash with fixed length
|
|
59
59
|
*/
|
|
60
|
-
static make(length?: number, radix?: number, map?:
|
|
60
|
+
static make(length?: number, radix?: number, map?: any): string;
|
|
61
61
|
/**
|
|
62
62
|
* Get a valid v4 UUID
|
|
63
63
|
*
|
|
@@ -66,16 +66,16 @@ export class PicoHash {
|
|
|
66
66
|
* @param {string|number} [version] UUID version number
|
|
67
67
|
* @returns {string} Returns a valid UUID
|
|
68
68
|
*/
|
|
69
|
-
static uuid(version?:
|
|
69
|
+
static uuid(version?: number): string;
|
|
70
70
|
/**
|
|
71
71
|
* Generate a password with or without symbols
|
|
72
72
|
*
|
|
73
73
|
* @example Hash.password(12, ['%', '&']) // => '0unJ%VDi2RJX'
|
|
74
74
|
*
|
|
75
75
|
* @param {number} [length=24] Length of password
|
|
76
|
-
* @param {
|
|
76
|
+
* @param {string[]} [symbols=null] Defined symbols or null for default
|
|
77
77
|
* @returns {string} A random password with fixed length
|
|
78
78
|
*/
|
|
79
|
-
static password(length?: number, symbols?:
|
|
79
|
+
static password(length?: number, symbols?: string[]): string;
|
|
80
80
|
}
|
|
81
81
|
export default PicoHash;
|
package/types/utils/Locale.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
export class PicoLocale {
|
|
1
|
+
export declare class PicoLocale {
|
|
2
2
|
/**
|
|
3
3
|
* Translation dictionary
|
|
4
4
|
*
|
|
5
|
-
* @type {
|
|
5
|
+
* @type {any}
|
|
6
6
|
*/
|
|
7
|
-
static $text:
|
|
7
|
+
static $text: any;
|
|
8
8
|
/**
|
|
9
9
|
* Cached collator instance
|
|
10
10
|
*
|
|
11
11
|
* @type {Intl.Collator|null}
|
|
12
12
|
*/
|
|
13
|
-
static $sort: Intl.Collator
|
|
13
|
+
static $sort: Intl.Collator;
|
|
14
14
|
/**
|
|
15
15
|
* Active locale code
|
|
16
16
|
*
|
|
@@ -55,10 +55,10 @@ export class PicoLocale {
|
|
|
55
55
|
* @example Locale.code() // => "en"
|
|
56
56
|
* @example Locale.code("de") // => "de"
|
|
57
57
|
*
|
|
58
|
-
* @param {string
|
|
58
|
+
* @param {string} [code] Locale code
|
|
59
59
|
* @returns {string} Active code
|
|
60
60
|
*/
|
|
61
|
-
static code(code?: string
|
|
61
|
+
static code(code?: string): string;
|
|
62
62
|
/**
|
|
63
63
|
* Get Intl.Collator for sorting
|
|
64
64
|
*
|
|
@@ -106,10 +106,10 @@ export class PicoLocale {
|
|
|
106
106
|
*
|
|
107
107
|
* @example Locale.countpick(["a","b"], 2) // => "b"
|
|
108
108
|
*
|
|
109
|
-
* @param {
|
|
109
|
+
* @param {string[]} splits Variant list
|
|
110
110
|
* @param {number} count Choice count
|
|
111
111
|
* @returns {string} Picked text
|
|
112
112
|
*/
|
|
113
|
-
static countpick(splits:
|
|
113
|
+
static countpick(splits: string[], count?: number): string;
|
|
114
114
|
}
|
|
115
|
-
export default
|
|
115
|
+
export default PicoLocale;
|
package/types/utils/Mixed.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { Mix } from "../index.esm.ts";
|
|
2
|
+
export declare const MIX_REGEX: {
|
|
3
|
+
iso: RegExp;
|
|
4
|
+
};
|
|
5
|
+
export declare class PicoMixed {
|
|
5
6
|
/**
|
|
6
7
|
* Check if the value is empty
|
|
7
8
|
*
|
|
@@ -290,30 +291,31 @@ export class PicoMixed {
|
|
|
290
291
|
* @example Mix.props(Math, ["PI"]) // => {}
|
|
291
292
|
*
|
|
292
293
|
* @param {any} value Source object
|
|
293
|
-
* @param {
|
|
294
|
+
* @param {string[]} [exclude] Exclude keys
|
|
294
295
|
* @returns {Record<string, any>} Props map
|
|
295
296
|
*/
|
|
296
|
-
static props(value: any, exclude?:
|
|
297
|
+
static props(value: any, exclude?: string[]): Record<string, any>;
|
|
298
|
+
static extend(target: any, value: any, exclude?: string[]): any;
|
|
297
299
|
/**
|
|
298
300
|
* Get static class props
|
|
299
301
|
*
|
|
300
302
|
* @example Mix.class(MyClass) // => {}
|
|
301
303
|
*
|
|
302
304
|
* @param {any} value Source class
|
|
303
|
-
* @param {
|
|
305
|
+
* @param {string[any]} [exclude] Exclude keys
|
|
304
306
|
* @returns {Record<string, any>} Props map
|
|
305
307
|
*/
|
|
306
|
-
static class(value: any, exclude?:
|
|
308
|
+
static class(value: any, exclude?: string[]): Record<string, any>;
|
|
307
309
|
/**
|
|
308
310
|
* Get prototype props
|
|
309
311
|
*
|
|
310
312
|
* @example Mix.proto(MyClass) // => {}
|
|
311
313
|
*
|
|
312
314
|
* @param {any} value Source class
|
|
313
|
-
* @param {
|
|
315
|
+
* @param {string[]} [exclude] Exclude keys
|
|
314
316
|
* @returns {Record<string, any>} Props map
|
|
315
317
|
*/
|
|
316
|
-
static proto(value: any, exclude?:
|
|
318
|
+
static proto(value: any, exclude?: string[]): Record<string, any>;
|
|
317
319
|
/**
|
|
318
320
|
* Create form data
|
|
319
321
|
*
|
|
@@ -330,7 +332,7 @@ export class PicoMixed {
|
|
|
330
332
|
* @example Mix.vals(NodeList, (val, key) => null) // => Mix
|
|
331
333
|
*
|
|
332
334
|
* @param {any} value Value to loop
|
|
333
|
-
* @param {
|
|
335
|
+
* @param {Function} cb Callback for each loop
|
|
334
336
|
* @returns {PicoMixed} Returns Mix instance
|
|
335
337
|
*/
|
|
336
338
|
static each(value: any, cb: Function): PicoMixed;
|
|
@@ -408,9 +410,9 @@ export class PicoMixed {
|
|
|
408
410
|
*
|
|
409
411
|
* @param {any} value The value to convert
|
|
410
412
|
* @param {any} fallback Fallback incase it is not primitive
|
|
411
|
-
* @returns {number
|
|
413
|
+
* @returns {number} Return value as number
|
|
412
414
|
*/
|
|
413
|
-
static num(value: any, fallback?:
|
|
415
|
+
static num(value: any, fallback?: number): number;
|
|
414
416
|
/**
|
|
415
417
|
* @see PicoMixed.num
|
|
416
418
|
*/
|
|
@@ -424,10 +426,10 @@ export class PicoMixed {
|
|
|
424
426
|
* @example Mix.int(true) // => NaN
|
|
425
427
|
*
|
|
426
428
|
* @param {any} value The value to convert
|
|
427
|
-
* @param {
|
|
428
|
-
* @returns {number
|
|
429
|
+
* @param {number} fallback Fallback incase it is not primitive
|
|
430
|
+
* @returns {number} Return value as integer
|
|
429
431
|
*/
|
|
430
|
-
static int(value: any, fallback?:
|
|
432
|
+
static int(value: any, fallback?: number): number;
|
|
431
433
|
/**
|
|
432
434
|
* @see PicoMixed.int
|
|
433
435
|
*/
|
|
@@ -452,19 +454,4 @@ export class PicoMixed {
|
|
|
452
454
|
*/
|
|
453
455
|
static boolean: typeof Mix.bool;
|
|
454
456
|
}
|
|
455
|
-
export
|
|
456
|
-
function global(...args: any[]): any;
|
|
457
|
-
function isPlain(...args: any[]): boolean;
|
|
458
|
-
function float(...args: any[]): any;
|
|
459
|
-
function delay(...args: any[]): Function;
|
|
460
|
-
function async(...args: any[]): Function;
|
|
461
|
-
function debounce(...args: any[]): Function;
|
|
462
|
-
function throttle(...args: any[]): Function;
|
|
463
|
-
function framerate(...args: any[]): Function;
|
|
464
|
-
function convertString(...args: any[]): string;
|
|
465
|
-
function convertDatetime(...args: any[]): string;
|
|
466
|
-
function convertBool(...args: any[]): any;
|
|
467
|
-
function convertBoolean(...args: any[]): any;
|
|
468
|
-
}
|
|
469
|
-
export default Mix;
|
|
470
|
-
import { Mix } from "../index.esm.js";
|
|
457
|
+
export default PicoMixed;
|
package/types/utils/Now.d.ts
CHANGED
|
@@ -1,53 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { PicoNowDefault } from "../now/NowDefault.ts";
|
|
2
|
+
import { PicoNowFormat } from "../now/NowFormat.ts";
|
|
3
|
+
import { PicoNowMatch } from "../now/NowMatch.ts";
|
|
4
|
+
import { PicoNowGrid } from "../now/NowGrid.ts";
|
|
5
|
+
import { PicoNowWalker } from "../now/NowWalker.ts";
|
|
6
|
+
import { PicoNowRange } from "../now/NowRange.ts";
|
|
7
|
+
import { PicoNowHuman } from "../now/NowHuman.ts";
|
|
8
|
+
export declare const PicoNowPlugins: (typeof PicoNowDefault | typeof PicoNowWalker | typeof PicoNowRange | typeof PicoNowHuman)[];
|
|
9
|
+
export interface PicoNowInterface {
|
|
10
|
+
value: Date;
|
|
11
|
+
input: any;
|
|
12
|
+
reset(config: any): PicoNow;
|
|
13
|
+
clone(): PicoNow;
|
|
14
|
+
valid(): boolean;
|
|
15
|
+
toDate(): Date;
|
|
16
|
+
toUTC(): string;
|
|
17
|
+
}
|
|
18
|
+
export interface PicoNow extends PicoNowDefault, PicoNowFormat, PicoNowMatch, PicoNowGrid, PicoNowWalker, PicoNowRange, PicoNowHuman {
|
|
19
|
+
}
|
|
20
|
+
declare const PicoNow_base: any;
|
|
6
21
|
/**
|
|
7
22
|
* @class PicoNow
|
|
8
|
-
*
|
|
9
|
-
* @
|
|
10
|
-
* @
|
|
11
|
-
* @
|
|
12
|
-
* @
|
|
13
|
-
* @
|
|
14
|
-
* @
|
|
15
|
-
* @typedef {import('../now/NowHuman.js').PicoNowHumanInstance} PicoNowHumanInstance
|
|
16
|
-
*
|
|
17
|
-
* @extends PicoNowDefaultInstance
|
|
18
|
-
* @extends PicoNowFormatInstance
|
|
19
|
-
* @extends PicoNowMatchInstance
|
|
20
|
-
* @extends PicoNowGridInstance
|
|
21
|
-
* @extends PicoNowWalkerInstance
|
|
22
|
-
* @extends PicoNowRangeInstance
|
|
23
|
-
* @extends PicoNowHumanInstance
|
|
23
|
+
* @extends PicoNowDefault
|
|
24
|
+
* @extends PicoNowFormat
|
|
25
|
+
* @extends PicoNowMatch
|
|
26
|
+
* @extends PicoNowGrid
|
|
27
|
+
* @extends PicoNowWalker
|
|
28
|
+
* @extends PicoNowRange
|
|
29
|
+
* @extends PicoNowHuman
|
|
24
30
|
*/
|
|
25
|
-
export class PicoNow {
|
|
31
|
+
export declare class PicoNow extends PicoNow_base {
|
|
26
32
|
/**
|
|
27
33
|
* Init hooks for instance
|
|
28
34
|
*
|
|
29
|
-
* @type {
|
|
35
|
+
* @type {Function[]}
|
|
30
36
|
*/
|
|
31
|
-
static init:
|
|
37
|
+
static init: Function[];
|
|
32
38
|
/**
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* @example Now.extend(fn)
|
|
39
|
+
* Original input value
|
|
36
40
|
*
|
|
37
|
-
* @
|
|
38
|
-
* @returns {void} No return value
|
|
41
|
+
* @type {any}
|
|
39
42
|
*/
|
|
40
|
-
|
|
43
|
+
input: any;
|
|
41
44
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* @example Now.make("now") // => Now
|
|
45
|
+
* Current Date instance
|
|
45
46
|
*
|
|
46
|
-
* @
|
|
47
|
-
* @param {string} [format] Input format
|
|
48
|
-
* @returns {PicoNow} Now instance
|
|
47
|
+
* @type {Date}
|
|
49
48
|
*/
|
|
50
|
-
|
|
49
|
+
value: Date;
|
|
51
50
|
/**
|
|
52
51
|
* Create Now instance from input
|
|
53
52
|
*
|
|
@@ -58,17 +57,24 @@ export class PicoNow {
|
|
|
58
57
|
*/
|
|
59
58
|
constructor(value?: any, format?: string);
|
|
60
59
|
/**
|
|
61
|
-
*
|
|
60
|
+
* Extend Now with a plugin
|
|
62
61
|
*
|
|
63
|
-
* @
|
|
62
|
+
* @example Now.extend(fn)
|
|
63
|
+
*
|
|
64
|
+
* @param {Function} plugin Plugin function
|
|
65
|
+
* @returns {void} No return value
|
|
64
66
|
*/
|
|
65
|
-
|
|
67
|
+
static extend(plugin: Function): void;
|
|
66
68
|
/**
|
|
67
|
-
*
|
|
69
|
+
* Create Now instance helper
|
|
68
70
|
*
|
|
69
|
-
* @
|
|
71
|
+
* @example Now.make("now") // => Now
|
|
72
|
+
*
|
|
73
|
+
* @param {any} [value] Date input
|
|
74
|
+
* @param {string} [format] Input format
|
|
75
|
+
* @returns {PicoNow} Now instance
|
|
70
76
|
*/
|
|
71
|
-
value:
|
|
77
|
+
static make(value?: any, format?: string): PicoNow;
|
|
72
78
|
/**
|
|
73
79
|
* Reset date parts to start
|
|
74
80
|
*
|
|
@@ -83,10 +89,9 @@ export class PicoNow {
|
|
|
83
89
|
*
|
|
84
90
|
* @example Now.make().clone() // => Now
|
|
85
91
|
*
|
|
86
|
-
* @param {boolean} [reset] Reset clone
|
|
87
92
|
* @returns {PicoNow} New instance
|
|
88
93
|
*/
|
|
89
|
-
clone(
|
|
94
|
+
clone(): PicoNow;
|
|
90
95
|
/**
|
|
91
96
|
* Check if input is valid date
|
|
92
97
|
*
|
|
@@ -111,15 +116,5 @@ export class PicoNow {
|
|
|
111
116
|
* @returns {string} UTC string
|
|
112
117
|
*/
|
|
113
118
|
toUTC(): string;
|
|
114
|
-
/**
|
|
115
|
-
* @see PicoNow.reset
|
|
116
|
-
*/
|
|
117
|
-
resetTime(): PicoNow;
|
|
118
119
|
}
|
|
119
|
-
export default
|
|
120
|
-
export type PicoNowMatchInstance = import("../now/NowMatch.js").PicoNowMatchInstance;
|
|
121
|
-
export type PicoNowFormatInstance = import("../now/NowFormat.js").PicoNowFormatInstance;
|
|
122
|
-
export type PicoNowGridInstance = import("../now/NowGrid.js").PicoNowGridInstance;
|
|
123
|
-
export type PicoNowWalkerInstance = import("../now/NowWalker.js").PicoNowWalkerInstance;
|
|
124
|
-
export type PicoNowRangeInstance = import("../now/NowRange.js").PicoNowRangeInstance;
|
|
125
|
-
export type PicoNowHumanInstance = import("../now/NowHuman.js").PicoNowHumanInstance;
|
|
120
|
+
export default PicoNow;
|