@kizmann/pico-js 1.0.13 → 2.0.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/README.md +27 -7
- package/dist/pico-js.browser.js +2 -0
- package/dist/pico-js.browser.js.map +1 -0
- package/dist/pico-js.esm.js +2 -0
- package/dist/pico-js.esm.js.map +1 -0
- package/package.json +20 -7
- package/src/dom/DomAttribute.js +374 -0
- package/src/dom/DomBuilder.js +152 -0
- package/src/dom/DomEvent.js +253 -0
- package/src/dom/DomFinder.js +669 -0
- package/src/dom/DomForm.js +57 -0
- package/src/dom/DomGlobal.js +193 -0
- package/src/dom/DomInview.js +332 -0
- package/src/dom/DomMeta.js +66 -0
- package/src/dom/DomObserver.js +57 -0
- package/src/dom/DomRectangle.js +657 -0
- package/src/format/FormatFile.js +54 -0
- package/src/format/FormatOption.js +108 -0
- package/src/format/FormatParam.js +107 -0
- package/src/format/FormatParser.js +156 -0
- package/src/format/FormatUrl.js +75 -0
- package/src/index.browser.js +10 -0
- package/src/index.esm.js +138 -0
- package/src/now/NowDefault.js +533 -0
- package/src/now/NowFormat.js +196 -0
- package/src/now/NowGrid.js +251 -0
- package/src/now/NowHuman.js +118 -0
- package/src/now/NowMatch.js +175 -0
- package/src/now/NowRange.js +70 -0
- package/src/now/NowWalker.js +544 -0
- package/src/tool/scope.js +103 -0
- package/src/utils/Array.js +986 -0
- package/src/utils/Cookie.js +184 -0
- package/src/utils/Data.js +200 -0
- package/src/utils/Dom.js +208 -0
- package/src/utils/Event.js +140 -0
- package/src/utils/Format.js +62 -0
- package/src/utils/Hash.js +164 -0
- package/src/utils/Locale.js +229 -0
- package/src/utils/Mixed.js +887 -0
- package/src/utils/Now.js +234 -0
- package/src/utils/Number.js +238 -0
- package/src/utils/Object.js +655 -0
- package/src/utils/Route.js +67 -0
- package/src/utils/Runner.js +327 -0
- package/src/utils/String.js +618 -0
- package/src/{library/element.js → wip/Element.js} +90 -16
- package/src/{library/map.js → wip/Map.js} +256 -40
- package/types/dom/DomAttribute.d.ts +137 -0
- package/types/dom/DomBuilder.d.ts +67 -0
- package/types/dom/DomEvent.d.ts +103 -0
- package/types/dom/DomFinder.d.ts +321 -0
- package/types/dom/DomForm.d.ts +21 -0
- package/types/dom/DomGlobal.d.ts +79 -0
- package/types/dom/DomInview.d.ts +114 -0
- package/types/dom/DomMeta.d.ts +29 -0
- package/types/dom/DomObserver.d.ts +21 -0
- package/types/dom/DomRectangle.d.ts +270 -0
- package/types/format/FormatFile.d.ts +18 -0
- package/types/format/FormatOption.d.ts +40 -0
- package/types/format/FormatParam.d.ts +39 -0
- package/types/format/FormatParser.d.ts +46 -0
- package/types/format/FormatUrl.d.ts +17 -0
- package/types/index.browser.d.ts +1 -0
- package/types/index.esm.d.ts +52 -0
- package/types/now/NowDefault.d.ts +183 -0
- package/types/now/NowFormat.d.ts +70 -0
- package/types/now/NowGrid.d.ts +107 -0
- package/types/now/NowHuman.d.ts +37 -0
- package/types/now/NowMatch.d.ts +108 -0
- package/types/now/NowRange.d.ts +21 -0
- package/types/now/NowWalker.d.ts +301 -0
- package/types/tool/scope.d.ts +24 -0
- package/types/utils/Array.d.ts +480 -0
- package/types/utils/Cookie.d.ts +60 -0
- package/types/utils/Data.d.ts +91 -0
- package/types/utils/Dom.d.ts +138 -0
- package/types/utils/Event.d.ts +58 -0
- package/types/utils/Format.d.ts +37 -0
- package/types/utils/Hash.d.ts +81 -0
- package/types/utils/Locale.d.ts +115 -0
- package/types/utils/Mixed.d.ts +469 -0
- package/types/utils/Now.d.ts +125 -0
- package/types/utils/Number.d.ts +127 -0
- package/types/utils/Object.d.ts +255 -0
- package/types/utils/Route.d.ts +37 -0
- package/types/utils/Runner.d.ts +139 -0
- package/types/utils/String.d.ts +330 -0
- package/types/wip/Element.d.ts +119 -0
- package/types/wip/Map.d.ts +254 -0
- package/dist/.ignore.js +0 -0
- package/dist/pico-js.js +0 -2
- package/dist/pico-js.js.map +0 -1
- package/src/element/default.js +0 -46
- package/src/element/example.js +0 -58
- package/src/index.js +0 -90
- package/src/library/cookie.js +0 -123
- package/src/library/data.js +0 -111
- package/src/library/event.js +0 -91
- package/src/library/locale.js +0 -84
- package/src/library/queue.js +0 -64
- package/src/library/route.js +0 -28
- package/src/utility/any.js +0 -369
- package/src/utility/array.js +0 -410
- package/src/utility/dom.js +0 -1425
- package/src/utility/now.js +0 -544
- package/src/utility/number.js +0 -128
- package/src/utility/object.js +0 -429
- package/src/utility/string.js +0 -328
- package/types/index.d.ts +0 -77
- package/types/library/cookie.d.ts +0 -10
- package/types/library/data.d.ts +0 -15
- package/types/library/element.d.ts +0 -22
- package/types/library/event.d.ts +0 -13
- package/types/library/locale.d.ts +0 -14
- package/types/library/map.d.ts +0 -43
- package/types/library/queue.d.ts +0 -18
- package/types/library/route.d.ts +0 -11
- package/types/utility/any.d.ts +0 -35
- package/types/utility/array.d.ts +0 -46
- package/types/utility/dom.d.ts +0 -101
- package/types/utility/now.d.ts +0 -79
- package/types/utility/number.d.ts +0 -17
- package/types/utility/object.d.ts +0 -29
- package/types/utility/string.d.ts +0 -26
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export const go: typeof PicoToolGo;
|
|
2
|
+
export const browser: typeof PicoToolBrowser;
|
|
3
|
+
export const device: typeof PicoToolDevice;
|
|
4
|
+
export const Dom: typeof import("#src/utils/Dom.js").PicoDom;
|
|
5
|
+
export const Now: typeof import("#src/utils/Now.js").PicoNow;
|
|
6
|
+
export const For: typeof import("#src/utils/Format.js").PicoFormat;
|
|
7
|
+
export const Run: typeof PicoRunner;
|
|
8
|
+
export const Str: typeof PicoString;
|
|
9
|
+
export const Num: typeof PicoNumber;
|
|
10
|
+
export const Arr: typeof PicoArray;
|
|
11
|
+
export const Obj: typeof PicoObject;
|
|
12
|
+
export const Mix: typeof PicoMixed;
|
|
13
|
+
export const Hash: typeof PicoHash;
|
|
14
|
+
export const Event: typeof PicoEvent;
|
|
15
|
+
export const Locale: typeof PicoLocale;
|
|
16
|
+
export const Cookie: typeof PicoCookie;
|
|
17
|
+
export const Any: {};
|
|
18
|
+
export function UUID(): string;
|
|
19
|
+
export type PicoToolGo = typeof import("#src/tool/scope.js").go;
|
|
20
|
+
export type PicoToolBrowser = typeof import("#src/tool/scope.js").browser;
|
|
21
|
+
export type PicoToolDevice = typeof import("#src/tool/scope.js").device;
|
|
22
|
+
export type PicoDom = typeof import("#src/utils/Dom.js").PicoDom;
|
|
23
|
+
export type PicoNow = typeof import("#src/utils/Now.js").PicoNow;
|
|
24
|
+
export type PicoFormat = typeof import("#src/utils/Format.js").PicoFormat;
|
|
25
|
+
export type PicoRunner = typeof import("#src/utils/Runner.js").PicoRunner;
|
|
26
|
+
export type PicoString = typeof import("#src/utils/String.js").PicoString;
|
|
27
|
+
export type PicoNumber = typeof import("#src/utils/Number.js").PicoNumber;
|
|
28
|
+
export type PicoArray = typeof import("#src/utils/Array.js").PicoArray;
|
|
29
|
+
export type PicoObject = typeof import("#src/utils/Object.js").PicoObject;
|
|
30
|
+
export type PicoMixed = typeof import("#src/utils/Mixed.js").PicoMixed;
|
|
31
|
+
export type PicoHash = typeof import("#src/utils/Hash.js").PicoHash;
|
|
32
|
+
export type PicoEvent = typeof import("#src/utils/Event.js").PicoEvent;
|
|
33
|
+
export type PicoLocale = typeof import("#src/utils/Locale.js").PicoLocale;
|
|
34
|
+
export type PicoCookie = typeof import("#src/utils/Cookie.js").PicoCookie;
|
|
35
|
+
import { default as Map } from "#src/wip/Map.js";
|
|
36
|
+
import { default as Data } from "#src/utils/Data.js";
|
|
37
|
+
import { default as Route } from "#src/utils/Route.js";
|
|
38
|
+
import { default as Element } from "#src/wip/Element.js";
|
|
39
|
+
import { go as PicoToolGo } from "#src/tool/scope.js";
|
|
40
|
+
import { browser as PicoToolBrowser } from "#src/tool/scope.js";
|
|
41
|
+
import { device as PicoToolDevice } from "#src/tool/scope.js";
|
|
42
|
+
import { default as PicoRunner } from "#src/utils/Runner.js";
|
|
43
|
+
import { default as PicoString } from "#src/utils/String.js";
|
|
44
|
+
import { default as PicoNumber } from "#src/utils/Number.js";
|
|
45
|
+
import { default as PicoArray } from "#src/utils/Array.js";
|
|
46
|
+
import { default as PicoObject } from "#src/utils/Object.js";
|
|
47
|
+
import { default as PicoMixed } from "#src/utils/Mixed.js";
|
|
48
|
+
import { default as PicoHash } from "#src/utils/Hash.js";
|
|
49
|
+
import { default as PicoEvent } from "#src/utils/Event.js";
|
|
50
|
+
import { default as PicoLocale } from "#src/utils/Locale.js";
|
|
51
|
+
import { default as PicoCookie } from "#src/utils/Cookie.js";
|
|
52
|
+
export { Map, Data, Route, Element };
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
export namespace NOW_MODIFY {
|
|
2
|
+
let second: RegExp;
|
|
3
|
+
let minute: RegExp;
|
|
4
|
+
let hour: RegExp;
|
|
5
|
+
let date: RegExp;
|
|
6
|
+
let month: RegExp;
|
|
7
|
+
let year: RegExp;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* @memberof PicoNow
|
|
11
|
+
* @extends {PicoNow}
|
|
12
|
+
*/
|
|
13
|
+
export class PicoNowDefaultInstance {
|
|
14
|
+
/**
|
|
15
|
+
* Get value by scope
|
|
16
|
+
*
|
|
17
|
+
* @example Now.get("year") // => 2026
|
|
18
|
+
*
|
|
19
|
+
* @param {string} scope Value scope
|
|
20
|
+
* @returns {number|PicoNow} Scope value
|
|
21
|
+
*/
|
|
22
|
+
get(scope: string): number | PicoNow;
|
|
23
|
+
/**
|
|
24
|
+
* Set value by scope
|
|
25
|
+
*
|
|
26
|
+
* @example Now.set(2026, "year")
|
|
27
|
+
*
|
|
28
|
+
* @param {any} value New value
|
|
29
|
+
* @param {string} scope Value scope
|
|
30
|
+
* @returns {PicoNow} Current instance
|
|
31
|
+
*/
|
|
32
|
+
set(value: any, scope: string): PicoNow;
|
|
33
|
+
/**
|
|
34
|
+
* Get or set timestamp
|
|
35
|
+
*
|
|
36
|
+
* @example Now.time() // => 1739334660000
|
|
37
|
+
*
|
|
38
|
+
* @param {any} [value] New timestamp
|
|
39
|
+
* @returns {number|PicoNow} Timestamp or instance
|
|
40
|
+
*/
|
|
41
|
+
time(value?: any): number | PicoNow;
|
|
42
|
+
/**
|
|
43
|
+
* Get or set seconds
|
|
44
|
+
*
|
|
45
|
+
* @example Now.second() // => 45
|
|
46
|
+
*
|
|
47
|
+
* @param {any} [value] New seconds
|
|
48
|
+
* @returns {number|PicoNow} Seconds or instance
|
|
49
|
+
*/
|
|
50
|
+
second(value?: any): number | PicoNow;
|
|
51
|
+
/**
|
|
52
|
+
* Get or set minutes
|
|
53
|
+
*
|
|
54
|
+
* @example Now.minute() // => 30
|
|
55
|
+
*
|
|
56
|
+
* @param {any} [value] New minutes
|
|
57
|
+
* @returns {number|PicoNow} Minutes or instance
|
|
58
|
+
*/
|
|
59
|
+
minute(value?: any): number | PicoNow;
|
|
60
|
+
/**
|
|
61
|
+
* Get or set hours
|
|
62
|
+
*
|
|
63
|
+
* @example Now.hour() // => 12
|
|
64
|
+
*
|
|
65
|
+
* @param {any} [value] New hours
|
|
66
|
+
* @returns {number|PicoNow} Hours or instance
|
|
67
|
+
*/
|
|
68
|
+
hour(value?: any): number | PicoNow;
|
|
69
|
+
/**
|
|
70
|
+
* Get or set day of week
|
|
71
|
+
*
|
|
72
|
+
* @example Now.day() // => 1
|
|
73
|
+
*
|
|
74
|
+
* @param {any} [value] New day
|
|
75
|
+
* @returns {number|PicoNow} Day or instance
|
|
76
|
+
*/
|
|
77
|
+
day(value?: any): number | PicoNow;
|
|
78
|
+
/**
|
|
79
|
+
* Get or set date of month
|
|
80
|
+
*
|
|
81
|
+
* @example Now.date() // => 12
|
|
82
|
+
*
|
|
83
|
+
* @param {any} [value] New date
|
|
84
|
+
* @returns {number|PicoNow} Date or instance
|
|
85
|
+
*/
|
|
86
|
+
date(value?: any): number | PicoNow;
|
|
87
|
+
/**
|
|
88
|
+
* Get or set month
|
|
89
|
+
*
|
|
90
|
+
* @example Now.month() // => 2
|
|
91
|
+
*
|
|
92
|
+
* @param {any} [value] New month
|
|
93
|
+
* @returns {number|PicoNow} Month or instance
|
|
94
|
+
*/
|
|
95
|
+
month(value?: any): number | PicoNow;
|
|
96
|
+
/**
|
|
97
|
+
* Get or set year
|
|
98
|
+
*
|
|
99
|
+
* @example Now.year() // => 2026
|
|
100
|
+
*
|
|
101
|
+
* @param {any} [value] New year
|
|
102
|
+
* @returns {number|PicoNow} Year or instance
|
|
103
|
+
*/
|
|
104
|
+
year(value?: any): number | PicoNow;
|
|
105
|
+
/**
|
|
106
|
+
* Get short year
|
|
107
|
+
*
|
|
108
|
+
* @example Now.shortyear() // => "26"
|
|
109
|
+
*
|
|
110
|
+
* @returns {string} Short year
|
|
111
|
+
*/
|
|
112
|
+
shortyear(): string;
|
|
113
|
+
/**
|
|
114
|
+
* Add value to scope
|
|
115
|
+
*
|
|
116
|
+
* @example Now.add(1, "day")
|
|
117
|
+
*
|
|
118
|
+
* @param {number} value Add value
|
|
119
|
+
* @param {string} [scope] Target scope
|
|
120
|
+
* @returns {PicoNow} Current instance
|
|
121
|
+
*/
|
|
122
|
+
add(value: number, scope?: string): PicoNow;
|
|
123
|
+
/**
|
|
124
|
+
* Subtract value from scope
|
|
125
|
+
*
|
|
126
|
+
* @example Now.sub(1, "day")
|
|
127
|
+
*
|
|
128
|
+
* @param {number} value Sub value
|
|
129
|
+
* @param {string} [scope] Target scope
|
|
130
|
+
* @returns {PicoNow} Current instance
|
|
131
|
+
*/
|
|
132
|
+
sub(value: number, scope?: string): PicoNow;
|
|
133
|
+
/**
|
|
134
|
+
* Check if string is modifiable
|
|
135
|
+
*
|
|
136
|
+
* @example Now.isModifible("+1 day") // => true
|
|
137
|
+
*
|
|
138
|
+
* @param {string} value Test value
|
|
139
|
+
* @returns {boolean} Is modifiable
|
|
140
|
+
*/
|
|
141
|
+
isModifible(value: string): boolean;
|
|
142
|
+
/**
|
|
143
|
+
* Modify date by string
|
|
144
|
+
*
|
|
145
|
+
* @example Now.modify("+1 day")
|
|
146
|
+
*
|
|
147
|
+
* @param {string} value Modify string
|
|
148
|
+
* @returns {PicoNow} Current instance
|
|
149
|
+
*/
|
|
150
|
+
modify(value: string): PicoNow;
|
|
151
|
+
/**
|
|
152
|
+
* Apply values from other date
|
|
153
|
+
*
|
|
154
|
+
* @example Now.apply("2026-01-01", "YYYY-MM-DD", ["year"])
|
|
155
|
+
*
|
|
156
|
+
* @param {any} value Source value
|
|
157
|
+
* @param {string} [format] Source format
|
|
158
|
+
* @param {Array<string>} [keys] Scope keys
|
|
159
|
+
* @returns {PicoNow} Current instance
|
|
160
|
+
*/
|
|
161
|
+
apply(value: any, format?: string, keys?: Array<string>): PicoNow;
|
|
162
|
+
/**
|
|
163
|
+
* Apply date from other value
|
|
164
|
+
*
|
|
165
|
+
* @example Now.applyDate("2026-01-01")
|
|
166
|
+
*
|
|
167
|
+
* @param {any} value Source value
|
|
168
|
+
* @param {string} [format] Source format
|
|
169
|
+
* @returns {PicoNow} Current instance
|
|
170
|
+
*/
|
|
171
|
+
applyDate(value: any, format?: string): PicoNow;
|
|
172
|
+
/**
|
|
173
|
+
* Apply time from other value
|
|
174
|
+
*
|
|
175
|
+
* @example Now.applyTime("12:00:00")
|
|
176
|
+
*
|
|
177
|
+
* @param {any} value Source value
|
|
178
|
+
* @param {string} [format] Source format
|
|
179
|
+
* @returns {PicoNow} Current instance
|
|
180
|
+
*/
|
|
181
|
+
applyTime(value: any, format?: string): PicoNow;
|
|
182
|
+
}
|
|
183
|
+
export function PicoNowDefaultPlugin(self: any): typeof import("#src/utils/Now.js").PicoNow;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export namespace NOW_FORMAT {
|
|
2
|
+
let L: string;
|
|
3
|
+
let LL: string;
|
|
4
|
+
let LLL: string;
|
|
5
|
+
let LLLL: string;
|
|
6
|
+
}
|
|
7
|
+
export namespace NOW_PARSE {
|
|
8
|
+
let second: string;
|
|
9
|
+
let minute: string;
|
|
10
|
+
let hour: string;
|
|
11
|
+
let date: string;
|
|
12
|
+
let month: string;
|
|
13
|
+
let year: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* @memberof PicoNow
|
|
17
|
+
* @extends {PicoNow}
|
|
18
|
+
*/
|
|
19
|
+
export class PicoNowFormatInstance {
|
|
20
|
+
/**
|
|
21
|
+
* Check if value matches format
|
|
22
|
+
*
|
|
23
|
+
* @example Now.isParsable("2026-01-01") // => true
|
|
24
|
+
*
|
|
25
|
+
* @param {string} value Test value
|
|
26
|
+
* @param {string} [format] Date format
|
|
27
|
+
* @returns {boolean} Is parsable
|
|
28
|
+
*/
|
|
29
|
+
isParsable(value: string, format?: string): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Parse date from string
|
|
32
|
+
*
|
|
33
|
+
* @example Now.parse("2026-01-01") // => Now
|
|
34
|
+
*
|
|
35
|
+
* @param {any} value Input value
|
|
36
|
+
* @param {string} [format] Input format
|
|
37
|
+
* @returns {PicoNow} Current instance
|
|
38
|
+
*/
|
|
39
|
+
parse(value: any, format?: string): PicoNow;
|
|
40
|
+
value: Date;
|
|
41
|
+
/**
|
|
42
|
+
* Parse date using format
|
|
43
|
+
*
|
|
44
|
+
* @example Now.parseFormat("01/01/2026", "DD/MM/YYYY")
|
|
45
|
+
*
|
|
46
|
+
* @param {string} value Input value
|
|
47
|
+
* @param {string} format Input format
|
|
48
|
+
* @returns {PicoNow} Current instance
|
|
49
|
+
*/
|
|
50
|
+
parseFormat(value: string, format: string): PicoNow;
|
|
51
|
+
/**
|
|
52
|
+
* Format date to string
|
|
53
|
+
*
|
|
54
|
+
* @example Now.format("YYYY-MM-DD") // => "2026-02-12"
|
|
55
|
+
*
|
|
56
|
+
* @param {string} [format] Output format
|
|
57
|
+
* @returns {string} Formatted string
|
|
58
|
+
*/
|
|
59
|
+
format(format?: string): string;
|
|
60
|
+
/**
|
|
61
|
+
* Format date as integer
|
|
62
|
+
*
|
|
63
|
+
* @example Now.code("YYYYMMDD") // => 20260212
|
|
64
|
+
*
|
|
65
|
+
* @param {string} [format] Output format
|
|
66
|
+
* @returns {number} Formatted integer
|
|
67
|
+
*/
|
|
68
|
+
code(format?: string): number;
|
|
69
|
+
}
|
|
70
|
+
export function PicoNowFormatPlugin(self: any): typeof import("#src/utils/Now.js").PicoNow;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @memberof PicoNow
|
|
3
|
+
* @extends {PicoNow}
|
|
4
|
+
*/
|
|
5
|
+
export class PicoNowGridInstance {
|
|
6
|
+
/**
|
|
7
|
+
* Get grid of dates by scope
|
|
8
|
+
*
|
|
9
|
+
* @example Now.grid("month") // => [Now, Now, ...]
|
|
10
|
+
*
|
|
11
|
+
* @param {string} [scope] Grid scope
|
|
12
|
+
* @returns {Array<PicoNow>} Array of dates
|
|
13
|
+
*/
|
|
14
|
+
grid(scope?: string): Array<PicoNow>;
|
|
15
|
+
/**
|
|
16
|
+
* Get seconds grid
|
|
17
|
+
*
|
|
18
|
+
* @example Now.getSecondsGrid(10)
|
|
19
|
+
*
|
|
20
|
+
* @param {number} [interval] Step interval
|
|
21
|
+
* @returns {Array<PicoNow>} Array of dates
|
|
22
|
+
*/
|
|
23
|
+
getSecondsGrid(interval?: number): Array<PicoNow>;
|
|
24
|
+
/**
|
|
25
|
+
* Get minutes grid
|
|
26
|
+
*
|
|
27
|
+
* @example Now.getMinutesGrid(10)
|
|
28
|
+
*
|
|
29
|
+
* @param {number} [interval] Step interval
|
|
30
|
+
* @returns {Array<PicoNow>} Array of dates
|
|
31
|
+
*/
|
|
32
|
+
getMinutesGrid(interval?: number): Array<PicoNow>;
|
|
33
|
+
/**
|
|
34
|
+
* Get hours grid
|
|
35
|
+
*
|
|
36
|
+
* @example Now.getHoursGrid(2)
|
|
37
|
+
*
|
|
38
|
+
* @param {number} [interval] Step interval
|
|
39
|
+
* @returns {Array<PicoNow>} Array of dates
|
|
40
|
+
*/
|
|
41
|
+
getHoursGrid(interval?: number): Array<PicoNow>;
|
|
42
|
+
/**
|
|
43
|
+
* Get days grid
|
|
44
|
+
*
|
|
45
|
+
* @example Now.getDaysGrid()
|
|
46
|
+
*
|
|
47
|
+
* @returns {Array<PicoNow>} Array of dates
|
|
48
|
+
*/
|
|
49
|
+
getDaysGrid(): Array<PicoNow>;
|
|
50
|
+
/**
|
|
51
|
+
* Get dates grid
|
|
52
|
+
*
|
|
53
|
+
* @example Now.getDatesGrid()
|
|
54
|
+
*
|
|
55
|
+
* @returns {Array<PicoNow>} Array of dates
|
|
56
|
+
*/
|
|
57
|
+
getDatesGrid(): Array<PicoNow>;
|
|
58
|
+
/**
|
|
59
|
+
* Get months grid
|
|
60
|
+
*
|
|
61
|
+
* @example Now.getMonthsGrid()
|
|
62
|
+
*
|
|
63
|
+
* @returns {Array<PicoNow>} Array of dates
|
|
64
|
+
*/
|
|
65
|
+
getMonthsGrid(): Array<PicoNow>;
|
|
66
|
+
/**
|
|
67
|
+
* Get years grid
|
|
68
|
+
*
|
|
69
|
+
* @example Now.getYearsGrid()
|
|
70
|
+
*
|
|
71
|
+
* @returns {Array<PicoNow>} Array of dates
|
|
72
|
+
*/
|
|
73
|
+
getYearsGrid(): Array<PicoNow>;
|
|
74
|
+
/**
|
|
75
|
+
* Get decades grid
|
|
76
|
+
*
|
|
77
|
+
* @example Now.getDecadesGrid()
|
|
78
|
+
*
|
|
79
|
+
* @returns {Array<PicoNow>} Array of dates
|
|
80
|
+
*/
|
|
81
|
+
getDecadesGrid(): Array<PicoNow>;
|
|
82
|
+
/**
|
|
83
|
+
* @see PicoNow.grid
|
|
84
|
+
*/
|
|
85
|
+
getYears(): PicoNow[];
|
|
86
|
+
/**
|
|
87
|
+
* @see PicoNow.grid
|
|
88
|
+
*/
|
|
89
|
+
getMonths(): PicoNow[];
|
|
90
|
+
/**
|
|
91
|
+
* @see PicoNow.grid
|
|
92
|
+
*/
|
|
93
|
+
getDates(): PicoNow[];
|
|
94
|
+
/**
|
|
95
|
+
* @see PicoNow.grid
|
|
96
|
+
*/
|
|
97
|
+
getHours(): PicoNow[];
|
|
98
|
+
/**
|
|
99
|
+
* @see PicoNow.grid
|
|
100
|
+
*/
|
|
101
|
+
getMinutes(): PicoNow[];
|
|
102
|
+
/**
|
|
103
|
+
* @see PicoNow.grid
|
|
104
|
+
*/
|
|
105
|
+
getSeconds(): PicoNow[];
|
|
106
|
+
}
|
|
107
|
+
export function PicoNowGridPlugin(self: any): typeof import("#src/utils/Now.js").PicoNow;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export const NOW_HUMAN_DAYS: string[];
|
|
2
|
+
export const NOW_HUMAN_MONTHS: string[];
|
|
3
|
+
/**
|
|
4
|
+
* @memberof PicoNow
|
|
5
|
+
* @extends {PicoNow}
|
|
6
|
+
*/
|
|
7
|
+
export class PicoNowHumanInstance {
|
|
8
|
+
/**
|
|
9
|
+
* Get human readable value
|
|
10
|
+
*
|
|
11
|
+
* @example Now.human("day") // => "Monday"
|
|
12
|
+
*
|
|
13
|
+
* @param {string} [scope] Value scope
|
|
14
|
+
* @param {number} [substr] Substring length
|
|
15
|
+
* @returns {string|number} Human value
|
|
16
|
+
*/
|
|
17
|
+
human(scope?: string, substr?: number): string | number;
|
|
18
|
+
/**
|
|
19
|
+
* Get human readable day
|
|
20
|
+
*
|
|
21
|
+
* @example Now.getHumanDay(3) // => "Mon"
|
|
22
|
+
*
|
|
23
|
+
* @param {number} [substr] Substring length
|
|
24
|
+
* @returns {string} Day name
|
|
25
|
+
*/
|
|
26
|
+
getHumanDay(substr?: number): string;
|
|
27
|
+
/**
|
|
28
|
+
* Get human readable month
|
|
29
|
+
*
|
|
30
|
+
* @example Now.getHumanMonth(3) // => "Jan"
|
|
31
|
+
*
|
|
32
|
+
* @param {number} [substr] Substring length
|
|
33
|
+
* @returns {string} Month name
|
|
34
|
+
*/
|
|
35
|
+
getHumanMonth(substr?: number): string;
|
|
36
|
+
}
|
|
37
|
+
export function PicoNowHumanPlugin(self: any): typeof import("#src/utils/Now.js").PicoNow;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @memberof PicoNow
|
|
3
|
+
* @extends {PicoNow}
|
|
4
|
+
*/
|
|
5
|
+
export class PicoNowMatchInstance {
|
|
6
|
+
/**
|
|
7
|
+
* Check if date is before value
|
|
8
|
+
*
|
|
9
|
+
* @example Now.make("2026-01-01").before("2026-02-12") // => true
|
|
10
|
+
*
|
|
11
|
+
* @param {any} [value] Compare value
|
|
12
|
+
* @param {string} [format] Compare format
|
|
13
|
+
* @returns {boolean} True if before
|
|
14
|
+
*/
|
|
15
|
+
before(value?: any, format?: string): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Check if date is before value date
|
|
18
|
+
*
|
|
19
|
+
* @example Now.make("2026-01-01").beforeDate("2026-02-12")
|
|
20
|
+
*
|
|
21
|
+
* @param {any} [value] Compare value
|
|
22
|
+
* @param {string} [format] Compare format
|
|
23
|
+
* @returns {boolean} True if before
|
|
24
|
+
*/
|
|
25
|
+
beforeDate(value?: any, format?: string): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Check if date is before value time
|
|
28
|
+
*
|
|
29
|
+
* @example Now.make("10:00:00").beforeTime("12:00:00")
|
|
30
|
+
*
|
|
31
|
+
* @param {any} [value] Compare value
|
|
32
|
+
* @param {string} [format] Compare format
|
|
33
|
+
* @returns {boolean} True if before
|
|
34
|
+
*/
|
|
35
|
+
beforeTime(value?: any, format?: string): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Check if date is after value
|
|
38
|
+
*
|
|
39
|
+
* @example Now.make("2026-02-12").after("2026-01-01") // => true
|
|
40
|
+
*
|
|
41
|
+
* @param {any} [value] Compare value
|
|
42
|
+
* @param {string} [format] Compare format
|
|
43
|
+
* @returns {boolean} True if after
|
|
44
|
+
*/
|
|
45
|
+
after(value?: any, format?: string): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Check if date is after value date
|
|
48
|
+
*
|
|
49
|
+
* @example Now.make("2026-02-12").afterDate("2026-01-01")
|
|
50
|
+
*
|
|
51
|
+
* @param {any} [value] Compare value
|
|
52
|
+
* @param {string} [format] Compare format
|
|
53
|
+
* @returns {boolean} True if after
|
|
54
|
+
*/
|
|
55
|
+
afterDate(value?: any, format?: string): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Check if date is after value time
|
|
58
|
+
*
|
|
59
|
+
* @example Now.make("12:00:00").afterTime("10:00:00")
|
|
60
|
+
*
|
|
61
|
+
* @param {any} [value] Compare value
|
|
62
|
+
* @param {string} [format] Compare format
|
|
63
|
+
* @returns {boolean} True if after
|
|
64
|
+
*/
|
|
65
|
+
afterTime(value?: any, format?: string): boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Check if date equals value
|
|
68
|
+
*
|
|
69
|
+
* @example Now.make("2026-01-01").equal("2026-01-01") // => true
|
|
70
|
+
*
|
|
71
|
+
* @param {any} [value] Compare value
|
|
72
|
+
* @param {string} [format] Compare format
|
|
73
|
+
* @returns {boolean} True if equal
|
|
74
|
+
*/
|
|
75
|
+
equal(value?: any, format?: string): boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Check if date equals value date
|
|
78
|
+
*
|
|
79
|
+
* @example Now.make("2026-01-01").equalDate("2026-01-01")
|
|
80
|
+
*
|
|
81
|
+
* @param {any} [value] Compare value
|
|
82
|
+
* @param {string} [format] Compare format
|
|
83
|
+
* @returns {boolean} True if equal
|
|
84
|
+
*/
|
|
85
|
+
equalDate(value?: any, format?: string): boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Check if date equals value time
|
|
88
|
+
*
|
|
89
|
+
* @example Now.make("12:00:00").equalTime("12:00:00")
|
|
90
|
+
*
|
|
91
|
+
* @param {any} [value] Compare value
|
|
92
|
+
* @param {string} [format] Compare format
|
|
93
|
+
* @returns {boolean} True if equal
|
|
94
|
+
*/
|
|
95
|
+
equalTime(value?: any, format?: string): boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Check if date is between values
|
|
98
|
+
*
|
|
99
|
+
* @example Now.make("2026-01-15").between("2026-01-01", "2026-01-31")
|
|
100
|
+
*
|
|
101
|
+
* @param {any} [start] Start value
|
|
102
|
+
* @param {any} [end] End value
|
|
103
|
+
* @param {string} [format] Compare format
|
|
104
|
+
* @returns {boolean} True if between
|
|
105
|
+
*/
|
|
106
|
+
between(start?: any, end?: any, format?: string): boolean;
|
|
107
|
+
}
|
|
108
|
+
export function PicoNowMatchPlugin(self: any): typeof import("#src/utils/Now.js").PicoNow;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @memberof PicoNow
|
|
3
|
+
* @extends {PicoNow}
|
|
4
|
+
*/
|
|
5
|
+
export class PicoNowRangeInstance {
|
|
6
|
+
/**
|
|
7
|
+
* Get range of dates
|
|
8
|
+
*
|
|
9
|
+
* @example Now.range("2026-01-31", "day") // => [Now, Now, ...]
|
|
10
|
+
*
|
|
11
|
+
* @param {any} [value] End date
|
|
12
|
+
* @param {string} [scope] Range scope
|
|
13
|
+
* @returns {Array<PicoNow>} Array of dates
|
|
14
|
+
*/
|
|
15
|
+
range(value?: any, scope?: string): Array<PicoNow>;
|
|
16
|
+
/**
|
|
17
|
+
* @see PicoNow.range
|
|
18
|
+
*/
|
|
19
|
+
getDatesRange(...args: any[]): PicoNow[];
|
|
20
|
+
}
|
|
21
|
+
export function PicoNowRangePlugin(self: any): typeof import("#src/utils/Now.js").PicoNow;
|