@car-cutter/wc-webplayer 0.4.1 → 0.5.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 CHANGED
@@ -1,10 +1,25 @@
1
+ declare type AspectRatio = `${number}:${number}`;
2
+
1
3
  declare type CamelToKebab<S extends string> = S extends `${infer T}${infer U}` ? `${T extends Lowercase<T> ? "" : "-"}${Lowercase<T>}${CamelToKebab<U>}` : S;
2
4
 
5
+ declare type Category = {
6
+ id: string;
7
+ title: string;
8
+ items: Item[];
9
+ };
10
+
3
11
  /**
4
12
  * Checks if WebPlayer's custom elements are defined and usable in the DOM.
5
13
  */
6
14
  export declare function checkCustomElementsDefinition(): boolean;
7
15
 
16
+ export declare type Composition = {
17
+ aspectRatio: AspectRatio;
18
+ imageHdWidth: ImageWidth;
19
+ imageSubWidths: ImageWidth[];
20
+ categories: Category[];
21
+ };
22
+
8
23
  export declare const DEFAULT_EVENT_PREFIX = "cc-webplayer:";
9
24
 
10
25
  /**
@@ -36,10 +51,46 @@ export declare const EVENT_HOTSPOTS_OFF = "hotspots-off";
36
51
 
37
52
  export declare const EVENT_HOTSPOTS_ON = "hotspots-on";
38
53
 
54
+ declare type Hotspot = {
55
+ title: string;
56
+ icon?: string;
57
+ description?: string;
58
+ position: {
59
+ x: number;
60
+ y: number;
61
+ };
62
+ detail?: {
63
+ type: "image" | "link" | "pdf";
64
+ src: string;
65
+ };
66
+ };
67
+
68
+ declare type ImageItem = { type: "image" } & ImageWithHotspots;
69
+
39
70
  declare type ImageLoadStrategy = "quality" | "speed";
40
71
 
41
72
  declare type ImageLoadStrategy_2 = "quality" | "speed";
42
73
 
74
+ declare type ImageWidth = number;
75
+
76
+ declare type ImageWithHotspots = {
77
+ src: string;
78
+ hotspots?: Hotspot[];
79
+ };
80
+
81
+ declare type Item = ImageItem | VideoItem | ThreeSixtyItem;
82
+
83
+ declare type ThreeSixtyItem = {
84
+ type: "360";
85
+ images: ImageWithHotspots[];
86
+ };
87
+
88
+ declare type VideoItem = {
89
+ type: "video";
90
+ src: string;
91
+ poster: string;
92
+ };
93
+
43
94
  export declare const WEB_PLAYER_ICON_WC_TAG = "cc-webplayer-icon";
44
95
 
45
96
  export declare const WEB_PLAYER_WC_TAG = "cc-webplayer";
@@ -75,18 +126,12 @@ export declare type WebPlayerProps = {
75
126
 
76
127
  declare type WebPlayerProps_2 = {
77
128
  compositionUrl: string;
78
-
79
- // Layout
80
129
  flatten?: boolean;
81
130
  infiniteCarrousel?: boolean;
82
131
  permanentGallery?: boolean;
83
-
84
- // Images loading
85
132
  imageLoadStrategy?: ImageLoadStrategy_2;
86
133
  minImageWidth?: number;
87
134
  maxImageWidth?: number;
88
-
89
- // Miscelaneous
90
135
  preventFullScreen?: boolean;
91
136
  eventPrefix?: string;
92
137
  reverse360?: boolean;