registration

This commit is contained in:
User
2025-02-02 16:08:03 +03:00
parent 7f6495eb4d
commit 78afbaed71
6334 changed files with 196774 additions and 165754 deletions

View File

@@ -1,15 +1,18 @@
import type { Duration, Interval } from "./types.js";
import type { ContextOptions, Duration, Interval } from "./types.js";
/**
* The {@link intervalToDuration} function options.
*/
export interface IntervalToDurationOptions extends ContextOptions<Date> {}
/**
* @name intervalToDuration
* @category Common Helpers
* @summary Convert interval to duration
*
* @description
* Convert a interval object to a duration object.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* Convert an interval object to a duration object.
*
* @param interval - The interval to convert to duration
* @param options - The context options
*
* @returns The duration object
*
@@ -18,9 +21,10 @@ import type { Duration, Interval } from "./types.js";
* intervalToDuration({
* start: new Date(1929, 0, 15, 12, 0, 0),
* end: new Date(1968, 3, 4, 19, 5, 0)
* })
* // => { years: 39, months: 2, days: 20, hours: 7, minutes: 5, seconds: 0 }
* });
* //=> { years: 39, months: 2, days: 20, hours: 7, minutes: 5, seconds: 0 }
*/
export declare function intervalToDuration<DateType extends Date>(
interval: Interval<DateType>,
export declare function intervalToDuration(
interval: Interval,
options?: IntervalToDurationOptions | undefined,
): Duration;