/** * Options for rounding a date's time components down. */ export interface RoundTimeDown { roundDownToDay?: boolean; roundDownToMinute?: boolean; } /** * Options for rounding a date to configured minute steps, then optionally rounding time components down. */ export interface StepRoundDateTimeDown extends RoundTimeDown { step?: number; roundToSteps?: boolean; } /** * Rounds the date's minutes to the nearest step, then rounds remaining time components down. * * @param date - Moment to round. * @param round - Step size and trailing-component clearing options. * @returns Rounded copy of the input moment. * * @example * ```ts * // Round to 15-minute steps and clear seconds * const rounded = roundDateTimeDownToSteps(new Date('2024-01-01T10:07:30Z'), { step: 15 }); * // rounded minutes will be 15 (rounded up from 7), seconds cleared * ``` */ export declare function roundDateTimeDownToSteps(date: Date, round: StepRoundDateTimeDown): Date; /** * Clears time components of the date based on rounding options (e.g. seconds/milliseconds, or hours/minutes for day rounding). * * @param date - Moment to round. * @param round - Selection of time components to clear. * @returns Rounded copy of the input moment. * * @example * ```ts * const result = roundDateTimeDown(new Date('2024-01-01T10:07:30.500Z'), { roundDownToMinute: true }); * // seconds and milliseconds are set to 0 * ``` */ export declare function roundDateTimeDown(date: Date, round: RoundTimeDown): Date; /** * Rounds the date's minutes up to the nearest multiple of the given step. * * If the step is 1 or less, the date is returned unchanged. If rounding pushes minutes to 60, the hour is incremented. * * @param date - Moment to round. * @param step - Granularity of minutes the result must align to. * @returns Copy of the moment with minutes snapped to the requested step. * * @example * ```ts * const result = roundToMinuteSteps(new Date('2024-01-01T10:07:00Z'), 15); * // result minutes will be 15 (next step above 7) * ``` */ export declare function roundToMinuteSteps(date: Date, step: number): Date;