@seatsio/seatsio-types 2.8.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.
- package/dist/index.d.ts +74 -40
- 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:
|
|
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?:
|
|
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:
|
|
169
|
-
objectLabel?: (object:
|
|
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:
|
|
178
|
-
sectionColor?: (section:
|
|
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:
|
|
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
|
|
@@ -359,15 +359,32 @@ export interface EventManagerSelectModeConfigOptions extends BaseEventManagerCon
|
|
|
359
359
|
tooltipContents?: (object: object) => string;
|
|
360
360
|
unavailableObjectsSelectable?: boolean;
|
|
361
361
|
selectableObjects?: string[];
|
|
362
|
+
/**
|
|
363
|
+
* @param object
|
|
364
|
+
* @param defaultIcon
|
|
365
|
+
* @param extraConfig
|
|
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
|
+
* For more details, {@link https://docs.seats.io/docs/event-manager/modes/select#objecticon see the documentation}.
|
|
368
|
+
*/
|
|
369
|
+
objectIcon?: (object: SelectableObject, defaultIcon: string | null, extraConfig?: ExtraConfig) => string;
|
|
370
|
+
objectTooltip?: {
|
|
371
|
+
showOrderId?: boolean;
|
|
372
|
+
showTechnicalLabel?: boolean;
|
|
373
|
+
showLabel?: boolean;
|
|
374
|
+
showCategory?: boolean;
|
|
375
|
+
showChannel?: boolean;
|
|
376
|
+
showActionHint?: boolean;
|
|
377
|
+
};
|
|
362
378
|
}
|
|
363
379
|
export interface EventManagerStaticModeConfigOptions extends BaseEventManagerConfigOptions, WithEvents {
|
|
364
380
|
mode: 'static';
|
|
365
|
-
onObjectMouseOver?: (object:
|
|
366
|
-
onObjectMouseOut?: (object:
|
|
381
|
+
onObjectMouseOver?: (object: SelectableObject) => void;
|
|
382
|
+
onObjectMouseOut?: (object: SelectableObject) => void;
|
|
367
383
|
tooltipContents?: (object: object) => string;
|
|
368
384
|
}
|
|
369
385
|
export type EventManagerConfigOptions = EventManagerManageObjectStatusesModeConfigOptions | EventManagerManageChannelsModeConfigOptions | EventManagerManageCategoriesModeConfigOptions | EventManagerSelectModeConfigOptions | EventManagerFilterSectionsModeConfigOptions | EventManagerStaticModeConfigOptions | (BaseEventManagerConfigOptions & WithEvent);
|
|
370
|
-
export
|
|
386
|
+
export type ChartDesignerConfigOptions = ChartDesignerNormalModeConfigOptions | ChartDesignerReadOnlyModeConfigOptions | ChartDesignerSafeModeConfigOptions;
|
|
387
|
+
export interface BaseChartDesignerConfigOptions {
|
|
371
388
|
canvasColorScheme?: 'auto' | 'light' | 'dark';
|
|
372
389
|
chartKey?: string;
|
|
373
390
|
container?: Element;
|
|
@@ -384,7 +401,6 @@ export interface ChartDesignerConfigOptions {
|
|
|
384
401
|
* Documentation: {@link https://docs.seats.io/docs/embedded-designer/configuration-language}
|
|
385
402
|
*/
|
|
386
403
|
language?: 'de' | 'en' | 'es' | 'fr' | 'pt';
|
|
387
|
-
mode?: 'normal' | 'safe' | 'readOnly';
|
|
388
404
|
onChartCreated?: (chartKey: string) => void;
|
|
389
405
|
onChartPublished?: (chartKey: string) => void;
|
|
390
406
|
onChartUpdated?: (chartKey: string) => void;
|
|
@@ -395,6 +411,18 @@ export interface ChartDesignerConfigOptions {
|
|
|
395
411
|
openLatestDrawing?: boolean;
|
|
396
412
|
secretKey: string;
|
|
397
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
|
+
}
|
|
398
426
|
export interface ChartDesignerFeatures {
|
|
399
427
|
'tables.bookAsAWhole'?: boolean;
|
|
400
428
|
areas?: boolean;
|
|
@@ -444,18 +472,18 @@ export type ChartRendererCallbacks = {
|
|
|
444
472
|
onFloorChanged?: (floor?: Floor) => void;
|
|
445
473
|
onFullScreenClosed?: () => void;
|
|
446
474
|
onFullScreenOpened?: () => void;
|
|
447
|
-
onHoldFailed?: (objects:
|
|
448
|
-
onHoldSucceeded?: (objects:
|
|
475
|
+
onHoldFailed?: (objects: BookableObject[], ticketTypes: TicketTypeJson[]) => void;
|
|
476
|
+
onHoldSucceeded?: (objects: BookableObject[], ticketTypes: TicketTypeJson[]) => void;
|
|
449
477
|
onHoldTokenExpired?: () => void;
|
|
450
|
-
onObjectClicked?: (object:
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
onObjectStatusChanged?: (object:
|
|
456
|
-
onReleaseHoldFailed?: (objects:
|
|
457
|
-
onReleaseHoldSucceeded?: (objects:
|
|
458
|
-
onSelectedObjectBooked?: (object:
|
|
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;
|
|
459
487
|
onSelectionInvalid?: (violations: string[]) => void;
|
|
460
488
|
onSelectionValid?: () => void;
|
|
461
489
|
onSessionInitialized?: (holdToken: HoldToken) => void;
|
|
@@ -737,19 +765,19 @@ interface Labels {
|
|
|
737
765
|
section?: string;
|
|
738
766
|
}
|
|
739
767
|
export type PriceType = number | string;
|
|
740
|
-
export interface
|
|
768
|
+
export interface InteractiveObject {
|
|
741
769
|
readonly label: string;
|
|
742
770
|
readonly labels: Labels;
|
|
743
771
|
}
|
|
744
|
-
export interface
|
|
745
|
-
readonly seats:
|
|
772
|
+
export interface NonBookableTable extends InteractiveObject {
|
|
773
|
+
readonly seats: Seat[];
|
|
746
774
|
readonly center: {
|
|
747
775
|
x: number;
|
|
748
776
|
y: number;
|
|
749
777
|
};
|
|
750
778
|
readonly category?: CategoryToJSON;
|
|
751
779
|
}
|
|
752
|
-
export interface
|
|
780
|
+
export interface NonBookableTableSeat extends InteractiveObject {
|
|
753
781
|
readonly center: {
|
|
754
782
|
x: number;
|
|
755
783
|
y: number;
|
|
@@ -761,7 +789,7 @@ export interface NonBookableTableSeatProps extends InteractiveObjectProps {
|
|
|
761
789
|
type: 'row' | 'table';
|
|
762
790
|
};
|
|
763
791
|
}
|
|
764
|
-
export interface
|
|
792
|
+
export interface AbstractSelectableObject extends InteractiveObject {
|
|
765
793
|
readonly objectType: string;
|
|
766
794
|
readonly selected: boolean;
|
|
767
795
|
readonly selectedTicketType: string | undefined;
|
|
@@ -775,8 +803,8 @@ export interface SelectableObjectProps extends InteractiveObjectProps {
|
|
|
775
803
|
select: (ticketType?: string) => Promise<void>;
|
|
776
804
|
deselect: (ticketType?: string) => Promise<void>;
|
|
777
805
|
}
|
|
778
|
-
export interface
|
|
779
|
-
readonly objectType:
|
|
806
|
+
export interface Section extends InteractiveObject {
|
|
807
|
+
readonly objectType: 'section';
|
|
780
808
|
readonly numberOfSelectableObjects: number;
|
|
781
809
|
readonly numberOfSelectedObjects: number;
|
|
782
810
|
readonly selectableCategories: CategoryKey[];
|
|
@@ -784,10 +812,11 @@ export interface SectionProps extends InteractiveObjectProps {
|
|
|
784
812
|
readonly isInteractive: boolean;
|
|
785
813
|
readonly sectionCategory?: CategoryToJSON;
|
|
786
814
|
}
|
|
787
|
-
export interface
|
|
815
|
+
export interface InteractiveSection extends AbstractSelectableObject {
|
|
816
|
+
readonly objectType: 'section';
|
|
788
817
|
readonly ticketListing: ListingBySection;
|
|
789
818
|
}
|
|
790
|
-
export interface
|
|
819
|
+
export interface AbstractBookableObject extends AbstractSelectableObject {
|
|
791
820
|
/**
|
|
792
821
|
* Set to one of the predefined values `free`, `reservedByToken`, `booked` or use a custom status.
|
|
793
822
|
*/
|
|
@@ -803,7 +832,8 @@ export interface BookableObjectProps extends SelectableObjectProps {
|
|
|
803
832
|
*/
|
|
804
833
|
channel?: Channel;
|
|
805
834
|
}
|
|
806
|
-
export interface
|
|
835
|
+
export interface Seat extends AbstractBookableObject {
|
|
836
|
+
readonly objectType: 'Seat';
|
|
807
837
|
readonly center: {
|
|
808
838
|
x: number;
|
|
809
839
|
y: number;
|
|
@@ -816,17 +846,19 @@ export interface SeatProps extends BookableObjectProps {
|
|
|
816
846
|
pulse: () => Promise<void>;
|
|
817
847
|
unpulse: () => Promise<void>;
|
|
818
848
|
}
|
|
819
|
-
export interface
|
|
849
|
+
export interface Booth extends AbstractBookableObject {
|
|
820
850
|
readonly objectType: 'Booth';
|
|
821
851
|
}
|
|
822
|
-
export interface
|
|
823
|
-
readonly
|
|
852
|
+
export interface Table extends AbstractBookableObject {
|
|
853
|
+
readonly objectType: 'Table';
|
|
854
|
+
readonly seats: NonBookableTableSeat[];
|
|
824
855
|
readonly center: {
|
|
825
856
|
x: number;
|
|
826
857
|
y: number;
|
|
827
858
|
};
|
|
828
859
|
}
|
|
829
|
-
export interface
|
|
860
|
+
export interface GeneralAdmissionArea extends AbstractBookableObject {
|
|
861
|
+
readonly objectType: 'GeneralAdmissionArea';
|
|
830
862
|
readonly numBooked: number;
|
|
831
863
|
readonly capacity: number;
|
|
832
864
|
readonly numFree: number;
|
|
@@ -837,17 +869,19 @@ export interface GeneralAdmissionAreaProps extends BookableObjectProps {
|
|
|
837
869
|
readonly entrance: string | null;
|
|
838
870
|
readonly bookAsAWhole: boolean;
|
|
839
871
|
}
|
|
872
|
+
export type BookableObject = Seat | GeneralAdmissionArea | Booth | Table;
|
|
873
|
+
export type SelectableObject = BookableObject | InteractiveSection;
|
|
840
874
|
export interface SeatingChart {
|
|
841
875
|
changeConfig: (config: ConfigChange) => Promise<void>;
|
|
842
876
|
clearSelection: () => Promise<void>;
|
|
843
877
|
deselectCategories: (categoryIds: string[]) => Promise<void>;
|
|
844
878
|
deselectObjects: (objects: (string | Selection)[]) => Promise<void>;
|
|
845
879
|
destroy: () => void;
|
|
846
|
-
findObject:
|
|
880
|
+
findObject: (label: string) => Promise<SelectableObject>;
|
|
847
881
|
getReportBySelectability: () => Promise<Object>;
|
|
848
882
|
holdToken: string;
|
|
849
883
|
listCategories: () => Promise<Category[]>;
|
|
850
|
-
listSelectedObjects:
|
|
884
|
+
listSelectedObjects: () => Promise<SelectableObject[]>;
|
|
851
885
|
render: () => SeatingChart;
|
|
852
886
|
rerender: () => void;
|
|
853
887
|
resetView: () => Promise<void>;
|
|
@@ -858,11 +892,11 @@ export interface SeatingChart {
|
|
|
858
892
|
unpulse: (objects: string[]) => Promise<void>;
|
|
859
893
|
startNewSession: () => Promise<void>;
|
|
860
894
|
zoomToFilteredCategories: () => Promise<void>;
|
|
861
|
-
zoomToSection: (label: string) =>
|
|
895
|
+
zoomToSection: (label: string) => Section[];
|
|
862
896
|
zoomToObjects: (labels: string[]) => Promise<void>;
|
|
863
897
|
zoomToSelectedObjects: () => Promise<void>;
|
|
864
898
|
}
|
|
865
|
-
export interface EventManager extends Pick<SeatingChart, 'clearSelection' | 'deselectCategories' | 'deselectObjects' | 'destroy' | 'findObject' | 'listCategories' | 'listSelectedObjects' | 'render' | 'rerender' | 'resetView' | 'selectCategories' | 'selectObjects' | 'zoomToObjects' | 'zoomToSection' | 'zoomToSelectedObjects' | 'pulse' | 'unpulse'> {
|
|
899
|
+
export interface EventManager extends Pick<SeatingChart, 'clearSelection' | 'deselectCategories' | 'deselectObjects' | 'destroy' | 'findObject' | 'listCategories' | 'listSelectedObjects' | 'selectedObjects' | 'render' | 'rerender' | 'resetView' | 'selectCategories' | 'selectObjects' | 'zoomToObjects' | 'zoomToSection' | 'zoomToSelectedObjects' | 'pulse' | 'unpulse'> {
|
|
866
900
|
setHighlightedObjects(strings: string[]): void;
|
|
867
901
|
clearHighlightedObjects(): void;
|
|
868
902
|
setFilteredSection(label: string): void;
|
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": "
|
|
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",
|