@kizmann/pico-js 2.0.8 → 2.0.10
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} +74 -78
- package/src/dom/{DomFinder.js → DomFinder.ts} +89 -129
- 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} +67 -88
- 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} +146 -160
- 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} +22 -22
- package/src/utils/{Mixed.js → Mixed.ts} +70 -58
- 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} +65 -47
- 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} +131 -101
- package/types/dom/DomAttribute.d.ts +16 -27
- package/types/dom/DomBuilder.d.ts +6 -9
- package/types/dom/DomEvent.d.ts +19 -25
- package/types/dom/DomFinder.d.ts +35 -58
- 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 -40
- 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 -104
- 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 +10 -10
- package/types/utils/Mixed.d.ts +18 -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 +41 -24
- 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
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
import { PicoDom, PicoDomInterface } from "../utils/Dom.ts";
|
|
2
|
+
import PicoDomFinder from "./DomFinder.js";
|
|
3
|
+
import PicoDomAttribute from "./DomAttribute.js";
|
|
4
|
+
export interface PicoDomRectangle extends PicoDomInterface, PicoDomFinder, PicoDomAttribute {
|
|
5
|
+
}
|
|
1
6
|
/**
|
|
2
7
|
* @memberof PicoDom
|
|
3
8
|
*/
|
|
4
|
-
export class
|
|
9
|
+
export declare class PicoDomRectangle {
|
|
5
10
|
/**
|
|
6
11
|
* Cast value to number
|
|
7
12
|
*
|
|
@@ -11,18 +16,7 @@ export class PicoDomRectangleStatic {
|
|
|
11
16
|
* @returns {number} Number value
|
|
12
17
|
*/
|
|
13
18
|
static num(value: any): number;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* @memberof PicoDom
|
|
17
|
-
* @extends {PicoDom}
|
|
18
|
-
*/
|
|
19
|
-
export class PicoDomRectangleInstance {
|
|
20
|
-
rect(fallback?: {
|
|
21
|
-
left: number;
|
|
22
|
-
top: number;
|
|
23
|
-
width: number;
|
|
24
|
-
height: number;
|
|
25
|
-
}): any;
|
|
19
|
+
rect(fallback?: any): any;
|
|
26
20
|
/**
|
|
27
21
|
* Get margin values
|
|
28
22
|
*
|
|
@@ -81,9 +75,9 @@ export class PicoDomRectangleInstance {
|
|
|
81
75
|
* @example Dom.find("div").realHeight({ display: "block" })
|
|
82
76
|
*
|
|
83
77
|
* @param {any} [style] Temp style
|
|
84
|
-
* @returns {
|
|
78
|
+
* @returns {any} Height value
|
|
85
79
|
*/
|
|
86
|
-
realHeight(style?: any):
|
|
80
|
+
realHeight(style?: any): any;
|
|
87
81
|
/**
|
|
88
82
|
* Evaluate target height
|
|
89
83
|
*
|
|
@@ -91,9 +85,9 @@ export class PicoDomRectangleInstance {
|
|
|
91
85
|
*
|
|
92
86
|
* @param {any} [target] Target element
|
|
93
87
|
* @param {boolean} [apply] Apply style
|
|
94
|
-
* @returns {
|
|
88
|
+
* @returns {any} Height value
|
|
95
89
|
*/
|
|
96
|
-
evaluateHeight(target?: any, apply?: boolean):
|
|
90
|
+
evaluateHeight(target?: any, apply?: boolean): any;
|
|
97
91
|
/**
|
|
98
92
|
* Get element width
|
|
99
93
|
*
|
|
@@ -132,9 +126,9 @@ export class PicoDomRectangleInstance {
|
|
|
132
126
|
* @example Dom.find("div").realWidth({ display: "block" })
|
|
133
127
|
*
|
|
134
128
|
* @param {any} [style] Temp style
|
|
135
|
-
* @returns {
|
|
129
|
+
* @returns {any} Width value
|
|
136
130
|
*/
|
|
137
|
-
realWidth(style?:
|
|
131
|
+
realWidth(style?: {}): any;
|
|
138
132
|
/**
|
|
139
133
|
* Evaluate target width
|
|
140
134
|
*
|
|
@@ -142,9 +136,9 @@ export class PicoDomRectangleInstance {
|
|
|
142
136
|
*
|
|
143
137
|
* @param {any} [target] Target element
|
|
144
138
|
* @param {boolean} [apply] Apply style
|
|
145
|
-
* @returns {
|
|
139
|
+
* @returns {any} Width value
|
|
146
140
|
*/
|
|
147
|
-
evaluateWidth(target?: any, apply?: boolean):
|
|
141
|
+
evaluateWidth(target?: any, apply?: boolean): any;
|
|
148
142
|
/**
|
|
149
143
|
* Get element offset
|
|
150
144
|
*
|
|
@@ -196,7 +190,7 @@ export class PicoDomRectangleInstance {
|
|
|
196
190
|
*
|
|
197
191
|
* @example Dom.find("div").loopOffset((el) => console.log(el))
|
|
198
192
|
*
|
|
199
|
-
* @param {
|
|
193
|
+
* @param {Function} cb Callback fn
|
|
200
194
|
* @param {any} [boundry] Loop limit
|
|
201
195
|
* @returns {PicoDom} Current instance
|
|
202
196
|
*/
|
|
@@ -238,9 +232,9 @@ export class PicoDomRectangleInstance {
|
|
|
238
232
|
*
|
|
239
233
|
* @param {any} [value] Scroll value
|
|
240
234
|
* @param {any} [boundry] View boundry
|
|
241
|
-
* @returns {
|
|
235
|
+
* @returns {any} Value or instance
|
|
242
236
|
*/
|
|
243
|
-
scrollTop(value?: any, boundry?: any):
|
|
237
|
+
scrollTop(value?: any, boundry?: any): any;
|
|
244
238
|
/**
|
|
245
239
|
* Get or set scroll left
|
|
246
240
|
*
|
|
@@ -248,9 +242,9 @@ export class PicoDomRectangleInstance {
|
|
|
248
242
|
*
|
|
249
243
|
* @param {any} [value] Scroll value
|
|
250
244
|
* @param {any} [boundry] View boundry
|
|
251
|
-
* @returns {
|
|
245
|
+
* @returns {any} Value or instance
|
|
252
246
|
*/
|
|
253
|
-
scrollLeft(value?: any, boundry?: any):
|
|
247
|
+
scrollLeft(value?: any, boundry?: any): any;
|
|
254
248
|
/**
|
|
255
249
|
* Get relative scroll
|
|
256
250
|
*
|
|
@@ -260,18 +254,5 @@ export class PicoDomRectangleInstance {
|
|
|
260
254
|
* @returns {any} Scroll values
|
|
261
255
|
*/
|
|
262
256
|
getScroll(boundry?: any): any;
|
|
263
|
-
/**
|
|
264
|
-
* @see PicoDom.loopOffsetParent
|
|
265
|
-
*/
|
|
266
|
-
loopOffsetParent(...args: any[]): PicoDom;
|
|
267
|
-
/**
|
|
268
|
-
* @see PicoDom.scrollTopGlobal
|
|
269
|
-
*/
|
|
270
|
-
scrollTopGlobal(): any;
|
|
271
|
-
/**
|
|
272
|
-
* @see PicoDom.scrollLeftGlobal
|
|
273
|
-
*/
|
|
274
|
-
scrollLeftGlobal(): any;
|
|
275
257
|
}
|
|
276
|
-
export
|
|
277
|
-
import { PicoDom } from "../utils/Dom.js";
|
|
258
|
+
export default PicoDomRectangle;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
export const FILE_UNITS: string[];
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*/
|
|
6
|
-
export class PicoFormatFileStatic {
|
|
1
|
+
export declare const FILE_UNITS: string[];
|
|
2
|
+
export interface PicoFormatFile {
|
|
3
|
+
}
|
|
4
|
+
export declare class PicoFormatFile {
|
|
7
5
|
/**
|
|
8
6
|
* Format file size
|
|
9
7
|
*
|
|
@@ -15,5 +13,4 @@ export class PicoFormatFileStatic {
|
|
|
15
13
|
*/
|
|
16
14
|
static filesize(value: any, decimals?: number): string;
|
|
17
15
|
}
|
|
18
|
-
export
|
|
19
|
-
import { PicoFormat } from "../utils/Format.js";
|
|
16
|
+
export default PicoFormatFile;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
1
|
+
export declare const OPTION_REGEX: {
|
|
2
|
+
entry: RegExp;
|
|
3
|
+
};
|
|
4
|
+
export interface PicoFormatOption {
|
|
3
5
|
}
|
|
4
|
-
|
|
5
|
-
* @memberof PicoFormat
|
|
6
|
-
*/
|
|
7
|
-
export class PicoFormatOptionStatic {
|
|
6
|
+
export declare class PicoFormatOption {
|
|
8
7
|
/**
|
|
9
8
|
* Cast object to options string
|
|
10
9
|
*
|
|
@@ -37,5 +36,4 @@ export class PicoFormatOptionStatic {
|
|
|
37
36
|
*/
|
|
38
37
|
static parseOptions(value: string): any;
|
|
39
38
|
}
|
|
40
|
-
export
|
|
41
|
-
import { PicoFormat } from "../utils/Format.js";
|
|
39
|
+
export default PicoFormatOption;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
1
|
+
export declare const PARAM_REGEX: {
|
|
2
|
+
entry: RegExp;
|
|
3
|
+
};
|
|
4
|
+
export interface PicoFormatParam {
|
|
3
5
|
}
|
|
4
|
-
|
|
5
|
-
* @memberof PicoFormat
|
|
6
|
-
* @extends {PicoFormat}
|
|
7
|
-
*/
|
|
8
|
-
export class PicoFormatParamStatic {
|
|
6
|
+
export declare class PicoFormatParam {
|
|
9
7
|
/**
|
|
10
8
|
* Cast object to params string
|
|
11
9
|
*
|
|
@@ -36,5 +34,4 @@ export class PicoFormatParamStatic {
|
|
|
36
34
|
*/
|
|
37
35
|
static parseParams(value: string): any;
|
|
38
36
|
}
|
|
39
|
-
export
|
|
40
|
-
import { PicoFormat } from "../utils/Format.js";
|
|
37
|
+
export default PicoFormatParam;
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
export const TYPE_PARSERS:
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
export
|
|
6
|
-
match: (val: any) => boolean;
|
|
7
|
-
parse: (val: any) => string;
|
|
8
|
-
}[];
|
|
9
|
-
/**
|
|
10
|
-
* @memberof PicoFormat
|
|
11
|
-
*/
|
|
12
|
-
export class PicoFormatParserStatic {
|
|
1
|
+
export declare const TYPE_PARSERS: any[];
|
|
2
|
+
export declare const TYPE_CASTERS: any[];
|
|
3
|
+
export interface PicoFormatParser {
|
|
4
|
+
}
|
|
5
|
+
export declare class PicoFormatParser {
|
|
13
6
|
/**
|
|
14
7
|
* Convert key path format
|
|
15
8
|
*
|
|
@@ -27,10 +20,10 @@ export class PicoFormatParserStatic {
|
|
|
27
20
|
*
|
|
28
21
|
* @param {any} value Input value
|
|
29
22
|
* @param {any} [fallback] Fallback value
|
|
30
|
-
* @param {
|
|
23
|
+
* @param {any[]} [parsers] Custom parsers
|
|
31
24
|
* @returns {any} Parsed value
|
|
32
25
|
*/
|
|
33
|
-
static parsed(value: any, fallback?: any, parsers?:
|
|
26
|
+
static parsed(value: any, fallback?: any, parsers?: any[]): any;
|
|
34
27
|
/**
|
|
35
28
|
* Cast value to string
|
|
36
29
|
*
|
|
@@ -38,10 +31,9 @@ export class PicoFormatParserStatic {
|
|
|
38
31
|
*
|
|
39
32
|
* @param {any} value Input value
|
|
40
33
|
* @param {boolean} [encode] Encode value
|
|
41
|
-
* @param {
|
|
34
|
+
* @param {any[]} [casters] Custom casters
|
|
42
35
|
* @returns {string} Casted string
|
|
43
36
|
*/
|
|
44
|
-
static casted(value: any, encode?: boolean, casters?:
|
|
37
|
+
static casted(value: any, encode?: boolean, casters?: any[]): string;
|
|
45
38
|
}
|
|
46
|
-
export
|
|
47
|
-
import { PicoFormat } from "../utils/Format.js";
|
|
39
|
+
export default PicoFormatParser;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
export const SLUG_CONVERT:
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*/
|
|
6
|
-
export class PicoFormatUrlStatic {
|
|
1
|
+
export declare const SLUG_CONVERT: any[];
|
|
2
|
+
export interface PicoFormatUrl {
|
|
3
|
+
}
|
|
4
|
+
export declare class PicoFormatUrl {
|
|
7
5
|
/**
|
|
8
6
|
* Create slug from string
|
|
9
7
|
*
|
|
@@ -14,5 +12,4 @@ export class PicoFormatUrlStatic {
|
|
|
14
12
|
*/
|
|
15
13
|
static slugify(value: any): string;
|
|
16
14
|
}
|
|
17
|
-
export
|
|
18
|
-
import { PicoFormat } from "../utils/Format.js";
|
|
15
|
+
export default PicoFormatUrl;
|
package/types/index.esm.d.ts
CHANGED
|
@@ -1,43 +1,31 @@
|
|
|
1
|
+
import { default as Run } from "./utils/Runner.ts";
|
|
2
|
+
import { default as Str } from "./utils/String.ts";
|
|
3
|
+
import { default as Num } from "./utils/Number.ts";
|
|
4
|
+
import { default as Arr } from "./utils/Array.ts";
|
|
5
|
+
import { default as Obj } from "./utils/Object.ts";
|
|
6
|
+
import { default as Mix } from "./utils/Mixed.ts";
|
|
7
|
+
import { default as Hash } from "./utils/Hash.ts";
|
|
8
|
+
import { default as Signal } from "./utils/Signal.ts";
|
|
9
|
+
import { default as Locale } from "./utils/Locale.ts";
|
|
10
|
+
import { default as Cookie } from "./utils/Cookie.ts";
|
|
11
|
+
import { default as Now } from "./utils/Now.ts";
|
|
12
|
+
import { default as Dom } from "./utils/Dom.ts";
|
|
13
|
+
import { default as For } from "./utils/Format.ts";
|
|
14
|
+
export { Dom, Now, For, Run, Str, Num, Arr, Obj, Mix, Hash, Signal, Locale, Cookie };
|
|
15
|
+
import { go, browser, device, trait } from "./tool/scope.ts";
|
|
16
|
+
export { go, browser, device, trait };
|
|
17
|
+
import { default as Data } from "./utils/Data.ts";
|
|
18
|
+
import { default as Route } from "./utils/Route.ts";
|
|
19
|
+
export { Route, Data };
|
|
1
20
|
/**
|
|
2
|
-
* @type {
|
|
21
|
+
* @type {Mix}
|
|
3
22
|
*/
|
|
4
|
-
export const Any:
|
|
23
|
+
export declare const Any: Mix;
|
|
5
24
|
/**
|
|
6
|
-
* @type {
|
|
25
|
+
* @type {Signal}
|
|
7
26
|
*/
|
|
8
|
-
export const Event:
|
|
9
|
-
export function UUID(): string;
|
|
27
|
+
export declare const Event: Signal;
|
|
10
28
|
/**
|
|
11
|
-
* @
|
|
29
|
+
* @returns {string}
|
|
12
30
|
*/
|
|
13
|
-
export const
|
|
14
|
-
/**
|
|
15
|
-
* @type {typeof PicoNow}
|
|
16
|
-
*/
|
|
17
|
-
export const Now: typeof PicoNow;
|
|
18
|
-
/**
|
|
19
|
-
* @type {typeof PicoFormat}
|
|
20
|
-
*/
|
|
21
|
-
export const For: typeof PicoFormat;
|
|
22
|
-
import { default as Run } from "./utils/Runner.js";
|
|
23
|
-
import { default as Str } from "./utils/String.js";
|
|
24
|
-
import { default as Num } from "./utils/Number.js";
|
|
25
|
-
import { default as Arr } from "./utils/Array.js";
|
|
26
|
-
import { default as Obj } from "./utils/Object.js";
|
|
27
|
-
import { default as Mix } from "./utils/Mixed.js";
|
|
28
|
-
import { default as Hash } from "./utils/Hash.js";
|
|
29
|
-
import { default as Signal } from "./utils/Signal.js";
|
|
30
|
-
import { default as Locale } from "./utils/Locale.js";
|
|
31
|
-
import { default as Cookie } from "./utils/Cookie.js";
|
|
32
|
-
import { go } from "./tool/scope.js";
|
|
33
|
-
import { browser } from "./tool/scope.js";
|
|
34
|
-
import { device } from "./tool/scope.js";
|
|
35
|
-
import { default as Map } from "./wip/Map.js";
|
|
36
|
-
import { default as Data } from "./utils/Data.js";
|
|
37
|
-
import { default as Route } from "./utils/Route.js";
|
|
38
|
-
import { default as Element } from "./wip/Element.js";
|
|
39
|
-
import { PicoMixed } from "./utils/Mixed.js";
|
|
40
|
-
import { PicoDom } from "./utils/Dom.js";
|
|
41
|
-
import { PicoNow } from "./utils/Now.js";
|
|
42
|
-
import { PicoFormat } from "./utils/Format.js";
|
|
43
|
-
export { Run, Str, Num, Arr, Obj, Mix, Hash, Signal, Locale, Cookie, go, browser, device, Map, Data, Route, Element };
|
|
31
|
+
export declare const UUID: () => string;
|
|
@@ -1,25 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
let hour: RegExp;
|
|
5
|
-
let date: RegExp;
|
|
6
|
-
let month: RegExp;
|
|
7
|
-
let year: RegExp;
|
|
1
|
+
import { PicoNow, PicoNowInterface } from "../utils/Now.ts";
|
|
2
|
+
export declare const NOW_MODIFY: any;
|
|
3
|
+
export interface PicoNowDefault extends PicoNowInterface {
|
|
8
4
|
}
|
|
9
5
|
/**
|
|
10
6
|
* @memberof PicoNow
|
|
11
|
-
* @extends {PicoNow}
|
|
12
7
|
*/
|
|
13
|
-
export class
|
|
8
|
+
export declare class PicoNowDefault {
|
|
9
|
+
static test(value: any): boolean;
|
|
14
10
|
/**
|
|
15
11
|
* Get value by scope
|
|
16
12
|
*
|
|
17
13
|
* @example Now.get("year") // => 2026
|
|
18
14
|
*
|
|
19
15
|
* @param {string} scope Value scope
|
|
20
|
-
* @returns {
|
|
16
|
+
* @returns {any} Scope value
|
|
21
17
|
*/
|
|
22
|
-
get(scope: string):
|
|
18
|
+
get(scope: string): any;
|
|
23
19
|
/**
|
|
24
20
|
* Set value by scope
|
|
25
21
|
*
|
|
@@ -36,72 +32,72 @@ export class PicoNowDefaultInstance {
|
|
|
36
32
|
* @example Now.time() // => 1739334660000
|
|
37
33
|
*
|
|
38
34
|
* @param {any} [value] New timestamp
|
|
39
|
-
* @returns {
|
|
35
|
+
* @returns {any} Timestamp or instance
|
|
40
36
|
*/
|
|
41
|
-
time(value?: any):
|
|
37
|
+
time(value?: any): any;
|
|
42
38
|
/**
|
|
43
39
|
* Get or set seconds
|
|
44
40
|
*
|
|
45
41
|
* @example Now.second() // => 45
|
|
46
42
|
*
|
|
47
43
|
* @param {any} [value] New seconds
|
|
48
|
-
* @returns {
|
|
44
|
+
* @returns {any} Seconds or instance
|
|
49
45
|
*/
|
|
50
|
-
second(value?: any):
|
|
46
|
+
second(value?: any): any;
|
|
51
47
|
/**
|
|
52
48
|
* Get or set minutes
|
|
53
49
|
*
|
|
54
50
|
* @example Now.minute() // => 30
|
|
55
51
|
*
|
|
56
52
|
* @param {any} [value] New minutes
|
|
57
|
-
* @returns {
|
|
53
|
+
* @returns {any} Minutes or instance
|
|
58
54
|
*/
|
|
59
|
-
minute(value?: any):
|
|
55
|
+
minute(value?: any): any;
|
|
60
56
|
/**
|
|
61
57
|
* Get or set hours
|
|
62
58
|
*
|
|
63
59
|
* @example Now.hour() // => 12
|
|
64
60
|
*
|
|
65
61
|
* @param {any} [value] New hours
|
|
66
|
-
* @returns {
|
|
62
|
+
* @returns {any} Hours or instance
|
|
67
63
|
*/
|
|
68
|
-
hour(value?: any):
|
|
64
|
+
hour(value?: any): any;
|
|
69
65
|
/**
|
|
70
66
|
* Get or set day of week
|
|
71
67
|
*
|
|
72
68
|
* @example Now.day() // => 1
|
|
73
69
|
*
|
|
74
70
|
* @param {any} [value] New day
|
|
75
|
-
* @returns {
|
|
71
|
+
* @returns {any} Day or instance
|
|
76
72
|
*/
|
|
77
|
-
day(value?: any):
|
|
73
|
+
day(value?: any): any;
|
|
78
74
|
/**
|
|
79
75
|
* Get or set date of month
|
|
80
76
|
*
|
|
81
77
|
* @example Now.date() // => 12
|
|
82
78
|
*
|
|
83
79
|
* @param {any} [value] New date
|
|
84
|
-
* @returns {
|
|
80
|
+
* @returns {any} Date or instance
|
|
85
81
|
*/
|
|
86
|
-
date(value?: any):
|
|
82
|
+
date(value?: any): any;
|
|
87
83
|
/**
|
|
88
84
|
* Get or set month
|
|
89
85
|
*
|
|
90
86
|
* @example Now.month() // => 2
|
|
91
87
|
*
|
|
92
88
|
* @param {any} [value] New month
|
|
93
|
-
* @returns {
|
|
89
|
+
* @returns {any} Month or instance
|
|
94
90
|
*/
|
|
95
|
-
month(value?: any):
|
|
91
|
+
month(value?: any): any;
|
|
96
92
|
/**
|
|
97
93
|
* Get or set year
|
|
98
94
|
*
|
|
99
95
|
* @example Now.year() // => 2026
|
|
100
96
|
*
|
|
101
97
|
* @param {any} [value] New year
|
|
102
|
-
* @returns {
|
|
98
|
+
* @returns {any} Year or instance
|
|
103
99
|
*/
|
|
104
|
-
year(value?: any):
|
|
100
|
+
year(value?: any): any;
|
|
105
101
|
/**
|
|
106
102
|
* Get short year
|
|
107
103
|
*
|
|
@@ -115,21 +111,21 @@ export class PicoNowDefaultInstance {
|
|
|
115
111
|
*
|
|
116
112
|
* @example Now.add(1, "day")
|
|
117
113
|
*
|
|
118
|
-
* @param {
|
|
114
|
+
* @param {any} value Add value
|
|
119
115
|
* @param {string} [scope] Target scope
|
|
120
116
|
* @returns {PicoNow} Current instance
|
|
121
117
|
*/
|
|
122
|
-
add(value:
|
|
118
|
+
add(value: any, scope?: string): PicoNow;
|
|
123
119
|
/**
|
|
124
120
|
* Subtract value from scope
|
|
125
121
|
*
|
|
126
122
|
* @example Now.sub(1, "day")
|
|
127
123
|
*
|
|
128
|
-
* @param {
|
|
124
|
+
* @param {any} value Sub value
|
|
129
125
|
* @param {string} [scope] Target scope
|
|
130
126
|
* @returns {PicoNow} Current instance
|
|
131
127
|
*/
|
|
132
|
-
sub(value:
|
|
128
|
+
sub(value: any, scope?: string): PicoNow;
|
|
133
129
|
/**
|
|
134
130
|
* Check if string is modifiable
|
|
135
131
|
*
|
|
@@ -155,10 +151,10 @@ export class PicoNowDefaultInstance {
|
|
|
155
151
|
*
|
|
156
152
|
* @param {any} value Source value
|
|
157
153
|
* @param {string} [format] Source format
|
|
158
|
-
* @param {
|
|
154
|
+
* @param {string[]} [keys] Scope keys
|
|
159
155
|
* @returns {PicoNow} Current instance
|
|
160
156
|
*/
|
|
161
|
-
apply(value: any, format?: string, keys?:
|
|
157
|
+
apply(value: any, format?: string, keys?: string[]): PicoNow;
|
|
162
158
|
/**
|
|
163
159
|
* Apply date from other value
|
|
164
160
|
*
|
|
@@ -179,70 +175,5 @@ export class PicoNowDefaultInstance {
|
|
|
179
175
|
* @returns {PicoNow} Current instance
|
|
180
176
|
*/
|
|
181
177
|
applyTime(value: any, format?: string): PicoNow;
|
|
182
|
-
/**
|
|
183
|
-
* @see PicoNow.add
|
|
184
|
-
*/
|
|
185
|
-
addSecond(value: any): PicoNow;
|
|
186
|
-
/**
|
|
187
|
-
* @see PicoNow.sub
|
|
188
|
-
*/
|
|
189
|
-
subSecond(value: any): PicoNow;
|
|
190
|
-
/**
|
|
191
|
-
* @see PicoNow.add
|
|
192
|
-
*/
|
|
193
|
-
addMinute(value: any): PicoNow;
|
|
194
|
-
/**
|
|
195
|
-
* @see PicoNow.sub
|
|
196
|
-
*/
|
|
197
|
-
subMinute(value: any): PicoNow;
|
|
198
|
-
/**
|
|
199
|
-
* @see PicoNow.add
|
|
200
|
-
*/
|
|
201
|
-
addHour(value: any): PicoNow;
|
|
202
|
-
/**
|
|
203
|
-
* @see PicoNow.sub
|
|
204
|
-
*/
|
|
205
|
-
subHour(value: any): PicoNow;
|
|
206
|
-
/**
|
|
207
|
-
* @see PicoNow.add
|
|
208
|
-
*/
|
|
209
|
-
addDates(value: any): PicoNow;
|
|
210
|
-
/**
|
|
211
|
-
* @see PicoNow.sub
|
|
212
|
-
*/
|
|
213
|
-
subDates(value: any): PicoNow;
|
|
214
|
-
/**
|
|
215
|
-
* @see PicoNow.add
|
|
216
|
-
*/
|
|
217
|
-
addMonths(value: any): PicoNow;
|
|
218
|
-
/**
|
|
219
|
-
* @see PicoNow.sub
|
|
220
|
-
*/
|
|
221
|
-
subMonths(value: any): PicoNow;
|
|
222
|
-
/**
|
|
223
|
-
* @see PicoNow.add
|
|
224
|
-
*/
|
|
225
|
-
addYears(value: any): PicoNow;
|
|
226
|
-
/**
|
|
227
|
-
* @see PicoNow.sub
|
|
228
|
-
*/
|
|
229
|
-
subYears(value: any): PicoNow;
|
|
230
|
-
/**
|
|
231
|
-
* @see PicoNow.add
|
|
232
|
-
*/
|
|
233
|
-
addDecades(value: any): PicoNow;
|
|
234
|
-
/**
|
|
235
|
-
* @see PicoNow.sub
|
|
236
|
-
*/
|
|
237
|
-
subDecades(value: any): PicoNow;
|
|
238
|
-
/**
|
|
239
|
-
* @see PicoNow.day
|
|
240
|
-
*/
|
|
241
|
-
humanDay(): number | PicoNow;
|
|
242
|
-
/**
|
|
243
|
-
* @see PicoNow.month
|
|
244
|
-
*/
|
|
245
|
-
humanMonth(): number | PicoNow;
|
|
246
178
|
}
|
|
247
|
-
export
|
|
248
|
-
import { PicoNow } from "../utils/Now.js";
|
|
179
|
+
export default PicoNowDefault;
|
package/types/now/NowFormat.d.ts
CHANGED
|
@@ -1,25 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
let LTS: string;
|
|
8
|
-
let LTSD: string;
|
|
9
|
-
}
|
|
10
|
-
export namespace NOW_PARSE {
|
|
11
|
-
let second: string;
|
|
12
|
-
let minute: string;
|
|
13
|
-
let hour: string;
|
|
14
|
-
let date: string;
|
|
15
|
-
let month: string;
|
|
16
|
-
let year: string;
|
|
1
|
+
import { PicoNow, PicoNowInterface } from "../utils/Now.ts";
|
|
2
|
+
import PicoNowDefault from "./NowDefault.js";
|
|
3
|
+
import PicoNowHuman from "./NowHuman.js";
|
|
4
|
+
export declare const NOW_FORMAT: any;
|
|
5
|
+
export declare const NOW_PARSE: any;
|
|
6
|
+
export interface PicoNowFormat extends PicoNowInterface, PicoNowDefault, PicoNowHuman {
|
|
17
7
|
}
|
|
18
8
|
/**
|
|
19
9
|
* @memberof PicoNow
|
|
20
|
-
* @extends {PicoNow}
|
|
21
10
|
*/
|
|
22
|
-
export class
|
|
11
|
+
export declare class PicoNowFormat {
|
|
23
12
|
/**
|
|
24
13
|
* Check if value matches format
|
|
25
14
|
*
|
|
@@ -40,7 +29,6 @@ export class PicoNowFormatInstance {
|
|
|
40
29
|
* @returns {PicoNow} Current instance
|
|
41
30
|
*/
|
|
42
31
|
parse(value: any, format?: string): PicoNow;
|
|
43
|
-
value: Date;
|
|
44
32
|
/**
|
|
45
33
|
* Parse date using format
|
|
46
34
|
*
|
|
@@ -70,5 +58,4 @@ export class PicoNowFormatInstance {
|
|
|
70
58
|
*/
|
|
71
59
|
code(format?: string): number;
|
|
72
60
|
}
|
|
73
|
-
export
|
|
74
|
-
import { PicoNow } from "../utils/Now.js";
|
|
61
|
+
export default PicoNowFormat;
|