@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
@@ -1,78 +1,85 @@
1
- /**
2
- * @returns {typeof PicoDom}
3
- */
4
- export function PicoDomBuilder(): typeof PicoDom;
5
- export const PicoDomPlugins: ((self: typeof PicoDom) => typeof PicoDom)[];
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
- * @typedef {import('../dom/DomFinder.js').PicoDomFinderInstance} PicoDomFinderInstance
10
- * @typedef {import('../dom/DomGlobal.js').PicoDomGlobalStatic} PicoDomGlobalStatic
11
- * @typedef {import('../dom/DomGlobal.js').PicoDomGlobalInstance} PicoDomGlobalInstance
12
- * @typedef {import('../dom/DomEvent.js').PicoDomEventStatic} PicoDomEventStatic
13
- * @typedef {import('../dom/DomEvent.js').PicoDomEventInstance} PicoDomEventInstance
14
- * @typedef {import('../dom/DomBuilder.js').PicoDomBuilderStatic} PicoDomBuilderStatic
15
- * @typedef {import('../dom/DomBuilder.js').PicoDomBuilderInstance} PicoDomBuilderInstance
16
- * @typedef {import('../dom/DomRectangle.js').PicoDomRectangleStatic} PicoDomRectangleStatic
17
- * @typedef {import('../dom/DomRectangle.js').PicoDomRectangleInstance} PicoDomRectangleInstance
18
- * @typedef {import('../dom/DomAttribute.js').PicoDomAttributeStatic} PicoDomAttributeStatic
19
- * @typedef {import('../dom/DomAttribute.js').PicoDomAttributeInstance} PicoDomAttributeInstance
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 {Array<function>}
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
- static init: Array<Function>;
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[]): PicoDom;
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 {function} plugin Plugin function
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|undefined
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 PicoDomBuilder;
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;
@@ -1,37 +1,24 @@
1
- /**
2
- * @returns {typeof PicoFormat}
3
- */
4
- export function PicoFormatBuilder(): typeof PicoFormat;
5
- export const PicoFormatPlugins: ((self: typeof PicoFormat) => typeof PicoFormat)[];
6
- /**
7
- * @class PicoFormat
8
- *
9
- * @typedef {import('../format/FormatParser.js').PicoFormatParserStatic} PicoFormatParserStatic
10
- * @typedef {import('../format/FormatParam.js').PicoFormatParamStatic} PicoFormatParamStatic
11
- * @typedef {import('../format/FormatOption.js').PicoFormatOptionStatic} PicoFormatOptionStatic
12
- * @typedef {import('../format/FormatUrl.js').PicoFormatUrlStatic} PicoFormatUrlStatic
13
- * @typedef {import('../format/FormatFile.js').PicoFormatFileStatic} PicoFormatFileStatic
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 {function} plugin Plugin function
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 PicoFormatBuilder;
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;
@@ -1,30 +1,30 @@
1
1
  /**
2
- * @var {Array<string>} RADIX_NUMBER Radix from 0 to 9
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 {Array<string>} RADIX_LETTER_LC Radix from a to z
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 {Array<string>} RADIX_LETTER_UC Radix from A to Z
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 {Array<string>} RADIX_UUID Radix from 0-9, a-f and A-F
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 {Array<string>} RADIX_UP19 Radix with 8, 9, a and b
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 {Array<string>} radix_symbol_pass Radix for passwords
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
- * @var {Array<string>} RADIX
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 {Array<string>} [radix=null] A defined radix or null for default
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?: Array<string>): string;
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 {Record<number, string>} [map] Remap for generated string
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?: Record<number, string>): string;
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?: string | number): string;
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 {Array<string>} [symbols=null] Defined symbols or null for default
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?: Array<string>): string;
79
+ static password(length?: number, symbols?: string[]): string;
80
80
  }
81
81
  export default PicoHash;
@@ -1,16 +1,16 @@
1
- export class PicoLocale {
1
+ export declare class PicoLocale {
2
2
  /**
3
3
  * Translation dictionary
4
4
  *
5
- * @type {Record<any, any>}
5
+ * @type {any}
6
6
  */
7
- static $text: Record<any, any>;
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 | null;
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|null} [code] Locale code
58
+ * @param {string} [code] Locale code
59
59
  * @returns {string} Active code
60
60
  */
61
- static code(code?: string | null): 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 {Array<string>} splits Variant list
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: Array<string>, count: number): string;
113
+ static countpick(splits: string[], count?: number): string;
114
114
  }
115
- export default Locale;
115
+ export default PicoLocale;
@@ -1,7 +1,8 @@
1
- export namespace MIX_REGEX {
2
- let iso: RegExp;
3
- }
4
- export class PicoMixed {
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 {Array<any>} [exclude] Exclude keys
294
+ * @param {string[]} [exclude] Exclude keys
294
295
  * @returns {Record<string, any>} Props map
295
296
  */
296
- static props(value: any, exclude?: Array<any>): Record<string, any>;
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 {Array<any>} [exclude] Exclude keys
305
+ * @param {string[any]} [exclude] Exclude keys
304
306
  * @returns {Record<string, any>} Props map
305
307
  */
306
- static class(value: any, exclude?: Array<any>): Record<string, any>;
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 {Array<any>} [exclude] Exclude keys
315
+ * @param {string[]} [exclude] Exclude keys
314
316
  * @returns {Record<string, any>} Props map
315
317
  */
316
- static proto(value: any, exclude?: Array<any>): Record<string, any>;
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 {function} cb Callback for each loop
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|any} Return value as number
413
+ * @returns {number} Return value as number
412
414
  */
413
- static num(value: any, fallback?: any): number | any;
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 {any} fallback Fallback incase it is not primitive
428
- * @returns {number|any} Return value as integer
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?: any): number | any;
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 namespace PicoMixed {
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;
@@ -1,53 +1,52 @@
1
- /**
2
- * @returns {typeof PicoNow}
3
- */
4
- export function PicoNowBuilder(): typeof PicoNow;
5
- export const PicoNowPlugins: ((self: typeof PicoNow) => typeof PicoNow)[];
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
- * @typedef {import('../now/NowMatch.js').PicoNowMatchInstance} PicoNowMatchInstance
10
- * @typedef {import('../now/NowFormat.js').PicoNowFormatInstance} PicoNowFormatInstance
11
- * @typedef {import('../now/NowMatch.js').PicoNowMatchInstance} PicoNowMatchInstance
12
- * @typedef {import('../now/NowGrid.js').PicoNowGridInstance} PicoNowGridInstance
13
- * @typedef {import('../now/NowWalker.js').PicoNowWalkerInstance} PicoNowWalkerInstance
14
- * @typedef {import('../now/NowRange.js').PicoNowRangeInstance} PicoNowRangeInstance
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 {Array<function>}
35
+ * @type {Function[]}
30
36
  */
31
- static init: Array<Function>;
37
+ static init: Function[];
32
38
  /**
33
- * Extend Now with a plugin
34
- *
35
- * @example Now.extend(fn)
39
+ * Original input value
36
40
  *
37
- * @param {function} plugin Plugin function
38
- * @returns {void} No return value
41
+ * @type {any}
39
42
  */
40
- static extend(plugin: Function): void;
43
+ input: any;
41
44
  /**
42
- * Create Now instance helper
43
- *
44
- * @example Now.make("now") // => Now
45
+ * Current Date instance
45
46
  *
46
- * @param {any} [value] Date input
47
- * @param {string} [format] Input format
48
- * @returns {PicoNow} Now instance
47
+ * @type {Date}
49
48
  */
50
- static make(value?: any, format?: string): PicoNow;
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
- * Original input value
60
+ * Extend Now with a plugin
62
61
  *
63
- * @type {any}
62
+ * @example Now.extend(fn)
63
+ *
64
+ * @param {Function} plugin Plugin function
65
+ * @returns {void} No return value
64
66
  */
65
- input: any;
67
+ static extend(plugin: Function): void;
66
68
  /**
67
- * Current Date instance
69
+ * Create Now instance helper
68
70
  *
69
- * @type {Date}
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: Date;
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(reset?: boolean): PicoNow;
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 PicoNowBuilder;
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;