import { createLayout, createBlockSection, updateSectionSeating, validateLayout } from "@openseat/core";
const empty = createLayout({
id: "hall", name: "Main hall", width: 1200, height: 800,
categories: [{ id: "general", name: "General", colour: "#2563EB" }],
});
const { layout, sectionId } = createBlockSection(empty, {
position: { x: 600, y: 400 },
categoryId: "general",
seating: {
kind: "block",
rows: 10,
seatsPerRow: 20,
seatSpacing: 24,
rowSpacing: 30,
curvature: 20, // -100..100; > 0 arcs around the stage in front
align: "center",
aisles: [10],
aisleWidth: 30,
seatShape: { kind: "circle", radius: 9 },
seatLabeling: { format: "numeric", start: 1, step: 1, direction: "ltr" },
},
});
// Change a parameter later: seats that still have a slot keep their IDs.
const { layout: bigger, report } = updateSectionSeating(layout, sectionId, { rows: 14, curvature: 35 });
console.log(validateLayout(bigger).valid, report.removedSeatIds);