import { type Maybe } from '../value'; import { type IsInSetDecisionFunction } from '../set/set.decision'; export type Sunday = 0; export type Monday = 1; export type Tuesday = 2; export type Wednesday = 3; export type Thusrsday = 4; export type Friday = 5; export type Saturday = 6; /** * Values that correspond to each day of the week. */ export type DayOfWeek = Sunday | Monday | Tuesday | Wednesday | Thusrsday | Friday | Saturday | Sunday; /** * Returns the day of the week for the input date. * * Equivalent to date.getDay(). * * @param date - The date to get the day of week for * @returns The DayOfWeek value (0=Sunday through 6=Saturday) */ export declare function dayOfWeek(date: Date): DayOfWeek; /** * Decision function that checks whether or not the input DayOfWeek or the DayOfWeek for the input Date is in the set. */ export type IsInAllowedDaysOfWeekSetDecisionFunction = IsInSetDecisionFunction; /** * Creates a DecisionFunction that checks whether the input day or Date falls within the allowed days of the week. * * @param allowedDaysOfWeek - Set of allowed DayOfWeek values * @returns A decision function that checks membership in the allowed set */ export declare function isInAllowedDaysOfWeekSet(allowedDaysOfWeek: Set): IsInAllowedDaysOfWeekSetDecisionFunction; /** * Returns all days of the week starting from the given day up to the specified number of days. * * Returns 7 days by default. * * @param startingOn - The day to start from (defaults to Sunday) * @param maxDays - Maximum number of days to return (defaults to 7) * @returns An array of DayOfWeek values */ export declare function daysOfWeekArray(startingOn?: DayOfWeek, maxDays?: number): DayOfWeek[]; /** * Enum for the days of the week. */ export declare enum Day { SUNDAY = 0, MONDAY = 1, TUESDAY = 2, WEDNESDAY = 3, THURSDAY = 4, FRIDAY = 5, SATURDAY = 6 } /** * Object containing the name of every day and whether they're true/false. */ export interface EnabledDays { sunday: boolean; monday: boolean; tuesday: boolean; wednesday: boolean; thursday: boolean; friday: boolean; saturday: boolean; } /** * Creates an EnabledDays object from an iterable of Day enum values. * * @param input - Iterable of Day values to mark as enabled * @returns An EnabledDays object with the specified days set to true */ export declare function enabledDaysFromDaysOfWeek(input: Maybe>): EnabledDays; /** * Converts an EnabledDays object to an array of Day enum values. * * @param input - The EnabledDays object to convert * @returns An array of Day values for all enabled days */ export declare function daysOfWeekFromEnabledDays(input: Maybe): Day[]; /** * Configuration for transforming day-of-week name strings. */ export interface DayOfWeekNamesTransformConfig { /** * Whether or not to abbreviate the day names. * * I.E. Mon, Tue, etc. */ abbreviation?: boolean; /** * Whether or not to uppercase the days. * * I.E. MONDAY, TUE, etc. */ uppercase?: boolean; } /** * Returns an array of strings with each day of the week named. * * @param sundayFirst - If true (default), Sunday is the first day; otherwise Monday is first * @param transform - Optional configuration for abbreviation and casing * @returns Array of day name strings */ export declare function getDaysOfWeekNames(sundayFirst?: boolean, transform?: DayOfWeekNamesTransformConfig): string[]; /** * Creates a Map from DayOfWeek values to their string names. * * @param transform - Optional configuration for abbreviation and casing * @returns A Map from DayOfWeek to name string */ export declare function daysOfWeekNameMap(transform?: DayOfWeekNamesTransformConfig): Map; /** * Function that returns the name string for a given DayOfWeek. */ export type DayOfWeekNameFunction = (dayOfWeek: DayOfWeek) => string; /** * Creates a function that returns the name for a given DayOfWeek. * * @param transform - Optional configuration for abbreviation and casing * @returns A function that maps DayOfWeek values to name strings */ export declare function daysOfWeekNameFunction(transform?: DayOfWeekNamesTransformConfig): DayOfWeekNameFunction; /** * Returns the DayOfWeek for the day after the given day. * * @param day - The starting day * @returns The next day of the week */ export declare function getDayTomorrow(day: DayOfWeek): DayOfWeek; /** * Returns the DayOfWeek for the day before the given day. * * @param day - The starting day * @returns The previous day of the week */ export declare function getDayYesterday(day: DayOfWeek): DayOfWeek; /** * Returns the DayOfWeek offset by the given number of days (positive = forward, negative = backward). * * @param day - The starting day * @param days - The number of days to offset (positive or negative) * @returns The resulting DayOfWeek */ export declare function getDayOffset(day: DayOfWeek, days: number): DayOfWeek; /** * Returns the DayOfWeek that is the given number of days before the input day. * * @param day - The starting day * @param days - The number of days to go back (defaults to 1) * @returns The resulting DayOfWeek */ export declare function getPreviousDay(day: DayOfWeek, days?: number): DayOfWeek; /** * Returns the DayOfWeek that is the given number of days after the input day. * * @param day - The starting day * @param days - The number of days to advance (defaults to 1) * @returns The resulting DayOfWeek */ export declare function getNextDay(day: DayOfWeek, days?: number): DayOfWeek;