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,9 @@
import type { Day } from "./types.js";
import type { ContextOptions, DateArg, Day } from "./types.js";
/**
* The {@link previousDay} function options.
*/
export interface PreviousDayOptions<DateType extends Date = Date>
extends ContextOptions<DateType> {}
/**
* @name previousDay
* @category Weekday Helpers
@@ -8,9 +13,11 @@ import type { Day } from "./types.js";
* When is the previous day of the week? 0-6 the day of the week, 0 represents Sunday.
*
* @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 ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The date to check
* @param day - The day of the week
* @param options - An object with options
*
* @returns The date is the previous day of week
*
@@ -24,7 +31,11 @@ import type { Day } from "./types.js";
* const result = previousDay(new Date(2020, 2, 21), 2)
* //=> Tue Mar 17 2020 00:00:00
*/
export declare function previousDay<DateType extends Date>(
date: DateType | number | string,
export declare function previousDay<
DateType extends Date,
ResultDate extends Date = DateType,
>(
date: DateArg<DateType>,
day: Day,
): DateType;
options?: PreviousDayOptions<ResultDate> | undefined,
): ResultDate;