@seatsio/seatsio-types 2.9.0 → 3.0.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 +58 -40
  2. package/package.json +5 -1
package/dist/index.d.ts CHANGED
@@ -113,7 +113,7 @@ export interface ChartRendererConfigOptions extends DeprecatedConfigProperties,
113
113
  * @param ticketType The ticket type for which the user clicked on the plus button. Optional.
114
114
  * {@link https://docs.seats.io/docs/renderer/config-cangaselectionbeincreased See documentation}
115
115
  */
116
- canGASelectionBeIncreased?: (gaArea: GeneralAdmissionAreaProps, defaultValue: boolean, extraConfig: ExtraConfig, ticketType?: TicketTypeJson) => boolean;
116
+ canGASelectionBeIncreased?: (gaArea: GeneralAdmissionArea, defaultValue: boolean, extraConfig: ExtraConfig, ticketType?: TicketTypeJson) => boolean;
117
117
  /**
118
118
  * 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.
119
119
  * {@link https://docs.seats.io/docs/renderer/config-selectedobjectsinputname See documentation}
@@ -132,7 +132,7 @@ export interface ChartRendererConfigOptions extends DeprecatedConfigProperties,
132
132
  /**
133
133
  * 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}
134
134
  */
135
- tooltipInfo?: <T extends SelectableObjectProps>(object: T) => string;
135
+ tooltipInfo?: (object: SelectableObject) => string;
136
136
  /**
137
137
  * On mobile, when displaying a chart with sections, a tooltip is shown at the bottom of the screen with the section name and pricing.
138
138
  * You can hide this tooltip on mobile by passing `showActiveSectionTooltipOnMobile: false`.
@@ -165,8 +165,8 @@ export interface ChartRendererConfigOptions extends DeprecatedConfigProperties,
165
165
  * Leaves the specified categories normally visible, while making all others dimmed out. The array can be a list of category IDs or labels.
166
166
  */
167
167
  filteredCategories?: CategoryKey[];
168
- objectColor?: (object: SelectableObjectProps, defaultColor: string, extraConfig: ExtraConfig) => string;
169
- objectLabel?: (object: SelectableObjectProps, defaultLabel: string, extraConfig: ExtraConfig) => string;
168
+ objectColor?: (object: SelectableObject, defaultColor: string, extraConfig: ExtraConfig) => string;
169
+ objectLabel?: (object: SelectableObject, defaultLabel: string, extraConfig: ExtraConfig) => string;
170
170
  /**
171
171
  * @param object
172
172
  * @param defaultIcon
@@ -174,8 +174,8 @@ export interface ChartRendererConfigOptions extends DeprecatedConfigProperties,
174
174
  * @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}.
175
175
  * For more details, {@link https://docs.seats.io/docs/renderer/config-objecticon see the documentation}.
176
176
  */
177
- objectIcon?: (object: SelectableObjectProps, defaultIcon: string | null, extraConfig?: ExtraConfig) => string;
178
- sectionColor?: (section: SectionProps, defaultColor: string, extraConfig: ExtraConfig) => string;
177
+ objectIcon?: (object: SelectableObject, defaultIcon: string | null, extraConfig?: ExtraConfig) => string;
178
+ sectionColor?: (section: Section, defaultColor: string, extraConfig: ExtraConfig) => string;
179
179
  /**
180
180
  * 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}
181
181
  * @default 'always'
@@ -184,7 +184,7 @@ export interface ChartRendererConfigOptions extends DeprecatedConfigProperties,
184
184
  /**
185
185
  * 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}
186
186
  */
187
- isObjectVisible?: (object: SelectableObjectProps, extraConfig: ExtraConfig) => boolean;
187
+ isObjectVisible?: (object: SelectableObject, extraConfig: ExtraConfig) => boolean;
188
188
  /**
189
189
  * Set to true to show seat labels in your chart.
190
190
  * @deault false
@@ -366,7 +366,7 @@ export interface EventManagerSelectModeConfigOptions extends BaseEventManagerCon
366
366
  * @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}.
367
367
  * For more details, {@link https://docs.seats.io/docs/event-manager/modes/select#objecticon see the documentation}.
368
368
  */
369
- objectIcon?: (object: SelectableObjectProps, defaultIcon: string | null, extraConfig?: ExtraConfig) => string;
369
+ objectIcon?: (object: SelectableObject, defaultIcon: string | null, extraConfig?: ExtraConfig) => string;
370
370
  objectTooltip?: {
371
371
  showOrderId?: boolean;
372
372
  showTechnicalLabel?: boolean;
@@ -378,12 +378,13 @@ export interface EventManagerSelectModeConfigOptions extends BaseEventManagerCon
378
378
  }
379
379
  export interface EventManagerStaticModeConfigOptions extends BaseEventManagerConfigOptions, WithEvents {
380
380
  mode: 'static';
381
- onObjectMouseOver?: (object: SelectableObjectProps) => void;
382
- onObjectMouseOut?: (object: SelectableObjectProps) => void;
381
+ onObjectMouseOver?: (object: SelectableObject) => void;
382
+ onObjectMouseOut?: (object: SelectableObject) => void;
383
383
  tooltipContents?: (object: object) => string;
384
384
  }
385
385
  export type EventManagerConfigOptions = EventManagerManageObjectStatusesModeConfigOptions | EventManagerManageChannelsModeConfigOptions | EventManagerManageCategoriesModeConfigOptions | EventManagerSelectModeConfigOptions | EventManagerFilterSectionsModeConfigOptions | EventManagerStaticModeConfigOptions | (BaseEventManagerConfigOptions & WithEvent);
386
- export interface ChartDesignerConfigOptions {
386
+ export type ChartDesignerConfigOptions = ChartDesignerNormalModeConfigOptions | ChartDesignerReadOnlyModeConfigOptions | ChartDesignerSafeModeConfigOptions;
387
+ export interface BaseChartDesignerConfigOptions {
387
388
  canvasColorScheme?: 'auto' | 'light' | 'dark';
388
389
  chartKey?: string;
389
390
  container?: Element;
@@ -400,7 +401,6 @@ export interface ChartDesignerConfigOptions {
400
401
  * Documentation: {@link https://docs.seats.io/docs/embedded-designer/configuration-language}
401
402
  */
402
403
  language?: 'de' | 'en' | 'es' | 'fr' | 'pt';
403
- mode?: 'normal' | 'safe' | 'readOnly';
404
404
  onChartCreated?: (chartKey: string) => void;
405
405
  onChartPublished?: (chartKey: string) => void;
406
406
  onChartUpdated?: (chartKey: string) => void;
@@ -411,6 +411,18 @@ export interface ChartDesignerConfigOptions {
411
411
  openLatestDrawing?: boolean;
412
412
  secretKey: string;
413
413
  }
414
+ export interface ChartDesignerNormalModeConfigOptions extends BaseChartDesignerConfigOptions {
415
+ mode?: 'normal';
416
+ }
417
+ export interface ChartDesignerReadOnlyModeConfigOptions extends BaseChartDesignerConfigOptions {
418
+ mode: 'readOnly';
419
+ }
420
+ export interface ChartDesignerSafeModeConfigOptions extends BaseChartDesignerConfigOptions {
421
+ mode: 'safe';
422
+ safeModeOptions?: {
423
+ allowDeletingObjects?: boolean;
424
+ };
425
+ }
414
426
  export interface ChartDesignerFeatures {
415
427
  'tables.bookAsAWhole'?: boolean;
416
428
  areas?: boolean;
@@ -460,18 +472,18 @@ export type ChartRendererCallbacks = {
460
472
  onFloorChanged?: (floor?: Floor) => void;
461
473
  onFullScreenClosed?: () => void;
462
474
  onFullScreenOpened?: () => void;
463
- onHoldFailed?: (objects: BookableObjectProps[], ticketTypes: TicketTypeJson[]) => void;
464
- onHoldSucceeded?: (objects: BookableObjectProps[], ticketTypes: TicketTypeJson[]) => void;
475
+ onHoldFailed?: (objects: BookableObject[], ticketTypes: TicketTypeJson[]) => void;
476
+ onHoldSucceeded?: (objects: BookableObject[], ticketTypes: TicketTypeJson[]) => void;
465
477
  onHoldTokenExpired?: () => void;
466
- onObjectClicked?: (object: SelectableObjectProps) => void;
467
- onObjectDeselected?: (object: BookableObjectProps, selectedTicketType: TicketTypeJson) => void;
468
- onObjectMouseOut?: (object: SelectableObjectProps) => void;
469
- onObjectMouseOver?: (object: SelectableObjectProps) => void;
470
- onObjectSelected?: (object: SelectableObjectProps, selectedTicketType: TicketTypeJson) => void;
471
- onObjectStatusChanged?: (object: BookableObjectProps) => void;
472
- onReleaseHoldFailed?: (objects: BookableObjectProps[], ticketTypes: TicketTypeJson[]) => void;
473
- onReleaseHoldSucceeded?: (objects: BookableObjectProps[], ticketTypes: TicketTypeJson[]) => void;
474
- onSelectedObjectBooked?: (object: BookableObjectProps) => void;
478
+ onObjectClicked?: (object: SelectableObject) => void;
479
+ onObjectMouseOut?: (object: SelectableObject) => void;
480
+ onObjectMouseOver?: (object: SelectableObject) => void;
481
+ onObjectSelected?: (object: SelectableObject, selectedTicketType: TicketTypeJson) => void;
482
+ onObjectDeselected?: (object: SelectableObject, selectedTicketType: TicketTypeJson) => void;
483
+ onObjectStatusChanged?: (object: BookableObject) => void;
484
+ onReleaseHoldFailed?: (objects: BookableObject[], ticketTypes: TicketTypeJson[]) => void;
485
+ onReleaseHoldSucceeded?: (objects: BookableObject[], ticketTypes: TicketTypeJson[]) => void;
486
+ onSelectedObjectBooked?: (object: BookableObject) => void;
475
487
  onSelectionInvalid?: (violations: string[]) => void;
476
488
  onSelectionValid?: () => void;
477
489
  onSessionInitialized?: (holdToken: HoldToken) => void;
@@ -753,19 +765,19 @@ interface Labels {
753
765
  section?: string;
754
766
  }
755
767
  export type PriceType = number | string;
756
- export interface InteractiveObjectProps {
768
+ export interface InteractiveObject {
757
769
  readonly label: string;
758
770
  readonly labels: Labels;
759
771
  }
760
- export interface NonBookableTableProps extends InteractiveObjectProps {
761
- readonly seats: SeatProps[];
772
+ export interface NonBookableTable extends InteractiveObject {
773
+ readonly seats: Seat[];
762
774
  readonly center: {
763
775
  x: number;
764
776
  y: number;
765
777
  };
766
778
  readonly category?: CategoryToJSON;
767
779
  }
768
- export interface NonBookableTableSeatProps extends InteractiveObjectProps {
780
+ export interface NonBookableTableSeat extends InteractiveObject {
769
781
  readonly center: {
770
782
  x: number;
771
783
  y: number;
@@ -777,7 +789,7 @@ export interface NonBookableTableSeatProps extends InteractiveObjectProps {
777
789
  type: 'row' | 'table';
778
790
  };
779
791
  }
780
- export interface SelectableObjectProps extends InteractiveObjectProps {
792
+ export interface AbstractSelectableObject extends InteractiveObject {
781
793
  readonly objectType: string;
782
794
  readonly selected: boolean;
783
795
  readonly selectedTicketType: string | undefined;
@@ -791,8 +803,8 @@ export interface SelectableObjectProps extends InteractiveObjectProps {
791
803
  select: (ticketType?: string) => Promise<void>;
792
804
  deselect: (ticketType?: string) => Promise<void>;
793
805
  }
794
- export interface SectionProps extends InteractiveObjectProps {
795
- readonly objectType: string;
806
+ export interface Section extends InteractiveObject {
807
+ readonly objectType: 'section';
796
808
  readonly numberOfSelectableObjects: number;
797
809
  readonly numberOfSelectedObjects: number;
798
810
  readonly selectableCategories: CategoryKey[];
@@ -800,10 +812,11 @@ export interface SectionProps extends InteractiveObjectProps {
800
812
  readonly isInteractive: boolean;
801
813
  readonly sectionCategory?: CategoryToJSON;
802
814
  }
803
- export interface InteractiveSectionProps extends SelectableObjectProps {
815
+ export interface InteractiveSection extends AbstractSelectableObject {
816
+ readonly objectType: 'section';
804
817
  readonly ticketListing: ListingBySection;
805
818
  }
806
- export interface BookableObjectProps extends SelectableObjectProps {
819
+ export interface AbstractBookableObject extends AbstractSelectableObject {
807
820
  /**
808
821
  * Set to one of the predefined values `free`, `reservedByToken`, `booked` or use a custom status.
809
822
  */
@@ -819,7 +832,8 @@ export interface BookableObjectProps extends SelectableObjectProps {
819
832
  */
820
833
  channel?: Channel;
821
834
  }
822
- export interface SeatProps extends BookableObjectProps {
835
+ export interface Seat extends AbstractBookableObject {
836
+ readonly objectType: 'Seat';
823
837
  readonly center: {
824
838
  x: number;
825
839
  y: number;
@@ -832,17 +846,19 @@ export interface SeatProps extends BookableObjectProps {
832
846
  pulse: () => Promise<void>;
833
847
  unpulse: () => Promise<void>;
834
848
  }
835
- export interface BoothProps extends BookableObjectProps {
849
+ export interface Booth extends AbstractBookableObject {
836
850
  readonly objectType: 'Booth';
837
851
  }
838
- export interface TableProps extends BookableObjectProps {
839
- readonly seats: NonBookableTableSeatProps[];
852
+ export interface Table extends AbstractBookableObject {
853
+ readonly objectType: 'Table';
854
+ readonly seats: NonBookableTableSeat[];
840
855
  readonly center: {
841
856
  x: number;
842
857
  y: number;
843
858
  };
844
859
  }
845
- export interface GeneralAdmissionAreaProps extends BookableObjectProps {
860
+ export interface GeneralAdmissionArea extends AbstractBookableObject {
861
+ readonly objectType: 'GeneralAdmissionArea';
846
862
  readonly numBooked: number;
847
863
  readonly capacity: number;
848
864
  readonly numFree: number;
@@ -853,17 +869,19 @@ export interface GeneralAdmissionAreaProps extends BookableObjectProps {
853
869
  readonly entrance: string | null;
854
870
  readonly bookAsAWhole: boolean;
855
871
  }
872
+ export type BookableObject = Seat | GeneralAdmissionArea | Booth | Table;
873
+ export type SelectableObject = BookableObject | InteractiveSection;
856
874
  export interface SeatingChart {
857
875
  changeConfig: (config: ConfigChange) => Promise<void>;
858
876
  clearSelection: () => Promise<void>;
859
877
  deselectCategories: (categoryIds: string[]) => Promise<void>;
860
878
  deselectObjects: (objects: (string | Selection)[]) => Promise<void>;
861
879
  destroy: () => void;
862
- findObject: <T extends SelectableObjectProps>(label: string) => Promise<T>;
880
+ findObject: (label: string) => Promise<SelectableObject>;
863
881
  getReportBySelectability: () => Promise<Object>;
864
882
  holdToken: string;
865
883
  listCategories: () => Promise<Category[]>;
866
- listSelectedObjects: <T extends SelectableObjectProps>() => Promise<T[]>;
884
+ listSelectedObjects: () => Promise<SelectableObject[]>;
867
885
  render: () => SeatingChart;
868
886
  rerender: () => void;
869
887
  resetView: () => Promise<void>;
@@ -874,7 +892,7 @@ export interface SeatingChart {
874
892
  unpulse: (objects: string[]) => Promise<void>;
875
893
  startNewSession: () => Promise<void>;
876
894
  zoomToFilteredCategories: () => Promise<void>;
877
- zoomToSection: (label: string) => SectionProps[];
895
+ zoomToSection: (label: string) => Section[];
878
896
  zoomToObjects: (labels: string[]) => Promise<void>;
879
897
  zoomToSelectedObjects: () => Promise<void>;
880
898
  }
package/package.json CHANGED
@@ -1,12 +1,16 @@
1
1
  {
2
2
  "name": "@seatsio/seatsio-types",
3
3
  "description": "Type definitions for Seats.io",
4
- "version": "2.9.0",
4
+ "version": "3.0.0",
5
5
  "license": "MIT",
6
6
  "types": "dist/index.d.ts",
7
7
  "files": [
8
8
  "dist/index.d.ts"
9
9
  ],
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/seatsio/seatsio-types"
13
+ },
10
14
  "devDependencies": {
11
15
  "@actions/core": "1.10.1",
12
16
  "cli-select-2": "2.0.0",