@seatsio/seatsio-types 2.0.2 → 2.1.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.
Files changed (2) hide show
  1. package/dist/index.d.ts +75 -24
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -27,15 +27,23 @@ export interface CommonConfigOptions {
27
27
  */
28
28
  divId?: string;
29
29
  }
30
+ interface WithEvents {
31
+ event?: string;
32
+ events?: string[];
33
+ }
34
+ interface WithEvent {
35
+ event: string;
36
+ }
37
+ type Session = 'continue' | 'manual' | 'none' | 'start';
30
38
  export interface ChartRendererConfigOptions extends DeprecatedConfigProperties, CommonConfigOptions, ChartRendererCallbacks {
31
39
  /**
32
40
  * Allows to render a multi-floor seating chart with specific floor selected, instead of the default all-floors view.
33
41
  */
34
42
  activeFloor?: string;
35
43
  /**
36
- * The key of the events for which you want to render the seating chart.
37
- * 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.
38
- */
44
+ * The key of the events for which you want to render the seating chart.
45
+ * 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.
46
+ */
39
47
  events?: string[];
40
48
  /**
41
49
  * This parameter supports the following values:
@@ -47,8 +55,8 @@ export interface ChartRendererConfigOptions extends DeprecatedConfigProperties,
47
55
  */
48
56
  mode?: ChartRendererMode;
49
57
  /**
50
- * 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.
51
- */
58
+ * 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.
59
+ */
52
60
  objectTooltip?: ChartRendererObjectTooltip;
53
61
  /**
54
62
  * Seats supports two types of pricing: simple pricing and multi-level pricing. {@link https://docs.seats.io/docs/renderer/config-pricing See documentation}
@@ -67,8 +75,8 @@ export interface ChartRendererConfigOptions extends DeprecatedConfigProperties,
67
75
  * */
68
76
  workspaceKey: string;
69
77
  /**
70
- * The key of the event (or the season) for which you want to render the seating chart.
71
- */
78
+ * The key of the event (or the season) for which you want to render the seating chart.
79
+ */
72
80
  event?: string;
73
81
  /** Custom data to be passed to certain callbacks. {@link https://docs.seats.io/docs/renderer/config-extraconfig/ See documentation} for information. */
74
82
  extraConfig?: ExtraConfig;
@@ -186,7 +194,7 @@ export interface ChartRendererConfigOptions extends DeprecatedConfigProperties,
186
194
  * Start a session to temporarily hold objects upon selection. {@link https://docs.seats.io/docs/renderer/config-session See documentation} for more details.
187
195
  * @default 'none'
188
196
  */
189
- session?: 'continue' | 'manual' | 'none' | 'start';
197
+ session?: Session;
190
198
  /**
191
199
  * 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.
192
200
  */
@@ -223,27 +231,27 @@ export interface ChartRendererConfigOptions extends DeprecatedConfigProperties,
223
231
  inputDevice?: 'cursor' | 'touch' | 'auto';
224
232
  /**
225
233
  * 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.
226
- */
234
+ */
227
235
  loading?: string;
228
236
  /**
229
237
  * 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.
230
238
  */
231
239
  colorScheme?: 'light' | 'dark';
232
240
  /**
233
- * Replaces certain colors of the current color scheme. {@link https://docs.seats.io/docs/renderer/colors See documentation}
234
- */
241
+ * Replaces certain colors of the current color scheme. {@link https://docs.seats.io/docs/renderer/colors See documentation}
242
+ */
235
243
  colors?: {
236
244
  colorSelected?: string;
237
245
  cursorTooltipBackgroundColor?: string;
238
246
  colorTitle?: string;
239
247
  };
240
248
  /**
241
- * Sets the preset of styles to use for the seating chart user interface. {@link https://docs.seats.io/docs/renderer/stylepreset See documentation}
242
- */
249
+ * Sets the preset of styles to use for the seating chart user interface. {@link https://docs.seats.io/docs/renderer/stylepreset See documentation}
250
+ */
243
251
  stylePreset?: 'balance' | 'bubblegum' | 'flathead' | 'bezels' | 'leaf';
244
252
  /**
245
- * Sets the intention for certain style properties, allowing to override the current style preset. {@link https://docs.seats.io/docs/renderer/style See documentation}
246
- */
253
+ * Sets the intention for certain style properties, allowing to override the current style preset. {@link https://docs.seats.io/docs/renderer/style See documentation}
254
+ */
247
255
  style?: StyleOverride;
248
256
  /**
249
257
  * 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.
@@ -270,8 +278,7 @@ export interface ChartRendererConfigOptions extends DeprecatedConfigProperties,
270
278
  channels?: string[];
271
279
  }
272
280
  export type ExtractedEventManagerProps = Pick<ChartRendererConfigOptions, 'colors' | 'colorScheme' | 'extraConfig' | 'fitTo' | 'objectColor' | 'showFullScreenButton' | 'style' | 'stylePreset' | 'tooltipInfo' | 'themePreset' | 'themeColors'>;
273
- export interface EventManagerConfigOptions extends CommonConfigOptions, ExtractedEventManagerProps, EventManagerCallbacks {
274
- event: string;
281
+ interface BaseEventManagerConfigOptions extends CommonConfigOptions, ExtractedEventManagerProps, EventManagerCallbacks {
275
282
  mode: EventManagerMode;
276
283
  /**
277
284
  * The secret key of a workspace.
@@ -322,6 +329,41 @@ export interface EventManagerConfigOptions extends CommonConfigOptions, Extracte
322
329
  useChannelColors?: boolean;
323
330
  };
324
331
  }
332
+ interface EventManagerManageObjectStatusesModeConfigOptions extends BaseEventManagerConfigOptions, WithEvents {
333
+ mode: 'manageObjectStatuses';
334
+ session?: Session;
335
+ }
336
+ interface EventManagerManageChannelsModeConfigOptions extends BaseEventManagerConfigOptions, WithEvent {
337
+ mode: 'manageChannels';
338
+ manageChannelsList?: boolean;
339
+ unavailableObjectsSelectable?: boolean;
340
+ }
341
+ interface EventManagerManageCategoriesModeConfigOptions extends BaseEventManagerConfigOptions, WithEvent {
342
+ mode: 'manageCategories';
343
+ unavailableObjectsSelectable?: boolean;
344
+ }
345
+ interface EventManagerFilterSectionsModeConfigOptions extends BaseEventManagerConfigOptions, WithEvent {
346
+ mode: 'filterSections';
347
+ onFilteredSectionChange: (sectionLabels: string[]) => {};
348
+ }
349
+ interface EventManagerSelectModeConfigOptions extends BaseEventManagerConfigOptions, WithEvents {
350
+ mode: 'select';
351
+ maxSelectedObjects?: SelectionLimiter;
352
+ numberOfPlacesToSelect?: number;
353
+ selectedObjects?: (string | SelectedObject | SelectedGA)[];
354
+ selectionBy?: 'places' | 'objects';
355
+ ticketTypes?: TicketTypeJsonWithoutPrice[];
356
+ tooltipContents?: (object: object) => string;
357
+ unavailableObjectsSelectable?: boolean;
358
+ selectableObjects?: string[];
359
+ }
360
+ interface EventManagerStaticModeConfigOptions extends BaseEventManagerConfigOptions, WithEvents {
361
+ mode: 'static';
362
+ onObjectMouseOver?: (object: SelectableObjectProps) => void;
363
+ onObjectMouseOut?: (object: SelectableObjectProps) => void;
364
+ tooltipContents?: (object: object) => string;
365
+ }
366
+ export type EventManagerConfigOptions = EventManagerManageObjectStatusesModeConfigOptions | EventManagerManageChannelsModeConfigOptions | EventManagerManageCategoriesModeConfigOptions | EventManagerSelectModeConfigOptions | EventManagerFilterSectionsModeConfigOptions | EventManagerStaticModeConfigOptions | (BaseEventManagerConfigOptions & WithEvent);
325
367
  export interface ChartDesignerConfigOptions {
326
368
  canvasColorScheme?: 'auto' | 'light' | 'dark';
327
369
  chartKey?: string;
@@ -528,9 +570,9 @@ export interface ChartRendererObjectTooltip {
528
570
  */
529
571
  stylizedLabel?: boolean;
530
572
  /**
531
- * 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.
532
- * @default auto
533
- */
573
+ * 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.
574
+ * @default auto
575
+ */
534
576
  confirmSelectionOnMobile?: boolean | 'auto';
535
577
  }
536
578
  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';
@@ -597,12 +639,12 @@ export type DeprecatedConfigProperties = {
597
639
  */
598
640
  holdOnSelect?: boolean;
599
641
  /**
600
- * @deprecated Use `showSectionContents: "always"` instead.
601
- */
642
+ * @deprecated Use `showSectionContents: "always"` instead.
643
+ */
602
644
  alwaysShowSectionContents?: boolean;
603
645
  /**
604
- * @deprecated
605
- */
646
+ * @deprecated
647
+ */
606
648
  showRowLines?: boolean;
607
649
  };
608
650
  export type ChartRendererMode = 'normal' | 'print' | 'spotlight' | 'static';
@@ -665,6 +707,11 @@ interface TicketTypeJson {
665
707
  label?: string;
666
708
  formattedPrice?: PriceType;
667
709
  }
710
+ interface TicketTypeJsonWithoutPrice {
711
+ ticketType?: string;
712
+ label?: string;
713
+ description?: string;
714
+ }
668
715
  interface Labels {
669
716
  own: string;
670
717
  displayedLabel: string;
@@ -791,6 +838,10 @@ export interface SeatingChart {
791
838
  zoomToSelectedObjects: () => Promise<void>;
792
839
  }
793
840
  export interface EventManager extends Pick<SeatingChart, 'clearSelection' | 'deselectCategories' | 'deselectObjects' | 'destroy' | 'findObject' | 'listCategories' | 'listSelectedObjects' | 'render' | 'rerender' | 'resetView' | 'selectCategories' | 'selectObjects' | 'zoomToSection' | 'zoomToSelectedObjects'> {
841
+ setHighlightedObjects(strings: string[]): void;
842
+ clearHighlightedObjects(): void;
843
+ setFilteredSection(label: string): void;
844
+ clearFilteredSection(): void;
794
845
  }
795
846
  export interface Channel {
796
847
  name: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@seatsio/seatsio-types",
3
3
  "description": "Type definitions for Seats.io",
4
- "version": "2.0.2",
4
+ "version": "2.1.0",
5
5
  "license": "MIT",
6
6
  "types": "dist/index.d.ts",
7
7
  "files": [