From a28074ecffcec470eb2c9b48a0a018a673474118 Mon Sep 17 00:00:00 2001 From: mroloux Date: Thu, 24 Oct 2024 09:45:45 +0200 Subject: [PATCH] Expose `chart.doSelectObjects` and `chart.trySelectObjects` (#26) --- src/index.test.ts | 3 ++- src/index.ts | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/index.test.ts b/src/index.test.ts index 015301c..44a4bd3 100644 --- a/src/index.test.ts +++ b/src/index.test.ts @@ -442,7 +442,8 @@ new seatsio.SeatingChartDesigner({ }) // Seating chart tests -seatingChart.selectObjects(['A1', { label: 'someLabel', ticketType: 'aTicketType', amount: 2 }, { label: 'anotherLabel', amount: 2 }]) +seatingChart.doSelectObjects(['A1', { label: 'someLabel', ticketType: 'aTicketType', amount: 2 }, { label: 'anotherLabel', amount: 2 }]) +seatingChart.trySelectObjects(['A1', { label: 'someLabel', ticketType: 'aTicketType', amount: 2 }, { label: 'anotherLabel', amount: 2 }]) seatingChart.deselectObjects(['A1', { label: 'someLabel', ticketType: 'aTicketType', amount: 2 }]) seatingChart.listSelectedObjects().then(objects => { diff --git a/src/index.ts b/src/index.ts index ec2cee3..535dcfa 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1346,7 +1346,8 @@ export interface SeatingChart { resetView: () => Promise selectCategories: (categories: CategoryKey[]) => Promise selectedObjects: string[] - selectObjects: (objects: (string | SelectedAmount)[]) => Promise + doSelectObjects: (objects: (string | SelectedAmount)[]) => Promise + trySelectObjects: (objects: (string | SelectedAmount)[]) => Promise pulse: (objects: string []) => Promise unpulse: (objects: string []) => Promise startNewSession: () => Promise @@ -1369,7 +1370,8 @@ export interface EventManager extends Pick