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,5 @@
import type {
ContextOptions,
Interval,
LocalizedOptions,
StepOptions,
@@ -7,10 +8,28 @@ import type {
/**
* The {@link eachWeekOfInterval} function options.
*/
export interface EachWeekOfIntervalOptions
export interface EachWeekOfIntervalOptions<DateType extends Date = Date>
extends StepOptions,
WeekOptions,
LocalizedOptions<"options"> {}
LocalizedOptions<"options">,
ContextOptions<DateType> {}
/**
* The {@link eachWeekOfInterval} function result type. It resolves the proper data type.
* It uses the first argument date object type, starting from the interval start date,
* then the end interval date. If a context function is passed, it uses the context function return type.
*/
export type EachWeekOfIntervalResult<
IntervalType extends Interval,
Options extends EachWeekOfIntervalOptions | undefined,
> = Array<
Options extends EachWeekOfIntervalOptions<infer DateType>
? DateType
: IntervalType["start"] extends Date
? IntervalType["start"]
: IntervalType["end"] extends Date
? IntervalType["end"]
: Date
>;
/**
* @name eachWeekOfInterval
* @category Interval Helpers
@@ -19,8 +38,6 @@ export interface EachWeekOfIntervalOptions
* @description
* Return the array of weeks within the specified time 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).
*
* @param interval - The interval.
* @param options - An object with options.
*
@@ -43,7 +60,10 @@ export interface EachWeekOfIntervalOptions
* // Sun Nov 23 2014 00:00:00
* // ]
*/
export declare function eachWeekOfInterval<DateType extends Date>(
interval: Interval<DateType>,
options?: EachWeekOfIntervalOptions,
): DateType[];
export declare function eachWeekOfInterval<
IntervalType extends Interval,
Options extends EachWeekOfIntervalOptions | undefined = undefined,
>(
interval: IntervalType,
options?: Options,
): EachWeekOfIntervalResult<IntervalType, Options>;