import type { BookingService, BookingSettings, Booking, VenueScheduleDay, ScheduleOffering, ScheduleGrid } from "./types/booking.js"; /** * A space (booking service) is "free" only when both price is zero AND the * merchant explicitly does not require payment. Mirrors v2/api gating: * `services.paymentRequired` controls Stripe; `price` controls UI. */ export declare function isFreeSpace(service: Pick): boolean; /** * Result of evaluating whether a member is allowed to cancel their booking via * the public magic-link flow. `reason` distinguishes between an outright block * (merchant disabled self-cancel) and a time-based block (past the cutoff). */ export type MemberCancelEligibility = { ok: true; } | { ok: false; reason: "disabled"; } | { ok: false; reason: "past_cutoff"; cutoffHours: number; }; /** * Decide whether a member can self-cancel a booking based on merchant policy. * * Used both server-side (the API guard on `POST /v6/public/bookings/:id/cancel`) * and client-side (member-portal hides the cancel button + shows a localized * notice). Keeping the math here ensures UI and API can never disagree. * * @param booking Minimal booking shape — needs the local date + start time. * @param settings Merchant-configured booking settings (the policy bits). * @param now Override for tests. Defaults to wall-clock now. * @param timeZone IANA company timezone for booking wall-clock interpretation. */ export declare function canMemberCancelBooking(booking: Pick<{ bookingDate: string; startTime: string; }, "bookingDate" | "startTime">, settings: Pick, now?: Date, timeZone?: string | null): MemberCancelEligibility; /** * Format a booking's date and time into a human-readable string. * Example: "Oct 15, 2025 at 2:00 PM" */ export declare function formatBookingDateTime(booking: Pick, locale?: string): string; /** * Get a localized/friendly label for a booking status. */ export declare function getBookingStatusLabel(status: string): string; /** * Mirror of getEffectivePrice for products. * Returns the effective price of a booking service. */ export declare function getEffectiveBookingPrice(service: Pick): number; /** Extract "HH:MM" from a schedule session `start` ("YYYY-MM-DD HH:MM" or ISO). */ export declare function scheduleSlotParam(start: string): string; /** * Distinct offerings across the whole timetable, in first-seen order — used to * build the filter chips ("All" + one per offering). */ export declare function extractScheduleOfferings(days: VenueScheduleDay[]): ScheduleOffering[]; /** * Narrow each day's sessions to a single offering. `offeringId === null` * returns the days unchanged (the "All" filter). */ export declare function filterScheduleDays(days: VenueScheduleDay[], offeringId: string | null): VenueScheduleDay[]; /** * Lay the timetable out as a grid: a sorted list of distinct `HH:MM` row * labels and an index from `"date|HH:MM"` to the sessions in that cell. A cell * can hold multiple sessions (different offerings at the same time). */ export declare function buildScheduleGrid(days: VenueScheduleDay[]): ScheduleGrid; /** Total session count across all days — for empty-state checks. */ export declare function countScheduleSessions(days: VenueScheduleDay[]): number; //# sourceMappingURL=bookings.d.ts.map