@car-cutter/vue-webplayer 0.4.2 → 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
@@ -15,6 +15,36 @@ declare type __VLS_TypePropsToOption<T> = {
15
15
  };
16
16
  };
17
17
 
18
+ declare type AspectRatio = `${number}:${number}`;
19
+
20
+ declare type AspectRatio_2 = `${number}:${number}`;
21
+
22
+ declare type Category = {
23
+ id: string;
24
+ title: string;
25
+ items: Item[];
26
+ };
27
+
28
+ declare type Category_2 = {
29
+ id: string;
30
+ title: string;
31
+ items: Item_2[];
32
+ };
33
+
34
+ export declare type Composition = {
35
+ aspectRatio: AspectRatio_2;
36
+ imageHdWidth: ImageWidth_2;
37
+ imageSubWidths: ImageWidth_2[];
38
+ categories: Category_2[];
39
+ };
40
+
41
+ declare type Composition_2 = {
42
+ aspectRatio: AspectRatio;
43
+ imageHdWidth: ImageWidth;
44
+ imageSubWidths: ImageWidth[];
45
+ categories: Category[];
46
+ };
47
+
18
48
  export declare const DEFAULT_EVENT_PREFIX = "cc-webplayer:";
19
49
 
20
50
  export declare const EVENT_COMPOSITION_LOAD_ERROR = "composition-load-error";
@@ -35,16 +65,88 @@ export declare const EVENT_HOTSPOTS_OFF = "hotspots-off";
35
65
 
36
66
  export declare const EVENT_HOTSPOTS_ON = "hotspots-on";
37
67
 
68
+ declare type Hotspot = {
69
+ title: string;
70
+ icon?: string;
71
+ description?: string;
72
+ position: {
73
+ x: number;
74
+ y: number;
75
+ };
76
+ detail?: {
77
+ type: "image" | "link" | "pdf";
78
+ src: string;
79
+ };
80
+ };
81
+
82
+ declare type Hotspot_2 = {
83
+ title: string;
84
+ icon?: string;
85
+ description?: string;
86
+ position: {
87
+ x: number;
88
+ y: number;
89
+ };
90
+ detail?: {
91
+ type: "image" | "link" | "pdf";
92
+ src: string;
93
+ };
94
+ };
95
+
96
+ declare type ImageItem = { type: "image" } & ImageWithHotspots;
97
+
98
+ declare type ImageItem_2 = { type: "image" } & ImageWithHotspots_2;
99
+
38
100
  declare type ImageLoadStrategy = "quality" | "speed";
39
101
 
102
+ declare type ImageWidth = number;
103
+
104
+ declare type ImageWidth_2 = number;
105
+
106
+ declare type ImageWithHotspots = {
107
+ src: string;
108
+ hotspots?: Hotspot[];
109
+ };
110
+
111
+ declare type ImageWithHotspots_2 = {
112
+ src: string;
113
+ hotspots?: Hotspot_2[];
114
+ };
115
+
116
+ declare type Item = ImageItem | VideoItem | ThreeSixtyItem;
117
+
118
+ declare type Item_2 = ImageItem_2 | VideoItem_2 | ThreeSixtyItem_2;
119
+
120
+ declare type ThreeSixtyItem = {
121
+ type: "360";
122
+ images: ImageWithHotspots[];
123
+ };
124
+
125
+ declare type ThreeSixtyItem_2 = {
126
+ type: "360";
127
+ images: ImageWithHotspots_2[];
128
+ };
129
+
130
+ declare type VideoItem = {
131
+ type: "video";
132
+ src: string;
133
+ poster: string;
134
+ };
135
+
136
+ declare type VideoItem_2 = {
137
+ type: "video";
138
+ src: string;
139
+ poster: string;
140
+ };
141
+
40
142
  export declare const WEB_PLAYER_ICON_WC_TAG = "cc-webplayer-icon";
41
143
 
42
144
  export declare const WEB_PLAYER_WC_TAG = "cc-webplayer";
43
145
 
44
146
  export declare const WebPlayer: DefineComponent<__VLS_TypePropsToOption<WebPlayerProps>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
45
- compositionLoading: () => void;
46
- compositionLoaded: () => void;
47
- compositionLoadError: () => void;
147
+ compositionLoading: (url: string) => void;
148
+ compositionLoaded: (composition: Composition_2) => void;
149
+ compositionLoadError: (error: unknown) => void;
48
150
  extendModeOn: () => void;
49
151
  extendModeOff: () => void;
50
152
  hotspotsOn: () => void;
@@ -52,9 +154,9 @@ hotspotsOff: () => void;
52
154
  galleryOpen: () => void;
53
155
  galleryClose: () => void;
54
156
  }, string, PublicProps, Readonly<ExtractPropTypes<__VLS_TypePropsToOption<WebPlayerProps>>> & {
55
- onCompositionLoading?: (() => any) | undefined;
56
- onCompositionLoaded?: (() => any) | undefined;
57
- onCompositionLoadError?: (() => any) | undefined;
157
+ onCompositionLoading?: ((url: string) => any) | undefined;
158
+ onCompositionLoaded?: ((composition: Composition_2) => any) | undefined;
159
+ onCompositionLoadError?: ((error: unknown) => any) | undefined;
58
160
  onExtendModeOn?: (() => any) | undefined;
59
161
  onExtendModeOff?: (() => any) | undefined;
60
162
  onHotspotsOn?: (() => any) | undefined;
@@ -64,9 +166,9 @@ onGalleryClose?: (() => any) | undefined;
64
166
  }, {}, {}>;
65
167
 
66
168
  export declare type WebPlayerEvents = {
67
- compositionLoading: [];
68
- compositionLoaded: [];
69
- compositionLoadError: [];
169
+ compositionLoading: [url: string];
170
+ compositionLoaded: [composition: Composition_2];
171
+ compositionLoadError: [error: unknown];
70
172
  extendModeOn: [];
71
173
  extendModeOff: [];
72
174
  hotspotsOn: [];