@stripchatdev/ext-helper 0.1.44 → 0.1.45
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/README.md +31 -0
- package/dist/helpers/index.d.ts +1025 -0
- package/dist/helpers/index.js +84 -0
- package/dist/helpers/react.d.ts +977 -0
- package/dist/helpers/react.js +16 -0
- package/dist/index.d.ts +8 -1
- package/package.json +20 -2
|
@@ -0,0 +1,1025 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create a state client for a visual slot.
|
|
3
|
+
*
|
|
4
|
+
* Use the same channel as the background host. The client starts with
|
|
5
|
+
* `isLoading: true` and `state: null`, then exposes the state received from the
|
|
6
|
+
* host. `setState()` sends a partial update; the state changes when the host
|
|
7
|
+
* publishes the resulting state.
|
|
8
|
+
*
|
|
9
|
+
* @typeParam State - Shape of the state shared through the channel.
|
|
10
|
+
* @param channel - Channel name shared with the background host.
|
|
11
|
+
* @param extHelper - Extension helper used for local slot communication.
|
|
12
|
+
* @returns A client for reading, updating, and subscribing to shared state.
|
|
13
|
+
*/
|
|
14
|
+
export declare const createSlotStateClient: <State extends object>({ channel, extHelper, }: TCreateSlotStateClientProps) => TSlotStateClient<State>;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Create a state host for a background slot.
|
|
18
|
+
*
|
|
19
|
+
* The background slot owns the shared state. Visual slots use the same channel
|
|
20
|
+
* to read the state and send partial updates.
|
|
21
|
+
*
|
|
22
|
+
* Create one host for each channel and call `unsubscribe()` when it is no longer
|
|
23
|
+
* needed. Visual slots should use `createSlotStateClient` or `useSlotState`.
|
|
24
|
+
*
|
|
25
|
+
* @typeParam State - Shape of the state shared through the channel.
|
|
26
|
+
* @param channel - Channel name shared with the visual-slot clients.
|
|
27
|
+
* @param extHelper - Extension helper used for local slot communication.
|
|
28
|
+
* @param initialState - Initial state owned by the background slot.
|
|
29
|
+
* @returns A controller for reading, updating, and stopping the host.
|
|
30
|
+
*/
|
|
31
|
+
export declare const createSlotStateHost: <State extends object>({ channel, extHelper, initialState, }: TCreateSlotStateHostProps<State>) => TSlotStateHost<State>;
|
|
32
|
+
|
|
33
|
+
declare type IV1IntIncrementFailureReason = 'INT_INCREMENT_FAILURE_REASON_UNSPECIFIED' | 'INT_INCREMENT_FAILURE_REASON_NONE' | 'INT_INCREMENT_FAILURE_REASON_VALIDATION_DENIED';
|
|
34
|
+
|
|
35
|
+
declare type TAnyApiEventData<D = unknown> = D;
|
|
36
|
+
|
|
37
|
+
declare type TAnyApiEventName = string;
|
|
38
|
+
|
|
39
|
+
declare type TAnyApiMethodMeta<P = unknown, R = unknown> = {
|
|
40
|
+
params: P;
|
|
41
|
+
result: R;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
declare type TAnyApiMethodName = string;
|
|
45
|
+
|
|
46
|
+
declare type TAnyApiSchema<Events extends Record<TAnyApiEventName, TAnyApiEventData> = Record<TAnyApiEventName, TAnyApiEventData>, Methods extends Record<TAnyApiMethodName, TAnyApiMethodMeta> = Record<TAnyApiMethodName, TAnyApiMethodMeta>> = {
|
|
47
|
+
events: Events;
|
|
48
|
+
methods: Methods;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
declare type TAnyPubSubHandler<D = unknown> = (data: D, peerId: TTransportPeer['id']) => void;
|
|
52
|
+
|
|
53
|
+
declare type TApiContract = TApiSchema;
|
|
54
|
+
|
|
55
|
+
declare type TApiSchema = TAnyApiSchema<TEvents, TMethods>;
|
|
56
|
+
|
|
57
|
+
/** Options for connecting a visual slot to shared background state. */
|
|
58
|
+
export declare type TCreateSlotStateClientProps = {
|
|
59
|
+
/** Shared name for the state. */
|
|
60
|
+
channel: string;
|
|
61
|
+
/** Extension helper used for slot communication. */
|
|
62
|
+
extHelper: TExtHelper;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
/** Options for creating shared state owned by a background slot. */
|
|
66
|
+
export declare type TCreateSlotStateHostProps<State extends object> = TCreateSlotStateClientProps & {
|
|
67
|
+
/** Initial shared state. */
|
|
68
|
+
initialState: State;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
declare type TEvents = TV1Events;
|
|
72
|
+
|
|
73
|
+
declare type TExtHelper = {
|
|
74
|
+
bootstrap(): void;
|
|
75
|
+
makeRequest<M extends Extract<keyof TApiContract['methods'], string>>(method: M, params: TApiContract['methods'][M]['params']): Promise<TApiContract['methods'][M]['result']>;
|
|
76
|
+
subscribe<E extends Extract<keyof TApiContract['events'], string>>(eventName: E, handler: TAnyPubSubHandler<TApiContract['events'][E]>): void;
|
|
77
|
+
unsubscribe<E extends Extract<keyof TApiContract['events'], string>>(eventName: E, handler?: TAnyPubSubHandler<TApiContract['events'][E]>): void;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
/** Unique identifier for a guest user **/
|
|
81
|
+
declare type TGuestHash = string;
|
|
82
|
+
|
|
83
|
+
declare type TMethods = TV1Methods;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Status of the movable overlay.
|
|
87
|
+
* `active` - pulsing green
|
|
88
|
+
* `inactive` - orange
|
|
89
|
+
* `connecting` - green
|
|
90
|
+
* `error` - red
|
|
91
|
+
*/
|
|
92
|
+
declare type TMovableOverlayStatus = 'active' | 'inactive' | 'connecting' | 'error';
|
|
93
|
+
|
|
94
|
+
/** Client for reading and updating state owned by a background slot. */
|
|
95
|
+
export declare type TSlotStateClient<State extends object> = {
|
|
96
|
+
/** Return the current state and loading status. */
|
|
97
|
+
getSnapshot: () => TSlotStateSnapshot<State>;
|
|
98
|
+
/** Send a shallow partial update to the background slot. */
|
|
99
|
+
setState: (newState: Partial<State>) => Promise<void>;
|
|
100
|
+
/** Subscribe to state changes and return an unsubscribe function. */
|
|
101
|
+
subscribe: (listener: () => void) => () => void;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
/** Controls shared state owned by a background slot. */
|
|
105
|
+
export declare type TSlotStateHost<State extends object> = {
|
|
106
|
+
/** Return the current state. */
|
|
107
|
+
getState: () => State;
|
|
108
|
+
/** Apply a shallow partial update and publish the new state. */
|
|
109
|
+
setState: (newState: Partial<State>) => Promise<void>;
|
|
110
|
+
/** Stop sharing this state. */
|
|
111
|
+
unsubscribe: () => void;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
/** Current shared state exposed by a visual-slot client. */
|
|
115
|
+
export declare type TSlotStateSnapshot<State extends object> = {
|
|
116
|
+
/** Whether the initial state is still loading. */
|
|
117
|
+
isLoading: boolean;
|
|
118
|
+
/** The current state, or `null` while loading. */
|
|
119
|
+
state: State | null;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
declare type TTransportPeer = {
|
|
123
|
+
id: string;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
declare type TUnknownDictionary = Record<string, unknown>;
|
|
127
|
+
|
|
128
|
+
declare type TUserId = number;
|
|
129
|
+
|
|
130
|
+
declare type TV1ActionParamValue = string | number | boolean | null | undefined | TV1ActionParamValue[] | {
|
|
131
|
+
[key: string]: TV1ActionParamValue;
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
declare type TV1ActionRequestParams = {
|
|
135
|
+
actionName: string;
|
|
136
|
+
params: Record<string, TV1ActionParamValue>;
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
declare type TV1ActionResult = {
|
|
140
|
+
body: unknown;
|
|
141
|
+
code: number;
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
declare type TV1ChatEvents = {
|
|
145
|
+
/** Triggered on every new message in a chat */
|
|
146
|
+
'v1.chat.message.received': {
|
|
147
|
+
/** Text of the message */
|
|
148
|
+
messageText: string;
|
|
149
|
+
/** User who sent the message **/
|
|
150
|
+
sender: TV1ExtUser;
|
|
151
|
+
/** Whether message was sent in public or private chat **/
|
|
152
|
+
type: 'private' | 'public';
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
declare type TV1ChatMethods = {
|
|
157
|
+
/**
|
|
158
|
+
* This method should be used to notify a user in the chat about an event related to the extension, for example, showing the result of a game. Therefore, it should be used only after `v1.payment.tokens.spend.succeeded` event.
|
|
159
|
+
*
|
|
160
|
+
* The message is sent locally to each user on behalf of the extension. The message is not sent to the server
|
|
161
|
+
* and is not broadcasted — each user sees it injected into their own local chat feed.
|
|
162
|
+
*
|
|
163
|
+
* Because the message is local only, it is **not persisted**: it will disappear from the chat
|
|
164
|
+
* history after the page is reloaded.
|
|
165
|
+
*
|
|
166
|
+
* **Note:** A clickable link to the extension is always appended at the end of every message sent via this method.
|
|
167
|
+
* Clicking it opens the extension that sent the message.
|
|
168
|
+
* This behavior is mandatory and cannot be disabled.
|
|
169
|
+
*/
|
|
170
|
+
'v1.chat.message.send': {
|
|
171
|
+
params: {
|
|
172
|
+
/** Whether the username should be hidden. Always respect user's anonimity and use data received in `v1.payment.tokens.spend.succeeded'. */
|
|
173
|
+
isAnonymous: boolean;
|
|
174
|
+
/**
|
|
175
|
+
* Chat message text.
|
|
176
|
+
*
|
|
177
|
+
* Supports inline markup tags:
|
|
178
|
+
* - `{#accent}…{/accent}` — highlights text with an accent color.
|
|
179
|
+
* - `{#fade}…{/fade}` — renders text in a dimmed/secondary style.
|
|
180
|
+
*
|
|
181
|
+
* Example: `'won {#accent}Alice{/accent} in'`
|
|
182
|
+
*/
|
|
183
|
+
message: string;
|
|
184
|
+
user: TV1ExtUser | null;
|
|
185
|
+
};
|
|
186
|
+
result: null;
|
|
187
|
+
};
|
|
188
|
+
/** Use this method to send a message in the chat as a bot or model.
|
|
189
|
+
* The message is sent locally to each user and looks like a normal chat message. The message is **not persisted** and will disappear from the chat after the page is reloaded.
|
|
190
|
+
* */
|
|
191
|
+
'v1.chatbot.message.send': {
|
|
192
|
+
params: {
|
|
193
|
+
/** Sender of the message.
|
|
194
|
+
* If `bot`, the message will be sent with the name of the extension
|
|
195
|
+
* If `model`, the message will be sent with the name of the current model
|
|
196
|
+
* */
|
|
197
|
+
from: 'bot' | 'model';
|
|
198
|
+
/** Text of the message.
|
|
199
|
+
*
|
|
200
|
+
*
|
|
201
|
+
* The message can contain {username} placeholder, which will be replaced with the name of the user receiving the message.
|
|
202
|
+
* If the user is anonymous, the placeholder will be replaced with empty string.
|
|
203
|
+
* If the user is guest, the placeholder will be replaced with "Guest".
|
|
204
|
+
*
|
|
205
|
+
* Example usage: "Hello, {username}! Welcome to the chat!"
|
|
206
|
+
* */
|
|
207
|
+
message: string;
|
|
208
|
+
};
|
|
209
|
+
result: null;
|
|
210
|
+
};
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
declare type TV1Events = TV1ExtEvents & TV1PaymentEvents & TV1ModelEvents & TV1SessionEvents & TV1TipEvents & TV1ChatEvents & TV1GoalEvents;
|
|
214
|
+
|
|
215
|
+
declare type TV1ExtContext = {
|
|
216
|
+
model?: TV1ExtModel;
|
|
217
|
+
/** Unique identifier for the extension. */
|
|
218
|
+
slug?: string;
|
|
219
|
+
user?: TV1ExtUser;
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
declare type TV1ExtEvents = {
|
|
223
|
+
'v1.ext.activity.available': null;
|
|
224
|
+
'v1.ext.activity.busy': null;
|
|
225
|
+
'v1.ext.context.updated': {
|
|
226
|
+
context: TV1ExtContext;
|
|
227
|
+
};
|
|
228
|
+
/**
|
|
229
|
+
* Fired whenever the viewer counts for the room change.
|
|
230
|
+
* Emitted only for show types: `public`, `groupShow`, `ticketShow`.
|
|
231
|
+
*/
|
|
232
|
+
'v1.ext.viewers.updated': {
|
|
233
|
+
viewers: TV1ExtViewers;
|
|
234
|
+
};
|
|
235
|
+
'v1.ext.whispered': TV1WhisperData;
|
|
236
|
+
'v1.ext.whispered.local': TV1WhisperData;
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
/** Guest user (not logged in). */
|
|
240
|
+
declare type TV1ExtGuestUser = {
|
|
241
|
+
/** Unique identifier for a guest user. */
|
|
242
|
+
guestHash: TGuestHash;
|
|
243
|
+
/** User is a guest (not logged in). */
|
|
244
|
+
isGuest: true;
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
/** Logged-in user. */
|
|
248
|
+
declare type TV1ExtLoggedInUser = {
|
|
249
|
+
/** User's fan club data. Contains information regarding user's subscription to the model's fan club. */
|
|
250
|
+
fanClub: TV1UsersFanClub;
|
|
251
|
+
/** User previously purchased tokens. */
|
|
252
|
+
hasPaidBefore: boolean;
|
|
253
|
+
/** User has tokens. */
|
|
254
|
+
hasTokens: boolean;
|
|
255
|
+
/** User currently has Ultimate membership. */
|
|
256
|
+
hasUltimateSubscription: boolean;
|
|
257
|
+
/** User ID. */
|
|
258
|
+
id: TUserId;
|
|
259
|
+
/** User is logged in. */
|
|
260
|
+
isGuest: false;
|
|
261
|
+
/** User is invisible. Do not expose any data of invisible users. */
|
|
262
|
+
isInvisible: boolean;
|
|
263
|
+
/** User is the highest tipper in the room over past 12 hours. */
|
|
264
|
+
isKing: boolean;
|
|
265
|
+
/** User is a knight of the model. */
|
|
266
|
+
isKnight: boolean;
|
|
267
|
+
/**
|
|
268
|
+
* User has a model account.
|
|
269
|
+
*
|
|
270
|
+
* This can be true for another model visiting the stream. To check whether the
|
|
271
|
+
* current user is the broadcaster, compare `context.user.id`
|
|
272
|
+
* and `context.model.id`.
|
|
273
|
+
*/
|
|
274
|
+
isModel: boolean;
|
|
275
|
+
/**
|
|
276
|
+
* Current show/session state for this user.
|
|
277
|
+
*
|
|
278
|
+
* - `public` — public broadcast context
|
|
279
|
+
* - `private` — private show context
|
|
280
|
+
* - `exclusivePrivate` — exclusive private show context
|
|
281
|
+
* - `groupShow` — group show context
|
|
282
|
+
* - `ticketShow` — ticket show context
|
|
283
|
+
* - `off` — offline
|
|
284
|
+
* - `spy` — spying on a private show
|
|
285
|
+
*/
|
|
286
|
+
status: TV1UserStatus;
|
|
287
|
+
/** User username. */
|
|
288
|
+
username: string;
|
|
289
|
+
/** User activity ranking data when available. */
|
|
290
|
+
userRanking?: TV1UserRanking;
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
declare type TV1ExtMethods = {
|
|
294
|
+
'v1.ext.actions.call': {
|
|
295
|
+
params: TV1ActionRequestParams;
|
|
296
|
+
result: TV1ActionResult;
|
|
297
|
+
};
|
|
298
|
+
'v1.ext.activity.request': {
|
|
299
|
+
params: {
|
|
300
|
+
durationMs: number;
|
|
301
|
+
};
|
|
302
|
+
result: {
|
|
303
|
+
activityId: string;
|
|
304
|
+
};
|
|
305
|
+
};
|
|
306
|
+
'v1.ext.activity.status': {
|
|
307
|
+
params: null;
|
|
308
|
+
result: {
|
|
309
|
+
status: 'available' | 'busy';
|
|
310
|
+
};
|
|
311
|
+
};
|
|
312
|
+
'v1.ext.context.get': {
|
|
313
|
+
params: null;
|
|
314
|
+
result: TV1ExtContext;
|
|
315
|
+
};
|
|
316
|
+
'v1.ext.movableOverlay.update': {
|
|
317
|
+
params: {
|
|
318
|
+
message?: string;
|
|
319
|
+
status?: TMovableOverlayStatus;
|
|
320
|
+
};
|
|
321
|
+
result: null;
|
|
322
|
+
};
|
|
323
|
+
'v1.ext.settings.get': {
|
|
324
|
+
params: null;
|
|
325
|
+
result: {
|
|
326
|
+
settings: TV1ExtSettings;
|
|
327
|
+
};
|
|
328
|
+
};
|
|
329
|
+
/** Opens Stripchat sign-up dialog for anonymous users. Use this when your extension requires a registered account to function */
|
|
330
|
+
'v1.ext.signup.open': {
|
|
331
|
+
params: {
|
|
332
|
+
type: 'user';
|
|
333
|
+
};
|
|
334
|
+
result: null;
|
|
335
|
+
};
|
|
336
|
+
/**
|
|
337
|
+
* Returns the current viewer counts for the room.
|
|
338
|
+
* Supported only for show types: `public`, `groupShow`, `ticketShow`.
|
|
339
|
+
* Returns `null` for other show types.
|
|
340
|
+
*/
|
|
341
|
+
'v1.ext.viewers.get': {
|
|
342
|
+
params: null;
|
|
343
|
+
result: TV1ExtViewers | null;
|
|
344
|
+
};
|
|
345
|
+
/** 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 */
|
|
346
|
+
'v1.ext.whisper': {
|
|
347
|
+
params: {
|
|
348
|
+
/** Any JSON-serializable object to send to every frame.
|
|
349
|
+
* Never send any sensetive data through this field, such as username or user id.
|
|
350
|
+
* */
|
|
351
|
+
data: TV1WhisperData;
|
|
352
|
+
/** @deprecated
|
|
353
|
+
* Use `paymentHash` instead
|
|
354
|
+
*
|
|
355
|
+
* Payment data returned by the `payment.tokens.spend.succeeded` event.
|
|
356
|
+
* Required for users in public shows. Use it only once for the request it authorizes. Do not store or reuse it.
|
|
357
|
+
* */
|
|
358
|
+
paymentData?: TV1PaymentData;
|
|
359
|
+
/** Payment hash returned by the `payment.tokens.spend.succeeded` event.
|
|
360
|
+
* Payment hash is used for authentication. Required for users in public shows. Use it only once for the request it authorizes. Do not store or reuse it.
|
|
361
|
+
* */
|
|
362
|
+
paymentHash?: TV1PaymentHash;
|
|
363
|
+
};
|
|
364
|
+
result: null;
|
|
365
|
+
};
|
|
366
|
+
/** Sends a message to every frame of the current user */
|
|
367
|
+
'v1.ext.whisper.local': {
|
|
368
|
+
params: {
|
|
369
|
+
data: TV1WhisperData;
|
|
370
|
+
};
|
|
371
|
+
result: null;
|
|
372
|
+
};
|
|
373
|
+
};
|
|
374
|
+
|
|
375
|
+
declare type TV1ExtModel = {
|
|
376
|
+
/** Model's avatar url */
|
|
377
|
+
avatarUrlThumb: string;
|
|
378
|
+
/** @deprecated use isExclusivePrivateEnabled instead. This property will be removed soon */
|
|
379
|
+
doP2p: boolean;
|
|
380
|
+
/** @deprecated use isPrivateEnabled instead. This property will be removed soon */
|
|
381
|
+
doPrivate: boolean;
|
|
382
|
+
/** Broadcasting gender. Could be one of the male, female, tranny or group */
|
|
383
|
+
gender: TV1Genders;
|
|
384
|
+
id: TUserId;
|
|
385
|
+
/** Is exclusive private mode enabled on the stream */
|
|
386
|
+
isExclusivePrivateEnabled: boolean;
|
|
387
|
+
/** Is non nude model */
|
|
388
|
+
isNonNude: boolean;
|
|
389
|
+
/** Is private mode enabled on the stream */
|
|
390
|
+
isPrivateEnabled: boolean;
|
|
391
|
+
/** Is spy mode enabled on the stream */
|
|
392
|
+
isSpyEnabled: boolean;
|
|
393
|
+
/** Model's name from her profile. If not set, an empty string will be returned */
|
|
394
|
+
name: string;
|
|
395
|
+
/** Status of the show. Possible values:
|
|
396
|
+
*
|
|
397
|
+
* - `idle` - model is online but not streaming
|
|
398
|
+
* - `public` - model is broadcasting public show
|
|
399
|
+
* - `private` - model is in private show
|
|
400
|
+
* - `exclusivePrivate` - model is in exclusive private show
|
|
401
|
+
* - `off` - model is offline
|
|
402
|
+
* - `groupShow` - model is in group show that is not a ticket show
|
|
403
|
+
* - `ticketShow` - model is in ticket show
|
|
404
|
+
* */
|
|
405
|
+
status: TV1ModelStatus;
|
|
406
|
+
/** Model's username */
|
|
407
|
+
username: string;
|
|
408
|
+
};
|
|
409
|
+
|
|
410
|
+
declare type TV1ExtSettings = unknown;
|
|
411
|
+
|
|
412
|
+
declare type TV1ExtUser = TV1ExtGuestUser | TV1ExtLoggedInUser;
|
|
413
|
+
|
|
414
|
+
/** Viewer counts for the current room. */
|
|
415
|
+
declare type TV1ExtViewers = {
|
|
416
|
+
/** Number of guest (unauthenticated) viewers. */
|
|
417
|
+
guests: number;
|
|
418
|
+
/** Total number of viewers in the room. */
|
|
419
|
+
total: number;
|
|
420
|
+
/** Number of viewers who hold tokens. */
|
|
421
|
+
withTokens: number;
|
|
422
|
+
};
|
|
423
|
+
|
|
424
|
+
declare type TV1FanClubMethods = {
|
|
425
|
+
/**
|
|
426
|
+
* Opens the fan club subscription modal for the current model.
|
|
427
|
+
* Read `context.user.fanClub` from the extension context to verify the user is eligible before calling.
|
|
428
|
+
* This field is available only for logged-in users (`context.user.isGuest === false`).
|
|
429
|
+
* Pass `null` for params to open the modal with the `soldier` tab selected by default.
|
|
430
|
+
*/
|
|
431
|
+
'v1.fanClub.request': {
|
|
432
|
+
params: {
|
|
433
|
+
/** Which tier tab to show in the modal. */
|
|
434
|
+
tier: TV1FanClubTier;
|
|
435
|
+
} | null;
|
|
436
|
+
result: null;
|
|
437
|
+
};
|
|
438
|
+
};
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
* Fan club subscription tier. Ordered from lowest to highest:
|
|
442
|
+
* - `soldier` — first tier with basic benefits
|
|
443
|
+
* - `lord` — second tier with more benefits than `soldier`
|
|
444
|
+
* - `prince` — third tier with the most benefits
|
|
445
|
+
*/
|
|
446
|
+
declare type TV1FanClubTier = 'soldier' | 'lord' | 'prince';
|
|
447
|
+
|
|
448
|
+
declare type TV1Genders = 'male' | 'female' | 'group' | 'tranny';
|
|
449
|
+
|
|
450
|
+
/** Regular goal data */
|
|
451
|
+
declare type TV1GoalData = {
|
|
452
|
+
/** Goal description */
|
|
453
|
+
description: string;
|
|
454
|
+
/** Whether the goal is fully completed */
|
|
455
|
+
isCompleted: boolean;
|
|
456
|
+
/** Amount of tokens already collected */
|
|
457
|
+
tokensCollected: number;
|
|
458
|
+
/** Target amount in tokens */
|
|
459
|
+
tokensTarget: number;
|
|
460
|
+
};
|
|
461
|
+
|
|
462
|
+
declare type TV1GoalEvents = {
|
|
463
|
+
/** Fired when any field of the active goal changes (description, isCompleted, tokensTarget, or tokensCollected), or the active goal is removed. */
|
|
464
|
+
'v1.goal.updated': {
|
|
465
|
+
goal: TV1GoalData | null;
|
|
466
|
+
};
|
|
467
|
+
};
|
|
468
|
+
|
|
469
|
+
declare type TV1GoalMethods = {
|
|
470
|
+
/** Get the current active goal. Returns null if no goal is active. */
|
|
471
|
+
'v1.goal.get': {
|
|
472
|
+
params: null;
|
|
473
|
+
result: {
|
|
474
|
+
goal: TV1GoalData | null;
|
|
475
|
+
};
|
|
476
|
+
};
|
|
477
|
+
};
|
|
478
|
+
|
|
479
|
+
declare type TV1Methods = TV1ExtMethods & TV1SystemMethods & TV1PaymentMethods & TV1ModelMethods & TV1ChatMethods & TV1PrivateMethods & TV1MonitoringMethods & TV1SessionMethods & TV1StorageMethods & TV1TipMethods & TV1GoalMethods & TV1FanClubMethods;
|
|
480
|
+
|
|
481
|
+
declare type TV1ModelEvents = {
|
|
482
|
+
'v1.model.ext.settings.set.requested': null;
|
|
483
|
+
};
|
|
484
|
+
|
|
485
|
+
declare type TV1ModelMethods = {
|
|
486
|
+
'v1.model.ext.settings.get': {
|
|
487
|
+
params: null;
|
|
488
|
+
result: {
|
|
489
|
+
settings: TV1ExtSettings;
|
|
490
|
+
};
|
|
491
|
+
};
|
|
492
|
+
'v1.model.ext.settings.set': {
|
|
493
|
+
params: {
|
|
494
|
+
isError: boolean;
|
|
495
|
+
settings: TV1ExtSettings;
|
|
496
|
+
};
|
|
497
|
+
result: null;
|
|
498
|
+
};
|
|
499
|
+
};
|
|
500
|
+
|
|
501
|
+
declare type TV1ModelStatus = Exclude<(typeof V1_SHOW_STATUSES)[keyof typeof V1_SHOW_STATUSES], 'spy'>;
|
|
502
|
+
|
|
503
|
+
declare type TV1MonitoringMethods = {
|
|
504
|
+
'v1.monitoring.report.error': {
|
|
505
|
+
params: {
|
|
506
|
+
data: unknown;
|
|
507
|
+
message: string;
|
|
508
|
+
};
|
|
509
|
+
result: null;
|
|
510
|
+
};
|
|
511
|
+
'v1.monitoring.report.log': {
|
|
512
|
+
params: {
|
|
513
|
+
data: unknown;
|
|
514
|
+
message: string;
|
|
515
|
+
};
|
|
516
|
+
result: null;
|
|
517
|
+
};
|
|
518
|
+
};
|
|
519
|
+
|
|
520
|
+
/** Payment data returned after a successful token spend. Use it only once for the request it authorizes. Do not store or reuse it. */
|
|
521
|
+
declare type TV1PaymentData = {
|
|
522
|
+
/** The amount of tokens spent */
|
|
523
|
+
amount: string;
|
|
524
|
+
/** Payment token used for authentication */
|
|
525
|
+
paymentToken: string;
|
|
526
|
+
/** Transaction identifier */
|
|
527
|
+
transactionId: string;
|
|
528
|
+
/** User's ID */
|
|
529
|
+
userId: string;
|
|
530
|
+
};
|
|
531
|
+
|
|
532
|
+
declare type TV1PaymentEvents = {
|
|
533
|
+
/**
|
|
534
|
+
* Received when tokens are successfully spent
|
|
535
|
+
* Contains payment data returned after a successful token spend. Use it only once for the request it authorizes. Do not store or reuse it.
|
|
536
|
+
*/
|
|
537
|
+
'v1.payment.tokens.spend.succeeded': {
|
|
538
|
+
/** Was the tip anonymous. Use this field in `v1.chat.message.send` */
|
|
539
|
+
isAnonymous: boolean;
|
|
540
|
+
/** @deprecated
|
|
541
|
+
* Use `paymentHash` instead.
|
|
542
|
+
*
|
|
543
|
+
* Payment data returned after a successful token spend. Use it only once for the request it authorizes. Do not store or reuse it. */
|
|
544
|
+
paymentData: TV1PaymentData;
|
|
545
|
+
/**
|
|
546
|
+
* Payment hash used for authentication. Required for users in public shows. Use it only once for the request it authorizes. Do not store or reuse it.
|
|
547
|
+
*/
|
|
548
|
+
paymentHash: TV1PaymentHash;
|
|
549
|
+
/** Custom data passed in `payment.tokens.spend` method */
|
|
550
|
+
tokensSpendData: TV1TokenSpendData;
|
|
551
|
+
};
|
|
552
|
+
};
|
|
553
|
+
|
|
554
|
+
/** Payment hash used for authentication. Do not store or reuse it. Use it only once for the request it authorizes. */
|
|
555
|
+
declare type TV1PaymentHash = string;
|
|
556
|
+
|
|
557
|
+
declare type TV1PaymentMethods = {
|
|
558
|
+
/** Requests a confirmation modal to spend tokens */
|
|
559
|
+
'v1.payment.tokens.spend': {
|
|
560
|
+
params: {
|
|
561
|
+
/** Amount of tokens to spend */
|
|
562
|
+
tokensAmount: number;
|
|
563
|
+
/** Custom data which will be passed back in the `v1.payment.tokens.spend.succeeded` event */
|
|
564
|
+
tokensSpendData: TV1TokenSpendData;
|
|
565
|
+
};
|
|
566
|
+
result: null;
|
|
567
|
+
};
|
|
568
|
+
/** Opens the token top-up (purchase) modal directly, sending the user straight to buying tokens — without
|
|
569
|
+
* the spend-confirmation step of `v1.payment.tokens.spend`. Use it for an explicit "Buy tokens" CTA. */
|
|
570
|
+
'v1.payment.tokens.topup': {
|
|
571
|
+
params: null;
|
|
572
|
+
result: null;
|
|
573
|
+
};
|
|
574
|
+
};
|
|
575
|
+
|
|
576
|
+
declare type TV1PrivateMethods = {
|
|
577
|
+
'v1.private.request': {
|
|
578
|
+
params: null;
|
|
579
|
+
result: null;
|
|
580
|
+
};
|
|
581
|
+
};
|
|
582
|
+
|
|
583
|
+
declare type TV1SerializedError = {
|
|
584
|
+
cause?: TV1SerializedError;
|
|
585
|
+
message: string;
|
|
586
|
+
name: string;
|
|
587
|
+
stack?: string;
|
|
588
|
+
};
|
|
589
|
+
|
|
590
|
+
declare type TV1Session = TV1SessionSelf | TV1SessionOther;
|
|
591
|
+
|
|
592
|
+
declare type TV1SessionActionType = 'join' | 'finish';
|
|
593
|
+
|
|
594
|
+
declare type TV1SessionEvents = {
|
|
595
|
+
'v1.session.updated': {
|
|
596
|
+
data: TV1SessionUpdate;
|
|
597
|
+
};
|
|
598
|
+
'v1.session.whispered.model': TV1SessionWhisperData;
|
|
599
|
+
};
|
|
600
|
+
|
|
601
|
+
declare type TV1SessionMethods = {
|
|
602
|
+
'v1.session.finish.model': {
|
|
603
|
+
params: null;
|
|
604
|
+
result: null;
|
|
605
|
+
};
|
|
606
|
+
'v1.session.get': {
|
|
607
|
+
params: null;
|
|
608
|
+
result: {
|
|
609
|
+
session: TV1Session | null;
|
|
610
|
+
};
|
|
611
|
+
};
|
|
612
|
+
'v1.session.join.model': {
|
|
613
|
+
params: {
|
|
614
|
+
ttl: string;
|
|
615
|
+
};
|
|
616
|
+
result: null;
|
|
617
|
+
};
|
|
618
|
+
'v1.session.join.user': {
|
|
619
|
+
params: {
|
|
620
|
+
/** @deprecated
|
|
621
|
+
* Use `paymentHash` instead.
|
|
622
|
+
*
|
|
623
|
+
* Payment data returned by the `payment.tokens.spend.succeeded` event. Use it only once for the request it authorizes. Do not store or reuse it. */
|
|
624
|
+
payment?: TV1PaymentData;
|
|
625
|
+
/**
|
|
626
|
+
* Payment hash returned by the `payment.tokens.spend.succeeded` event.
|
|
627
|
+
* Use it only once for the request it authorizes. Do not store or reuse it.
|
|
628
|
+
*/
|
|
629
|
+
paymentHash: TV1PaymentHash;
|
|
630
|
+
/** Session lifetime in seconds (minimum 1). */
|
|
631
|
+
ttl: string;
|
|
632
|
+
};
|
|
633
|
+
result: null;
|
|
634
|
+
};
|
|
635
|
+
'v1.session.whisper.user': {
|
|
636
|
+
params: {
|
|
637
|
+
data: TV1SessionWhisperData;
|
|
638
|
+
};
|
|
639
|
+
result: null;
|
|
640
|
+
};
|
|
641
|
+
};
|
|
642
|
+
|
|
643
|
+
declare type TV1SessionOther = {
|
|
644
|
+
/** The session exists but belongs to a different extension */
|
|
645
|
+
owner: 'other';
|
|
646
|
+
};
|
|
647
|
+
|
|
648
|
+
declare type TV1SessionSelf = {
|
|
649
|
+
meta: {
|
|
650
|
+
/** Platform session id */
|
|
651
|
+
sessionId: string;
|
|
652
|
+
/** Remaining lifetime in seconds */
|
|
653
|
+
ttlSec: number;
|
|
654
|
+
};
|
|
655
|
+
/** The session exists and belongs to this extension */
|
|
656
|
+
owner: 'self';
|
|
657
|
+
};
|
|
658
|
+
|
|
659
|
+
declare type TV1SessionUpdate = {
|
|
660
|
+
action: TV1SessionActionType;
|
|
661
|
+
session: TV1Session | null;
|
|
662
|
+
userId: TUserId;
|
|
663
|
+
};
|
|
664
|
+
|
|
665
|
+
declare type TV1SessionWhisperData = TUnknownDictionary;
|
|
666
|
+
|
|
667
|
+
declare type TV1StorageMethods = {
|
|
668
|
+
'v1.storage.int.get': {
|
|
669
|
+
params: {
|
|
670
|
+
key: string;
|
|
671
|
+
};
|
|
672
|
+
result: {
|
|
673
|
+
/** `false` when the key has never been set (value will be 0). */
|
|
674
|
+
exists?: boolean;
|
|
675
|
+
/** @format int64 */
|
|
676
|
+
value: string;
|
|
677
|
+
};
|
|
678
|
+
};
|
|
679
|
+
/**
|
|
680
|
+
* Add `delta` to an integer counter. Negative delta subtracts.
|
|
681
|
+
* When the key is configured with a payment policy, pass `paymentContext`
|
|
682
|
+
* so the server can validate the transaction before applying the change.
|
|
683
|
+
*/
|
|
684
|
+
'v1.storage.int.increment': {
|
|
685
|
+
params: {
|
|
686
|
+
/** Amount to add (may be negative). Must not be zero. */
|
|
687
|
+
delta: string;
|
|
688
|
+
key: string;
|
|
689
|
+
/** Opaque payload forwarded to server-side payment/policy validation. */
|
|
690
|
+
paymentContext?: string;
|
|
691
|
+
};
|
|
692
|
+
result: {
|
|
693
|
+
failureReason?: IV1IntIncrementFailureReason;
|
|
694
|
+
/** New counter value after the increment (present when `success` is true). */
|
|
695
|
+
success: boolean;
|
|
696
|
+
value?: string;
|
|
697
|
+
};
|
|
698
|
+
};
|
|
699
|
+
/** Reset an integer counter to 0. */
|
|
700
|
+
'v1.storage.int.reset': {
|
|
701
|
+
params: {
|
|
702
|
+
key: string;
|
|
703
|
+
};
|
|
704
|
+
result: {
|
|
705
|
+
success: boolean;
|
|
706
|
+
/** Stored value after reset; always 0 when `success` is true. */
|
|
707
|
+
value?: string;
|
|
708
|
+
};
|
|
709
|
+
};
|
|
710
|
+
'v1.storage.mutex.getState': {
|
|
711
|
+
params: {
|
|
712
|
+
mutexName: string;
|
|
713
|
+
};
|
|
714
|
+
result: {
|
|
715
|
+
/** `true` if the mutex is currently locked. */
|
|
716
|
+
held: boolean;
|
|
717
|
+
};
|
|
718
|
+
};
|
|
719
|
+
'v1.storage.mutex.lock': {
|
|
720
|
+
params: {
|
|
721
|
+
mutexName: string;
|
|
722
|
+
/** Auto-release after this many seconds. Omit or 0 = hold until explicit unlock. */
|
|
723
|
+
/** @format int64 */
|
|
724
|
+
ttl?: string;
|
|
725
|
+
};
|
|
726
|
+
result: {
|
|
727
|
+
success: boolean;
|
|
728
|
+
};
|
|
729
|
+
};
|
|
730
|
+
'v1.storage.mutex.unlock': {
|
|
731
|
+
params: {
|
|
732
|
+
mutexName: string;
|
|
733
|
+
};
|
|
734
|
+
result: {
|
|
735
|
+
success: boolean;
|
|
736
|
+
};
|
|
737
|
+
};
|
|
738
|
+
'v1.storage.string.append': {
|
|
739
|
+
params: {
|
|
740
|
+
key: string;
|
|
741
|
+
/** Auto-delete the key after this many seconds. Omit or 0 = no expiry. */
|
|
742
|
+
/** @format int64 */
|
|
743
|
+
ttl?: string;
|
|
744
|
+
value: string;
|
|
745
|
+
};
|
|
746
|
+
result: {
|
|
747
|
+
success: boolean;
|
|
748
|
+
};
|
|
749
|
+
};
|
|
750
|
+
'v1.storage.string.get': {
|
|
751
|
+
params: {
|
|
752
|
+
/**
|
|
753
|
+
* When `true`, read the single extension-wide value shared across every room and viewer
|
|
754
|
+
* instead of the value scoped to the current room and viewer. Use for shared data seeded
|
|
755
|
+
* on the server. Defaults to `false` (per-room read).
|
|
756
|
+
*/
|
|
757
|
+
all?: boolean;
|
|
758
|
+
key: string;
|
|
759
|
+
};
|
|
760
|
+
result: {
|
|
761
|
+
/** `false` when the key has never been set (value will be `''` empty string). */
|
|
762
|
+
exists: boolean;
|
|
763
|
+
/**
|
|
764
|
+
* Server time (UTC, RFC3339) at which the response was generated. Use this instead of the device
|
|
765
|
+
* clock for time-window logic — a skewed local clock won't desync the extension. Optional so a host
|
|
766
|
+
* that doesn't yet surface it still validates (newer hosts always include it).
|
|
767
|
+
*/
|
|
768
|
+
time?: string;
|
|
769
|
+
/** Stored string value. Empty string if the key was never set. */
|
|
770
|
+
value: string;
|
|
771
|
+
};
|
|
772
|
+
};
|
|
773
|
+
'v1.storage.string.set': {
|
|
774
|
+
params: {
|
|
775
|
+
key: string;
|
|
776
|
+
/** Auto-delete the key after this many seconds. Omit or 0 = no expiry. */
|
|
777
|
+
/** @format int64 */
|
|
778
|
+
ttl?: string;
|
|
779
|
+
value: string;
|
|
780
|
+
};
|
|
781
|
+
result: {
|
|
782
|
+
success: boolean;
|
|
783
|
+
};
|
|
784
|
+
};
|
|
785
|
+
/**
|
|
786
|
+
* Read a top counter: total sum in the window, last incrementer,
|
|
787
|
+
* top-N users by total, and per-day breakdown.
|
|
788
|
+
*/
|
|
789
|
+
'v1.storage.top.get': {
|
|
790
|
+
params: {
|
|
791
|
+
key: string;
|
|
792
|
+
/** Sliding time horizon for summing increments. */
|
|
793
|
+
top: TV1TopWindow;
|
|
794
|
+
/** How many users to return in `topUsers`. 0 = default 10; max 100. */
|
|
795
|
+
topN?: number;
|
|
796
|
+
};
|
|
797
|
+
result: {
|
|
798
|
+
topUsers?: TV1TopUserEntry[];
|
|
799
|
+
};
|
|
800
|
+
};
|
|
801
|
+
/** Append an increment to a top counter for the current model session. */
|
|
802
|
+
'v1.storage.top.increment': {
|
|
803
|
+
params: {
|
|
804
|
+
/**
|
|
805
|
+
* Positive amount to add.
|
|
806
|
+
* @format int64
|
|
807
|
+
*/
|
|
808
|
+
amount: string;
|
|
809
|
+
key: string;
|
|
810
|
+
/** An optional string saved for this increment from that user's latest event. */
|
|
811
|
+
meta?: string;
|
|
812
|
+
/**
|
|
813
|
+
* User id credited for this increment (appears in `top/get` top_users).
|
|
814
|
+
* @format int64
|
|
815
|
+
*/
|
|
816
|
+
userId: string;
|
|
817
|
+
};
|
|
818
|
+
result: {
|
|
819
|
+
/** An optional string saved for this increment from that user's latest event. */
|
|
820
|
+
meta?: string;
|
|
821
|
+
success: boolean;
|
|
822
|
+
/** Echo of request `userId`; `windowStats` apply to this user. */
|
|
823
|
+
/** @format int64 */
|
|
824
|
+
userId?: string;
|
|
825
|
+
/** One entry per standard horizon (1d, 7d, 30d) with that user's total in each window after the increment. */
|
|
826
|
+
windowStats?: TV1TopIncrementWindowStat[];
|
|
827
|
+
};
|
|
828
|
+
};
|
|
829
|
+
/** Clear all increments for a top counter key. */
|
|
830
|
+
'v1.storage.top.reset': {
|
|
831
|
+
params: {
|
|
832
|
+
key: string;
|
|
833
|
+
};
|
|
834
|
+
result: {
|
|
835
|
+
success: boolean;
|
|
836
|
+
};
|
|
837
|
+
};
|
|
838
|
+
};
|
|
839
|
+
|
|
840
|
+
declare type TV1SystemMethods = {
|
|
841
|
+
'v1.system.report.crash': {
|
|
842
|
+
params: {
|
|
843
|
+
data?: Record<string, unknown>;
|
|
844
|
+
error?: TV1SerializedError;
|
|
845
|
+
kind: string;
|
|
846
|
+
type: 'network' | 'runtime';
|
|
847
|
+
};
|
|
848
|
+
result: null;
|
|
849
|
+
};
|
|
850
|
+
'v1.system.resize.notify': {
|
|
851
|
+
params: {
|
|
852
|
+
height: number;
|
|
853
|
+
width: number;
|
|
854
|
+
};
|
|
855
|
+
result: null;
|
|
856
|
+
};
|
|
857
|
+
};
|
|
858
|
+
|
|
859
|
+
/** Tokens spend tip data */
|
|
860
|
+
declare type TV1TipData = {
|
|
861
|
+
/** Amount of tokens spent */
|
|
862
|
+
amount: number;
|
|
863
|
+
/** Tip id */
|
|
864
|
+
id: string;
|
|
865
|
+
/** Is anonymous tip or not */
|
|
866
|
+
isAnonymous: boolean;
|
|
867
|
+
/** Is tip sent from the current user or not */
|
|
868
|
+
isFromTheCurrentUser: boolean;
|
|
869
|
+
/** Is tip sent from the current extension or not */
|
|
870
|
+
isOriginalSource: boolean;
|
|
871
|
+
/** Message that was sent with the tip. Empty string if no message was sent */
|
|
872
|
+
message?: string;
|
|
873
|
+
/** Source of the tip. Could be one of the following:
|
|
874
|
+
*
|
|
875
|
+
* `console` - tip was sent using / command
|
|
876
|
+
* `tipMenu` - tip was sent using tip menu
|
|
877
|
+
* `goal` - tip was sent via goal button
|
|
878
|
+
* `epicGoal` - tip was sent to epic goal
|
|
879
|
+
* `fullscreen` - tip was sent from the fullscreen view
|
|
880
|
+
* `interactiveToy` - tip was sent from the interactive toy
|
|
881
|
+
* `privateChat` - tip was sent from the private chat, in any type of show
|
|
882
|
+
* `publicChat` - tip was sent using publich chat, either in public or group show.
|
|
883
|
+
* `extension` - tip was sent from one of the extensions
|
|
884
|
+
* `sendTipButton` - tip was sent using send tip button
|
|
885
|
+
* `feed` - tip was sent from the feed
|
|
886
|
+
* */
|
|
887
|
+
source: TV1TipSource;
|
|
888
|
+
/** Message visibility: `public` — visible to everyone in the room; `private` — visible only to the model. */
|
|
889
|
+
type: 'private' | 'public';
|
|
890
|
+
/** User who sent the tip. Can be null in case of anonymous tip */
|
|
891
|
+
user?: TV1ExtUser | null;
|
|
892
|
+
};
|
|
893
|
+
|
|
894
|
+
declare type TV1TipEvents = {
|
|
895
|
+
/** Fired when the tip menu has been updated.*/
|
|
896
|
+
'v1.tipMenu.updated': {
|
|
897
|
+
/** The current tip menu data. */
|
|
898
|
+
tipMenu: TV1TipMenu;
|
|
899
|
+
};
|
|
900
|
+
/** Fired on every tip in chat for both model and user. Doesn't fire on private tips during public shows */
|
|
901
|
+
'v1.tokens.spent': {
|
|
902
|
+
tipData: TV1TipData;
|
|
903
|
+
};
|
|
904
|
+
};
|
|
905
|
+
|
|
906
|
+
/** Tip menu data */
|
|
907
|
+
declare type TV1TipMenu = {
|
|
908
|
+
/** Whether tip menu is enabled or not. If it's disabled, the `items` array will be empty. */
|
|
909
|
+
isEnabled: boolean;
|
|
910
|
+
/** The list of tip menu items sorted by the model. */
|
|
911
|
+
items: TV1TipMenuItem[];
|
|
912
|
+
};
|
|
913
|
+
|
|
914
|
+
/** Tip menu item defined by the model. */
|
|
915
|
+
declare type TV1TipMenuItem = {
|
|
916
|
+
/** Activity name */
|
|
917
|
+
activity: string;
|
|
918
|
+
/** Price of the activity for the current user applying all discounts.
|
|
919
|
+
* Discounts can be applied based on the user's fan club memberhip.
|
|
920
|
+
* */
|
|
921
|
+
price: number;
|
|
922
|
+
};
|
|
923
|
+
|
|
924
|
+
declare type TV1TipMethods = {
|
|
925
|
+
/** Get the current tip menu. Tip menu data might change during the broadcast, so subscribe to `v1.tipMenu.updated` to listen to these changes. */
|
|
926
|
+
'v1.tipMenu.get': {
|
|
927
|
+
params: null;
|
|
928
|
+
result: {
|
|
929
|
+
/** The current tip menu data. */
|
|
930
|
+
tipMenu: TV1TipMenu;
|
|
931
|
+
};
|
|
932
|
+
};
|
|
933
|
+
};
|
|
934
|
+
|
|
935
|
+
/** Source of the tip. Could be one of the following:
|
|
936
|
+
*
|
|
937
|
+
* `console` - tip was sent using / command
|
|
938
|
+
* `tipMenu` - tip was sent using tip menu
|
|
939
|
+
* `goal` - tip was sent via goal button
|
|
940
|
+
* `epicGoal` - tip was sent to epic goal
|
|
941
|
+
* `fullscreen` - tip was sent from the fullscreen view
|
|
942
|
+
* `interactiveToy` - tip was sent from the interactive toy
|
|
943
|
+
* `privateChat` - tip was sent from the private chat, in any type of show
|
|
944
|
+
* `publicChat` - tip was sent using publich chat, either in public or group show.
|
|
945
|
+
* `extension` - tip was sent from one of the extensions
|
|
946
|
+
* `sendTipButton` - tip was sent using send tip button
|
|
947
|
+
* `feed` - tip was sent from the feed
|
|
948
|
+
*/
|
|
949
|
+
declare type TV1TipSource = 'console' | 'tipMenu' | 'goal' | 'epicGoal' | 'fullscreen' | 'interactiveToy' | 'publicChat' | 'privateChat' | 'extension' | 'sendTipButton' | 'feed';
|
|
950
|
+
|
|
951
|
+
/** Custom data that you can pass when requesting token spend. You will receive it on successful payment */
|
|
952
|
+
declare type TV1TokenSpendData = TUnknownDictionary;
|
|
953
|
+
|
|
954
|
+
/**
|
|
955
|
+
* Per-window statistics for a user after a top counter increment.
|
|
956
|
+
* One entry per standard horizon (1d, 7d, 30d).
|
|
957
|
+
*/
|
|
958
|
+
declare type TV1TopIncrementWindowStat = {
|
|
959
|
+
/** User's summed total within this window after the increment. */
|
|
960
|
+
value: string;
|
|
961
|
+
/** Sliding time horizon (1d, 7d, or 30d). */
|
|
962
|
+
window: TV1TopWindow;
|
|
963
|
+
};
|
|
964
|
+
|
|
965
|
+
declare type TV1TopUserEntry = {
|
|
966
|
+
/** An optional string saved for this increment from that user's latest event */
|
|
967
|
+
meta?: string;
|
|
968
|
+
/** Sum of increment amounts within the sliding window for this user. */
|
|
969
|
+
total: string;
|
|
970
|
+
/** User ID recorded as incrementer. */
|
|
971
|
+
userId: string;
|
|
972
|
+
};
|
|
973
|
+
|
|
974
|
+
declare type TV1TopWindow = 'TOP_1D' | 'TOP_7D' | 'TOP_30D' | 'TOP_UNSPECIFIED';
|
|
975
|
+
|
|
976
|
+
/**
|
|
977
|
+
* User activity league. Ordered from lowest to highest activity rank:
|
|
978
|
+
* - `grey` — new or low-activity users (level 1–9)
|
|
979
|
+
* - `bronze` — early active users (level 10–19)
|
|
980
|
+
* - `silver` — regularly active users (level 20–34)
|
|
981
|
+
* - `gold` — highly active users (level 35–54)
|
|
982
|
+
* - `diamond` — very highly active users (level 55–79)
|
|
983
|
+
* - `royal` — elite activity users (level 80–99)
|
|
984
|
+
* - `legend` — top activity users (level 100)
|
|
985
|
+
*/
|
|
986
|
+
declare type TV1UserLeague = 'grey' | 'bronze' | 'silver' | 'gold' | 'diamond' | 'royal' | 'legend';
|
|
987
|
+
|
|
988
|
+
/** User activity ranking system */
|
|
989
|
+
declare type TV1UserRanking = {
|
|
990
|
+
/** League representation of the user's activity level. Could be `grey`, `bronze`, `silver`, `gold`, `diamond`, `royal` or `legend`. */
|
|
991
|
+
league: TV1UserLeague;
|
|
992
|
+
/** Activity level from 1 to 100. */
|
|
993
|
+
level: number;
|
|
994
|
+
};
|
|
995
|
+
|
|
996
|
+
declare type TV1UsersFanClub = TV1UsersFanClubSubscribed | TV1UsersFanClubNotSubscribed;
|
|
997
|
+
|
|
998
|
+
declare type TV1UsersFanClubNotSubscribed = {
|
|
999
|
+
/** Whether user is subscribed to the model's fan club or not */
|
|
1000
|
+
isSubscribed: false;
|
|
1001
|
+
};
|
|
1002
|
+
|
|
1003
|
+
declare type TV1UsersFanClubSubscribed = {
|
|
1004
|
+
/** Whether user is subscribed to the model's fan club or not */
|
|
1005
|
+
isSubscribed: true;
|
|
1006
|
+
/** The tier of the fan club subscription. Could be `soldier`, `lord` or `prince`. Higher tiers provide more benefits. */
|
|
1007
|
+
tier: TV1FanClubTier;
|
|
1008
|
+
};
|
|
1009
|
+
|
|
1010
|
+
declare type TV1UserStatus = Exclude<(typeof V1_SHOW_STATUSES)[keyof typeof V1_SHOW_STATUSES], 'idle'>;
|
|
1011
|
+
|
|
1012
|
+
declare type TV1WhisperData = TUnknownDictionary;
|
|
1013
|
+
|
|
1014
|
+
declare const V1_SHOW_STATUSES: {
|
|
1015
|
+
readonly STATUS_TICKET_SHOW: "ticketShow";
|
|
1016
|
+
readonly STATUS_GROUP_SHOW: "groupShow";
|
|
1017
|
+
readonly STATUS_OFF: "off";
|
|
1018
|
+
readonly STATUS_PRIVATE: "private";
|
|
1019
|
+
readonly STATUS_EXCLUSIVE_PRIVATE: "exclusivePrivate";
|
|
1020
|
+
readonly STATUS_PUBLIC: "public";
|
|
1021
|
+
readonly STATUS_IDLE: "idle";
|
|
1022
|
+
readonly STATUS_SPY: "spy";
|
|
1023
|
+
};
|
|
1024
|
+
|
|
1025
|
+
export { }
|