@seatsio/seatsio-types 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1 @@
1
+ Type definitions for [Seats.io](https://www.seats.io/).
@@ -0,0 +1,821 @@
1
+ interface SeatingChartConstructor {
2
+ new (config: ChartRendererConfigOptions): SeatingChart;
3
+ }
4
+ interface EventManagerConstructor {
5
+ new (config: EventManagerConfigOptions): EventManager;
6
+ }
7
+ interface ChartDesignerConstructor {
8
+ new (config: ChartDesignerConfigOptions): ChartDesigner;
9
+ }
10
+ export interface Seatsio {
11
+ SeatingChart: SeatingChartConstructor;
12
+ EventManager: EventManagerConstructor;
13
+ SeatingChartDesigner: ChartDesignerConstructor;
14
+ }
15
+ export interface CommonConfigOptions {
16
+ /**
17
+ * The parent {@link https://developer.mozilla.org/en-US/docs/Web/API/Element Element} in which the chart gets rendered.
18
+ * Either pass in `container` or `divId`, but not both.
19
+ */
20
+ container?: Element;
21
+ /**
22
+ * The id of the <div> element on your page in which you want seats.io to render the seating chart.
23
+ * Either pass in `divId` or `container`, but not both.
24
+ */
25
+ divId?: string;
26
+ }
27
+ export interface ChartRendererConfigOptions extends DeprecatedConfigProperties, CommonConfigOptions, ChartRendererCallbacks {
28
+ /**
29
+ * Allows to render a multi-floor seating chart with specific floor selected, instead of the default all-floors view.
30
+ */
31
+ activeFloor?: string;
32
+ /**
33
+ * The key of the events for which you want to render the seating chart.
34
+ * Note: Channels functionality is not supported when using an event group with multiple events. Use {@link https://docs.seats.io/docs/api/seasons seasons} for that.
35
+ */
36
+ events?: string[];
37
+ /**
38
+ * This parameter supports the following values:
39
+ * - **normal**: the default setting. Objects are selectable, and zooming and panning are enabled
40
+ * - **static**: objects are not selectable, but zooming and panning is enabled
41
+ * - **print**: objects are not selectable and zooming and panning is disabled
42
+ * - **spotlight**: shows selected objects while dimming all others. Navigation controls are enabled but interaction is disabled.
43
+ * @default normal
44
+ */
45
+ mode?: ChartRendererMode;
46
+ /**
47
+ * Allows to toggle on or off some features of the cursor tooltip, displayed when hovering objects when using pointing devices like a mouse, or when tapping on an object on touch devices.
48
+ */
49
+ objectTooltip?: ChartRendererObjectTooltip;
50
+ /**
51
+ * Seats supports two types of pricing: simple pricing and multi-level pricing. {@link https://docs.seats.io/docs/renderer/config-pricing See documentation}
52
+ */
53
+ pricing?: Pricing;
54
+ /**
55
+ * Formats the price into a custom defined string when showing it to and en user. {@link https://docs.seats.io/docs/renderer/config-priceformatter See documentation}
56
+ */
57
+ priceFormatter?: (price: number) => string;
58
+ /**
59
+ * When true, overlays the price or price range of a section on top of it when the chart is zoomed out.
60
+ */
61
+ showSectionPricingOverlay?: boolean;
62
+ /**
63
+ * The public workspace key for the workspace in which the chart was created. You can find it on your {@link https://app.seats.io/workspace-settings workspace settings} page.
64
+ * */
65
+ workspaceKey: string;
66
+ /**
67
+ * The key of the event (or the season) for which you want to render the seating chart.
68
+ */
69
+ event?: string;
70
+ /** Custom data to be passed to certain callbacks. {@link https://docs.seats.io/docs/renderer/config-extraconfig/ See documentation} for information. */
71
+ extraConfig?: ExtraConfig;
72
+ /**
73
+ * Render the chart with the specified objects selected (if they are still free). {@link https://docs.seats.io/docs/renderer/config-selectedobjects See documentation}
74
+ */
75
+ selectedObjects?: (string | SelectedObject | SelectedGA)[];
76
+ /**
77
+ * Render the chart with the specified objects selectable. {@link https://docs.seats.io/docs/renderer/selectableobjects See documentation}
78
+ */
79
+ selectableObjects?: string[];
80
+ /**
81
+ * Selection validators run every time a seat is selected or deselected. They check whether there are no orphan seats, and/or whether all selected seats are consecutive (meaning: next to each other and in the same category). {@link https://docs.seats.io/docs/renderer/config-selectionvalidators See documentation}
82
+ */
83
+ selectionValidators?: SelectionValidator[];
84
+ /**
85
+ * Restrict the number of objects a user is allowed to select. This can be configured based on total number of tickets, ticket types, categories or a combination of both. {@link https://docs.seats.io/docs/renderer/config-maxselectedobjects See documentation} for detailed information.
86
+ */
87
+ maxSelectedObjects?: SelectionLimiter;
88
+ /**
89
+ * Activates one-click selection mode. {@link https://docs.seats.io/docs/renderer/config-numberofplacestoselect See documentation}
90
+ */
91
+ numberOfPlacesToSelect?: number;
92
+ /**
93
+ * If true, users will get a button on the top left hand side they can use to switch between different selection modes: seat selection, rectangle selection or lasso selection. {@link https://docs.seats.io/docs/renderer/config-multiselectenabled See documentation}
94
+ * @default false
95
+ */
96
+ multiSelectEnabled?: boolean;
97
+ /**
98
+ * This function is invoked when a user clicks on a GA area. If canGASelectionBeIncreased returns true, the user is able to increase the number of selected places by clicking on the + button of the ticket selector that pops up.
99
+ * @param gaArea The GA area that has been selected.
100
+ * @param defaultValue A boolean that indicates if additional GA places can be selected. This is determined by whether the number of selected places plus the number places booked by other users is smaller than the capacity of the GA area.
101
+ * @param extraConfig Variables and data from your application. See extraConfig.
102
+ * @param ticketType The ticket type for which the user clicked on the plus button. Optional.
103
+ * {@link https://docs.seats.io/docs/renderer/config-cangaselectionbeincreased See documentation}
104
+ */
105
+ canGASelectionBeIncreased?: (gaArea: GeneralAdmissionAreaProps, defaultValue: boolean, extraConfig: ExtraConfig, ticketType?: string) => boolean;
106
+ /**
107
+ * If your chart div is enclosed within a <form>element, you can use this configuration option to automatically add the selected seat IDs to the form data. This is one of the ways you can pass the selected seats to your server, so that you can book them later on through the Seats API.
108
+ * {@link https://docs.seats.io/docs/renderer/config-selectedobjectsinputname See documentation}
109
+ */
110
+ selectedObjectsInputName?: string;
111
+ /**
112
+ * If set to `false`, objects that don't have pricing information will be rendered as not selectable (i.e. greyed out).
113
+ * @default true
114
+ */
115
+ objectWithoutPricingSelectable?: boolean;
116
+ /**
117
+ * If set to `false`, objects that don't have a category will be rendered as not selectable (i.e. greyed out).
118
+ * @default true.
119
+ */
120
+ objectWithoutCategorySelectable?: boolean;
121
+ /**
122
+ * A function whose result will be displayed as extra information on the cursor tooltip. {@link https://docs.seats.io/docs/renderer/config-tooltipinfo See documentation}
123
+ */
124
+ tooltipInfo?: <T extends SelectableObjectProps>(object: T) => string;
125
+ /**
126
+ * On mobile, when displaying a chart with sections, a tooltip is shown at the bottom of the screen with the section name and pricing.
127
+ * You can hide this tooltip on mobile by passing `showActiveSectionTooltipOnMobile: false`.
128
+ * @default true
129
+ */
130
+ showActiveSectionTooltipOnMobile?: boolean;
131
+ /**
132
+ * On mobile, a view from seat thumbnail is displayed on the top left of the screen. Tapping this image will expand the thumbnail. You can hide this thumbnail on mobile by passing `showViewFromYourSeatOnMobile: false`.
133
+ * @default true
134
+ */
135
+ showViewFromYourSeatOnMobile?: boolean;
136
+ /**
137
+ * On desktop, a view from seat is displayed inside the tooltip when hovering a seat. You can hide this picture on desktop by passing `showViewFromYourSeatOnDesktop: false`.
138
+ * @default true
139
+ */
140
+ showViewFromYourSeatOnDesktop?: boolean;
141
+ /**
142
+ * Used to enable or disable the category filter GUI, as well as configuring certain aspects of it. {@link https://docs.seats.io/docs/renderer/categoryfilter See documentation}
143
+ */
144
+ categoryFilter?: CategoryFilter;
145
+ /**
146
+ * Makes the specified categories available from selection, while making all others unavailable from selection. The array can be a list of category IDs or labels.
147
+ */
148
+ availableCategories?: CategoryKey[];
149
+ /**
150
+ * Makes the specified categories unavailable from selection. The array can be a list of category IDs or labels.
151
+ */
152
+ unavailableCategories?: CategoryKey[];
153
+ /**
154
+ * Leaves the specified categories normally visible, while making all others dimmed out. The array can be a list of category IDs or labels.
155
+ */
156
+ filteredCategories?: CategoryKey[];
157
+ objectColor?: (object: SelectableObjectProps, defaultColor: string, extraConfig: ExtraConfig) => string;
158
+ objectLabel?: (object: SelectableObjectProps, defaultLabel: string, extraConfig: ExtraConfig) => string;
159
+ /**
160
+ * @param object
161
+ * @param defaultIcon
162
+ * @param extraConfig
163
+ * @returns A string with the name of a FontAwesome v4.7.0 icon. {@link https://fontawesome.com/v4.7.0/icons/ See the full list of available icons}.
164
+ * For more details, {@link https://docs.seats.io/docs/renderer/config-objecticon see the documentation}.
165
+ */
166
+ objectIcon?: (object: SelectableObjectProps, defaultIcon: string | null, extraConfig?: ExtraConfig) => string;
167
+ sectionColor?: (section: SectionProps, defaultColor: string, extraConfig: ExtraConfig) => string;
168
+ /**
169
+ * This setting allows you specify when section contents (rows of seats, tables, etc) should be shown. Only available on charts with sections. {@link https://docs.seats.io/docs/renderer/config-showsectioncontents See documentation}
170
+ * @default 'always'
171
+ */
172
+ showSectionContents?: 'always' | 'auto' | 'onlyAfterZoom';
173
+ /**
174
+ * A function that should return true if an object is visible, and false otherwise. When an object is invisible, it can't be selected or interacted with. {@link https://docs.seats.io/docs/renderer/config-isobjectvisible See documentation}
175
+ */
176
+ isObjectVisible?: (object: SelectableObjectProps, extraConfig: ExtraConfig) => boolean;
177
+ /**
178
+ * Set to true to show seat labels in your chart.
179
+ * @deault false
180
+ */
181
+ showSeatLabels?: boolean;
182
+ /**
183
+ * Start a session to temporarily hold objects upon selection. {@link https://docs.seats.io/docs/renderer/config-session See documentation} for more details.
184
+ * @default 'none'
185
+ */
186
+ session?: 'continue' | 'manual' | 'none' | 'start';
187
+ /**
188
+ * Hold tokens allows the chart renderer to re-select already selected seats after a page refresh. {@link https://docs.seats.io/docs/renderer/config-holdtoken See documentation} for more details.
189
+ */
190
+ holdToken?: string;
191
+ /**
192
+ * The name of the hidden input field that contains the hold token. Only makes sense when a session is active. {@link https://docs.seats.io/docs/renderer/config-holdtokeninputname See documentation}
193
+ */
194
+ holdTokenInputName?: string;
195
+ holdOnSelectForGAs?: boolean;
196
+ /**
197
+ * When zoomed in on a chart with sections, a minimap is shown so ticket buyers have a better sense which seats they're looking at. Set to false to hide it.
198
+ * @default true
199
+ */
200
+ showMinimap?: boolean;
201
+ /**
202
+ * Whether to show the full screen button or not. For accounts created prior to September 11th 2019, please see the {@link https://docs.seats.io/docs/renderer/config-showfullscreenbutton documentation}.
203
+ * @default true
204
+ */
205
+ showFullScreenButton?: boolean;
206
+ /**
207
+ * If true, a legend with the category names and colors is rendered at the top of the chart.
208
+ * @default false
209
+ */
210
+ showLegend?: boolean;
211
+ legend?: Legend;
212
+ /**
213
+ * Set to false to hide the zoom out button on mobile devices.
214
+ * @default true
215
+ */
216
+ showZoomOutButtonOnMobile?: boolean;
217
+ /**
218
+ * Specifies the type of input device to optimize the user interface for. See the {@link https://docs.seats.io/docs/renderer/inputdevice documentation} for more information.
219
+ */
220
+ inputDevice?: 'cursor' | 'touch' | 'auto';
221
+ /**
222
+ * This parameter allows you to override the default seats.io spinner that is shown while the floor plan is being loaded. The value can contain (valid) html.
223
+ */
224
+ loading?: string;
225
+ /**
226
+ * Sets the color scheme for the user interface. The colors of certain floor plan elements, such as zoomed-in sections, will also be adjusted accordingly.
227
+ */
228
+ colorScheme?: 'light' | 'dark';
229
+ /**
230
+ * Replaces certain colors of the current color scheme. {@link https://docs.seats.io/docs/renderer/colors See documentation}
231
+ */
232
+ colors?: {
233
+ colorSelected?: string;
234
+ cursorTooltipBackgroundColor?: string;
235
+ colorTitle?: string;
236
+ };
237
+ /**
238
+ * Sets the preset of styles to use for the seating chart user interface. {@link https://docs.seats.io/docs/renderer/stylepreset See documentation}
239
+ */
240
+ stylePreset?: 'balance' | 'bubblegum' | 'flathead' | 'bezels' | 'leaf';
241
+ /**
242
+ * Sets the intention for certain style properties, allowing to override the current style preset. {@link https://docs.seats.io/docs/renderer/style See documentation}
243
+ */
244
+ style?: StyleOverride;
245
+ /**
246
+ * Determines how the chart will fit within its parent container. See the {@link https://docs.seats.io/docs/renderer/config-fitto documentation} for more information on this setting.
247
+ */
248
+ fitTo?: 'widthAndHeight' | 'width';
249
+ /**
250
+ * This setting should only be used for accounts created before May 15th 2019. See the {@link https://docs.seats.io/docs/renderer/config-unifiedobjectpropertiesincallbacks documentation} for more details.
251
+ * @deprecated
252
+ */
253
+ unifiedObjectPropertiesInCallbacks?: boolean;
254
+ /**
255
+ * Sets the language for built-in texts in seats.io. For more details see {@link https://support.seats.io/en/articles/2074430-translating-embedded-floor-plans-i18n Translating embedded floor plans (I18N)}.
256
+ * @default 'en'
257
+ */
258
+ language?: Language;
259
+ /**
260
+ * Allows overriding build-in strings with your own translations. For more information, see {@link http://support.seats.io/integrating-seats-io/multi-language-i18n-support this page}.
261
+ */
262
+ messages?: ChartRendererStrings;
263
+ /**
264
+ * The keys of the channels you wish to make selectable. Objects that have no channel assigned, or that have a channel assigned whose key is not in this list, will not be selectable. However, by passing in NO_CHANNEL as channel key, objects without channel become selectable.
265
+ * You cannot supply an empty array: the channels array needs to be either undefined, or an array of at least one element.
266
+ */
267
+ channels?: string[];
268
+ }
269
+ export type ExtractedEventManagerProps = Pick<ChartRendererConfigOptions, 'colors' | 'colorScheme' | 'extraConfig' | 'fitTo' | 'objectColor' | 'showFullScreenButton' | 'style' | 'stylePreset' | 'tooltipInfo' | 'themePreset' | 'themeColors'>;
270
+ export interface EventManagerConfigOptions extends CommonConfigOptions, ExtractedEventManagerProps, EventManagerCallbacks {
271
+ event: string;
272
+ mode: EventManagerMode;
273
+ /**
274
+ * The secret key of a workspace.
275
+ * WARNING: Never expose this key on a public web page. It should only be used behind a login wall.
276
+ */
277
+ secretKey: string;
278
+ /**
279
+ * Supported languages:
280
+ * - `'nl'` - Dutch
281
+ * - `'en'` - English
282
+ * - `'de'` – German
283
+ * - `'pt'` – Portuguese
284
+ * - `'es'` – Spanish
285
+ * - `'fr'` – French'
286
+ *
287
+ * @default `'en'`
288
+ */
289
+ language?: 'de' | 'en' | 'es' | 'fr' | 'nl' | 'pt';
290
+ /**
291
+ * Allows to toggle on or off some features of the cursor tooltip, displayed when hovering objects when using pointing devices like a mouse, or when tapping on an object on touch devices.
292
+ */
293
+ messages?: EventAndChartManagerStrings;
294
+ objectTooltip?: {
295
+ /**
296
+ * Show the orderId in the tooltip if present.
297
+ * @default true
298
+ */
299
+ showOrderId?: boolean;
300
+ /**
301
+ * Show the technical label, if one of the label components was overridden via the Displayed Label field in Designer.
302
+ * @default false
303
+ */
304
+ showTechicalLabel?: boolean;
305
+ };
306
+ viewSettingsDefaults?: {
307
+ /**
308
+ * @default false
309
+ */
310
+ showSeatLabels?: boolean;
311
+ /**
312
+ * @default false
313
+ */
314
+ showRowLabels?: boolean;
315
+ /**
316
+ * Use channel colors (true) or category colors (false). Only available in select and static modes
317
+ * @default false
318
+ */
319
+ useChannelColors?: boolean;
320
+ };
321
+ }
322
+ export interface ChartDesignerConfigOptions {
323
+ canvasColorScheme?: 'auto' | 'light' | 'dark';
324
+ chartKey?: string;
325
+ container?: Element;
326
+ divId?: string;
327
+ /**
328
+ * Documentation: {@link https://docs.seats.io/docs/embedded-designer/configuration-features}
329
+ */
330
+ features?: {
331
+ disabled?: (keyof ChartDesignerFeatures)[];
332
+ enabled?: (keyof ChartDesignerFeatures)[];
333
+ readOnly?: ('chartName' | 'categoryList')[];
334
+ };
335
+ /**
336
+ * Documentation: {@link https://docs.seats.io/docs/embedded-designer/configuration-language}
337
+ */
338
+ language?: 'de' | 'en' | 'es' | 'fr' | 'pt';
339
+ mode?: 'normal' | 'safe' | 'readOnly';
340
+ onChartCreated?: (chartKey: string) => void;
341
+ onChartPublished?: (chartKey: string) => void;
342
+ onChartUpdated?: (chartKey: string) => void;
343
+ onDesignerRendered?: (designer: ChartDesigner) => void;
344
+ onDesignerRenderingFailed?: (designer: ChartDesigner) => void;
345
+ onExitRequested?: () => void;
346
+ openDraftDrawing?: boolean;
347
+ openLastDrawing?: boolean;
348
+ secretKey: string;
349
+ }
350
+ export interface ChartDesignerFeatures {
351
+ 'tables.bookAsAWhole'?: boolean;
352
+ areas?: boolean;
353
+ backgroundImage?: boolean;
354
+ booths?: boolean;
355
+ categoryList?: boolean;
356
+ contextActions?: boolean;
357
+ firstTimeTutorial?: boolean;
358
+ focalPoint?: boolean;
359
+ icons?: boolean;
360
+ images?: boolean;
361
+ labeling?: boolean;
362
+ nodes?: boolean;
363
+ objectProperties?: boolean;
364
+ publishedSectionLabel?: boolean;
365
+ publishing?: boolean;
366
+ referenceChart?: boolean;
367
+ rows?: boolean;
368
+ sections?: boolean;
369
+ shapes?: boolean;
370
+ tables?: boolean;
371
+ texts?: boolean;
372
+ viewFromYourSeat?: boolean;
373
+ }
374
+ export interface ChartDesigner extends Pick<SeatingChart, 'render' | 'destroy'> {
375
+ }
376
+ export type ConfigChange = Pick<ChartRendererConfigOptions, 'availableCategories' | 'channels' | 'extraConfig' | 'filteredCategories' | 'maxSelectedObjects' | 'numberOfPlacesToSelect' | 'objectColor' | 'objectLabel' | 'pricing' | 'unavailableCategories'>;
377
+ type ChartRendererBuiltInStrings = {
378
+ [key in ChartRendererStringKey]: string;
379
+ };
380
+ type EventAndChartManagerBuiltInStrings = {
381
+ [key in EventAndChartManagerStringKey]: string;
382
+ };
383
+ export type AnyString<T> = T & {
384
+ [key: string]: string;
385
+ };
386
+ export type LiteralUnion<T extends string> = T | {};
387
+ export type ChartRendererStrings = AnyString<Partial<ChartRendererBuiltInStrings>>;
388
+ export type EventAndChartManagerStrings = AnyString<Partial<EventAndChartManagerBuiltInStrings>>;
389
+ export type ChartRendererStringKey = 'accessible' | 'and' | 'available.places' | 'available.seats' | 'bar' | 'bench' | 'cancel' | 'chair' | 'choosePriceLevel' | 'choosePriceLevels' | 'chooseTickets' | 'clickToDeselect' | 'clickToDeselectPlaces' | 'clickToFilterCategories' | 'clickToSelect' | 'clickToSelectPlaces' | 'close' | 'closeFullScreen' | 'companionSeat' | 'confirm' | 'couch' | 'deselect' | 'deselectOthersFirst' | 'disabledBySocialDistancing' | 'done' | 'holdFailedModalBodyBecauseBadRequest' | 'holdFailedModalBodyBecauseNetworkIssue' | 'holdFailedModalBodyBecauseOther' | 'holdReleaseFailedModalBodyBecauseBadRequest' | 'holdReleaseFailedModalBodyBecauseNetworkIssue' | 'holdReleaseFailedModalBodyBecauseOther' | 'maxSelectionReached' | 'maxSelectionReachedWithNumber' | 'moreExtraCategories' | 'multipleTicketsAvailableInSection' | 'noLongerAvailable' | 'noOrphanSeats' | 'noSocialDistancingOrphanSeats' | 'notAvailable' | 'notEnoughPlacesAvailable' | 'notEnoughPlacesToSelectLeft' | 'openFullScreen' | 'pickCategory' | 'renderingFailed' | 'restrictedView' | 'row' | 'seat' | 'seats' | 'section' | 'sectionAvailability.none' | 'select-lasso' | 'select-rectangle' | 'select' | 'selected' | 'selectionToolsHintDeselect' | 'selectMorePlaces' | 'selectQuantity' | 'sessionExpired' | 'sessionExpiredAllPlacesReleased' | 'sessionExpiredStartOver' | 'singlePlaceToSelectLeft' | 'singleTicketAvailableInSection' | 'stool' | 'table' | 'tapToFilterCategories' | 'ticketsAvailableFrom' | 'unavailablePlace' | 'useMetaKeyToZoom' | 'willBeDisabledBySocialDistancing' | 'x.places' | 'x.to.y.places';
390
+ export type EventAndChartManagerStringKey = 'allPlacesAvailable' | 'allTablesWillBeBookableBySeat' | 'allTablesWillBeBookableByTable' | 'anEventInSeasonChannelForEvent' | 'anEventInSeasonChannelForPartialSeason' | 'anEventInSeasonChannelForTopLevelSeason' | 'applyChanges' | 'assignedToChannelInSeasonEvent' | 'assignedToChannelInSeasonPartialSeason' | 'assignedToChannelInSeasonTopLevelSeason' | 'book' | 'bookableBySeat' | 'bookableByTable' | 'bookBySeatsOnly' | 'bookByTablesOnly' | 'booked' | 'bookNumPlaces' | 'cannotBeMarkedAs' | 'cantManuallyEnableAndDisableSameSeat' | 'change' | 'channelName' | 'channels' | 'clickToBook' | 'clickToChange' | 'clickToDisableSeats' | 'clickToEnableSeats' | 'clickToMarkAs' | 'clickToRelease' | 'clickToTestRules' | 'clickToUndo' | 'close' | 'confirmAllBookableBySeat' | 'confirmAllBookableByTable' | 'confirmBookSocialDistancingBody' | 'confirmBookSocialDistancingConfirmButton' | 'confirmBookSocialDistancingTitle' | 'confirmDeleteRuleset' | 'confirmLeaveChangesWillBeLost' | 'confirmResetObjectCategories' | 'confirmResetTableBookingModes' | 'confirmUnassignAndRemoveChannel' | 'createChannel' | 'createRuleset' | 'defaultChannel' | 'defaultChannelHint' | 'delete' | 'disable' | 'disabledByRules' | 'disableDiagonalSeatsInFrontAndBehind' | 'disabledSeat' | 'disabledSeats' | 'disableSeats' | 'disableSeatsInFrontAndBehind' | 'done' | 'duplicate' | 'editRules' | 'enable' | 'enableMaxGroupSizeHint' | 'entirelyForSale' | 'entirelyNotForSale' | 'extraPlace' | 'extraPlaces' | 'fixedSocialDistancingGroupLayout' | 'fixedSocialDistancingGroupLayoutHint1' | 'fixedSocialDistancingGroupLayoutHint2' | 'forSale' | 'forSaleWillNotConsumeSaveMessage' | 'free' | 'goBack' | 'manage' | 'manageChannels' | 'manuallyDisabled' | 'manuallyDisabledSeat' | 'manuallyDisabledSeats' | 'manuallyDisableSeats' | 'manuallyEnabledOverRules' | 'manuallyEnabledSeat' | 'manuallyEnabledSeats' | 'manuallyEnableSeats' | 'markAs' | 'markNumObjectsAs' | 'markNumPlacesAsNotForSale' | 'maxGroupSize' | 'maxOccupancy' | 'maxOccupancyPlaces' | 'noCategory' | 'noChannel' | 'noChannelsCreated' | 'noPlacesAvailable' | 'noSeasonChannelsCreated' | 'notForSale' | 'notForSaleInSeason' | 'notForSaleWillConsumeSaveMessage' | 'numberOfDisabledAisleSeats' | 'numberOfDisabledSeatsToTheSides' | 'numberOfPlacesNotForSaleError' | 'numExtraPlacesWillBeBooked' | 'numObjectsMarkedAs' | 'numPlacesBooked' | 'numPlacesNotForSale' | 'numPlacesWillBeReleased' | 'numSavesForSaleRemaining' | 'numSavesNotForSaleRemaining' | 'numWillBeBookableBySeat' | 'numWillBeBookableByTable' | 'object' | 'objectFoundLabel' | 'objects' | 'objectWillBeBooked' | 'objectWillBeReleased' | 'oneGroupPerTable' | 'oneGroupPerTableHint' | 'place' | 'places' | 'placesBooked' | 'placesNotForSale' | 'placesUnavailable' | 'pressToFocus' | 'pressToFocusWithinFloor' | 'release' | 'releaseNumPlaces' | 'reservedByToken' | 'resetToDefaultCategory' | 'resetToDefaults_help_categories' | 'resetToDefaults_help_makeAllBookBySeat' | 'resetToDefaults_help_makeAllBookByTable' | 'resetToDefaults_help' | 'resetToDefaults' | 'ruleBasedSocialDistancingGroupLayout' | 'ruleBasedSocialDistancingGroupLayoutHint' | 'rulesetName' | 'rulesetX' | 'save' | 'savedTooManyTimes' | 'saves' | 'searchByObjectLabel' | 'seasonBooked' | 'seasonBookedInCurrentEvent' | 'seasonBookedInCurrentSeason' | 'seasonBookedInEvents' | 'seasonCategoriesNotEditableNotice' | 'seasonChannelsNotEditableNotice' | 'seasonTableBookingModeNotEditableNotice' | 'seasonUnavailableFromEventBookings' | 'seat_booked_table_unavailable' | 'selectMode' | 'selectWholeRow' | 'serverFailCheckInternet' | 'showRowLabels' | 'showSeatLabels' | 'socialDistancingGroupLayoutType' | 'socialDistancingRulesets' | 'somethingWentWrong' | 'success' | 'table_booked_seats_unavailable' | 'table' | 'tableBookingModeAllBySeat' | 'tableBookingModeAllByTable' | 'tableBookingModeCustom' | 'tableBookingModeInherit' | 'tables' | 'thisIsAPreview' | 'undo' | 'useChannelColors' | 'willBeBookableBySeat' | 'willBeBookableByTable' | 'willBeMarkedAs' | 'xMore' | 'xObjectsFound';
391
+ export type ChartRendererCallbacks = {
392
+ onChartRendered?: (chart: SeatingChart) => void;
393
+ onChartRenderingFailed?: (chart: SeatingChart) => void;
394
+ onChartRerenderingStarted?: (chart: SeatingChart) => void;
395
+ onFilteredCategoriesChanged?: (categories: Category[]) => void;
396
+ onFloorChanged?: (floor?: Floor) => void;
397
+ onFullScreenClosed?: () => void;
398
+ onFullScreenOpened?: () => void;
399
+ onHoldFailed?: (objects: BookableObjectProps[], ticketTypes: string[]) => void;
400
+ onHoldSucceeded?: (objects: BookableObjectProps[], ticketTypes: string[]) => void;
401
+ onHoldTokenExpired?: () => void;
402
+ onObjectClicked?: (object: SelectableObjectProps) => void;
403
+ onObjectDeselected?: (object: BookableObjectProps, selectedTicketType: string) => void;
404
+ onObjectMouseOut?: (object: SelectableObjectProps) => void;
405
+ onObjectMouseOver?: (object: SelectableObjectProps) => void;
406
+ onObjectSelected?: (object: SelectableObjectProps, selectedTicketType: string) => void;
407
+ onObjectStatusChanged?: (object: BookableObjectProps) => void;
408
+ onReleaseHoldFailed?: (objects: BookableObjectProps[], ticketTypes: string[]) => void;
409
+ onReleaseHoldSucceeded?: (objects: BookableObjectProps[], ticketTypes: string[]) => void;
410
+ onSelectedObjectBooked?: (object: BookableObjectProps) => void;
411
+ onSelectionInvalid?: (violations: string[]) => void;
412
+ onSelectionValid?: () => void;
413
+ onSessionInitialized?: (holdToken: HoldToken) => void;
414
+ };
415
+ export type EventManagerCallbacks = Pick<ChartRendererCallbacks, 'onChartRendered' | 'onChartRenderingFailed' | 'onChartRerenderingStarted' | 'onObjectSelected' | 'onObjectDeselected' | 'onObjectClicked' | 'onFullScreenOpened' | 'onFullScreenClosed'> & {
416
+ onSubmitFailed?: () => void;
417
+ onSubmitSucceeded?: () => void;
418
+ };
419
+ export interface Legend {
420
+ /**
421
+ * Set this property to true to hide non selectable categories in the legend. A non selectable category is a category for which there are no selectable objects on the chart.
422
+ * By default, even categories without selectable objects are shown in the legend.
423
+ * @default false
424
+ */
425
+ hideNonSelectableCategories?: boolean;
426
+ /**
427
+ * Set this property to true to hide the gray "Not Available" item in the legend.
428
+ * @default false
429
+ */
430
+ hideUnavailableLegendItem?: boolean;
431
+ /**
432
+ * Set this property to true to only show category labels in the legend, without pricing information. Cannot be used in combination with `legend.hideCategoryName: true`.
433
+ * @default false
434
+ */
435
+ hidePricing?: boolean;
436
+ /**
437
+ * Set this property to true to only show pricing information in the legend, without the category name. Cannot be used in combination with `legend.hidePricing: true`.
438
+ * @default false
439
+ */
440
+ hideCategoryName?: boolean;
441
+ }
442
+ export type Region = 'eu' | 'na' | 'sa' | 'oc';
443
+ export type Floor = {
444
+ name: string;
445
+ categories?: Category[];
446
+ };
447
+ export type Category = {
448
+ accessible: boolean;
449
+ color: string;
450
+ key: number;
451
+ label: string;
452
+ pricing: {
453
+ price: number;
454
+ formattedPrice: string;
455
+ };
456
+ hasSelectableObjects: boolean;
457
+ };
458
+ export type HoldToken = {
459
+ token: string;
460
+ expiresAt: string;
461
+ expiresInSeconds: number;
462
+ };
463
+ export type StyleOverride = {
464
+ font?: 'Roboto' | 'Montserrat' | 'WorkSans' | 'NotoSansHK' | 'Lato' | 'NunitoSans';
465
+ fontWeight?: 'bolder' | 'minMax';
466
+ borderRadius?: 'none' | 'max' | 'asymmetrical';
467
+ border?: '3d' | 'thick';
468
+ padding?: 'spacious';
469
+ buttonFace: 'fillEnabled' | 'fillHighlightedOption';
470
+ };
471
+ export type ExtraConfig = Dict<any>;
472
+ export type SelectionLimiter = number | (TotalLimiter | TicketTypeLimiter | CategoryLimiter | CategoryAndTicketLimiter)[];
473
+ export type TotalLimiter = {
474
+ total: number;
475
+ };
476
+ export type TicketTypeLimiter = {
477
+ ticketType: string;
478
+ quantity: number;
479
+ };
480
+ export type CategoryLimiter = {
481
+ category: CategoryKey;
482
+ quantity: number;
483
+ };
484
+ export type CategoryAndTicketLimiter = {
485
+ category: string;
486
+ ticketTypes: TicketTypeLimiter[];
487
+ };
488
+ export interface ChartRendererObjectTooltip {
489
+ /**
490
+ * If true, a "Click to select" or "Click to deselect" message will be displayed on bookable objects when selection is allowed.
491
+ * @default true
492
+ */
493
+ showActionHint?: boolean;
494
+ /**
495
+ * If true, the amount of available seats of the section or general admission will be displayed.
496
+ * @default false
497
+ */
498
+ showAvailability?: boolean;
499
+ /**
500
+ * If true, the object's category color and name will be displayed.
501
+ * @default true
502
+ */
503
+ showCategory?: boolean;
504
+ /**
505
+ * If true, the section name, row number and/or seat number of the object will be visible. If false, no labeling will be shown.
506
+ * @default true
507
+ */
508
+ showLabel?: boolean;
509
+ /**
510
+ * If true, the price range of the object's category will be visible.
511
+ * @default true
512
+ */
513
+ showPricing?: boolean;
514
+ /**
515
+ * If true, a notice will be displayed on the tooltip if the object is unavailable.
516
+ * @default true
517
+ */
518
+ showUnavailableNotice?: boolean;
519
+ /**
520
+ * If true, a labels will be displayed in a hierarchy-based styling, improving readability. If false, labels will be displayed as flat text.
521
+ * @default true
522
+ */
523
+ stylizedLabel?: boolean;
524
+ /**
525
+ * If true, a popup will show up when selecting an object on mobile containing the same information as the desktop tooltip, seen on hover. A button must be pressed to confirm the selection. If false, selection is done instantly but no information regarding the object is shown to the user. If unset, it will automatically attempt to show it unless an onObjectClicked parameter is passed in.
526
+ * @default auto
527
+ */
528
+ confirmSelectionOnMobile?: boolean | 'auto';
529
+ }
530
+ export type Language = 'ar' | 'be' | 'bg' | 'ca' | 'cs' | 'cy' | 'da' | 'de' | 'el' | 'en' | 'es' | 'et' | 'fa' | 'fi' | 'fr' | 'hr' | 'he' | 'hu' | 'it' | 'ja' | 'ku' | 'li' | 'lv' | 'no' | 'nl' | 'pl' | 'pt' | 'ro' | 'ru' | 'sk' | 'sl' | 'sr' | 'sv' | 'tr' | 'uk' | 'zh-Hans' | 'zh-Hant';
531
+ export type CategoryFilter = {
532
+ /**
533
+ * If true, the category filter will be visible.
534
+ * @default false
535
+ */
536
+ enabled?: boolean;
537
+ /**
538
+ * If true, multiple categories can be selected at once.
539
+ * @default true
540
+ */
541
+ multiSelect?: boolean;
542
+ /**
543
+ * If true, the chart will zoom in or out to fit in the viewport the filtered objects.
544
+ * @default false
545
+ */
546
+ zoomOnSelect?: boolean;
547
+ };
548
+ export type DeprecatedConfigProperties = {
549
+ /**
550
+ * @deprecated Use `selectionValidators` instead. Read more at {@link https://docs.seats.io/docs/renderer-config-selectionvalidators}
551
+ */
552
+ allowOrphanSeats?: boolean;
553
+ /**
554
+ * @deprecated Use `selectionValidators` instead. Read more at {@link https://docs.seats.io/docs/renderer-config-selectionvalidators}
555
+ */
556
+ orphanSeats?: string;
557
+ /**
558
+ * @deprecated Use `tooltipInfo` instead. Read more at {@link https://docs.seats.io/docs/renderer-config-tooltipinfo}
559
+ */
560
+ customTooltipText?: boolean;
561
+ /**
562
+ * @deprecated Use `colorScheme`, `colors`, `stylePreset` and `style` instead. Read more at {@link https://docs.seats.io/docs/renderer-style-your-floor-plan}
563
+ */
564
+ tooltipStyle?: string;
565
+ /**
566
+ * @deprecated
567
+ */
568
+ isObjectSelectable?: Function;
569
+ /**
570
+ * @deprecated Use {@link https://docs.seats.io/docs/renderer-config-objectcategories objectCategories} instead.
571
+ */
572
+ objectCategory?: Function;
573
+ /**
574
+ * @deprecated Use the chart designer to indicate which row labels are shown.
575
+ */
576
+ showRowLabels?: boolean;
577
+ /**
578
+ * @deprecated Use {@link https://docs.seats.io/docs/renderer/colorscheme/ colorScheme} instead.
579
+ */
580
+ themePreset?: string;
581
+ /**
582
+ * @deprecated Use {@link https://docs.seats.io/docs/renderer/colors/ colors} instead.
583
+ */
584
+ themeColors?: any;
585
+ /**
586
+ * @deprecated Seats.io now uses native scrolling - no need to implement `onScrolledOutOfBoundsVertically` anymore.
587
+ */
588
+ onScrolledOutOfBoundsVertically?: () => void;
589
+ /**
590
+ * @deprecated Use {@link https://docs.seats.io/docs/renderer-config-session session} instead.
591
+ */
592
+ holdOnSelect?: boolean;
593
+ /**
594
+ * @deprecated Use `showSectionContents: "always"` instead.
595
+ */
596
+ alwaysShowSectionContents?: boolean;
597
+ /**
598
+ * @deprecated
599
+ */
600
+ showRowLines?: boolean;
601
+ };
602
+ export type ChartRendererMode = 'normal' | 'print' | 'spotlight' | 'static';
603
+ export type EventManagerMode = 'filterSections' | 'manageCategories' | 'manageChannels' | 'manageForSaleConfig' | 'manageObjectStatuses' | 'manageTableBooking' | 'select' | 'static';
604
+ export type SimplePricing = {
605
+ category: CategoryKey;
606
+ originalPrice?: number;
607
+ price: number;
608
+ };
609
+ export type MultiLevelPricing = {
610
+ category: number | string;
611
+ ticketTypes: TicketType[];
612
+ };
613
+ export type TicketType = {
614
+ ticketType: string;
615
+ originalPrice?: number;
616
+ price: number;
617
+ label?: string;
618
+ description?: string;
619
+ };
620
+ export type Pricing = (SimplePricing | MultiLevelPricing)[];
621
+ export type SelectionValidator = SelectionValidatorNoOrphanSeats | SelectionValidatorConsecutiveSeats | SelectionValidatorMinimumSelectedPlaces;
622
+ interface SelectionValidatorNoOrphanSeats {
623
+ type: 'noOrphanSeats';
624
+ mode?: 'strict' | 'lenient';
625
+ highlight?: boolean;
626
+ }
627
+ interface SelectionValidatorConsecutiveSeats {
628
+ type: 'consecutiveSeats';
629
+ }
630
+ interface SelectionValidatorMinimumSelectedPlaces {
631
+ type: 'minimumSelectedPlaces';
632
+ minimum: number;
633
+ }
634
+ export interface SelectedObject {
635
+ label: string;
636
+ ticketType: string;
637
+ }
638
+ export interface SelectedGA {
639
+ label: string;
640
+ amount: number;
641
+ }
642
+ export interface CategoryToJSON {
643
+ label: string;
644
+ color: string;
645
+ accessible: boolean;
646
+ key: CategoryKey;
647
+ pricing: PricingJson | null;
648
+ isFiltered: boolean;
649
+ hasSelectableObjects?: boolean;
650
+ }
651
+ export interface PricingJson {
652
+ price?: PriceType;
653
+ formattedPrice?: PriceType;
654
+ ticketTypes?: TicketTypeJson[];
655
+ }
656
+ interface TicketTypeJson {
657
+ ticketType?: string;
658
+ price?: PriceType;
659
+ label?: string;
660
+ formattedPrice?: PriceType;
661
+ }
662
+ interface Labels {
663
+ own: string;
664
+ displayedLabel: string;
665
+ parent?: string;
666
+ section?: string;
667
+ }
668
+ export type PriceType = number | string;
669
+ export interface InteractiveObjectProps {
670
+ readonly label?: string;
671
+ }
672
+ export interface NonBookableTableProps extends InteractiveObjectProps {
673
+ readonly label?: string;
674
+ readonly labels: Labels;
675
+ readonly id?: string;
676
+ readonly seats: SeatProps[];
677
+ readonly center: {
678
+ x: number;
679
+ y: number;
680
+ };
681
+ readonly category?: CategoryToJSON;
682
+ }
683
+ export interface NonBookableTableSeatProps extends InteractiveObjectProps {
684
+ readonly id?: string;
685
+ readonly label: string;
686
+ readonly labels: Labels;
687
+ readonly center: {
688
+ x: number;
689
+ y: number;
690
+ };
691
+ readonly restrictedView: boolean;
692
+ readonly companionSeat: boolean;
693
+ readonly accessible: boolean;
694
+ readonly disabledBySocialDistancingRules: boolean;
695
+ readonly parent: {
696
+ type: 'row' | 'table';
697
+ };
698
+ }
699
+ export interface SelectableObjectProps extends InteractiveObjectProps {
700
+ readonly id: string | undefined;
701
+ readonly label: string | undefined;
702
+ readonly objectType: string;
703
+ readonly labels: Labels;
704
+ readonly selected: boolean;
705
+ readonly selectedTicketType: string | undefined;
706
+ readonly accessible: boolean | undefined;
707
+ readonly restrictedView: boolean | undefined;
708
+ readonly companionSeat: boolean | undefined;
709
+ readonly displayObjectType: string | undefined;
710
+ readonly category?: CategoryToJSON;
711
+ readonly pricing: PricingJson;
712
+ readonly selectable?: boolean;
713
+ readonly disabledBySocialDistancingRules?: boolean;
714
+ }
715
+ export interface SectionProps extends InteractiveObjectProps {
716
+ readonly objectType: string;
717
+ readonly label: string | undefined;
718
+ readonly numberOfSelectableObjects: number;
719
+ readonly numberOfSelectedObjects: number;
720
+ readonly selectableCategories: CategoryKey[];
721
+ readonly entrance: string | null;
722
+ readonly isInteractive: boolean;
723
+ readonly labels: Labels;
724
+ readonly sectionCategory?: CategoryToJSON;
725
+ }
726
+ export interface InteractiveSectionProps extends SelectableObjectProps {
727
+ readonly ticketListing: ListingBySection;
728
+ }
729
+ export interface BookableObjectProps extends SelectableObjectProps {
730
+ /**
731
+ * Set to one of the predefined values `free`, `reservedByToken`, `booked` or use a custom status.
732
+ */
733
+ readonly status: LiteralUnion<'booked' | 'free' | 'reservedByToken'>;
734
+ readonly extraData: {} | undefined;
735
+ readonly forSale: boolean;
736
+ readonly dataPerEvent: Dict<object>;
737
+ inSelectableChannel?: boolean;
738
+ hashedChannelKey?: string;
739
+ isInChannel?: (channelKey: string) => boolean;
740
+ /**
741
+ * Only available in the Event Manager
742
+ */
743
+ channel?: Channel;
744
+ }
745
+ export interface SeatProps extends BookableObjectProps {
746
+ readonly center: {
747
+ x: number;
748
+ y: number;
749
+ };
750
+ readonly isOrphan: boolean;
751
+ readonly viewFromSeatUrl?: string;
752
+ readonly parent: {
753
+ type: 'row' | 'table';
754
+ };
755
+ }
756
+ export interface BoothProps extends BookableObjectProps {
757
+ readonly objectType: 'Booth';
758
+ }
759
+ export interface TableProps extends BookableObjectProps {
760
+ readonly seats: NonBookableTableSeatProps[];
761
+ readonly center: {
762
+ x: number;
763
+ y: number;
764
+ };
765
+ }
766
+ export interface GeneralAdmissionAreaProps extends BookableObjectProps {
767
+ readonly numBooked: number;
768
+ readonly capacity: number;
769
+ readonly numFree: number;
770
+ readonly numSelected: number;
771
+ readonly selectionPerTicketType: Dict<number>;
772
+ readonly holds: Dict<Dict<number>>;
773
+ readonly dataPerEvent: Dict<object>;
774
+ readonly entrance: string | null;
775
+ readonly translucent: boolean;
776
+ readonly bookAsAWhole: boolean;
777
+ }
778
+ export interface SeatingChart {
779
+ changeConfig: (config: ConfigChange) => Promise<void>;
780
+ clearSelection: () => Promise<void>;
781
+ deselectCategories: (categoryIds: string[]) => Promise<void>;
782
+ deselectObjects: (objects: string[] | Selection[]) => Promise<void>;
783
+ destroy: () => void;
784
+ findObject: (label: string) => Promise<SelectableObjectProps>;
785
+ getReportBySelectability: () => Promise<Object>;
786
+ holdToken: string;
787
+ listCategories: () => Promise<Category[]>;
788
+ listSelectedObjects: () => Promise<(any)[]>;
789
+ render: () => SeatingChart;
790
+ rerender: () => void;
791
+ resetView: () => Promise<void>;
792
+ selectCategories: (categoryIds: string[]) => Promise<void>;
793
+ selectedObjects: string[];
794
+ selectObjects: (objects: string[] | Selection[]) => Promise<void>;
795
+ startNewSession: () => Promise<void>;
796
+ zoomToFilteredCategories: () => Promise<void>;
797
+ zoomToSection: (label: string) => SectionProps[];
798
+ zoomToSelectedObjects: () => Promise<void>;
799
+ }
800
+ export interface EventManager extends Pick<SeatingChart, 'clearSelection' | 'deselectCategories' | 'deselectObjects' | 'destroy' | 'findObject' | 'listCategories' | 'listSelectedObjects' | 'render' | 'rerender' | 'resetView' | 'selectCategories' | 'selectObjects' | 'zoomToSection' | 'zoomToSelectedObjects'> {
801
+ }
802
+ export interface Channel {
803
+ name: string;
804
+ key: string;
805
+ color: string;
806
+ index: number;
807
+ }
808
+ export type Selection = {
809
+ id: string;
810
+ ticketType?: string;
811
+ amount?: number;
812
+ };
813
+ export type CategoryKey = string | number;
814
+ export interface Dict<T> {
815
+ [key: string]: T;
816
+ }
817
+ export type ListingBySection = {
818
+ minPrice: number;
819
+ quantity: number;
820
+ };
821
+ export {};
package/package.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "@seatsio/seatsio-types",
3
+ "description": "Type definitions for Seats.io",
4
+ "version": "0.3.0",
5
+ "license": "MIT",
6
+ "types": "dist/index.d.ts",
7
+ "files": [
8
+ "dist/index.d.ts"
9
+ ],
10
+ "devDependencies": {
11
+ "@actions/core": "1.10.1",
12
+ "cli-select-2": "2.0.0",
13
+ "typescript": "5.2.2",
14
+ "yargs": "17.7.2"
15
+ },
16
+ "scripts": {
17
+ "build": "tsc",
18
+ "watch": "tsc --watch",
19
+ "bump-version": "node scripts/bumpVersion.mjs"
20
+ }
21
+ }