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,4 +1,24 @@
import type { Interval } from "./types.js";
import type { ContextOptions, Interval } from "./types.js";
/**
* The {@link eachWeekendOfInterval} function options.
*/
export interface EachWeekendOfIntervalOptions<DateType extends Date = Date>
extends ContextOptions<DateType> {}
/**
* The {@link eachWeekendOfInterval} function result type.
*/
export type EachWeekendOfIntervalResult<
IntervalType extends Interval,
Options extends EachWeekendOfIntervalOptions | undefined,
> = Array<
Options extends EachWeekendOfIntervalOptions<infer DateType>
? DateType
: IntervalType["start"] extends Date
? IntervalType["start"]
: IntervalType["end"] extends Date
? IntervalType["end"]
: Date
>;
/**
* @name eachWeekendOfInterval
* @category Interval Helpers
@@ -7,9 +27,11 @@ import type { Interval } from "./types.js";
* @description
* Get all the Saturdays and Sundays in the given date interval.
*
* @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).
* @typeParam IntervalType - Interval type.
* @typeParam Options - Options type.
*
* @param interval - The given interval
* @param options - An object with options
*
* @returns An array containing all the Saturdays and Sundays
*
@@ -26,6 +48,10 @@ import type { Interval } from "./types.js";
* // Sun Sep 30 2018 00:00:00
* // ]
*/
export declare function eachWeekendOfInterval<DateType extends Date>(
interval: Interval<DateType>,
): DateType[];
export declare function eachWeekendOfInterval<
IntervalType extends Interval,
Options extends EachWeekendOfIntervalOptions | undefined = undefined,
>(
interval: IntervalType,
options?: Options,
): EachWeekendOfIntervalResult<IntervalType, Options>;