export {}; declare global { type BRTCapability = | 'analytics.events.write' | 'booking.availability.read' | 'booking.create' | 'cart.manage' | 'catalog.products.read' | 'communications.sms.open' | 'forms.submit' | 'site.theme.read' | 'waivers.start'; type BRTSettingValue = boolean | number | string; interface BRTReadyState { readonly capabilities: readonly BRTCapability[]; readonly settings: Readonly>; } interface BRTTheme { readonly primary: string; readonly secondary: string; readonly background: string; readonly surface: string; readonly text: string; readonly mutedText: string; readonly link: string; readonly button: string; readonly headingFont: string; readonly bodyFont: string; readonly sectionGap: string; readonly buttonRadius: string; } interface BRTCatalogQuery { readonly search?: string; readonly page?: number; readonly limit?: 12 | 24; readonly includeOutOfStock?: boolean; } interface BRTCatalogProduct { readonly id: number; readonly name: string; readonly url: string; readonly image: string; readonly price: string; readonly inStock: boolean; } interface BRTCatalogResult { readonly products: readonly BRTCatalogProduct[]; readonly total: number; readonly page: number; readonly lastPage: number; } interface BRTCartDetails { readonly productId: number; readonly quantity?: number; } interface BRTCartResult { readonly ok: boolean; readonly itemCount: number; readonly total: string; } interface BRTAvailabilityQuery { readonly laneId: number; readonly date: string; readonly durationMinutes: number; } interface BRTBookingDetails { readonly laneId?: number; readonly startsAt?: string; readonly endsAt?: string; } interface BRTOpenResult { readonly opened: true; readonly url: string; } interface BRTNewsletterFields { readonly email: string; } interface BRTContactFields { readonly questionType?: number; readonly name?: string; readonly email?: string; readonly phone?: string; readonly subject?: string; readonly message?: string; } interface BRTExtensionError extends Error { readonly code: string; } interface BRTExtensionAPI { readonly ready: Promise; request(capability: BRTCapability, action: string, payload?: Record): Promise; capabilities(): readonly BRTCapability[]; settings(): Readonly>; readonly analytics: { track(event: string, properties?: {readonly label?: string; readonly value?: number}): Promise<{readonly tracked: boolean}>; }; readonly booking: { availability(query: BRTAvailabilityQuery): Promise; start(details?: BRTBookingDetails): Promise; }; readonly cart: { manage(action: 'add' | 'remove' | 'update', details: BRTCartDetails): Promise; }; readonly catalog: { products(query?: BRTCatalogQuery): Promise; }; readonly communications: { text(message?: string): Promise<{readonly opened: true}>; }; readonly forms: { submit(form: 'newsletter', fields: BRTNewsletterFields): Promise<{readonly ok: boolean}>; submit(form: 'contact', fields: BRTContactFields): Promise<{readonly ok: boolean}>; }; readonly theme: { read(): Promise; }; readonly waivers: { start(waiver?: 'range' | 'rental' | 'class' | null): Promise; }; } interface Window { readonly BRT: BRTExtensionAPI; } }