@flowplayer/spins 0.1.0-rc.8 → 0.1.0-rc.9

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/types.d.ts CHANGED
@@ -13,10 +13,6 @@ declare const SPIN_CREATED = "spin:created";
13
13
  * Emitted when a different spin enters the viewport.
14
14
  */
15
15
  declare const SPIN_IN_VIEWPORT = "spin:viewport";
16
- /**
17
- * Should be emitted in order to add more spins dynamically.
18
- */
19
- declare const ADD_SPINS = "spins:add";
20
16
 
21
17
  /**
22
18
  * All supported plugin identifiers for configuring the player.
@@ -52,8 +48,7 @@ type SpinEventData = {
52
48
  config: SpinItem;
53
49
  spin: HTMLElement;
54
50
  };
55
- type AddSpinsEventData = SpinItem[];
56
- interface SpinsContainer extends HTMLDivElement {
51
+ interface SpinsContainer extends HTMLElement {
57
52
  /**
58
53
  * Adds a listener for the SpinsEvents["SPIN_CREATED"] event
59
54
  */
@@ -65,25 +60,20 @@ interface SpinsContainer extends HTMLDivElement {
65
60
  /**
66
61
  * Removes a listener for the SpinsEvents["SPIN_IN_VIEWPORT"] event
67
62
  */
68
- off(e: typeof SPIN_IN_VIEWPORT, handler: (e: CustomEvent<SpinEventData>) => void): void;
63
+ off(e: typeof SPIN_IN_VIEWPORT, handler: (e?: CustomEvent<SpinEventData>) => void): void;
69
64
  /**
70
65
  * Removes a listener for the SpinsEvents["SPIN_CREATED"] event
71
66
  */
72
- off(e: typeof SPIN_CREATED, handler: (e: CustomEvent<SpinEventData>) => void): void;
73
- /**
74
- * Triggers dynamic addition of new spins
75
- */
76
- emit(e: typeof ADD_SPINS, data: AddSpinsEventData): void;
67
+ off(e: typeof SPIN_CREATED, handler: (e?: CustomEvent<SpinEventData>) => void): void;
77
68
  /**
78
- * All the spins events.
69
+ * Add more spins dynamically.
79
70
  */
80
- events: typeof events;
71
+ addSpins(spins: SpinItem[]): void;
81
72
  }
82
73
  declare const events: {
83
74
  SPIN_IN_VIEWPORT: typeof SPIN_IN_VIEWPORT;
84
75
  SPIN_CREATED: typeof SPIN_CREATED;
85
- ADD_SPINS: typeof ADD_SPINS;
86
76
  };
87
77
  declare function createSpins(config: SpinsConfig): SpinsContainer;
88
78
 
89
- export { type AddSpinsEventData, type SpinEventData, type SpinItem, type SpinsConfig, type SpinsContainer, createSpins, events };
79
+ export { type SpinEventData, type SpinItem, type SpinsConfig, type SpinsContainer, createSpins, events };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@flowplayer/spins",
3
3
  "module": "dist/index.js",
4
- "version": "0.1.0-rc.8",
4
+ "version": "0.1.0-rc.9",
5
5
  "type": "module",
6
6
  "types": "./dist/types.d.ts",
7
7
  "exports": {