import { Event, AvailableTicket } from '../types.js'; interface ApiEvent { eventID?: number; id?: number; ID?: number; name?: string; title?: string; slug?: string; description?: string; date?: string; startDateTime?: string; start_date_time?: string; endDateTime?: string; end_date_time?: string; doorsOpenTime?: string; doors_open_time?: string; timezone?: string; time_zone?: string; venueId?: number; venue_id?: number; venueName?: string; venue_name?: string; venueAddress?: string; venue_address?: string; location?: string; imageUrl?: string; imageURL?: string; image_url?: string; image?: string; status?: string; isPublished?: boolean; is_published?: boolean; isCancelled?: boolean; is_cancelled?: boolean; availableTickets?: any[]; available_tickets?: any[]; tickets?: any[]; ticketsAvailable?: number; tickets_available?: number; ticketsSold?: number; tickets_sold?: number; minPrice?: number; min_price?: number; maxPrice?: number; max_price?: number; ctaText?: string; cta_text?: string; ctaState?: string; cta_state?: string; showPerformers?: boolean; show_performers?: boolean; eventSeriesId?: number; event_series_id?: number; seriesInstanceNumber?: number; series_instance_number?: number; timeZone?: string; salesStatus?: string; sales_status?: string; eventSummary?: string; password?: string; hasPassword?: boolean; disclaimer?: string; ticketType?: number; eventTicketingType?: number; ageRestriction?: number; displayAgeRestriction?: boolean; displayStartTime?: boolean; displayEndTime?: boolean; displayDoorsTime?: boolean; displayTicketsLeft?: boolean; postSalesMessage?: string; canceledReason?: string; postponedReason?: string; collectionId?: number; collection_id?: number; ticketsRemaining?: number; ticketsTotal?: number; hasHiddenTickets?: boolean; stage?: { name?: string; } | null; stageName?: string; stageId?: number; eventCategoryTypes?: number[] | null; publicPerformers?: Array<{ id?: number; displayName?: string; image?: string; }> | null; collectionIds?: number[] | null; venue?: Record; performers?: Record[]; faqs?: Record[]; showtimes?: Record[]; purchasedTickets?: Record[]; } /** * Get CDN image URL. * * Delegates the host-join to SC's canonical `resolveImageUrl` (one path-join, * one host constant). `{ cdn: true }` picks SC's CDN base, the host for public * buyer surfaces; SC owns which bucket that is. * * This replaced VC's local `micdrop-images.sfo3` bucket, which 404s for real * event/venue keys (CDN census 2026-07-05, ledger vc-getcdnimageurl-wrong- * bucket-404). SC additionally passes `data:`/`blob:` URLs through untouched * and normalizes a missing leading slash — a strict superset of the old body. */ export declare function getCDNImageUrl(path: string | undefined): string; /** * Extract image URL from event with fallbacks. * * DIVERGENCE (no-shadowed-helper rename-keep): the HOST-JOIN is now the SC * canonical (via `getCDNImageUrl` above); only the FIELD PRECEDENCE stays local * and deliberately differs -- this transformer reads * `imageUrl -> imageURL -> image_url -> image` (incl. the camelCase `imageURL`, * asserted by event.test.ts), whereas SC reads * `image -> coverImage -> imageUrl -> image_url`. The VC chain is what this * wire boundary trusts; changing it would repoint which field wins for the same * event, so it is preserved. Declared under a non-shadowing name and * re-exported below as `getEventImageUrl` so call sites keep their existing * import -- satisfies `micdrop/no-shadowed-helper` without suppression. */ declare function getEventImageUrlByFieldPrecedence(apiEvent: ApiEvent): string; export { getEventImageUrlByFieldPrecedence as getEventImageUrl }; /** * Calculate CTA state based on ticket availability */ /** * VC's 4-state CTA derivation (available/sold_out/coming_soon/ended) for parsed events. * Distinct from SC's `calculateCtaState` (richer wire-level canonical) — renamed to * avoid shadowing the SC export; this variant reads the parsed/raw event shape parseEvent consumes. */ type CtaState = 'available' | 'sold_out' | 'coming_soon' | 'ended'; export declare function deriveEventCtaState(apiEvent: ApiEvent): CtaState; /** * Parse a raw ticket payload into the normalized AvailableTicket domain shape. * * Wire shape is contained inside this module. Uses `||` chains matching the * old transformer exactly -- 0/false values fall through to the next variant * or default, byte-identical to previous behavior. */ export declare function parseTicket(raw: unknown): AvailableTicket; /** * Parse a raw event payload into the normalized Event domain shape. * * Wire shape (ApiEvent) is contained inside this module and never escapes it. * Uses `||` chains matching the old transformer exactly -- 0/false values fall * through to the next variant, byte-identical to previous behavior. Throw * behavior preserved from old mapper: null/undefined input (property access on a nullish value) or a non-array * tickets field throws exactly as the old code did. Callers always pass real * wire objects. * * COMPOSITION NOTE — passthrough seams (events convergence): * The trailing block of fields below is carried VERBATIM from the wire (no * fallback chains, no normalization) so that the view-shape projections — * `utils/event-transform.js` (DETAIL/BROWSE) and * `public-calendar-flow/transform.ts` (EventData) — can compose parseEvent * for every event-level scalar instead of reading the wire themselves. * `venue`/`performers`/`faqs`/`showtimes`/`purchasedTickets` stay raw objects * by contract: their consumers (and #260's performer canonical) own that * variance; normalizing them here would change rendered output. */ export declare function parseEvent(raw: unknown): Event; /** * Back-compat alias -- existing call sites using transformTicket continue * to work unchanged. */ export declare const transformTicket: typeof parseTicket; /** * Back-compat alias -- existing call sites using transformEvent(apiEvent) * continue to work unchanged. */ export declare const transformEvent: typeof parseEvent; /** * Legacy transformer name for backwards compatibility. */ export declare const transformEventData: typeof parseEvent;