import { type AllocationResource } from "@voyant-travel/availability/schema"; import type { PostgresJsDatabase } from "drizzle-orm/postgres-js"; import type { SeatLayoutCell, SeatLayoutSpec } from "./validation.js"; export interface AutoMaterializeRow { option_id: string; pax_count: number; capacity: number; name_pattern: string; ref_type: string | null; ref_id: string | null; layout: string | null; flags: Record | null; option_name: string | null; sort_order: number | null; } /** * Writes each vehicle and its child seats through the transaction supplied by * `autoMaterializeAllocationResources`. Do not call with an unscoped database * handle: the caller must hold the availability-slot row lock for the full * read/check/write operation. */ export declare function materializeVehicleSeatGroupInTransaction(db: PostgresJsDatabase, slotId: string, group: AutoMaterializeRow, startingSequence: number): Promise<{ resources: AllocationResource[]; vehicleCount: number; }>; export declare function parseLayoutSpecFromFlags(flags: Record | null): SeatLayoutSpec | null; /** * Derive window/aisle/middle from a seat's neighbours in the same row. * * - Touching an aisle or door cell -> "aisle" (the seat is on the aisle side) * - Touching the row boundary or a void cell -> "window" * - Surrounded by other seats -> "middle" * * Aisle takes precedence so the "window" tag is reserved for actual outer * seats; a 2-1 row's lone middle seat ends up "aisle" on both sides. */ export declare function positionFromCells(cells: ReadonlyArray, index: number): "window" | "aisle" | "middle"; export declare function renderNamePattern(pattern: string, vars: Record): string;