@stripchatdev/ext-helper 0.3.2 → 0.4.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/helpers/index.d.ts +95 -11
- package/dist/helpers/react.d.ts +95 -11
- package/dist/index.d.ts +95 -11
- package/package.json +1 -1
package/dist/helpers/index.d.ts
CHANGED
|
@@ -235,10 +235,15 @@ declare type TV1ChatMethods = {
|
|
|
235
235
|
};
|
|
236
236
|
};
|
|
237
237
|
|
|
238
|
-
declare type TV1Events = TV1ExtEvents & TV1PaymentEvents & TV1ModelEvents & TV1SessionEvents & TV1TipEvents & TV1ChatEvents & TV1GoalEvents;
|
|
238
|
+
declare type TV1Events = TV1ExtEvents & TV1PaymentEvents & TV1ModelEvents & TV1SessionEvents & TV1TipEvents & TV1ChatEvents & TV1GoalEvents & TV1ShowEvents;
|
|
239
239
|
|
|
240
240
|
declare type TV1ExtContext = {
|
|
241
241
|
model?: TV1ExtModel;
|
|
242
|
+
/**
|
|
243
|
+
* Show the current user takes part in. Always present for the model while they are producing a show,
|
|
244
|
+
* and present for a user only while that user is a participant of the show. Otherwise it is absent.
|
|
245
|
+
*/
|
|
246
|
+
show?: TV1ExtShow;
|
|
242
247
|
/** Unique identifier for the extension. */
|
|
243
248
|
slug?: string;
|
|
244
249
|
user?: TV1ExtUser;
|
|
@@ -251,6 +256,8 @@ declare type TV1ExtEvents = {
|
|
|
251
256
|
context: TV1ExtContext;
|
|
252
257
|
};
|
|
253
258
|
/**
|
|
259
|
+
* @deprecated This event will be removed in a future release.
|
|
260
|
+
*
|
|
254
261
|
* Fired whenever the viewer counts for the room change.
|
|
255
262
|
* Emitted only for show types: `public`, `groupShow`, `ticketShow`.
|
|
256
263
|
*/
|
|
@@ -308,6 +315,8 @@ declare type TV1ExtLoggedInUser = {
|
|
|
308
315
|
* - `ticketShow` — ticket show context
|
|
309
316
|
* - `off` — offline
|
|
310
317
|
* - `spy` — spying on a private show
|
|
318
|
+
*
|
|
319
|
+
* @deprecated Use `context.show` to check whether the user is a participant of the show. This field will be removed in a future release.
|
|
311
320
|
*/
|
|
312
321
|
status: TV1UserStatus;
|
|
313
322
|
/** User username. */
|
|
@@ -378,6 +387,8 @@ declare type TV1ExtMethods = {
|
|
|
378
387
|
result: null;
|
|
379
388
|
};
|
|
380
389
|
/**
|
|
390
|
+
* @deprecated This method will be removed in a future release.
|
|
391
|
+
*
|
|
381
392
|
* Returns the current viewer counts for the room.
|
|
382
393
|
* Supported only for show types: `public`, `groupShow`, `ticketShow`.
|
|
383
394
|
* Returns `null` for other show types.
|
|
@@ -436,16 +447,13 @@ declare type TV1ExtModel = {
|
|
|
436
447
|
isSpyEnabled: boolean;
|
|
437
448
|
/** Model's name from her profile. If not set, an empty string will be returned */
|
|
438
449
|
name: string;
|
|
439
|
-
/**
|
|
450
|
+
/** Presence of the model on the site. When it is `show`, read `context.show.status` for the type of the show. */
|
|
451
|
+
state: TV1ModelState;
|
|
452
|
+
/**
|
|
453
|
+
* Status of the show.
|
|
440
454
|
*
|
|
441
|
-
*
|
|
442
|
-
|
|
443
|
-
* - `private` - model is in private show
|
|
444
|
-
* - `exclusivePrivate` - model is in exclusive private show
|
|
445
|
-
* - `off` - model is offline
|
|
446
|
-
* - `groupShow` - model is in group show that is not a ticket show
|
|
447
|
-
* - `ticketShow` - model is in ticket show
|
|
448
|
-
* */
|
|
455
|
+
* @deprecated Use `context.show.status` for show-type checks and `state` for the presence of the model.
|
|
456
|
+
*/
|
|
449
457
|
status: TV1ModelStatus;
|
|
450
458
|
/** Model's username */
|
|
451
459
|
username: string;
|
|
@@ -468,6 +476,28 @@ declare type TV1ExtModelTag = {
|
|
|
468
476
|
|
|
469
477
|
declare type TV1ExtSettings = unknown;
|
|
470
478
|
|
|
479
|
+
/**
|
|
480
|
+
* Show that is currently running in the room.
|
|
481
|
+
*
|
|
482
|
+
* Present in the extension context only for participants of the show: always for the model,
|
|
483
|
+
* and for a user only while that user is a participant. It is absent for everyone else,
|
|
484
|
+
* for example for a user watching the room while the model is in a private show with somebody else,
|
|
485
|
+
* or while the user is spying on a private show.
|
|
486
|
+
*
|
|
487
|
+
* A spy viewer is not a participant of the show, so `context.show` remains undefined in that case.
|
|
488
|
+
* Extensions are not running while the user spies on a show, so an extension never observes spy mode
|
|
489
|
+
* and there is no `spy` value in `context.show.status`.
|
|
490
|
+
*
|
|
491
|
+
* Use `context.show` to branch on the type of the show and `v1.show.participants.get` to read who takes part in it.
|
|
492
|
+
*/
|
|
493
|
+
declare type TV1ExtShow = {
|
|
494
|
+
/** Type of the show. */
|
|
495
|
+
status: TV1ExtShowStatus;
|
|
496
|
+
};
|
|
497
|
+
|
|
498
|
+
/** Type of the show that is currently running in the room. */
|
|
499
|
+
declare type TV1ExtShowStatus = typeof V1_SHOW_STATUSES.STATUS_PUBLIC | typeof V1_SHOW_STATUSES.STATUS_GROUP_SHOW | typeof V1_SHOW_STATUSES.STATUS_TICKET_SHOW | typeof V1_SHOW_STATUSES.STATUS_PRIVATE | typeof V1_SHOW_STATUSES.STATUS_EXCLUSIVE_PRIVATE;
|
|
500
|
+
|
|
471
501
|
declare type TV1ExtUser = TV1ExtGuestUser | TV1ExtLoggedInUser;
|
|
472
502
|
|
|
473
503
|
/** Viewer counts for the current room. */
|
|
@@ -536,7 +566,7 @@ declare type TV1GoalMethods = {
|
|
|
536
566
|
};
|
|
537
567
|
};
|
|
538
568
|
|
|
539
|
-
declare type TV1Methods = TV1ExtMethods & TV1SystemMethods & TV1PaymentMethods & TV1ModelMethods & TV1ChatMethods & TV1PrivateMethods & TV1MonitoringMethods & TV1SessionMethods & TV1StorageMethods & TV1TipMethods & TV1GoalMethods & TV1FanClubMethods;
|
|
569
|
+
declare type TV1Methods = TV1ExtMethods & TV1SystemMethods & TV1PaymentMethods & TV1ModelMethods & TV1ChatMethods & TV1PrivateMethods & TV1MonitoringMethods & TV1SessionMethods & TV1StorageMethods & TV1TipMethods & TV1GoalMethods & TV1FanClubMethods & TV1ShowMethods;
|
|
540
570
|
|
|
541
571
|
declare type TV1ModelEvents = {
|
|
542
572
|
'v1.model.ext.settings.set.requested': null;
|
|
@@ -558,6 +588,15 @@ declare type TV1ModelMethods = {
|
|
|
558
588
|
};
|
|
559
589
|
};
|
|
560
590
|
|
|
591
|
+
/**
|
|
592
|
+
* Presence of the model on the site.
|
|
593
|
+
*
|
|
594
|
+
* - `off` — model is not on the site
|
|
595
|
+
* - `idle` — model is on the site but not producing a show
|
|
596
|
+
* - `show` — model is producing a show
|
|
597
|
+
*/
|
|
598
|
+
declare type TV1ModelState = (typeof V1_MODEL_STATES)[keyof typeof V1_MODEL_STATES];
|
|
599
|
+
|
|
561
600
|
/** Status that indicates which type of show model is producing now */
|
|
562
601
|
declare type TV1ModelStatus = Exclude<TV1ShowStatus, 'spy'>;
|
|
563
602
|
|
|
@@ -826,6 +865,42 @@ declare type TV1SessionUpdate = {
|
|
|
826
865
|
*/
|
|
827
866
|
declare type TV1SessionWhisperData = TUnknownDictionary;
|
|
828
867
|
|
|
868
|
+
declare type TV1ShowEvents = {
|
|
869
|
+
/**
|
|
870
|
+
* Fired when the participants of the show change, for example when a user joins or leaves the show.
|
|
871
|
+
*
|
|
872
|
+
* Emitted for the model and for participants of the show.
|
|
873
|
+
*/
|
|
874
|
+
'v1.show.participants.updated': {
|
|
875
|
+
data: {
|
|
876
|
+
/** Logged-in users that take part in the show. */
|
|
877
|
+
participants: TV1ExtLoggedInUser[];
|
|
878
|
+
/** Total number of participants of the show, including guests that are not listed in `participants`. */
|
|
879
|
+
total: number;
|
|
880
|
+
};
|
|
881
|
+
};
|
|
882
|
+
};
|
|
883
|
+
|
|
884
|
+
declare type TV1ShowMethods = {
|
|
885
|
+
/**
|
|
886
|
+
* Returns the users that take part in the show currently running in the room.
|
|
887
|
+
*
|
|
888
|
+
* Available for the model and for participants of the show. Check that `context.show` is present before calling.
|
|
889
|
+
*
|
|
890
|
+
* Guests are never listed in `participants`, but they are counted in `total`.
|
|
891
|
+
* Participants might change during the show, so subscribe to `v1.show.participants.updated` to listen to these changes.
|
|
892
|
+
*/
|
|
893
|
+
'v1.show.participants.get': {
|
|
894
|
+
params: null;
|
|
895
|
+
result: {
|
|
896
|
+
/** Logged-in users that take part in the show. */
|
|
897
|
+
participants: TV1ExtLoggedInUser[];
|
|
898
|
+
/** Total number of participants of the show, including guests that are not listed in `participants`. */
|
|
899
|
+
total: number;
|
|
900
|
+
};
|
|
901
|
+
};
|
|
902
|
+
};
|
|
903
|
+
|
|
829
904
|
declare type TV1ShowStatus = (typeof V1_SHOW_STATUSES)[keyof typeof V1_SHOW_STATUSES];
|
|
830
905
|
|
|
831
906
|
declare type TV1StorageMethods = {
|
|
@@ -1238,6 +1313,15 @@ declare type TV2WhisperData = {
|
|
|
1238
1313
|
tokenSum: number | null;
|
|
1239
1314
|
};
|
|
1240
1315
|
|
|
1316
|
+
declare const V1_MODEL_STATES: {
|
|
1317
|
+
/** Model is not on the site */
|
|
1318
|
+
readonly STATUS_OFF: "off";
|
|
1319
|
+
/** Model is on the site but not producing a show */
|
|
1320
|
+
readonly STATUS_IDLE: "idle";
|
|
1321
|
+
/** Model is producing a show */
|
|
1322
|
+
readonly STATUS_SHOW: "show";
|
|
1323
|
+
};
|
|
1324
|
+
|
|
1241
1325
|
declare const V1_SHOW_STATUSES: {
|
|
1242
1326
|
/** Ticket show */
|
|
1243
1327
|
readonly STATUS_TICKET_SHOW: "ticketShow";
|
package/dist/helpers/react.d.ts
CHANGED
|
@@ -169,10 +169,15 @@ declare type TV1ChatMethods = {
|
|
|
169
169
|
};
|
|
170
170
|
};
|
|
171
171
|
|
|
172
|
-
declare type TV1Events = TV1ExtEvents & TV1PaymentEvents & TV1ModelEvents & TV1SessionEvents & TV1TipEvents & TV1ChatEvents & TV1GoalEvents;
|
|
172
|
+
declare type TV1Events = TV1ExtEvents & TV1PaymentEvents & TV1ModelEvents & TV1SessionEvents & TV1TipEvents & TV1ChatEvents & TV1GoalEvents & TV1ShowEvents;
|
|
173
173
|
|
|
174
174
|
declare type TV1ExtContext = {
|
|
175
175
|
model?: TV1ExtModel;
|
|
176
|
+
/**
|
|
177
|
+
* Show the current user takes part in. Always present for the model while they are producing a show,
|
|
178
|
+
* and present for a user only while that user is a participant of the show. Otherwise it is absent.
|
|
179
|
+
*/
|
|
180
|
+
show?: TV1ExtShow;
|
|
176
181
|
/** Unique identifier for the extension. */
|
|
177
182
|
slug?: string;
|
|
178
183
|
user?: TV1ExtUser;
|
|
@@ -185,6 +190,8 @@ declare type TV1ExtEvents = {
|
|
|
185
190
|
context: TV1ExtContext;
|
|
186
191
|
};
|
|
187
192
|
/**
|
|
193
|
+
* @deprecated This event will be removed in a future release.
|
|
194
|
+
*
|
|
188
195
|
* Fired whenever the viewer counts for the room change.
|
|
189
196
|
* Emitted only for show types: `public`, `groupShow`, `ticketShow`.
|
|
190
197
|
*/
|
|
@@ -242,6 +249,8 @@ declare type TV1ExtLoggedInUser = {
|
|
|
242
249
|
* - `ticketShow` — ticket show context
|
|
243
250
|
* - `off` — offline
|
|
244
251
|
* - `spy` — spying on a private show
|
|
252
|
+
*
|
|
253
|
+
* @deprecated Use `context.show` to check whether the user is a participant of the show. This field will be removed in a future release.
|
|
245
254
|
*/
|
|
246
255
|
status: TV1UserStatus;
|
|
247
256
|
/** User username. */
|
|
@@ -312,6 +321,8 @@ declare type TV1ExtMethods = {
|
|
|
312
321
|
result: null;
|
|
313
322
|
};
|
|
314
323
|
/**
|
|
324
|
+
* @deprecated This method will be removed in a future release.
|
|
325
|
+
*
|
|
315
326
|
* Returns the current viewer counts for the room.
|
|
316
327
|
* Supported only for show types: `public`, `groupShow`, `ticketShow`.
|
|
317
328
|
* Returns `null` for other show types.
|
|
@@ -370,16 +381,13 @@ declare type TV1ExtModel = {
|
|
|
370
381
|
isSpyEnabled: boolean;
|
|
371
382
|
/** Model's name from her profile. If not set, an empty string will be returned */
|
|
372
383
|
name: string;
|
|
373
|
-
/**
|
|
384
|
+
/** Presence of the model on the site. When it is `show`, read `context.show.status` for the type of the show. */
|
|
385
|
+
state: TV1ModelState;
|
|
386
|
+
/**
|
|
387
|
+
* Status of the show.
|
|
374
388
|
*
|
|
375
|
-
*
|
|
376
|
-
|
|
377
|
-
* - `private` - model is in private show
|
|
378
|
-
* - `exclusivePrivate` - model is in exclusive private show
|
|
379
|
-
* - `off` - model is offline
|
|
380
|
-
* - `groupShow` - model is in group show that is not a ticket show
|
|
381
|
-
* - `ticketShow` - model is in ticket show
|
|
382
|
-
* */
|
|
389
|
+
* @deprecated Use `context.show.status` for show-type checks and `state` for the presence of the model.
|
|
390
|
+
*/
|
|
383
391
|
status: TV1ModelStatus;
|
|
384
392
|
/** Model's username */
|
|
385
393
|
username: string;
|
|
@@ -402,6 +410,28 @@ declare type TV1ExtModelTag = {
|
|
|
402
410
|
|
|
403
411
|
declare type TV1ExtSettings = unknown;
|
|
404
412
|
|
|
413
|
+
/**
|
|
414
|
+
* Show that is currently running in the room.
|
|
415
|
+
*
|
|
416
|
+
* Present in the extension context only for participants of the show: always for the model,
|
|
417
|
+
* and for a user only while that user is a participant. It is absent for everyone else,
|
|
418
|
+
* for example for a user watching the room while the model is in a private show with somebody else,
|
|
419
|
+
* or while the user is spying on a private show.
|
|
420
|
+
*
|
|
421
|
+
* A spy viewer is not a participant of the show, so `context.show` remains undefined in that case.
|
|
422
|
+
* Extensions are not running while the user spies on a show, so an extension never observes spy mode
|
|
423
|
+
* and there is no `spy` value in `context.show.status`.
|
|
424
|
+
*
|
|
425
|
+
* Use `context.show` to branch on the type of the show and `v1.show.participants.get` to read who takes part in it.
|
|
426
|
+
*/
|
|
427
|
+
declare type TV1ExtShow = {
|
|
428
|
+
/** Type of the show. */
|
|
429
|
+
status: TV1ExtShowStatus;
|
|
430
|
+
};
|
|
431
|
+
|
|
432
|
+
/** Type of the show that is currently running in the room. */
|
|
433
|
+
declare type TV1ExtShowStatus = typeof V1_SHOW_STATUSES.STATUS_PUBLIC | typeof V1_SHOW_STATUSES.STATUS_GROUP_SHOW | typeof V1_SHOW_STATUSES.STATUS_TICKET_SHOW | typeof V1_SHOW_STATUSES.STATUS_PRIVATE | typeof V1_SHOW_STATUSES.STATUS_EXCLUSIVE_PRIVATE;
|
|
434
|
+
|
|
405
435
|
declare type TV1ExtUser = TV1ExtGuestUser | TV1ExtLoggedInUser;
|
|
406
436
|
|
|
407
437
|
/** Viewer counts for the current room. */
|
|
@@ -470,7 +500,7 @@ declare type TV1GoalMethods = {
|
|
|
470
500
|
};
|
|
471
501
|
};
|
|
472
502
|
|
|
473
|
-
declare type TV1Methods = TV1ExtMethods & TV1SystemMethods & TV1PaymentMethods & TV1ModelMethods & TV1ChatMethods & TV1PrivateMethods & TV1MonitoringMethods & TV1SessionMethods & TV1StorageMethods & TV1TipMethods & TV1GoalMethods & TV1FanClubMethods;
|
|
503
|
+
declare type TV1Methods = TV1ExtMethods & TV1SystemMethods & TV1PaymentMethods & TV1ModelMethods & TV1ChatMethods & TV1PrivateMethods & TV1MonitoringMethods & TV1SessionMethods & TV1StorageMethods & TV1TipMethods & TV1GoalMethods & TV1FanClubMethods & TV1ShowMethods;
|
|
474
504
|
|
|
475
505
|
declare type TV1ModelEvents = {
|
|
476
506
|
'v1.model.ext.settings.set.requested': null;
|
|
@@ -492,6 +522,15 @@ declare type TV1ModelMethods = {
|
|
|
492
522
|
};
|
|
493
523
|
};
|
|
494
524
|
|
|
525
|
+
/**
|
|
526
|
+
* Presence of the model on the site.
|
|
527
|
+
*
|
|
528
|
+
* - `off` — model is not on the site
|
|
529
|
+
* - `idle` — model is on the site but not producing a show
|
|
530
|
+
* - `show` — model is producing a show
|
|
531
|
+
*/
|
|
532
|
+
declare type TV1ModelState = (typeof V1_MODEL_STATES)[keyof typeof V1_MODEL_STATES];
|
|
533
|
+
|
|
495
534
|
/** Status that indicates which type of show model is producing now */
|
|
496
535
|
declare type TV1ModelStatus = Exclude<TV1ShowStatus, 'spy'>;
|
|
497
536
|
|
|
@@ -760,6 +799,42 @@ declare type TV1SessionUpdate = {
|
|
|
760
799
|
*/
|
|
761
800
|
declare type TV1SessionWhisperData = TUnknownDictionary;
|
|
762
801
|
|
|
802
|
+
declare type TV1ShowEvents = {
|
|
803
|
+
/**
|
|
804
|
+
* Fired when the participants of the show change, for example when a user joins or leaves the show.
|
|
805
|
+
*
|
|
806
|
+
* Emitted for the model and for participants of the show.
|
|
807
|
+
*/
|
|
808
|
+
'v1.show.participants.updated': {
|
|
809
|
+
data: {
|
|
810
|
+
/** Logged-in users that take part in the show. */
|
|
811
|
+
participants: TV1ExtLoggedInUser[];
|
|
812
|
+
/** Total number of participants of the show, including guests that are not listed in `participants`. */
|
|
813
|
+
total: number;
|
|
814
|
+
};
|
|
815
|
+
};
|
|
816
|
+
};
|
|
817
|
+
|
|
818
|
+
declare type TV1ShowMethods = {
|
|
819
|
+
/**
|
|
820
|
+
* Returns the users that take part in the show currently running in the room.
|
|
821
|
+
*
|
|
822
|
+
* Available for the model and for participants of the show. Check that `context.show` is present before calling.
|
|
823
|
+
*
|
|
824
|
+
* Guests are never listed in `participants`, but they are counted in `total`.
|
|
825
|
+
* Participants might change during the show, so subscribe to `v1.show.participants.updated` to listen to these changes.
|
|
826
|
+
*/
|
|
827
|
+
'v1.show.participants.get': {
|
|
828
|
+
params: null;
|
|
829
|
+
result: {
|
|
830
|
+
/** Logged-in users that take part in the show. */
|
|
831
|
+
participants: TV1ExtLoggedInUser[];
|
|
832
|
+
/** Total number of participants of the show, including guests that are not listed in `participants`. */
|
|
833
|
+
total: number;
|
|
834
|
+
};
|
|
835
|
+
};
|
|
836
|
+
};
|
|
837
|
+
|
|
763
838
|
declare type TV1ShowStatus = (typeof V1_SHOW_STATUSES)[keyof typeof V1_SHOW_STATUSES];
|
|
764
839
|
|
|
765
840
|
declare type TV1StorageMethods = {
|
|
@@ -1190,6 +1265,15 @@ export declare const useSlotState: <State extends object>({ channel, extHelper,
|
|
|
1190
1265
|
state: State | null;
|
|
1191
1266
|
};
|
|
1192
1267
|
|
|
1268
|
+
declare const V1_MODEL_STATES: {
|
|
1269
|
+
/** Model is not on the site */
|
|
1270
|
+
readonly STATUS_OFF: "off";
|
|
1271
|
+
/** Model is on the site but not producing a show */
|
|
1272
|
+
readonly STATUS_IDLE: "idle";
|
|
1273
|
+
/** Model is producing a show */
|
|
1274
|
+
readonly STATUS_SHOW: "show";
|
|
1275
|
+
};
|
|
1276
|
+
|
|
1193
1277
|
declare const V1_SHOW_STATUSES: {
|
|
1194
1278
|
/** Ticket show */
|
|
1195
1279
|
readonly STATUS_TICKET_SHOW: "ticketShow";
|
package/dist/index.d.ts
CHANGED
|
@@ -210,10 +210,15 @@ declare type TV1ChatMethods = {
|
|
|
210
210
|
};
|
|
211
211
|
};
|
|
212
212
|
|
|
213
|
-
export declare type TV1Events = TV1ExtEvents & TV1PaymentEvents & TV1ModelEvents & TV1SessionEvents & TV1TipEvents & TV1ChatEvents & TV1GoalEvents;
|
|
213
|
+
export declare type TV1Events = TV1ExtEvents & TV1PaymentEvents & TV1ModelEvents & TV1SessionEvents & TV1TipEvents & TV1ChatEvents & TV1GoalEvents & TV1ShowEvents;
|
|
214
214
|
|
|
215
215
|
export declare type TV1ExtContext = {
|
|
216
216
|
model?: TV1ExtModel;
|
|
217
|
+
/**
|
|
218
|
+
* Show the current user takes part in. Always present for the model while they are producing a show,
|
|
219
|
+
* and present for a user only while that user is a participant of the show. Otherwise it is absent.
|
|
220
|
+
*/
|
|
221
|
+
show?: TV1ExtShow;
|
|
217
222
|
/** Unique identifier for the extension. */
|
|
218
223
|
slug?: string;
|
|
219
224
|
user?: TV1ExtUser;
|
|
@@ -232,6 +237,8 @@ declare type TV1ExtEvents = {
|
|
|
232
237
|
context: TV1ExtContext;
|
|
233
238
|
};
|
|
234
239
|
/**
|
|
240
|
+
* @deprecated This event will be removed in a future release.
|
|
241
|
+
*
|
|
235
242
|
* Fired whenever the viewer counts for the room change.
|
|
236
243
|
* Emitted only for show types: `public`, `groupShow`, `ticketShow`.
|
|
237
244
|
*/
|
|
@@ -289,6 +296,8 @@ export declare type TV1ExtLoggedInUser = {
|
|
|
289
296
|
* - `ticketShow` — ticket show context
|
|
290
297
|
* - `off` — offline
|
|
291
298
|
* - `spy` — spying on a private show
|
|
299
|
+
*
|
|
300
|
+
* @deprecated Use `context.show` to check whether the user is a participant of the show. This field will be removed in a future release.
|
|
292
301
|
*/
|
|
293
302
|
status: TV1UserStatus;
|
|
294
303
|
/** User username. */
|
|
@@ -359,6 +368,8 @@ declare type TV1ExtMethods = {
|
|
|
359
368
|
result: null;
|
|
360
369
|
};
|
|
361
370
|
/**
|
|
371
|
+
* @deprecated This method will be removed in a future release.
|
|
372
|
+
*
|
|
362
373
|
* Returns the current viewer counts for the room.
|
|
363
374
|
* Supported only for show types: `public`, `groupShow`, `ticketShow`.
|
|
364
375
|
* Returns `null` for other show types.
|
|
@@ -417,16 +428,13 @@ export declare type TV1ExtModel = {
|
|
|
417
428
|
isSpyEnabled: boolean;
|
|
418
429
|
/** Model's name from her profile. If not set, an empty string will be returned */
|
|
419
430
|
name: string;
|
|
420
|
-
/**
|
|
431
|
+
/** Presence of the model on the site. When it is `show`, read `context.show.status` for the type of the show. */
|
|
432
|
+
state: TV1ModelState;
|
|
433
|
+
/**
|
|
434
|
+
* Status of the show.
|
|
421
435
|
*
|
|
422
|
-
*
|
|
423
|
-
|
|
424
|
-
* - `private` - model is in private show
|
|
425
|
-
* - `exclusivePrivate` - model is in exclusive private show
|
|
426
|
-
* - `off` - model is offline
|
|
427
|
-
* - `groupShow` - model is in group show that is not a ticket show
|
|
428
|
-
* - `ticketShow` - model is in ticket show
|
|
429
|
-
* */
|
|
436
|
+
* @deprecated Use `context.show.status` for show-type checks and `state` for the presence of the model.
|
|
437
|
+
*/
|
|
430
438
|
status: TV1ModelStatus;
|
|
431
439
|
/** Model's username */
|
|
432
440
|
username: string;
|
|
@@ -449,6 +457,28 @@ export declare type TV1ExtModelTag = {
|
|
|
449
457
|
|
|
450
458
|
export declare type TV1ExtSettings = unknown;
|
|
451
459
|
|
|
460
|
+
/**
|
|
461
|
+
* Show that is currently running in the room.
|
|
462
|
+
*
|
|
463
|
+
* Present in the extension context only for participants of the show: always for the model,
|
|
464
|
+
* and for a user only while that user is a participant. It is absent for everyone else,
|
|
465
|
+
* for example for a user watching the room while the model is in a private show with somebody else,
|
|
466
|
+
* or while the user is spying on a private show.
|
|
467
|
+
*
|
|
468
|
+
* A spy viewer is not a participant of the show, so `context.show` remains undefined in that case.
|
|
469
|
+
* Extensions are not running while the user spies on a show, so an extension never observes spy mode
|
|
470
|
+
* and there is no `spy` value in `context.show.status`.
|
|
471
|
+
*
|
|
472
|
+
* Use `context.show` to branch on the type of the show and `v1.show.participants.get` to read who takes part in it.
|
|
473
|
+
*/
|
|
474
|
+
export declare type TV1ExtShow = {
|
|
475
|
+
/** Type of the show. */
|
|
476
|
+
status: TV1ExtShowStatus;
|
|
477
|
+
};
|
|
478
|
+
|
|
479
|
+
/** Type of the show that is currently running in the room. */
|
|
480
|
+
export declare type TV1ExtShowStatus = typeof V1_SHOW_STATUSES.STATUS_PUBLIC | typeof V1_SHOW_STATUSES.STATUS_GROUP_SHOW | typeof V1_SHOW_STATUSES.STATUS_TICKET_SHOW | typeof V1_SHOW_STATUSES.STATUS_PRIVATE | typeof V1_SHOW_STATUSES.STATUS_EXCLUSIVE_PRIVATE;
|
|
481
|
+
|
|
452
482
|
export declare type TV1ExtUser = TV1ExtGuestUser | TV1ExtLoggedInUser;
|
|
453
483
|
|
|
454
484
|
/** Viewer counts for the current room. */
|
|
@@ -522,7 +552,7 @@ export declare type TV1MethodErrors = {
|
|
|
522
552
|
'v1.storage.string.set': TV1StorageStringSetError;
|
|
523
553
|
};
|
|
524
554
|
|
|
525
|
-
export declare type TV1Methods = TV1ExtMethods & TV1SystemMethods & TV1PaymentMethods & TV1ModelMethods & TV1ChatMethods & TV1PrivateMethods & TV1MonitoringMethods & TV1SessionMethods & TV1StorageMethods & TV1TipMethods & TV1GoalMethods & TV1FanClubMethods;
|
|
555
|
+
export declare type TV1Methods = TV1ExtMethods & TV1SystemMethods & TV1PaymentMethods & TV1ModelMethods & TV1ChatMethods & TV1PrivateMethods & TV1MonitoringMethods & TV1SessionMethods & TV1StorageMethods & TV1TipMethods & TV1GoalMethods & TV1FanClubMethods & TV1ShowMethods;
|
|
526
556
|
|
|
527
557
|
declare type TV1ModelEvents = {
|
|
528
558
|
'v1.model.ext.settings.set.requested': null;
|
|
@@ -544,6 +574,15 @@ declare type TV1ModelMethods = {
|
|
|
544
574
|
};
|
|
545
575
|
};
|
|
546
576
|
|
|
577
|
+
/**
|
|
578
|
+
* Presence of the model on the site.
|
|
579
|
+
*
|
|
580
|
+
* - `off` — model is not on the site
|
|
581
|
+
* - `idle` — model is on the site but not producing a show
|
|
582
|
+
* - `show` — model is producing a show
|
|
583
|
+
*/
|
|
584
|
+
export declare type TV1ModelState = (typeof V1_MODEL_STATES)[keyof typeof V1_MODEL_STATES];
|
|
585
|
+
|
|
547
586
|
/** Status that indicates which type of show model is producing now */
|
|
548
587
|
export declare type TV1ModelStatus = Exclude<TV1ShowStatus, 'spy'>;
|
|
549
588
|
|
|
@@ -812,6 +851,42 @@ export declare type TV1SessionUpdate = {
|
|
|
812
851
|
*/
|
|
813
852
|
export declare type TV1SessionWhisperData = TUnknownDictionary;
|
|
814
853
|
|
|
854
|
+
declare type TV1ShowEvents = {
|
|
855
|
+
/**
|
|
856
|
+
* Fired when the participants of the show change, for example when a user joins or leaves the show.
|
|
857
|
+
*
|
|
858
|
+
* Emitted for the model and for participants of the show.
|
|
859
|
+
*/
|
|
860
|
+
'v1.show.participants.updated': {
|
|
861
|
+
data: {
|
|
862
|
+
/** Logged-in users that take part in the show. */
|
|
863
|
+
participants: TV1ExtLoggedInUser[];
|
|
864
|
+
/** Total number of participants of the show, including guests that are not listed in `participants`. */
|
|
865
|
+
total: number;
|
|
866
|
+
};
|
|
867
|
+
};
|
|
868
|
+
};
|
|
869
|
+
|
|
870
|
+
declare type TV1ShowMethods = {
|
|
871
|
+
/**
|
|
872
|
+
* Returns the users that take part in the show currently running in the room.
|
|
873
|
+
*
|
|
874
|
+
* Available for the model and for participants of the show. Check that `context.show` is present before calling.
|
|
875
|
+
*
|
|
876
|
+
* Guests are never listed in `participants`, but they are counted in `total`.
|
|
877
|
+
* Participants might change during the show, so subscribe to `v1.show.participants.updated` to listen to these changes.
|
|
878
|
+
*/
|
|
879
|
+
'v1.show.participants.get': {
|
|
880
|
+
params: null;
|
|
881
|
+
result: {
|
|
882
|
+
/** Logged-in users that take part in the show. */
|
|
883
|
+
participants: TV1ExtLoggedInUser[];
|
|
884
|
+
/** Total number of participants of the show, including guests that are not listed in `participants`. */
|
|
885
|
+
total: number;
|
|
886
|
+
};
|
|
887
|
+
};
|
|
888
|
+
};
|
|
889
|
+
|
|
815
890
|
export declare type TV1ShowStatus = (typeof V1_SHOW_STATUSES)[keyof typeof V1_SHOW_STATUSES];
|
|
816
891
|
|
|
817
892
|
declare type TV1StorageMethods = {
|
|
@@ -1232,6 +1307,15 @@ export declare type TV2WhisperData = {
|
|
|
1232
1307
|
tokenSum: number | null;
|
|
1233
1308
|
};
|
|
1234
1309
|
|
|
1310
|
+
export declare const V1_MODEL_STATES: {
|
|
1311
|
+
/** Model is not on the site */
|
|
1312
|
+
readonly STATUS_OFF: "off";
|
|
1313
|
+
/** Model is on the site but not producing a show */
|
|
1314
|
+
readonly STATUS_IDLE: "idle";
|
|
1315
|
+
/** Model is producing a show */
|
|
1316
|
+
readonly STATUS_SHOW: "show";
|
|
1317
|
+
};
|
|
1318
|
+
|
|
1235
1319
|
export declare const V1_SHOW_STATUSES: {
|
|
1236
1320
|
/** Ticket show */
|
|
1237
1321
|
readonly STATUS_TICKET_SHOW: "ticketShow";
|