@seatsio/seatsio-types 3.6.0 → 4.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 +30 -22
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -100,11 +100,11 @@ export interface ChartRendererConfigOptions extends DeprecatedConfigProperties,
100
100
  /**
101
101
  * Render the chart with the specified objects selected (if they are still free). {@link https://docs.seats.io/docs/renderer/config-selectedobjects See documentation}
102
102
  */
103
- selectedObjects?: (string | SelectedObject | SelectedGA)[];
103
+ selectedObjects?: (string | SelectedAmount)[];
104
104
  /**
105
105
  * Render the chart with the specified objects selectable. {@link https://docs.seats.io/docs/renderer/selectableobjects See documentation}
106
106
  */
107
- selectableObjects?: string[];
107
+ selectableObjects?: (string | SelectableAmount)[];
108
108
  /**
109
109
  * 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}
110
110
  */
@@ -171,15 +171,15 @@ export interface ChartRendererConfigOptions extends DeprecatedConfigProperties,
171
171
  */
172
172
  categoryFilter?: CategoryFilter;
173
173
  /**
174
- * 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.
174
+ * Makes the specified categories available from selection, while making all others unavailable from selection. The array can be a list of category keys or labels.
175
175
  */
176
176
  availableCategories?: CategoryKey[];
177
177
  /**
178
- * Makes the specified categories unavailable from selection. The array can be a list of category IDs or labels.
178
+ * Makes the specified categories unavailable from selection. The array can be a list of category keys or labels.
179
179
  */
180
180
  unavailableCategories?: CategoryKey[];
181
181
  /**
182
- * Leaves the specified categories normally visible, while making all others dimmed out. The array can be a list of category IDs or labels.
182
+ * Leaves the specified categories normally visible, while making all others dimmed out. The array can be a list of category keys or labels.
183
183
  */
184
184
  filteredCategories?: CategoryKey[];
185
185
  objectColor?: (object: SelectableObject, defaultColor: string, extraConfig: ExtraConfig) => string;
@@ -383,7 +383,7 @@ export interface EventManagerSelectModeConfigOptions extends BaseEventManagerCon
383
383
  maxSelectedObjects?: SelectionLimiter;
384
384
  numberOfPlacesToSelect?: number;
385
385
  isObjectSelectable?: (object: SelectableObject) => boolean;
386
- selectedObjects?: (string | SelectedObject | SelectedGA)[];
386
+ selectedObjects?: (string | SelectedAmount)[];
387
387
  selectionBy?: 'places' | 'objects';
388
388
  ticketTypes?: TicketTypeJsonWithoutPrice[];
389
389
  tooltipContents?: (object: object) => string;
@@ -559,7 +559,7 @@ export type Floor = {
559
559
  export type Category = {
560
560
  accessible: boolean;
561
561
  color: string;
562
- key: number;
562
+ key: CategoryKey;
563
563
  label: string;
564
564
  pricing: {
565
565
  price: number;
@@ -594,7 +594,7 @@ export type CategoryLimiter = {
594
594
  quantity: number;
595
595
  };
596
596
  export type CategoryAndTicketLimiter = {
597
- category: string;
597
+ category: CategoryKey;
598
598
  ticketTypes: TicketTypeLimiter[];
599
599
  };
600
600
  export interface ChartRendererObjectTooltip {
@@ -724,8 +724,18 @@ export type SimplePricing = {
724
724
  price: number;
725
725
  channels?: ChannelPricing[];
726
726
  };
727
+ export type SimplePricingForObjects = {
728
+ objects: string[];
729
+ originalPrice?: number;
730
+ price: number;
731
+ channels?: ChannelPricing[];
732
+ };
727
733
  export type MultiLevelPricing = {
728
- category: number | string;
734
+ category: CategoryKey;
735
+ ticketTypes: TicketType[];
736
+ };
737
+ export type MultiLevelPricingForObjects = {
738
+ objects: string[];
729
739
  ticketTypes: TicketType[];
730
740
  };
731
741
  export type ChannelPricing = (SimpleChannelPricing | MultiLevelChannelPricing);
@@ -745,7 +755,9 @@ export type TicketType = {
745
755
  label?: string;
746
756
  description?: string;
747
757
  };
748
- export type Pricing = (SimplePricing | MultiLevelPricing)[];
758
+ export type PricingForCategory = (SimplePricing | MultiLevelPricing);
759
+ export type PricingForObjects = (SimplePricingForObjects | MultiLevelPricingForObjects);
760
+ export type Pricing = (PricingForCategory | PricingForObjects)[];
749
761
  export type SelectionValidator = SelectionValidatorNoOrphanSeats | SelectionValidatorConsecutiveSeats | SelectionValidatorMinimumSelectedPlaces;
750
762
  interface SelectionValidatorNoOrphanSeats {
751
763
  type: 'noOrphanSeats';
@@ -760,11 +772,7 @@ interface SelectionValidatorMinimumSelectedPlaces {
760
772
  type: 'minimumSelectedPlaces';
761
773
  minimum: number;
762
774
  }
763
- export interface SelectedObject {
764
- label: string;
765
- ticketType: string;
766
- }
767
- export interface SelectedGA {
775
+ export interface SelectableAmount {
768
776
  label: string;
769
777
  amount: number;
770
778
  }
@@ -869,6 +877,7 @@ export interface AbstractBookableObject extends AbstractSelectableObject {
869
877
  readonly forSale: boolean;
870
878
  readonly dataPerEvent: Dict<object>;
871
879
  readonly seasonStatusOverriddenQuantity: number;
880
+ readonly entrance: string | null;
872
881
  inSelectableChannel?: boolean;
873
882
  hashedChannelKey?: string;
874
883
  isInChannel?: (channelKey: string) => boolean;
@@ -911,7 +920,6 @@ export interface GeneralAdmissionArea extends AbstractBookableObject {
911
920
  readonly selectionPerTicketType: Dict<number>;
912
921
  readonly holds: Dict<Dict<number>>;
913
922
  readonly dataPerEvent: Dict<object>;
914
- readonly entrance: string | null;
915
923
  readonly bookAsAWhole: boolean;
916
924
  }
917
925
  export type BookableObject = Seat | GeneralAdmissionArea | Booth | Table;
@@ -919,8 +927,8 @@ export type SelectableObject = BookableObject | InteractiveSection;
919
927
  export interface SeatingChart {
920
928
  changeConfig: (config: ConfigChange) => Promise<void>;
921
929
  clearSelection: () => Promise<void>;
922
- deselectCategories: (categoryIds: string[]) => Promise<void>;
923
- deselectObjects: (objects: (string | Selection)[]) => Promise<void>;
930
+ deselectCategories: (categories: CategoryKey[]) => Promise<void>;
931
+ deselectObjects: (objects: (string | SelectedAmount)[]) => Promise<void>;
924
932
  destroy: () => void;
925
933
  findObject: (label: string) => Promise<SelectableObject>;
926
934
  getReportBySelectability: () => Promise<Object>;
@@ -930,9 +938,9 @@ export interface SeatingChart {
930
938
  render: () => SeatingChart;
931
939
  rerender: () => void;
932
940
  resetView: () => Promise<void>;
933
- selectCategories: (categoryIds: string[]) => Promise<void>;
941
+ selectCategories: (categories: CategoryKey[]) => Promise<void>;
934
942
  selectedObjects: string[];
935
- selectObjects: (objects: (string | Selection)[]) => Promise<void>;
943
+ selectObjects: (objects: (string | SelectedAmount)[]) => Promise<void>;
936
944
  pulse: (objects: string[]) => Promise<void>;
937
945
  unpulse: (objects: string[]) => Promise<void>;
938
946
  startNewSession: () => Promise<void>;
@@ -953,8 +961,8 @@ export interface Channel {
953
961
  color: string;
954
962
  index: number;
955
963
  }
956
- export type Selection = {
957
- id: string;
964
+ export type SelectedAmount = {
965
+ label: string;
958
966
  ticketType?: string;
959
967
  amount?: number;
960
968
  };
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": "3.6.0",
4
+ "version": "4.1.0",
5
5
  "license": "MIT",
6
6
  "types": "dist/index.d.ts",
7
7
  "files": [