Skip to content

Commit 3008a67

Browse files
authored
Fix TS types of RoundTo and TotalOf (#93)
1 parent 2331468 commit 3008a67

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

index.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,15 +258,15 @@ export namespace Temporal {
258258
* `smallestUnit` property value is that string.
259259
*/
260260
export type RoundTo<T extends DateTimeUnit> =
261-
| T
261+
| SmallestUnit<T>
262262
| {
263263
/**
264264
* The unit to round to. For example, to round to the nearest minute,
265265
* use `smallestUnit: 'minute'`. This option is required. Note that the
266266
* same-named property is optional when passed to `until` or `since`
267267
* methods, because those methods do no rounding by default.
268268
*/
269-
smallestUnit: T;
269+
smallestUnit: SmallestUnit<T>;
270270

271271
/**
272272
* Allows rounding to an integer number of units. For example, to round to
@@ -301,7 +301,7 @@ export namespace Temporal {
301301
* object whose `smallestUnit` property value is that string.
302302
*/
303303
export type DurationRoundTo =
304-
| DateTimeUnit
304+
| SmallestUnit<DateTimeUnit>
305305
| ((
306306
| {
307307
/**
@@ -421,7 +421,7 @@ export namespace Temporal {
421421
* Options to control behavior of `Duration.prototype.total()`
422422
*/
423423
export type DurationTotalOf =
424-
| DateTimeUnit
424+
| TotalUnit<DateTimeUnit>
425425
| {
426426
/**
427427
* The unit to convert the duration to. This option is required.

0 commit comments

Comments
 (0)