@atlantjs/arch 13.3.0 → 14.0.1
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/@tool-box/utils/datatypes/boolean-utils.d.ts +7 -0
- package/@tool-box/utils/datatypes/boolean-utils.js +146 -4
- package/@tool-box/utils/datatypes/string-utils.d.ts +32 -4
- package/@tool-box/utils/datatypes/string-utils.js +303 -14
- package/@tool-box/utils/ducts/common.d.ts +49 -0
- package/@tool-box/utils/ducts/common.js +36 -3
- package/@tool-box/utils/ducts/optional-type.d.ts +85 -0
- package/@tool-box/utils/ducts/optional-type.js +79 -0
- package/@tool-box/utils/ducts/return-type.d.ts +17 -17
- package/@tool-box/utils/ducts/return-type.js +14 -4
- package/@tool-box/utils/http-provider/http-provider.d.ts +6 -0
- package/@tool-box/utils/http-provider/http-provider.js +43 -14
- package/@tool-box/utils/map/map.abstract.d.ts +39 -0
- package/@tool-box/utils/map/map.abstract.js +70 -6
- package/@tool-box/utils/random/random.d.ts +168 -0
- package/@tool-box/utils/random/random.js +235 -0
- package/@tool-box/utils/type-guard/guardian.d.ts +450 -7
- package/@tool-box/utils/type-guard/guardian.js +539 -35
- package/objects/@common/edges/cron-expression.edge.d.ts +30 -2
- package/objects/@common/edges/cron-expression.edge.js +77 -5
- package/objects/@common/edges/email.edge.d.ts +39 -1
- package/objects/@common/edges/email.edge.js +80 -2
- package/objects/@common/edges/ulid.sketch.edge.d.ts +48 -1
- package/objects/@common/edges/ulid.sketch.edge.js +75 -4
- package/objects/@common/edges/url.edge.d.ts +182 -0
- package/objects/@common/edges/url.edge.js +249 -0
- package/objects/@common/edges/username.edge.d.ts +9 -0
- package/objects/@common/edges/username.edge.js +34 -0
- package/objects/@common/edges/uuid.sketch.edge.d.ts +97 -1
- package/objects/@common/edges/uuid.sketch.edge.js +127 -6
- package/objects/amount/amount-value.edge.d.ts +39 -0
- package/objects/amount/amount-value.edge.js +69 -0
- package/objects/amount/amount.edge.d.ts +378 -2
- package/objects/amount/amount.edge.js +493 -4
- package/objects/datetime/edges/datetime.edge.d.ts +422 -4
- package/objects/datetime/edges/datetime.edge.js +538 -33
- package/objects/password/password.edge.d.ts +90 -0
- package/objects/password/password.edge.js +140 -6
- package/objects/primitives/boolean.edge.sketch.d.ts +105 -3
- package/objects/primitives/boolean.edge.sketch.js +132 -6
- package/objects/primitives/number.edge.sketch.d.ts +236 -0
- package/objects/primitives/number.edge.sketch.js +310 -24
- package/objects/primitives/string.edge.sketch.d.ts +148 -0
- package/objects/primitives/string.edge.sketch.js +191 -7
- package/objects/schedule/schedule.edge.d.ts +194 -0
- package/objects/schedule/schedule.edge.js +269 -2
- package/objects/time/time.edge.d.ts +285 -2
- package/objects/time/time.edge.js +385 -6
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -5,23 +5,441 @@ export declare class DatetimeEdge {
|
|
|
5
5
|
private readonly value?;
|
|
6
6
|
protected readonly date: Moment;
|
|
7
7
|
constructor(value?: (Date | string) | undefined);
|
|
8
|
+
/**
|
|
9
|
+
* Verifica se esta data é posterior a outra.
|
|
10
|
+
* @param other - Data para comparação
|
|
11
|
+
* @returns true se this > other, false caso contrário
|
|
12
|
+
* @example
|
|
13
|
+
* new DatetimeEdge(new Date("2026-12-01")).isAfter(new DatetimeEdge(new Date("2026-01-01"))) // true
|
|
14
|
+
*/
|
|
8
15
|
isAfter(other: DatetimeEdge): boolean;
|
|
9
|
-
|
|
10
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Verifica se esta data é anterior a outra.
|
|
18
|
+
* @param other - Data para comparação
|
|
19
|
+
* @returns true se this < other, false caso contrário
|
|
20
|
+
* @example
|
|
21
|
+
* new DatetimeEdge(new Date("2026-01-01")).isBefore(new DatetimeEdge(new Date("2026-12-01"))) // true
|
|
22
|
+
*/
|
|
11
23
|
isBefore(other: DatetimeEdge): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Verifica se esta data é igual a outra.
|
|
26
|
+
* @param other - Data para comparação
|
|
27
|
+
* @returns true se as datas são iguais, false caso contrário
|
|
28
|
+
* @example
|
|
29
|
+
* new DatetimeEdge(new Date("2026-01-01")).isEquals(new DatetimeEdge(new Date("2026-01-01"))) // true
|
|
30
|
+
*/
|
|
31
|
+
isEquals(other: DatetimeEdge): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Verifica se esta data está entre duas outras datas (exclusivo).
|
|
34
|
+
* @param initialDate - Data inicial do intervalo
|
|
35
|
+
* @param finalDate - Data final do intervalo
|
|
36
|
+
* @returns true se this está entre initialDate e finalDate, false caso contrário
|
|
37
|
+
* @example
|
|
38
|
+
* new DatetimeEdge(new Date("2026-06-15")).isBetween(
|
|
39
|
+
* new DatetimeEdge(new Date("2026-01-01")),
|
|
40
|
+
* new DatetimeEdge(new Date("2026-12-31"))
|
|
41
|
+
* ) // true
|
|
42
|
+
*/
|
|
12
43
|
isBetween(initialDate: DatetimeEdge, finalDate: DatetimeEdge): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Verifica se a data cai em um fim de semana (sábado ou domingo).
|
|
46
|
+
* @returns true se a data é sábado ou domingo, false caso contrário
|
|
47
|
+
* @example
|
|
48
|
+
* new DatetimeEdge(new Date("2026-03-14")).isWeekend() // true (sábado)
|
|
49
|
+
* new DatetimeEdge(new Date("2026-03-12")).isWeekend() // false (quinta-feira)
|
|
50
|
+
*/
|
|
13
51
|
isWeekend(): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Verifica se a data é um feriado no Brasil.
|
|
54
|
+
* @returns true se a data é um feriado nacional, false caso contrário
|
|
55
|
+
* @example
|
|
56
|
+
* new DatetimeEdge(new Date("2026-12-25")).isHoliday() // true (Natal)
|
|
57
|
+
* new DatetimeEdge(new Date("2026-03-12")).isHoliday() // false
|
|
58
|
+
*/
|
|
14
59
|
isHoliday(): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Verifica se a data é um dia útil (não é fim de semana nem feriado).
|
|
62
|
+
* @returns true se a data é um dia útil, false caso contrário
|
|
63
|
+
* @example
|
|
64
|
+
* new DatetimeEdge(new Date("2026-03-12")).isBusinessDay() // true (quinta-feira)
|
|
65
|
+
* new DatetimeEdge(new Date("2026-12-25")).isBusinessDay() // false (Natal)
|
|
66
|
+
*/
|
|
15
67
|
isBusinessDay(): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Verifica se a data corresponde ao dia de hoje.
|
|
70
|
+
* @returns true se a data é hoje, false caso contrário
|
|
71
|
+
* @example
|
|
72
|
+
* new DatetimeEdge(new Date()).isToday() // true
|
|
73
|
+
* new DatetimeEdge(new Date("2020-01-01")).isToday() // false
|
|
74
|
+
*/
|
|
75
|
+
isToday(): boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Verifica se a data corresponde a ontem.
|
|
78
|
+
* @returns true se a data é ontem, false caso contrário
|
|
79
|
+
* @example
|
|
80
|
+
* new DatetimeEdge(new Date()).isYesterday() // false
|
|
81
|
+
*/
|
|
82
|
+
isYesterday(): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Verifica se a data corresponde a amanhã.
|
|
85
|
+
* @returns true se a data é amanhã, false caso contrário
|
|
86
|
+
* @example
|
|
87
|
+
* new DatetimeEdge(new Date()).isTomorrow() // false
|
|
88
|
+
*/
|
|
89
|
+
isTomorrow(): boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Verifica se a data está no mesmo dia que outra.
|
|
92
|
+
* @param other - Data para comparação
|
|
93
|
+
* @returns true se ambas as datas estão no mesmo dia, false caso contrário
|
|
94
|
+
* @example
|
|
95
|
+
* const a = new DatetimeEdge(new Date("2026-03-12T08:00"));
|
|
96
|
+
* const b = new DatetimeEdge(new Date("2026-03-12T22:00"));
|
|
97
|
+
* a.isSameDay(b) // true
|
|
98
|
+
*/
|
|
99
|
+
isSameDay(other: DatetimeEdge): boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Verifica se a data está no mesmo mês que outra.
|
|
102
|
+
* @param other - Data para comparação
|
|
103
|
+
* @returns true se ambas as datas estão no mesmo mês e ano, false caso contrário
|
|
104
|
+
* @example
|
|
105
|
+
* const a = new DatetimeEdge(new Date("2026-03-01"));
|
|
106
|
+
* const b = new DatetimeEdge(new Date("2026-03-31"));
|
|
107
|
+
* a.isSameMonth(b) // true
|
|
108
|
+
*/
|
|
109
|
+
isSameMonth(other: DatetimeEdge): boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Verifica se a data está no mesmo ano que outra.
|
|
112
|
+
* @param other - Data para comparação
|
|
113
|
+
* @returns true se ambas as datas estão no mesmo ano, false caso contrário
|
|
114
|
+
* @example
|
|
115
|
+
* const a = new DatetimeEdge(new Date("2026-01-01"));
|
|
116
|
+
* const b = new DatetimeEdge(new Date("2026-12-31"));
|
|
117
|
+
* a.isSameYear(b) // true
|
|
118
|
+
*/
|
|
119
|
+
isSameYear(other: DatetimeEdge): boolean;
|
|
120
|
+
/**
|
|
121
|
+
* Retorna o dia da semana da data.
|
|
122
|
+
* @returns Enum WeekDayEnum representando o dia da semana
|
|
123
|
+
* @example
|
|
124
|
+
* new DatetimeEdge(new Date("2026-03-12")).getDayOfWeek() // WeekDayEnum.thursday
|
|
125
|
+
*/
|
|
16
126
|
getDayOfWeek(): WeekDayEnum;
|
|
127
|
+
/**
|
|
128
|
+
* Retorna o nome do mês da data.
|
|
129
|
+
* @returns Enum MonthNameEnum representando o mês
|
|
130
|
+
* @example
|
|
131
|
+
* new DatetimeEdge(new Date("2026-03-12")).getNameOfMonth() // MonthNameEnum.march
|
|
132
|
+
*/
|
|
17
133
|
getNameOfMonth(): MonthNameEnum;
|
|
134
|
+
/**
|
|
135
|
+
* Retorna o número do dia no mês.
|
|
136
|
+
* @returns Número do dia (1-31)
|
|
137
|
+
* @example
|
|
138
|
+
* new DatetimeEdge(new Date("2026-03-12")).getDayOfMonth() // 12
|
|
139
|
+
*/
|
|
18
140
|
getDayOfMonth(): number;
|
|
141
|
+
/**
|
|
142
|
+
* Retorna o número do mês (base 0).
|
|
143
|
+
* @returns Número do mês (0=janeiro, 11=dezembro)
|
|
144
|
+
* @example
|
|
145
|
+
* new DatetimeEdge(new Date("2026-03-12")).getNumberOfMonth() // 2
|
|
146
|
+
*/
|
|
19
147
|
getNumberOfMonth(): number;
|
|
148
|
+
/**
|
|
149
|
+
* Retorna o ano da data.
|
|
150
|
+
* @returns Número do ano
|
|
151
|
+
* @example
|
|
152
|
+
* new DatetimeEdge(new Date("2026-03-12")).getYear() // 2026
|
|
153
|
+
*/
|
|
20
154
|
getYear(): number;
|
|
155
|
+
/**
|
|
156
|
+
* Retorna as horas da data.
|
|
157
|
+
* @returns Número da hora (0-23)
|
|
158
|
+
* @example
|
|
159
|
+
* new DatetimeEdge(new Date("2026-03-12T14:30:00")).getHours() // 14
|
|
160
|
+
*/
|
|
161
|
+
getHours(): number;
|
|
162
|
+
/**
|
|
163
|
+
* Retorna os minutos da data.
|
|
164
|
+
* @returns Número dos minutos (0-59)
|
|
165
|
+
* @example
|
|
166
|
+
* new DatetimeEdge(new Date("2026-03-12T14:30:00")).getMinutes() // 30
|
|
167
|
+
*/
|
|
168
|
+
getMinutes(): number;
|
|
169
|
+
/**
|
|
170
|
+
* Retorna os segundos da data.
|
|
171
|
+
* @returns Número dos segundos (0-59)
|
|
172
|
+
* @example
|
|
173
|
+
* new DatetimeEdge(new Date("2026-03-12T14:30:45")).getSeconds() // 45
|
|
174
|
+
*/
|
|
175
|
+
getSeconds(): number;
|
|
176
|
+
/**
|
|
177
|
+
* Adiciona dias à data e retorna uma nova instância.
|
|
178
|
+
* @param days - Número de dias a adicionar
|
|
179
|
+
* @returns Nova instância com a data atualizada
|
|
180
|
+
* @example
|
|
181
|
+
* new DatetimeEdge(new Date("2026-03-12")).addDays(5) // DatetimeEdge("2026-03-17")
|
|
182
|
+
*/
|
|
183
|
+
addDays(days: number): DatetimeEdge;
|
|
184
|
+
/**
|
|
185
|
+
* Subtrai dias da data e retorna uma nova instância.
|
|
186
|
+
* @param days - Número de dias a subtrair
|
|
187
|
+
* @returns Nova instância com a data atualizada
|
|
188
|
+
* @example
|
|
189
|
+
* new DatetimeEdge(new Date("2026-03-12")).subtractDays(5) // DatetimeEdge("2026-03-07")
|
|
190
|
+
*/
|
|
191
|
+
subtractDays(days: number): DatetimeEdge;
|
|
192
|
+
/**
|
|
193
|
+
* Adiciona meses à data e retorna uma nova instância.
|
|
194
|
+
* @param months - Número de meses a adicionar
|
|
195
|
+
* @returns Nova instância com a data atualizada
|
|
196
|
+
* @example
|
|
197
|
+
* new DatetimeEdge(new Date("2026-03-12")).addMonths(2) // DatetimeEdge("2026-05-12")
|
|
198
|
+
*/
|
|
199
|
+
addMonths(months: number): DatetimeEdge;
|
|
200
|
+
/**
|
|
201
|
+
* Subtrai meses da data e retorna uma nova instância.
|
|
202
|
+
* @param months - Número de meses a subtrair
|
|
203
|
+
* @returns Nova instância com a data atualizada
|
|
204
|
+
* @example
|
|
205
|
+
* new DatetimeEdge(new Date("2026-03-12")).subtractMonths(2) // DatetimeEdge("2026-01-12")
|
|
206
|
+
*/
|
|
207
|
+
subtractMonths(months: number): DatetimeEdge;
|
|
208
|
+
/**
|
|
209
|
+
* Adiciona anos à data e retorna uma nova instância.
|
|
210
|
+
* @param years - Número de anos a adicionar
|
|
211
|
+
* @returns Nova instância com a data atualizada
|
|
212
|
+
* @example
|
|
213
|
+
* new DatetimeEdge(new Date("2026-03-12")).addYears(1) // DatetimeEdge("2027-03-12")
|
|
214
|
+
*/
|
|
215
|
+
addYears(years: number): DatetimeEdge;
|
|
216
|
+
/**
|
|
217
|
+
* Subtrai anos da data e retorna uma nova instância.
|
|
218
|
+
* @param years - Número de anos a subtrair
|
|
219
|
+
* @returns Nova instância com a data atualizada
|
|
220
|
+
* @example
|
|
221
|
+
* new DatetimeEdge(new Date("2026-03-12")).subtractYears(1) // DatetimeEdge("2025-03-12")
|
|
222
|
+
*/
|
|
223
|
+
subtractYears(years: number): DatetimeEdge;
|
|
224
|
+
/**
|
|
225
|
+
* Adiciona horas à data e retorna uma nova instância.
|
|
226
|
+
* @param hours - Número de horas a adicionar
|
|
227
|
+
* @returns Nova instância com a data atualizada
|
|
228
|
+
* @example
|
|
229
|
+
* new DatetimeEdge(new Date("2026-03-12T08:00")).addHours(3) // DatetimeEdge("2026-03-12T11:00")
|
|
230
|
+
*/
|
|
231
|
+
addHours(hours: number): DatetimeEdge;
|
|
232
|
+
/**
|
|
233
|
+
* Adiciona minutos à data e retorna uma nova instância.
|
|
234
|
+
* @param minutes - Número de minutos a adicionar
|
|
235
|
+
* @returns Nova instância com a data atualizada
|
|
236
|
+
* @example
|
|
237
|
+
* new DatetimeEdge(new Date("2026-03-12T08:00")).addMinutes(30) // DatetimeEdge("2026-03-12T08:30")
|
|
238
|
+
*/
|
|
239
|
+
addMinutes(minutes: number): DatetimeEdge;
|
|
240
|
+
/**
|
|
241
|
+
* Calcula a diferença em dias entre esta data e outra.
|
|
242
|
+
* @param other - Data para calcular a diferença
|
|
243
|
+
* @returns Número de dias de diferença (positivo se this > other)
|
|
244
|
+
* @example
|
|
245
|
+
* new DatetimeEdge(new Date("2026-03-15")).diffInDays(new DatetimeEdge(new Date("2026-03-10"))) // 5
|
|
246
|
+
*/
|
|
247
|
+
diffInDays(other: DatetimeEdge): number;
|
|
248
|
+
/**
|
|
249
|
+
* Calcula a diferença em meses entre esta data e outra.
|
|
250
|
+
* @param other - Data para calcular a diferença
|
|
251
|
+
* @returns Número de meses de diferença (positivo se this > other)
|
|
252
|
+
* @example
|
|
253
|
+
* new DatetimeEdge(new Date("2026-05-12")).diffInMonths(new DatetimeEdge(new Date("2026-03-12"))) // 2
|
|
254
|
+
*/
|
|
255
|
+
diffInMonths(other: DatetimeEdge): number;
|
|
256
|
+
/**
|
|
257
|
+
* Calcula a diferença em anos entre esta data e outra.
|
|
258
|
+
* @param other - Data para calcular a diferença
|
|
259
|
+
* @returns Número de anos de diferença (positivo se this > other)
|
|
260
|
+
* @example
|
|
261
|
+
* new DatetimeEdge(new Date("2028-03-12")).diffInYears(new DatetimeEdge(new Date("2026-03-12"))) // 2
|
|
262
|
+
*/
|
|
263
|
+
diffInYears(other: DatetimeEdge): number;
|
|
264
|
+
/**
|
|
265
|
+
* Calcula a diferença em horas entre esta data e outra.
|
|
266
|
+
* @param other - Data para calcular a diferença
|
|
267
|
+
* @returns Número de horas de diferença (positivo se this > other)
|
|
268
|
+
* @example
|
|
269
|
+
* new DatetimeEdge(new Date("2026-03-12T14:00")).diffInHours(new DatetimeEdge(new Date("2026-03-12T08:00"))) // 6
|
|
270
|
+
*/
|
|
271
|
+
diffInHours(other: DatetimeEdge): number;
|
|
272
|
+
/**
|
|
273
|
+
* Calcula a diferença em minutos entre esta data e outra.
|
|
274
|
+
* @param other - Data para calcular a diferença
|
|
275
|
+
* @returns Número de minutos de diferença (positivo se this > other)
|
|
276
|
+
* @example
|
|
277
|
+
* new DatetimeEdge(new Date("2026-03-12T08:45")).diffInMinutes(new DatetimeEdge(new Date("2026-03-12T08:00"))) // 45
|
|
278
|
+
*/
|
|
279
|
+
diffInMinutes(other: DatetimeEdge): number;
|
|
280
|
+
/**
|
|
281
|
+
* Retorna a diferença legível entre esta data e o momento atual.
|
|
282
|
+
* @returns String descritiva como "Há 3 dias.", "Há 2 horas.", etc.
|
|
283
|
+
* @example
|
|
284
|
+
* new DatetimeEdge(new Date("2025-03-12")).diffFromNow() // "Há 1 ano."
|
|
285
|
+
*/
|
|
286
|
+
diffFromNow(): string;
|
|
287
|
+
/**
|
|
288
|
+
* Retorna o início do dia (00:00:00.000) como nova instância.
|
|
289
|
+
* @returns Nova instância com o horário zerado para o início do dia
|
|
290
|
+
* @example
|
|
291
|
+
* new DatetimeEdge(new Date("2026-03-12T14:30")).startOfDay()
|
|
292
|
+
* // DatetimeEdge("2026-03-12T00:00:00.000")
|
|
293
|
+
*/
|
|
294
|
+
startOfDay(): DatetimeEdge;
|
|
295
|
+
/**
|
|
296
|
+
* Retorna o fim do dia (23:59:59.999) como nova instância.
|
|
297
|
+
* @returns Nova instância com o horário ajustado para o fim do dia
|
|
298
|
+
* @example
|
|
299
|
+
* new DatetimeEdge(new Date("2026-03-12T08:00")).endOfDay()
|
|
300
|
+
* // DatetimeEdge("2026-03-12T23:59:59.999")
|
|
301
|
+
*/
|
|
302
|
+
endOfDay(): DatetimeEdge;
|
|
303
|
+
/**
|
|
304
|
+
* Retorna o início do mês como nova instância.
|
|
305
|
+
* @returns Nova instância apontando para o primeiro dia do mês à meia-noite
|
|
306
|
+
* @example
|
|
307
|
+
* new DatetimeEdge(new Date("2026-03-12")).startOfMonth()
|
|
308
|
+
* // DatetimeEdge("2026-03-01T00:00:00.000")
|
|
309
|
+
*/
|
|
310
|
+
startOfMonth(): DatetimeEdge;
|
|
311
|
+
/**
|
|
312
|
+
* Retorna o fim do mês como nova instância.
|
|
313
|
+
* @returns Nova instância apontando para o último dia do mês ao fim do dia
|
|
314
|
+
* @example
|
|
315
|
+
* new DatetimeEdge(new Date("2026-03-12")).endOfMonth()
|
|
316
|
+
* // DatetimeEdge("2026-03-31T23:59:59.999")
|
|
317
|
+
*/
|
|
318
|
+
endOfMonth(): DatetimeEdge;
|
|
319
|
+
/**
|
|
320
|
+
* Retorna o início do ano como nova instância.
|
|
321
|
+
* @returns Nova instância apontando para o primeiro dia do ano à meia-noite
|
|
322
|
+
* @example
|
|
323
|
+
* new DatetimeEdge(new Date("2026-03-12")).startOfYear()
|
|
324
|
+
* // DatetimeEdge("2026-01-01T00:00:00.000")
|
|
325
|
+
*/
|
|
326
|
+
startOfYear(): DatetimeEdge;
|
|
327
|
+
/**
|
|
328
|
+
* Retorna o fim do ano como nova instância.
|
|
329
|
+
* @returns Nova instância apontando para o último dia do ano ao fim do dia
|
|
330
|
+
* @example
|
|
331
|
+
* new DatetimeEdge(new Date("2026-03-12")).endOfYear()
|
|
332
|
+
* // DatetimeEdge("2026-12-31T23:59:59.999")
|
|
333
|
+
*/
|
|
334
|
+
endOfYear(): DatetimeEdge;
|
|
335
|
+
/**
|
|
336
|
+
* Cria uma cópia independente desta instância de DatetimeEdge.
|
|
337
|
+
* @returns Nova instância com o mesmo valor de data
|
|
338
|
+
* @example
|
|
339
|
+
* const dt1 = new DatetimeEdge(new Date("2026-03-12"));
|
|
340
|
+
* const dt2 = dt1.clone(); // instância independente
|
|
341
|
+
*/
|
|
342
|
+
clone(): DatetimeEdge;
|
|
343
|
+
/**
|
|
344
|
+
* Retorna uma nova instância com a data alterada, mantendo o horário.
|
|
345
|
+
* @param date - Novo objeto Date
|
|
346
|
+
* @returns Nova instância com o valor fornecido
|
|
347
|
+
* @example
|
|
348
|
+
* new DatetimeEdge(new Date("2026-03-12")).withDate(new Date("2026-12-25"))
|
|
349
|
+
* // DatetimeEdge("2026-12-25")
|
|
350
|
+
*/
|
|
351
|
+
withDate(date: Date): DatetimeEdge;
|
|
352
|
+
/**
|
|
353
|
+
* Retorna a data no formato ISO 8601.
|
|
354
|
+
* @returns String no formato "YYYY-MM-DDTHH:mm:ss.sssZ"
|
|
355
|
+
* @example
|
|
356
|
+
* new DatetimeEdge(new Date("2026-03-12")).toISOString() // "2026-03-12T00:00:00.000Z"
|
|
357
|
+
*/
|
|
21
358
|
toISOString(): string;
|
|
22
|
-
|
|
23
|
-
|
|
359
|
+
/**
|
|
360
|
+
* Retorna a data como objeto Date nativo.
|
|
361
|
+
* @returns Objeto Date representando esta data
|
|
362
|
+
* @example
|
|
363
|
+
* new DatetimeEdge(new Date("2026-03-12")).toDate() // Date object
|
|
364
|
+
*/
|
|
24
365
|
toDate(): Date;
|
|
366
|
+
/**
|
|
367
|
+
* Retorna a data no formato YYYY-MM-DD.
|
|
368
|
+
* @returns String no formato "YYYY-MM-DD"
|
|
369
|
+
* @example
|
|
370
|
+
* new DatetimeEdge(new Date("2026-03-12")).toYYYYMMDD() // "2026-03-12"
|
|
371
|
+
*/
|
|
25
372
|
toYYYYMMDD(): string;
|
|
373
|
+
/**
|
|
374
|
+
* Retorna a data no formato DD/MM/YYYY (padrão brasileiro).
|
|
375
|
+
* @returns String no formato "DD/MM/YYYY"
|
|
376
|
+
* @example
|
|
377
|
+
* new DatetimeEdge(new Date("2026-03-12")).toDDMMYYYY() // "12/03/2026"
|
|
378
|
+
*/
|
|
379
|
+
toDDMMYYYY(): string;
|
|
380
|
+
/**
|
|
381
|
+
* Retorna a data e hora no formato DD/MM/YYYY HH:mm.
|
|
382
|
+
* @returns String no formato "DD/MM/YYYY HH:mm"
|
|
383
|
+
* @example
|
|
384
|
+
* new DatetimeEdge(new Date("2026-03-12T14:30")).toDDMMYYYYHHmm() // "12/03/2026 14:30"
|
|
385
|
+
*/
|
|
386
|
+
toDDMMYYYYHHmm(): string;
|
|
387
|
+
/**
|
|
388
|
+
* Retorna a data formatada com um padrão customizado do moment.js.
|
|
389
|
+
* @param format - Padrão de formatação (ex: "YYYY-MM-DD HH:mm:ss")
|
|
390
|
+
* @returns String formatada conforme o padrão fornecido
|
|
391
|
+
* @example
|
|
392
|
+
* new DatetimeEdge(new Date("2026-03-12T14:30")).format("MMMM Do YYYY") // "March 12th 2026"
|
|
393
|
+
*/
|
|
394
|
+
format(format: string): string;
|
|
395
|
+
/**
|
|
396
|
+
* Retorna o timestamp em milissegundos da data.
|
|
397
|
+
* @returns Número de milissegundos desde 01/01/1970 UTC
|
|
398
|
+
* @example
|
|
399
|
+
* new DatetimeEdge(new Date("2026-03-12")).timestamp() // 1773273600000
|
|
400
|
+
*/
|
|
401
|
+
timestamp(): number;
|
|
402
|
+
/**
|
|
403
|
+
* Retorna o timestamp Unix em segundos da data.
|
|
404
|
+
* @returns Número de segundos desde 01/01/1970 UTC
|
|
405
|
+
* @example
|
|
406
|
+
* new DatetimeEdge(new Date("2026-03-12")).unix() // 1773273600
|
|
407
|
+
*/
|
|
408
|
+
unix(): number;
|
|
409
|
+
/**
|
|
410
|
+
* Cria um DatetimeEdge representando o momento atual.
|
|
411
|
+
* @returns Nova instância com a data e hora atuais
|
|
412
|
+
* @example
|
|
413
|
+
* DatetimeEdge.now() // DatetimeEdge com a data e hora do momento da chamada
|
|
414
|
+
*/
|
|
415
|
+
static now(): DatetimeEdge;
|
|
416
|
+
/**
|
|
417
|
+
* Retorna a maior (mais recente) data de uma lista.
|
|
418
|
+
* @param dates - Array de instâncias de DatetimeEdge para comparação
|
|
419
|
+
* @returns A instância com a data mais recente
|
|
420
|
+
* @throws {Error} Se o array estiver vazio
|
|
421
|
+
* @example
|
|
422
|
+
* DatetimeEdge.max([
|
|
423
|
+
* new DatetimeEdge(new Date("2026-01-01")),
|
|
424
|
+
* new DatetimeEdge(new Date("2026-06-15")),
|
|
425
|
+
* ]) // DatetimeEdge("2026-06-15")
|
|
426
|
+
*/
|
|
427
|
+
static max(dates: DatetimeEdge[]): DatetimeEdge;
|
|
428
|
+
/**
|
|
429
|
+
* Retorna a menor (mais antiga) data de uma lista.
|
|
430
|
+
* @param dates - Array de instâncias de DatetimeEdge para comparação
|
|
431
|
+
* @returns A instância com a data mais antiga
|
|
432
|
+
* @throws {Error} Se o array estiver vazio
|
|
433
|
+
* @example
|
|
434
|
+
* DatetimeEdge.min([
|
|
435
|
+
* new DatetimeEdge(new Date("2026-01-01")),
|
|
436
|
+
* new DatetimeEdge(new Date("2026-06-15")),
|
|
437
|
+
* ]) // DatetimeEdge("2026-01-01")
|
|
438
|
+
*/
|
|
439
|
+
static min(dates: DatetimeEdge[]): DatetimeEdge;
|
|
440
|
+
/**
|
|
441
|
+
* Valida se a data fornecida no construtor é uma data válida.
|
|
442
|
+
* @throws {Error} Se a data for inválida
|
|
443
|
+
*/
|
|
26
444
|
protected validate(): void;
|
|
27
445
|
}
|