/** * @license * Copyright 2026 Aglyn LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * The model behind the weekly hours picker: seven days, each a list of open * intervals in minutes since midnight. Index 0 is Sunday, as `Date#getDay` * counts, so a booking service's `windows[weekday]` maps onto it as is. * * Opening hours, pickup hours and delivery windows are STORED as text lines * in `schema.org`'s `openingHours` syntax (`Mo-Fr 09:00-17:00`), which the * structured-data serializer and checkout read. The picker writes those same * lines, so nothing downstream changes; nobody types them. */ export interface WeeklyHoursInterval { /** Minutes since midnight. */ start: number; /** Minutes since midnight. Earlier than `start` means the next morning. */ end: number; } /** Seven entries, Sunday first; an empty list is a closed day. */ export type WeeklyHours = WeeklyHoursInterval[][]; /** Display order and names, Monday first, with each day's index. */ export declare const WEEKLY_HOURS_DAYS: ReadonlyArray<{ index: number; name: string; short: string; }>; /** An all-closed week. */ export declare const emptyWeeklyHours: () => WeeklyHours; /** `540` → `09:00`. */ export declare const formatClockMinutes: (minutes: number) => string; /** `540` → `9:00 AM`, for a menu. */ export declare const clockLabel: (minutes: number) => string; /** * Hours text → the picker's week. Lines that do not read are returned by * their 1-based number, so the picker can say what it could not show rather * than silently dropping a saved opening time. */ export declare function weeklyHoursFromText(value: unknown): { hours: WeeklyHours; unreadLines: number[]; }; /** * The picker's week → hours text, one line per interval per set of days that * share it: days with the same hours are written together (`Mo-Fr`), which is * how a business reads its own hours back. */ export declare function weeklyHoursToText(hours: WeeklyHours): string;