@seatmap.pro/renderer 0.0.5 → 0.0.6

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/lib/index.d.mts CHANGED
@@ -314,6 +314,14 @@ interface IPoint {
314
314
  readonly x: number;
315
315
  readonly y: number;
316
316
  }
317
+ /**
318
+ * @hidden
319
+ */
320
+ declare const addPoints: (a: IPoint, b: IPoint) => IPoint;
321
+ /**
322
+ * @hidden
323
+ */
324
+ declare const subPoints: (a: IPoint, b: IPoint) => IPoint;
317
325
 
318
326
  interface IPrice {
319
327
  id: IPriceId;
@@ -340,10 +348,6 @@ interface IRendererMachineContext {
340
348
  id: number;
341
349
  };
342
350
  }
343
- /**
344
- * @hidden
345
- */
346
- type RendererMachineReducer<T> = (ctx: IRendererMachineContext, src: T) => IRendererMachineContext;
347
351
  /**
348
352
  * @hidden
349
353
  */
@@ -367,75 +371,6 @@ declare enum RendererSelectMode {
367
371
  ADD = "add",
368
372
  SUBTRACT = "subtract"
369
373
  }
370
- /**
371
- * Source events
372
- */
373
- /**
374
- * @hidden
375
- */
376
- declare enum SrcEventType {
377
- DRAG_START = "srcDragStart",
378
- DRAG_MOVE = "srcDragMove",
379
- DRAG_END = "srcDragEnd",
380
- CLICK = "srcClick",
381
- MOUSE_MOVE = "srcMouseMove"
382
- }
383
- /**
384
- * @hidden
385
- */
386
- type SrcEvent = IDragStartSrcEvent | IDragMoveSrcEvent | IDragEndSrcEvent | IClickSrcEvent | IMouseMoveSrcEvent;
387
- /**
388
- * @hidden
389
- */
390
- interface IDragSrcEvent<T> {
391
- type: T;
392
- origin: {
393
- x: number;
394
- y: number;
395
- };
396
- delta: {
397
- x: number;
398
- y: number;
399
- };
400
- shiftKey?: boolean;
401
- altKey?: boolean;
402
- }
403
- /**
404
- * @hidden
405
- */
406
- type IDragStartSrcEvent = IDragSrcEvent<SrcEventType.DRAG_START>;
407
- /**
408
- * @hidden
409
- */
410
- type IDragMoveSrcEvent = IDragSrcEvent<SrcEventType.DRAG_MOVE>;
411
- /**
412
- * @hidden
413
- */
414
- type IDragEndSrcEvent = IDragSrcEvent<SrcEventType.DRAG_END>;
415
- /**
416
- * @hidden
417
- */
418
- interface IClickSrcEvent {
419
- type: SrcEventType.CLICK;
420
- target: HTMLElement;
421
- point: {
422
- x: number;
423
- y: number;
424
- };
425
- section?: ISection;
426
- seat?: ISeat;
427
- shiftKey?: boolean;
428
- altKey?: boolean;
429
- }
430
- /**
431
- * @hidden
432
- */
433
- interface IMouseMoveSrcEvent {
434
- type: SrcEventType.MOUSE_MOVE;
435
- target: HTMLElement;
436
- section?: ISection;
437
- seat?: ISeat;
438
- }
439
374
  /**
440
375
  * Output events
441
376
  */
@@ -1974,6 +1909,19 @@ interface IAdminRendererSettings extends IRendererSettings {
1974
1909
  */
1975
1910
  env?: string;
1976
1911
  }
1912
+ /**
1913
+ * Interface for the Admin Renderer functionality.
1914
+ * Extends the base renderer interface with admin-specific methods.
1915
+ */
1916
+ interface IAdminRenderer extends IRenderer {
1917
+ /**
1918
+ * Loads an event by its ID.
1919
+ *
1920
+ * @param eventId - The ID of the event to load
1921
+ * @returns A promise that resolves when the event is loaded
1922
+ */
1923
+ loadEvent: (eventId: string) => Promise<void>;
1924
+ }
1977
1925
  /**
1978
1926
  * Admin Renderer class for seatmap administration.
1979
1927
  * Extends the base Renderer with admin-specific functionality.
@@ -2120,6 +2068,49 @@ interface IBookingRendererSettings extends IRendererSettings {
2120
2068
  */
2121
2069
  backgroundLoadStepTime?: number;
2122
2070
  }
2071
+ /**
2072
+ * Interface for the Booking Renderer functionality.
2073
+ * Extends the base renderer interface with booking-specific methods.
2074
+ *
2075
+ * @hidden
2076
+ */
2077
+ interface IBookingRenderer extends IRenderer {
2078
+ /**
2079
+ * Loads an event by its ID.
2080
+ *
2081
+ * @param eventId - The ID of the event to load
2082
+ * @returns A promise that resolves when the event is loaded
2083
+ */
2084
+ loadEvent: (eventId: string) => Promise<void>;
2085
+ }
2086
+ /**
2087
+ * Interface defining the view box properties for the booking renderer.
2088
+ * Contains information about the current viewport dimensions and transformations.
2089
+ *
2090
+ * @hidden
2091
+ */
2092
+ interface IViewBox {
2093
+ /**
2094
+ * The width of the view box in pixels.
2095
+ */
2096
+ readonly width: number;
2097
+ /**
2098
+ * The height of the view box in pixels.
2099
+ */
2100
+ readonly height: number;
2101
+ /**
2102
+ * The current scale factor of the view.
2103
+ */
2104
+ readonly scale: number;
2105
+ /**
2106
+ * The X translation of the view in pixels.
2107
+ */
2108
+ readonly translateX: number;
2109
+ /**
2110
+ * The Y translation of the view in pixels.
2111
+ */
2112
+ readonly translateY: number;
2113
+ }
2123
2114
  /**
2124
2115
  * Booking Renderer class for seatmap booking.
2125
2116
  * Extends the base Renderer with booking-specific functionality.
@@ -2204,4 +2195,4 @@ declare class SeatmapBookingRenderer extends Renderer {
2204
2195
 
2205
2196
  declare const mergeSettings: <TSettings extends IRendererSettings>(defaults: IRendererSettings, settings?: TSettings | undefined) => IRendererSettings & TSettings;
2206
2197
 
2207
- export { BookingApiClient, type ById, type ColorSequenceSettings, type DestEvent, DestEventType, type IAdminRendererSettings, type IBaseSeat, type IBaseSector, type IBeforeSeatDrawEvent, type IBookingRendererSettings, type ICart, type ICartGa, type ICartSeat, type IClickSrcEvent, type IColoredPrice, type IConfigurationDTO, type IDeselectDestEvent, type IDragEndSrcEvent, type IDragMoveSrcEvent, type IDragStartSrcEvent, type IExtendedSeat, type IMouseMoveSrcEvent, type IPanDestEvent, type IPanZoomDestEvent, type IPlainSeatsDTO, type IPngBackgroundDTO, type IPoint, type IPrice, type IPriceDTO, type IPriceId, type IPriceListDTO, type IRectSelectDestEvent, type IRemovedCartGa, type IRenderer, type IRendererMachineContext, type IRendererSeatStyleSettings, type IRendererSettings, type IRendererSvgSectionStylesSetting, type IRendererTheme, type IRowDTO, type ISVGBackgroundDTO, type ISchemaDTO, type ISeat, type ISeatCartSwitchDestEvent, type ISeatDTO, type ISeatMouseEnterDestEvent, type ISeatMouseLeaveDestEvent, type ISeatPriceScheme, type ISeatSelectDestEvent, type ISeatStyle, type ISection, type ISectionClickDestEvent, type ISectionMouseEnterDestEvent, type ISectionMouseLeaveDestEvent, type ISectionRect, type ISectionWithCoords, type ISector, type ISectorDTO, type ISpecialPrice, type ISpecialState, type ISvgSectionStyle, type IVenueDTO, Renderer, type RendererMachine, type RendererMachineReducer, type RendererMachineService, RendererSelectMode, RendererTargetType, type SeatFilter, type SeatInteractionState, SeatmapAdminRenderer, SeatmapBookingRenderer, type SrcEvent, SrcEventType, type TransformArray, mergeSettings };
2198
+ export { BookingApiClient, type ById, type ColorSequenceSettings, type IAdminRenderer, type IAdminRendererSettings, type IBaseSeat, type IBaseSector, type IBeforeSeatDrawEvent, type IBookingRenderer, type IBookingRendererSettings, type ICart, type ICartGa, type ICartSeat, type IColoredPrice, type IConfigurationDTO, type IExtendedSeat, type IPlainSeatsDTO, type IPngBackgroundDTO, type IPoint, type IPrice, type IPriceDTO, type IPriceId, type IPriceListDTO, type IRemovedCartGa, type IRenderer, type IRendererSeatStyleSettings, type IRendererSettings, type IRendererSvgSectionStylesSetting, type IRendererTheme, type IRowDTO, type ISVGBackgroundDTO, type ISchemaDTO, type ISeat, type ISeatDTO, type ISeatPriceScheme, type ISeatStyle, type ISection, type ISectionRect, type ISectionWithCoords, type ISector, type ISectorDTO, type ISpecialPrice, type ISpecialState, type ISvgSectionStyle, type IVenueDTO, type IViewBox, Renderer, type RendererMachine, type RendererMachineService, RendererSelectMode, RendererTargetType, type SeatFilter, type SeatInteractionState, SeatmapAdminRenderer, SeatmapBookingRenderer, type TransformArray, addPoints, mergeSettings, subPoints };
package/lib/index.d.ts CHANGED
@@ -314,6 +314,14 @@ interface IPoint {
314
314
  readonly x: number;
315
315
  readonly y: number;
316
316
  }
317
+ /**
318
+ * @hidden
319
+ */
320
+ declare const addPoints: (a: IPoint, b: IPoint) => IPoint;
321
+ /**
322
+ * @hidden
323
+ */
324
+ declare const subPoints: (a: IPoint, b: IPoint) => IPoint;
317
325
 
318
326
  interface IPrice {
319
327
  id: IPriceId;
@@ -340,10 +348,6 @@ interface IRendererMachineContext {
340
348
  id: number;
341
349
  };
342
350
  }
343
- /**
344
- * @hidden
345
- */
346
- type RendererMachineReducer<T> = (ctx: IRendererMachineContext, src: T) => IRendererMachineContext;
347
351
  /**
348
352
  * @hidden
349
353
  */
@@ -367,75 +371,6 @@ declare enum RendererSelectMode {
367
371
  ADD = "add",
368
372
  SUBTRACT = "subtract"
369
373
  }
370
- /**
371
- * Source events
372
- */
373
- /**
374
- * @hidden
375
- */
376
- declare enum SrcEventType {
377
- DRAG_START = "srcDragStart",
378
- DRAG_MOVE = "srcDragMove",
379
- DRAG_END = "srcDragEnd",
380
- CLICK = "srcClick",
381
- MOUSE_MOVE = "srcMouseMove"
382
- }
383
- /**
384
- * @hidden
385
- */
386
- type SrcEvent = IDragStartSrcEvent | IDragMoveSrcEvent | IDragEndSrcEvent | IClickSrcEvent | IMouseMoveSrcEvent;
387
- /**
388
- * @hidden
389
- */
390
- interface IDragSrcEvent<T> {
391
- type: T;
392
- origin: {
393
- x: number;
394
- y: number;
395
- };
396
- delta: {
397
- x: number;
398
- y: number;
399
- };
400
- shiftKey?: boolean;
401
- altKey?: boolean;
402
- }
403
- /**
404
- * @hidden
405
- */
406
- type IDragStartSrcEvent = IDragSrcEvent<SrcEventType.DRAG_START>;
407
- /**
408
- * @hidden
409
- */
410
- type IDragMoveSrcEvent = IDragSrcEvent<SrcEventType.DRAG_MOVE>;
411
- /**
412
- * @hidden
413
- */
414
- type IDragEndSrcEvent = IDragSrcEvent<SrcEventType.DRAG_END>;
415
- /**
416
- * @hidden
417
- */
418
- interface IClickSrcEvent {
419
- type: SrcEventType.CLICK;
420
- target: HTMLElement;
421
- point: {
422
- x: number;
423
- y: number;
424
- };
425
- section?: ISection;
426
- seat?: ISeat;
427
- shiftKey?: boolean;
428
- altKey?: boolean;
429
- }
430
- /**
431
- * @hidden
432
- */
433
- interface IMouseMoveSrcEvent {
434
- type: SrcEventType.MOUSE_MOVE;
435
- target: HTMLElement;
436
- section?: ISection;
437
- seat?: ISeat;
438
- }
439
374
  /**
440
375
  * Output events
441
376
  */
@@ -1974,6 +1909,19 @@ interface IAdminRendererSettings extends IRendererSettings {
1974
1909
  */
1975
1910
  env?: string;
1976
1911
  }
1912
+ /**
1913
+ * Interface for the Admin Renderer functionality.
1914
+ * Extends the base renderer interface with admin-specific methods.
1915
+ */
1916
+ interface IAdminRenderer extends IRenderer {
1917
+ /**
1918
+ * Loads an event by its ID.
1919
+ *
1920
+ * @param eventId - The ID of the event to load
1921
+ * @returns A promise that resolves when the event is loaded
1922
+ */
1923
+ loadEvent: (eventId: string) => Promise<void>;
1924
+ }
1977
1925
  /**
1978
1926
  * Admin Renderer class for seatmap administration.
1979
1927
  * Extends the base Renderer with admin-specific functionality.
@@ -2120,6 +2068,49 @@ interface IBookingRendererSettings extends IRendererSettings {
2120
2068
  */
2121
2069
  backgroundLoadStepTime?: number;
2122
2070
  }
2071
+ /**
2072
+ * Interface for the Booking Renderer functionality.
2073
+ * Extends the base renderer interface with booking-specific methods.
2074
+ *
2075
+ * @hidden
2076
+ */
2077
+ interface IBookingRenderer extends IRenderer {
2078
+ /**
2079
+ * Loads an event by its ID.
2080
+ *
2081
+ * @param eventId - The ID of the event to load
2082
+ * @returns A promise that resolves when the event is loaded
2083
+ */
2084
+ loadEvent: (eventId: string) => Promise<void>;
2085
+ }
2086
+ /**
2087
+ * Interface defining the view box properties for the booking renderer.
2088
+ * Contains information about the current viewport dimensions and transformations.
2089
+ *
2090
+ * @hidden
2091
+ */
2092
+ interface IViewBox {
2093
+ /**
2094
+ * The width of the view box in pixels.
2095
+ */
2096
+ readonly width: number;
2097
+ /**
2098
+ * The height of the view box in pixels.
2099
+ */
2100
+ readonly height: number;
2101
+ /**
2102
+ * The current scale factor of the view.
2103
+ */
2104
+ readonly scale: number;
2105
+ /**
2106
+ * The X translation of the view in pixels.
2107
+ */
2108
+ readonly translateX: number;
2109
+ /**
2110
+ * The Y translation of the view in pixels.
2111
+ */
2112
+ readonly translateY: number;
2113
+ }
2123
2114
  /**
2124
2115
  * Booking Renderer class for seatmap booking.
2125
2116
  * Extends the base Renderer with booking-specific functionality.
@@ -2204,4 +2195,4 @@ declare class SeatmapBookingRenderer extends Renderer {
2204
2195
 
2205
2196
  declare const mergeSettings: <TSettings extends IRendererSettings>(defaults: IRendererSettings, settings?: TSettings | undefined) => IRendererSettings & TSettings;
2206
2197
 
2207
- export { BookingApiClient, type ById, type ColorSequenceSettings, type DestEvent, DestEventType, type IAdminRendererSettings, type IBaseSeat, type IBaseSector, type IBeforeSeatDrawEvent, type IBookingRendererSettings, type ICart, type ICartGa, type ICartSeat, type IClickSrcEvent, type IColoredPrice, type IConfigurationDTO, type IDeselectDestEvent, type IDragEndSrcEvent, type IDragMoveSrcEvent, type IDragStartSrcEvent, type IExtendedSeat, type IMouseMoveSrcEvent, type IPanDestEvent, type IPanZoomDestEvent, type IPlainSeatsDTO, type IPngBackgroundDTO, type IPoint, type IPrice, type IPriceDTO, type IPriceId, type IPriceListDTO, type IRectSelectDestEvent, type IRemovedCartGa, type IRenderer, type IRendererMachineContext, type IRendererSeatStyleSettings, type IRendererSettings, type IRendererSvgSectionStylesSetting, type IRendererTheme, type IRowDTO, type ISVGBackgroundDTO, type ISchemaDTO, type ISeat, type ISeatCartSwitchDestEvent, type ISeatDTO, type ISeatMouseEnterDestEvent, type ISeatMouseLeaveDestEvent, type ISeatPriceScheme, type ISeatSelectDestEvent, type ISeatStyle, type ISection, type ISectionClickDestEvent, type ISectionMouseEnterDestEvent, type ISectionMouseLeaveDestEvent, type ISectionRect, type ISectionWithCoords, type ISector, type ISectorDTO, type ISpecialPrice, type ISpecialState, type ISvgSectionStyle, type IVenueDTO, Renderer, type RendererMachine, type RendererMachineReducer, type RendererMachineService, RendererSelectMode, RendererTargetType, type SeatFilter, type SeatInteractionState, SeatmapAdminRenderer, SeatmapBookingRenderer, type SrcEvent, SrcEventType, type TransformArray, mergeSettings };
2198
+ export { BookingApiClient, type ById, type ColorSequenceSettings, type IAdminRenderer, type IAdminRendererSettings, type IBaseSeat, type IBaseSector, type IBeforeSeatDrawEvent, type IBookingRenderer, type IBookingRendererSettings, type ICart, type ICartGa, type ICartSeat, type IColoredPrice, type IConfigurationDTO, type IExtendedSeat, type IPlainSeatsDTO, type IPngBackgroundDTO, type IPoint, type IPrice, type IPriceDTO, type IPriceId, type IPriceListDTO, type IRemovedCartGa, type IRenderer, type IRendererSeatStyleSettings, type IRendererSettings, type IRendererSvgSectionStylesSetting, type IRendererTheme, type IRowDTO, type ISVGBackgroundDTO, type ISchemaDTO, type ISeat, type ISeatDTO, type ISeatPriceScheme, type ISeatStyle, type ISection, type ISectionRect, type ISectionWithCoords, type ISector, type ISectorDTO, type ISpecialPrice, type ISpecialState, type ISvgSectionStyle, type IVenueDTO, type IViewBox, Renderer, type RendererMachine, type RendererMachineService, RendererSelectMode, RendererTargetType, type SeatFilter, type SeatInteractionState, SeatmapAdminRenderer, SeatmapBookingRenderer, type TransformArray, addPoints, mergeSettings, subPoints };