visiting-hours
Version:
An advanced, feature rich, optimised and tiny visiting-hours library.
25 lines (24 loc) • 1.12 kB
TypeScript
import type { VisitingHoursConfigInterface } from './Interface/VisitingHoursConfigInterface';
import type { DateInputInterface } from './Interface/DateInputInterface';
import type { LuxonShapeInterface } from './Interface/LuxonShapeInterface';
import type { HourMatchInterface } from './Interface/HourMatchInterface';
import type { HourMatchSetInterface } from './Interface/HourMatchSetInterface';
export declare class VisitingHours {
private zone?;
private live;
private lastTimeStamp;
private lastMatch;
private validUntil;
private hoursIndex;
constructor({ regular, special, zone, live }: VisitingHoursConfigInterface);
isOpen(inputDate: UndeterminedDateInputType): HourMatchInterface;
/**
* Returns all the remaining hour ranges for the provided date, included left-overs past midnight.
*/
getRemainingHours(inputDate: UndeterminedDateInputType): HourMatchSetInterface[];
private getDateInput;
private checkCache;
private sourceDate;
private writeCache;
}
export declare type UndeterminedDateInputType = Date | DateInputInterface | LuxonShapeInterface;