@stripchatdev/ext-helper 0.1.27 → 0.1.28

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.
Files changed (2) hide show
  1. package/dist/index.d.ts +26 -0
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -164,6 +164,13 @@ declare type TV1ExtEvents = {
164
164
  'v1.ext.context.updated': {
165
165
  context: TV1ExtContext;
166
166
  };
167
+ /**
168
+ * Fired whenever the viewer counts for the room change.
169
+ * Emitted only for show types: `public`, `groupShow`, `ticketShow`.
170
+ */
171
+ 'v1.ext.viewers.updated': {
172
+ viewers: TV1ExtViewers;
173
+ };
167
174
  'v1.ext.whispered': TV1WhisperData;
168
175
  'v1.ext.whispered.local': TV1WhisperData;
169
176
  };
@@ -257,6 +264,15 @@ declare type TV1ExtMethods = {
257
264
  };
258
265
  result: null;
259
266
  };
267
+ /**
268
+ * Returns the current viewer counts for the room.
269
+ * Supported only for show types: `public`, `groupShow`, `ticketShow`.
270
+ * Returns `null` for other show types.
271
+ */
272
+ 'v1.ext.viewers.get': {
273
+ params: null;
274
+ result: TV1ExtViewers | null;
275
+ };
260
276
  /** Broadcasts a message through the server to all clients in the room that have this extension loaded. Every slot iframe of every user receives the corresponding `v1.ext.whispered` event */
261
277
  'v1.ext.whisper': {
262
278
  params: {
@@ -317,6 +333,16 @@ export declare type TV1ExtSettings = unknown;
317
333
 
318
334
  export declare type TV1ExtUser = TV1ExtGuestUser | TV1ExtLoggedInUser;
319
335
 
336
+ /** Viewer counts for the current room. */
337
+ export declare type TV1ExtViewers = {
338
+ /** Number of guest (unauthenticated) viewers. */
339
+ guests: number;
340
+ /** Total number of viewers in the room. */
341
+ total: number;
342
+ /** Number of viewers who hold tokens. */
343
+ withTokens: number;
344
+ };
345
+
320
346
  export declare type TV1Genders = 'male' | 'female' | 'group' | 'tranny';
321
347
 
322
348
  export declare type TV1Methods = TV1ExtMethods & TV1SystemMethods & TV1PaymentMethods & TV1ModelMethods & TV1ChatMethods & TV1PrivateMethods & TV1MonitoringMethods & TV1SessionMethods & TV1StorageMethods & TV1TipMethods;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stripchatdev/ext-helper",
3
3
  "private": false,
4
- "version": "0.1.27",
4
+ "version": "0.1.28",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "module": "./dist/ext-helper.js",