/** * @license * Copyright 2023 Nuraly, Laabidi Aymen * SPDX-License-Identifier: MIT */ import { TimeValue, TimePeriod, TimeFormat } from '../timepicker.types.js'; /** * Time utility functions for time picker component */ export declare class TimeUtils { /** * Create a new TimeValue object */ static createTimeValue(hours: number, minutes: number, seconds?: number, period?: TimePeriod): TimeValue; /** * Parse time string to TimeValue */ static parseTimeString(timeString: string, format?: TimeFormat): TimeValue | null; /** * Parse 24-hour format time string */ private static parse24HourTime; /** * Parse 12-hour format time string */ private static parse12HourTime; /** * Format TimeValue to string */ static formatTimeValue(time: TimeValue, format?: TimeFormat, showSeconds?: boolean): string; /** * Format time in 24-hour format */ private static format24HourTime; /** * Format time in 12-hour format */ private static format12HourTime; /** * Get current time as TimeValue */ static getCurrentTime(): TimeValue; /** * Compare two TimeValue objects */ static compareTime(time1: TimeValue, time2: TimeValue): number; /** * Check if two TimeValue objects are equal */ static isTimeEqual(time1: TimeValue, time2: TimeValue): boolean; /** * Validate 24-hour time components */ private static isValidTime24; /** * Validate 12-hour time components */ private static isValidTime12; /** * Add time to a TimeValue */ static addTime(time: TimeValue, hoursToAdd: number, minutesToAdd: number, secondsToAdd?: number): TimeValue; /** * Generate time options for dropdowns */ static generateTimeOptions(interval?: number, format?: TimeFormat, showSeconds?: boolean): Array<{ value: string; label: string; }>; /** * Round time to nearest interval */ static roundToInterval(time: TimeValue, intervalMinutes: number): TimeValue; /** * Check if time is within range */ static isTimeInRange(time: TimeValue, minTime: TimeValue | null, maxTime: TimeValue | null): boolean; /** * Convert Date object to TimeValue */ static dateToTimeValue(date: Date): TimeValue; /** * Convert TimeValue to Date object (using current date) */ static timeValueToDate(time: TimeValue, baseDate?: Date): Date; } //# sourceMappingURL=time.utils.d.ts.map