domma-js 0.55.0 → 0.57.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/assets/types/generated/public/assets/flags/africa.d.ts +6 -0
- package/assets/types/generated/public/assets/flags/americas.d.ts +6 -0
- package/assets/types/generated/public/assets/flags/asia.d.ts +6 -0
- package/assets/types/generated/public/assets/flags/europe.d.ts +9 -0
- package/assets/types/generated/public/assets/flags/index.d.ts +11 -0
- package/assets/types/generated/public/assets/flags/oceania.d.ts +2 -0
- package/assets/types/generated/public/assets/icons/buildings.d.ts +6 -0
- package/assets/types/generated/public/assets/icons/code.d.ts +2 -0
- package/assets/types/generated/public/assets/icons/commerce.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/communication.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/devices.d.ts +6 -0
- package/assets/types/generated/public/assets/icons/emojis.d.ts +6 -0
- package/assets/types/generated/public/assets/icons/files.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/finance.d.ts +6 -0
- package/assets/types/generated/public/assets/icons/forms.d.ts +5 -0
- package/assets/types/generated/public/assets/icons/health.d.ts +6 -0
- package/assets/types/generated/public/assets/icons/index.d.ts +24 -0
- package/assets/types/generated/public/assets/icons/media.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/navigation.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/seasonal.d.ts +6 -0
- package/assets/types/generated/public/assets/icons/social.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/sport.d.ts +6 -0
- package/assets/types/generated/public/assets/icons/status.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/transport.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/ui.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/weather.d.ts +6 -0
- package/assets/types/generated/src/auth.d.ts +424 -0
- package/assets/types/generated/src/avatar.d.ts +270 -0
- package/assets/types/generated/src/binding-source.d.ts +58 -0
- package/assets/types/generated/src/butterfly-drawing.d.ts +2 -0
- package/assets/types/generated/src/component-factory.d.ts +150 -0
- package/assets/types/generated/src/component.d.ts +162 -0
- package/assets/types/generated/src/components/back-to-top.d.ts +150 -0
- package/assets/types/generated/src/components/badge.d.ts +208 -0
- package/assets/types/generated/src/components/card.d.ts +189 -0
- package/assets/types/generated/src/components/command-palette.d.ts +352 -0
- package/assets/types/generated/src/components/dropzone.d.ts +342 -0
- package/assets/types/generated/src/components/focus-trap.d.ts +238 -0
- package/assets/types/generated/src/components/loader.d.ts +133 -0
- package/assets/types/generated/src/components/modal.d.ts +341 -0
- package/assets/types/generated/src/components/range-slider.d.ts +267 -0
- package/assets/types/generated/src/components/shared.d.ts +91 -0
- package/assets/types/generated/src/components/split-pane.d.ts +239 -0
- package/assets/types/generated/src/components/toast.d.ts +284 -0
- package/assets/types/generated/src/components/tooltip.d.ts +200 -0
- package/assets/types/generated/src/components/virtual-list.d.ts +340 -0
- package/assets/types/generated/src/config.d.ts +193 -0
- package/assets/types/generated/src/context-cursor.d.ts +69 -0
- package/assets/types/generated/src/context-menu.d.ts +596 -0
- package/assets/types/generated/src/dates.d.ts +367 -0
- package/assets/types/generated/src/dom.d.ts +1221 -0
- package/assets/types/generated/src/effects.d.ts +1281 -0
- package/assets/types/generated/src/elements.d.ts +4996 -0
- package/assets/types/generated/src/escape.d.ts +5 -0
- package/assets/types/generated/src/flags-bundle.d.ts +4 -0
- package/assets/types/generated/src/flags.d.ts +338 -0
- package/assets/types/generated/src/forms.d.ts +1060 -0
- package/assets/types/generated/src/globals.d.ts +45 -0
- package/assets/types/generated/src/http.d.ts +131 -0
- package/assets/types/generated/src/i18n.d.ts +261 -0
- package/assets/types/generated/src/icons.d.ts +213 -0
- package/assets/types/generated/src/index.d.ts +249 -0
- package/assets/types/generated/src/input-group.d.ts +135 -0
- package/assets/types/generated/src/models.d.ts +968 -0
- package/assets/types/generated/src/popover.d.ts +412 -0
- package/assets/types/generated/src/router.d.ts +344 -0
- package/assets/types/generated/src/safe-url.d.ts +10 -0
- package/assets/types/generated/src/sanitize.d.ts +97 -0
- package/assets/types/generated/src/schema-builder.d.ts +420 -0
- package/assets/types/generated/src/skeleton.d.ts +135 -0
- package/assets/types/generated/src/smooth-caret.d.ts +61 -0
- package/assets/types/generated/src/sortable.d.ts +369 -0
- package/assets/types/generated/src/storage.d.ts +93 -0
- package/assets/types/generated/src/tables.d.ts +901 -0
- package/assets/types/generated/src/theme.d.ts +277 -0
- package/assets/types/generated/src/ticker-tape-drawing.d.ts +2 -0
- package/assets/types/generated/src/treeview.d.ts +504 -0
- package/assets/types/generated/src/utils.d.ts +1667 -0
- package/assets/types/generated/src/web-components/base/domma-element.d.ts +134 -0
- package/assets/types/generated/src/web-components/index.d.ts +14 -0
- package/assets/types/generated/vendor/domma-reactive.d.ts +587 -0
- package/assets/types/index.d.ts +104 -216
- package/package.json +5 -2
- package/public/dist/bundles/domma-complete.css +1084 -14
- package/public/dist/bundles/domma-data-focused.css +1084 -14
- package/public/dist/bundles/domma-essentials.css +1084 -14
- package/public/dist/bundles/domma-full.css +1084 -14
- package/public/dist/bundles/domma-minimal.css +8 -8
- package/public/dist/domma-flags.esm.js +3 -3
- package/public/dist/domma-flags.esm.js.map +1 -1
- package/public/dist/domma-flags.min.js +3 -3
- package/public/dist/domma-flags.min.js.map +1 -1
- package/public/dist/domma-syntax.min.js +3 -3
- package/public/dist/domma.css +3 -3
- package/public/dist/domma.esm.js +5 -5
- package/public/dist/domma.esm.js.map +1 -1
- package/public/dist/domma.min.js +5 -5
- package/public/dist/domma.min.js.map +1 -1
- package/public/dist/elements.css +1073 -3
- package/public/dist/grid.css +3 -3
- package/public/dist/syntax.css +3 -3
- package/public/dist/themes/domma-themes.css +3 -3
- package/templates/kickstart/frontend/types/domma.d.ts +2 -1
- package/assets/types/config.d.ts +0 -136
- package/assets/types/dates.d.ts +0 -209
- package/assets/types/dom.d.ts +0 -448
- package/assets/types/elements.d.ts +0 -682
- package/assets/types/flags.d.ts +0 -130
- package/assets/types/http.d.ts +0 -97
- package/assets/types/icons.d.ts +0 -147
- package/assets/types/models.d.ts +0 -260
- package/assets/types/smooth-caret.d.ts +0 -12
- package/assets/types/storage.d.ts +0 -93
- package/assets/types/tables.d.ts +0 -327
- package/assets/types/theme.d.ts +0 -137
- package/assets/types/utils.d.ts +0 -675
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Anything a date can be made from. `null`/`undefined` mean now.
|
|
3
|
+
* @typedef {Date|string|number|DommaDate|null|undefined} DateInput
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* A unit of time - singular or plural, any case. `date` is the day of the month; `day` is the
|
|
7
|
+
* day of the week for `get()` and a calendar day elsewhere.
|
|
8
|
+
* @typedef {'year'|'years'|'month'|'months'|'week'|'weeks'|'day'|'days'|'date'|'hour'|'hours'|'minute'|'minutes'|'second'|'seconds'|'millisecond'|'milliseconds'} DateUnit
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* A unit for `diff()` - singular or plural.
|
|
12
|
+
* @typedef {'milliseconds'|'seconds'|'minutes'|'hours'|'days'|'weeks'|'months'|'years'|'millisecond'|'second'|'minute'|'hour'|'day'|'week'|'month'|'year'} DiffUnit
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Bounds for `isBetween()`: `(` / `)` exclusive, `[` / `]` inclusive.
|
|
16
|
+
* @typedef {'()'|'[]'|'[)'|'(]'} Inclusivity
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Chainable date wrapper class
|
|
20
|
+
*/
|
|
21
|
+
export class DommaDate {
|
|
22
|
+
/**
|
|
23
|
+
* @param {DateInput} [value] The date; now when omitted
|
|
24
|
+
*/
|
|
25
|
+
constructor(value?: DateInput);
|
|
26
|
+
/**
|
|
27
|
+
* @type {Date}
|
|
28
|
+
* @private
|
|
29
|
+
*/
|
|
30
|
+
private _date;
|
|
31
|
+
/**
|
|
32
|
+
* Add time to the date (mutates and returns this date)
|
|
33
|
+
* @param {number} amount
|
|
34
|
+
* @param {DateUnit} unit
|
|
35
|
+
* @returns {this}
|
|
36
|
+
*/
|
|
37
|
+
add(amount: number, unit: DateUnit): this;
|
|
38
|
+
/**
|
|
39
|
+
* Subtract time from the date (mutates and returns this date)
|
|
40
|
+
* @param {number} amount
|
|
41
|
+
* @param {DateUnit} unit
|
|
42
|
+
* @returns {this}
|
|
43
|
+
*/
|
|
44
|
+
subtract(amount: number, unit: DateUnit): this;
|
|
45
|
+
/**
|
|
46
|
+
* Set to the start of a unit of time (weeks start on Sunday)
|
|
47
|
+
* @param {DateUnit} unit
|
|
48
|
+
* @returns {this}
|
|
49
|
+
*/
|
|
50
|
+
startOf(unit: DateUnit): this;
|
|
51
|
+
/**
|
|
52
|
+
* Set to the end of a unit of time
|
|
53
|
+
* @param {DateUnit} unit
|
|
54
|
+
* @returns {this}
|
|
55
|
+
*/
|
|
56
|
+
endOf(unit: DateUnit): this;
|
|
57
|
+
/**
|
|
58
|
+
* Set a unit of time (`month` is 0-11; `day` and `date` both set the day of the month)
|
|
59
|
+
* @param {DateUnit} unit
|
|
60
|
+
* @param {number} value
|
|
61
|
+
* @returns {this}
|
|
62
|
+
*/
|
|
63
|
+
set(unit: DateUnit, value: number): this;
|
|
64
|
+
/**
|
|
65
|
+
* @overload
|
|
66
|
+
* @returns {Date} The underlying Date (not a copy)
|
|
67
|
+
*/
|
|
68
|
+
get(): Date;
|
|
69
|
+
/**
|
|
70
|
+
* @overload
|
|
71
|
+
* @param {Exclude<DateUnit, 'week'|'weeks'>} unit
|
|
72
|
+
* @returns {number} The unit's value (`day` is the day of the week, `date` the day of the month)
|
|
73
|
+
*/
|
|
74
|
+
get(unit: Exclude<DateUnit, "week" | "weeks">): number;
|
|
75
|
+
/**
|
|
76
|
+
* Get the year
|
|
77
|
+
* @returns {number}
|
|
78
|
+
*/
|
|
79
|
+
year(): number;
|
|
80
|
+
/**
|
|
81
|
+
* Get the month (0-11)
|
|
82
|
+
* @returns {number}
|
|
83
|
+
*/
|
|
84
|
+
month(): number;
|
|
85
|
+
/**
|
|
86
|
+
* Get the date of month (1-31)
|
|
87
|
+
* @returns {number}
|
|
88
|
+
*/
|
|
89
|
+
date(): number;
|
|
90
|
+
/**
|
|
91
|
+
* Get the day of week (0-6, Sunday=0)
|
|
92
|
+
* @returns {number}
|
|
93
|
+
*/
|
|
94
|
+
day(): number;
|
|
95
|
+
/**
|
|
96
|
+
* Get the hour (0-23)
|
|
97
|
+
* @returns {number}
|
|
98
|
+
*/
|
|
99
|
+
hour(): number;
|
|
100
|
+
/**
|
|
101
|
+
* Get the minute (0-59)
|
|
102
|
+
* @returns {number}
|
|
103
|
+
*/
|
|
104
|
+
minute(): number;
|
|
105
|
+
/**
|
|
106
|
+
* Get the second (0-59)
|
|
107
|
+
* @returns {number}
|
|
108
|
+
*/
|
|
109
|
+
second(): number;
|
|
110
|
+
/**
|
|
111
|
+
* Get the millisecond (0-999)
|
|
112
|
+
* @returns {number}
|
|
113
|
+
*/
|
|
114
|
+
millisecond(): number;
|
|
115
|
+
/**
|
|
116
|
+
* Get the day of year (1-366)
|
|
117
|
+
* @returns {number}
|
|
118
|
+
*/
|
|
119
|
+
dayOfYear(): number;
|
|
120
|
+
/**
|
|
121
|
+
* Get the week of year
|
|
122
|
+
* @returns {number}
|
|
123
|
+
*/
|
|
124
|
+
week(): number;
|
|
125
|
+
/**
|
|
126
|
+
* Get the quarter (1-4)
|
|
127
|
+
* @returns {number}
|
|
128
|
+
*/
|
|
129
|
+
quarter(): number;
|
|
130
|
+
/**
|
|
131
|
+
* Get Unix timestamp (seconds)
|
|
132
|
+
* @returns {number}
|
|
133
|
+
*/
|
|
134
|
+
unix(): number;
|
|
135
|
+
/**
|
|
136
|
+
* Get milliseconds since epoch
|
|
137
|
+
* @returns {number}
|
|
138
|
+
*/
|
|
139
|
+
valueOf(): number;
|
|
140
|
+
/**
|
|
141
|
+
* Format the date using tokens (see `D.tokens`)
|
|
142
|
+
* @param {string} [formatStr='YYYY-MM-DD HH:mm:ss']
|
|
143
|
+
* @returns {string}
|
|
144
|
+
*/
|
|
145
|
+
format(formatStr?: string): string;
|
|
146
|
+
/**
|
|
147
|
+
* Get ISO 8601 string
|
|
148
|
+
* @returns {string}
|
|
149
|
+
*/
|
|
150
|
+
toISOString(): string;
|
|
151
|
+
/**
|
|
152
|
+
* Get a copy of the native Date
|
|
153
|
+
* @returns {Date}
|
|
154
|
+
*/
|
|
155
|
+
toDate(): Date;
|
|
156
|
+
/**
|
|
157
|
+
* Get string representation
|
|
158
|
+
* @returns {string}
|
|
159
|
+
*/
|
|
160
|
+
toString(): string;
|
|
161
|
+
/**
|
|
162
|
+
* Relative time from now (or from `relativeTo`), e.g. `3 days ago`, `in 2 hours`, `just now`
|
|
163
|
+
* @param {DateInput} [relativeTo]
|
|
164
|
+
* @returns {string}
|
|
165
|
+
*/
|
|
166
|
+
fromNow(relativeTo?: DateInput): string;
|
|
167
|
+
/**
|
|
168
|
+
* Relative time from this date to another
|
|
169
|
+
* @param {DateInput} date
|
|
170
|
+
* @returns {string}
|
|
171
|
+
*/
|
|
172
|
+
to(date: DateInput): string;
|
|
173
|
+
/**
|
|
174
|
+
* Check if date is before another (at the granularity of `unit` when given)
|
|
175
|
+
* @param {DateInput} other
|
|
176
|
+
* @param {DateUnit} [unit]
|
|
177
|
+
* @returns {boolean}
|
|
178
|
+
*/
|
|
179
|
+
isBefore(other: DateInput, unit?: DateUnit): boolean;
|
|
180
|
+
/**
|
|
181
|
+
* Check if date is after another (at the granularity of `unit` when given)
|
|
182
|
+
* @param {DateInput} other
|
|
183
|
+
* @param {DateUnit} [unit]
|
|
184
|
+
* @returns {boolean}
|
|
185
|
+
*/
|
|
186
|
+
isAfter(other: DateInput, unit?: DateUnit): boolean;
|
|
187
|
+
/**
|
|
188
|
+
* Check if date is the same as another (within the same `unit` when given)
|
|
189
|
+
* @param {DateInput} other
|
|
190
|
+
* @param {DateUnit} [unit]
|
|
191
|
+
* @returns {boolean}
|
|
192
|
+
*/
|
|
193
|
+
isSame(other: DateInput, unit?: DateUnit): boolean;
|
|
194
|
+
/**
|
|
195
|
+
* Check if date is between two dates
|
|
196
|
+
* @param {DateInput} start
|
|
197
|
+
* @param {DateInput} end
|
|
198
|
+
* @param {DateUnit|null} [unit]
|
|
199
|
+
* @param {Inclusivity} [inclusivity='()']
|
|
200
|
+
* @returns {boolean}
|
|
201
|
+
*/
|
|
202
|
+
isBetween(start: DateInput, end: DateInput, unit?: DateUnit | null, inclusivity?: Inclusivity): boolean;
|
|
203
|
+
/**
|
|
204
|
+
* Difference between this date and another (positive when this one is later), floored unless `precise`
|
|
205
|
+
* @param {DateInput} other
|
|
206
|
+
* @param {DiffUnit} [unit='milliseconds']
|
|
207
|
+
* @param {boolean} [precise=false]
|
|
208
|
+
* @returns {number}
|
|
209
|
+
*/
|
|
210
|
+
diff(other: DateInput, unit?: DiffUnit, precise?: boolean): number;
|
|
211
|
+
/**
|
|
212
|
+
* @param {DommaDate} other
|
|
213
|
+
* @returns {number}
|
|
214
|
+
* @private
|
|
215
|
+
*/
|
|
216
|
+
private _monthDiff;
|
|
217
|
+
/**
|
|
218
|
+
* Check if date is valid
|
|
219
|
+
* @returns {boolean}
|
|
220
|
+
*/
|
|
221
|
+
isValid(): boolean;
|
|
222
|
+
/**
|
|
223
|
+
* Check if year is a leap year
|
|
224
|
+
* @returns {boolean}
|
|
225
|
+
*/
|
|
226
|
+
isLeapYear(): boolean;
|
|
227
|
+
/**
|
|
228
|
+
* Get number of days in month
|
|
229
|
+
* @returns {number}
|
|
230
|
+
*/
|
|
231
|
+
daysInMonth(): number;
|
|
232
|
+
/**
|
|
233
|
+
* Create a copy of this date
|
|
234
|
+
* @returns {DommaDate}
|
|
235
|
+
*/
|
|
236
|
+
clone(): DommaDate;
|
|
237
|
+
/**
|
|
238
|
+
* @param {string} unit
|
|
239
|
+
* @returns {string}
|
|
240
|
+
* @private
|
|
241
|
+
*/
|
|
242
|
+
private _normalizeUnit;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Anything a date can be made from. `null`/`undefined` mean now.
|
|
246
|
+
*/
|
|
247
|
+
export type DateInput = Date | string | number | DommaDate | null | undefined;
|
|
248
|
+
/**
|
|
249
|
+
* A unit of time - singular or plural, any case. `date` is the day of the month; `day` is the
|
|
250
|
+
* day of the week for `get()` and a calendar day elsewhere.
|
|
251
|
+
*/
|
|
252
|
+
export type DateUnit = "year" | "years" | "month" | "months" | "week" | "weeks" | "day" | "days" | "date" | "hour" | "hours" | "minute" | "minutes" | "second" | "seconds" | "millisecond" | "milliseconds";
|
|
253
|
+
/**
|
|
254
|
+
* A unit for `diff()` - singular or plural.
|
|
255
|
+
*/
|
|
256
|
+
export type DiffUnit = "milliseconds" | "seconds" | "minutes" | "hours" | "days" | "weeks" | "months" | "years" | "millisecond" | "second" | "minute" | "hour" | "day" | "week" | "month" | "year";
|
|
257
|
+
/**
|
|
258
|
+
* Bounds for `isBetween()`: `(` / `)` exclusive, `[` / `]` inclusive.
|
|
259
|
+
*/
|
|
260
|
+
export type Inclusivity = "()" | "[]" | "[)" | "(]";
|
|
261
|
+
/**
|
|
262
|
+
* Descriptions of the `format()` tokens, keyed by token.
|
|
263
|
+
*/
|
|
264
|
+
export type FormatTokens = {
|
|
265
|
+
YYYY: string;
|
|
266
|
+
YY: string;
|
|
267
|
+
MM: string;
|
|
268
|
+
M: string;
|
|
269
|
+
DD: string;
|
|
270
|
+
D: string;
|
|
271
|
+
HH: string;
|
|
272
|
+
H: string;
|
|
273
|
+
hh: string;
|
|
274
|
+
h: string;
|
|
275
|
+
mm: string;
|
|
276
|
+
m: string;
|
|
277
|
+
ss: string;
|
|
278
|
+
s: string;
|
|
279
|
+
SSS: string;
|
|
280
|
+
A: string;
|
|
281
|
+
a: string;
|
|
282
|
+
ddd: string;
|
|
283
|
+
dddd: string;
|
|
284
|
+
MMM: string;
|
|
285
|
+
MMMM: string;
|
|
286
|
+
};
|
|
287
|
+
/**
|
|
288
|
+
* The statics on the date factory.
|
|
289
|
+
*/
|
|
290
|
+
export type DatesStatics = {
|
|
291
|
+
/**
|
|
292
|
+
* Get current timestamp in milliseconds
|
|
293
|
+
*/
|
|
294
|
+
now: () => number;
|
|
295
|
+
/**
|
|
296
|
+
* Parse a date string, optionally with a
|
|
297
|
+
* format of YYYY YY MM M DD D HH H mm m ss s tokens; an unmatched string gives an invalid date
|
|
298
|
+
*/
|
|
299
|
+
parse: (dateString: string, format?: string) => DommaDate;
|
|
300
|
+
/**
|
|
301
|
+
* Check if a value is a valid date
|
|
302
|
+
*/
|
|
303
|
+
isValid: (value: DateInput) => boolean;
|
|
304
|
+
/**
|
|
305
|
+
* The earliest of the dates (arrays are flattened)
|
|
306
|
+
*/
|
|
307
|
+
min: (...dates: Array<DateInput | DateInput[]>) => DommaDate;
|
|
308
|
+
/**
|
|
309
|
+
* The latest of the dates (arrays are flattened)
|
|
310
|
+
*/
|
|
311
|
+
max: (...dates: Array<DateInput | DateInput[]>) => DommaDate;
|
|
312
|
+
/**
|
|
313
|
+
* Format tokens reference
|
|
314
|
+
*/
|
|
315
|
+
tokens: FormatTokens;
|
|
316
|
+
};
|
|
317
|
+
/**
|
|
318
|
+
* The date factory (`D`): `D(value?)` wraps a date in a chainable {@link DommaDate};
|
|
319
|
+
* the statics (`D.now()`, `D.parse()`, ...) do the rest.
|
|
320
|
+
*/
|
|
321
|
+
export type Dates = ((value?: DateInput) => DommaDate) & DatesStatics;
|
|
322
|
+
/**
|
|
323
|
+
* Descriptions of the `format()` tokens, keyed by token.
|
|
324
|
+
* @typedef {object} FormatTokens
|
|
325
|
+
* @property {string} YYYY
|
|
326
|
+
* @property {string} YY
|
|
327
|
+
* @property {string} MM
|
|
328
|
+
* @property {string} M
|
|
329
|
+
* @property {string} DD
|
|
330
|
+
* @property {string} D
|
|
331
|
+
* @property {string} HH
|
|
332
|
+
* @property {string} H
|
|
333
|
+
* @property {string} hh
|
|
334
|
+
* @property {string} h
|
|
335
|
+
* @property {string} mm
|
|
336
|
+
* @property {string} m
|
|
337
|
+
* @property {string} ss
|
|
338
|
+
* @property {string} s
|
|
339
|
+
* @property {string} SSS
|
|
340
|
+
* @property {string} A
|
|
341
|
+
* @property {string} a
|
|
342
|
+
* @property {string} ddd
|
|
343
|
+
* @property {string} dddd
|
|
344
|
+
* @property {string} MMM
|
|
345
|
+
* @property {string} MMMM
|
|
346
|
+
*/
|
|
347
|
+
/**
|
|
348
|
+
* The statics on the date factory.
|
|
349
|
+
* @typedef {object} DatesStatics
|
|
350
|
+
* @property {() => number} now Get current timestamp in milliseconds
|
|
351
|
+
* @property {(dateString: string, format?: string) => DommaDate} parse Parse a date string, optionally with a
|
|
352
|
+
* format of YYYY YY MM M DD D HH H mm m ss s tokens; an unmatched string gives an invalid date
|
|
353
|
+
* @property {(value: DateInput) => boolean} isValid Check if a value is a valid date
|
|
354
|
+
* @property {(...dates: Array<DateInput|DateInput[]>) => DommaDate} min The earliest of the dates (arrays are flattened)
|
|
355
|
+
* @property {(...dates: Array<DateInput|DateInput[]>) => DommaDate} max The latest of the dates (arrays are flattened)
|
|
356
|
+
* @property {FormatTokens} tokens Format tokens reference
|
|
357
|
+
*/
|
|
358
|
+
/**
|
|
359
|
+
* The date factory (`D`): `D(value?)` wraps a date in a chainable {@link DommaDate};
|
|
360
|
+
* the statics (`D.now()`, `D.parse()`, ...) do the rest.
|
|
361
|
+
* @typedef {((value?: DateInput) => DommaDate) & DatesStatics} Dates
|
|
362
|
+
*/
|
|
363
|
+
/**
|
|
364
|
+
* Main date factory function
|
|
365
|
+
* @type {Dates}
|
|
366
|
+
*/
|
|
367
|
+
export const dates: Dates;
|