@streamlayer/react 1.21.3 → 1.22.1
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/lib/app/masters.d.ts +2 -5
- package/lib/app/pause-ad.d.ts +1 -10
- package/lib/app/useStreamLayerApp.d.ts +1 -23
- package/lib/cjs/Question.js +1 -0
- package/lib/cjs/advertisement.js +40 -40
- package/lib/cjs/analytics.js +1 -0
- package/lib/cjs/auth.js +1 -1
- package/lib/cjs/bet-pack.js +1 -1
- package/lib/cjs/gamification-feature.js +1 -1
- package/lib/cjs/hooks-B0Qttldg.js +1 -0
- package/lib/cjs/index-DSi8Qgfs.js +1 -0
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/index10.js +1 -0
- package/lib/cjs/index11.js +4 -0
- package/lib/cjs/index12.js +1 -0
- package/lib/cjs/index13.js +1 -0
- package/lib/cjs/index14.js +1 -0
- package/lib/cjs/index15.js +1 -0
- package/lib/cjs/index16.js +5 -0
- package/lib/cjs/index2.js +1 -5
- package/lib/cjs/index3.js +1 -0
- package/lib/cjs/index4.js +5 -0
- package/lib/cjs/index5.js +1 -0
- package/lib/cjs/index6.js +1 -0
- package/lib/cjs/index7.js +5 -0
- package/lib/cjs/index8.js +1 -0
- package/lib/cjs/index9.js +1 -0
- package/lib/cjs/insight.js +1 -1
- package/lib/cjs/masters.js +1 -1
- package/lib/cjs/masters2.js +6 -6
- package/lib/cjs/notification.js +1 -1
- package/lib/cjs/pause-ad.js +1 -1
- package/lib/cjs/points.js +1 -1
- package/lib/cjs/sl-types.js +15 -0
- package/lib/cjs/storage.js +1 -0
- package/lib/cjs/theme.js +17 -0
- package/lib/cjs/useStreamLayerApp.js +1 -1
- package/lib/cjs/useStreamLayerApp2.js +17 -16
- package/lib/cjs/utils.js +47 -0
- package/lib/cjs/vast-client.min.js +1 -0
- package/lib/classic/app/masters.d.ts +2 -5
- package/lib/classic/app/pause-ad.d.ts +1 -10
- package/lib/classic/app/useStreamLayerApp.d.ts +1 -23
- package/lib/classic/cjs/Question.js +1 -0
- package/lib/classic/cjs/advertisement.js +40 -40
- package/lib/classic/cjs/analytics.js +1 -0
- package/lib/classic/cjs/auth.js +1 -1
- package/lib/classic/cjs/bet-pack.js +4 -4
- package/lib/classic/cjs/gamification-feature.js +1 -1
- package/lib/classic/cjs/hooks-B0Qttldg.js +1 -0
- package/lib/classic/cjs/index-DSi8Qgfs.js +1 -0
- package/lib/classic/cjs/index.js +1 -1
- package/lib/classic/cjs/index10.js +1 -0
- package/lib/classic/cjs/index11.js +1 -0
- package/lib/classic/cjs/index12.js +1 -0
- package/lib/classic/cjs/index13.js +4 -0
- package/lib/classic/cjs/index2.js +5 -0
- package/lib/classic/cjs/index3.js +1 -0
- package/lib/classic/cjs/index4.js +1 -0
- package/lib/classic/cjs/index5.js +1 -0
- package/lib/classic/cjs/index6.js +5 -0
- package/lib/classic/cjs/index7.js +1 -0
- package/lib/classic/cjs/index8.js +1 -0
- package/lib/classic/cjs/index9.js +1 -0
- package/lib/classic/cjs/insight.js +1 -1
- package/lib/classic/cjs/notification.js +1 -1
- package/lib/classic/cjs/notification2.js +1 -0
- package/lib/classic/cjs/pause-ad.js +1 -1
- package/lib/classic/cjs/points.js +1 -1
- package/lib/classic/cjs/sl-types.js +15 -0
- package/lib/classic/cjs/useStreamLayerApp.js +1 -1
- package/lib/classic/cjs/useStreamLayerApp2.js +17 -16
- package/lib/classic/cjs/utils.js +47 -0
- package/lib/classic/cjs/vast-client.min.js +1 -0
- package/lib/classic/es/Question.js +392 -0
- package/lib/classic/es/advertisement.js +10375 -10374
- package/lib/classic/es/analytics.js +28 -0
- package/lib/classic/es/auth.js +4 -4
- package/lib/classic/es/bet-pack.js +55 -51
- package/lib/classic/es/gamification-feature.js +1 -1
- package/lib/classic/es/hooks-B0Qttldg.js +98 -0
- package/lib/classic/es/index-DSi8Qgfs.js +65 -0
- package/lib/classic/es/index.js +14 -15
- package/lib/classic/es/index10.js +87 -0
- package/lib/classic/es/index11.js +2355 -0
- package/lib/classic/es/index12.js +183 -0
- package/lib/classic/es/index13.js +835 -0
- package/lib/classic/es/index2.js +2621 -0
- package/lib/classic/es/index3.js +64 -0
- package/lib/classic/es/index4.js +19 -0
- package/lib/classic/es/index5.js +285 -0
- package/lib/classic/es/{index-l-eyvmpL.js → index6.js} +937 -937
- package/lib/classic/es/index7.js +7 -0
- package/lib/classic/es/index8.js +11 -0
- package/lib/classic/es/index9.js +319 -0
- package/lib/classic/es/insight.js +31 -32
- package/lib/classic/es/notification.js +7 -1006
- package/lib/classic/es/notification2.js +1117 -0
- package/lib/classic/es/pause-ad.js +139 -138
- package/lib/classic/es/points.js +39 -38
- package/lib/classic/es/sl-types.js +258 -0
- package/lib/classic/es/useStreamLayerApp.js +1 -2
- package/lib/classic/es/useStreamLayerApp2.js +4798 -2735
- package/lib/classic/es/utils.js +76 -0
- package/lib/{es/vast-client.min-B0NUra1B.js → classic/es/vast-client.min.js} +338 -338
- package/lib/classic/index.d.ts +5 -13
- package/lib/classic/masters.d.ts +1 -1
- package/lib/dist/cjs/index.js +1 -1
- package/lib/dist/cjs/masters.js +34 -33
- package/lib/dist/es/index.js +2 -2
- package/lib/dist/es/masters.js +10563 -8870
- package/lib/dist/index.d.ts +1332 -0
- package/lib/dist/style.css +1 -1
- package/lib/es/Question.js +136 -0
- package/lib/es/advertisement.js +10375 -10374
- package/lib/es/analytics.js +28 -0
- package/lib/es/auth.js +4 -4
- package/lib/es/bet-pack.js +7 -6
- package/lib/es/gamification-feature.js +1 -1
- package/lib/es/hooks-B0Qttldg.js +98 -0
- package/lib/es/index-DSi8Qgfs.js +65 -0
- package/lib/es/index.js +13 -14
- package/lib/es/index10.js +267 -0
- package/lib/es/index11.js +835 -0
- package/lib/es/index12.js +183 -0
- package/lib/es/index13.js +319 -0
- package/lib/es/index14.js +87 -0
- package/lib/es/index15.js +2355 -0
- package/lib/es/index16.js +1254 -0
- package/lib/es/index2.js +1349 -3364
- package/lib/es/index3.js +64 -0
- package/lib/es/index4.js +3418 -0
- package/lib/es/index5.js +19 -0
- package/lib/es/index6.js +285 -0
- package/lib/es/{index-l-eyvmpL.js → index7.js} +937 -937
- package/lib/es/index8.js +7 -0
- package/lib/es/index9.js +11 -0
- package/lib/es/insight.js +31 -32
- package/lib/es/masters.js +6 -5
- package/lib/es/masters2.js +189 -176
- package/lib/es/notification.js +141 -136
- package/lib/es/pause-ad.js +140 -139
- package/lib/es/points.js +40 -38
- package/lib/es/sl-types.js +277 -0
- package/lib/es/storage.js +113 -0
- package/lib/es/theme.js +47 -0
- package/lib/es/useStreamLayerApp.js +1 -2
- package/lib/es/useStreamLayerApp2.js +4798 -2735
- package/lib/es/utils.js +76 -0
- package/lib/{classic/es/vast-client.min-B0NUra1B.js → es/vast-client.min.js} +338 -338
- package/lib/index.d.ts +5 -13
- package/lib/masters.d.ts +1 -1
- package/lib/style.css +1 -1
- package/package.json +16 -51
- package/lib/app/event.d.ts +0 -6
- package/lib/app/provider.d.ts +0 -49
- package/lib/cjs/index-l-eyvmpL.js +0 -5
- package/lib/cjs/provider.js +0 -84
- package/lib/cjs/vast-client.min-B0NUra1B.js +0 -1
- package/lib/classic/app/event.d.ts +0 -6
- package/lib/classic/app/provider.d.ts +0 -49
- package/lib/classic/cjs/index-l-eyvmpL.js +0 -5
- package/lib/classic/cjs/provider.js +0 -68
- package/lib/classic/cjs/vast-client.min-B0NUra1B.js +0 -1
- package/lib/classic/es/provider.js +0 -7619
- package/lib/dist/cjs/gamification-feature2.js +0 -1
- package/lib/dist/es/gamification-feature2.js +0 -285
- package/lib/es/provider.js +0 -7695
|
@@ -0,0 +1,1332 @@
|
|
|
1
|
+
declare module "../../sdk-web-storage/src/isQuotaExceededError" {
|
|
2
|
+
export function isQuotaExceededError(err: unknown): boolean;
|
|
3
|
+
}
|
|
4
|
+
declare module "../../sdk-web-storage/src/index" {
|
|
5
|
+
import { isQuotaExceededError } from "../../sdk-web-storage/src/isQuotaExceededError";
|
|
6
|
+
export { isQuotaExceededError };
|
|
7
|
+
export type ArrayWithMinTwoItems = [string, string, ...string[]];
|
|
8
|
+
export class Storage {
|
|
9
|
+
private delimiter;
|
|
10
|
+
private prefix;
|
|
11
|
+
private storage;
|
|
12
|
+
constructor(prefix?: string, storage?: globalThis.Storage);
|
|
13
|
+
clear: () => void;
|
|
14
|
+
protected generateKey: (keyParts: string[]) => string;
|
|
15
|
+
protected write: (keyParts_0: string, keyParts_1: string, ...keyParts: string[]) => void;
|
|
16
|
+
protected read: (...keyParts: string[]) => string | undefined;
|
|
17
|
+
protected remove: (...keyParts: string[]) => void;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
declare module "../../sdk-web-core/src/storage" {
|
|
21
|
+
import { Storage } from '@streamlayer/sdk-web-storage';
|
|
22
|
+
export class UserStorage extends Storage {
|
|
23
|
+
constructor();
|
|
24
|
+
setSchema: (value: string) => void;
|
|
25
|
+
getSchema: () => string | undefined;
|
|
26
|
+
setToken: (value: string) => void;
|
|
27
|
+
getToken: () => string | undefined;
|
|
28
|
+
setExternalToken: (value: string) => void;
|
|
29
|
+
getExternalToken: () => string | undefined;
|
|
30
|
+
removeToken: () => void;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
declare module "../../sdk-web-types/src/sl-types" {
|
|
34
|
+
import type { StreamSettings as SLStreamSettings, SdkOverlay, Advertising, OrganizationSettings as SLOrganizationSettings } from '@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb';
|
|
35
|
+
import type { GameSettings as IGameSettings } from '@streamlayer/sl-eslib/sdkSettings/game/common/game_common_pb';
|
|
36
|
+
import type { ClientSettings } from '@streamlayer/sl-eslib/sdkSettings/client/client_pb';
|
|
37
|
+
import type { User as ProtoUser } from '@streamlayer/sl-eslib/users/users_common_pb';
|
|
38
|
+
import type { SummaryResponse_ResponseData_SummaryResponseAttributes } from '@streamlayer/sl-eslib/sports/events/events_pb';
|
|
39
|
+
import type { PickHistory as IPickHistory, InsightHistory as IInsightHistory, TweetHistory as ITweetHistory, FeedItem as IFeedItem, FeedItemAttributes as IFeedItemAttributes, InstantView as IInstantView, PromotionHistory as IPromotionHistory } from '@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb';
|
|
40
|
+
import type { LeaderboardItem as ILeaderboardItem } from '@streamlayer/sl-eslib/interactive/leaderboard/interactive.leaderboard_pb';
|
|
41
|
+
import { type ExtendedQuestionAnswer as IExtendedQuestionAnswer, type Question as IQuestion, type ExtendedQuestion as IExtendedQuestion, type QuestionOptions_PromotionOptions, type QuestionOptions_AdCampaigns, type QuestionNotification as IQuestionNotification, type PromotionNotification as IPromotionNotification, type CloseTimer as ICloseTimer, type Promotion as IPromotion, QuestionOptions_GamOptions } from '@streamlayer/sl-eslib/interactive/interactive.common_pb';
|
|
42
|
+
export type UnionOmit<T, K extends string | number | symbol> = T extends unknown ? Omit<T, K> : never;
|
|
43
|
+
export type NullUnionOmit<T, K extends string | number | symbol> = null extends T ? UnionOmit<NonNullable<T>, K> : UnionOmit<T, K>;
|
|
44
|
+
export type RecursiveOmitHelper<T, K extends string | number | symbol> = {
|
|
45
|
+
[P in keyof T]: RecursiveOmit<T[P], K>;
|
|
46
|
+
};
|
|
47
|
+
export type RecursiveOmit<T, K extends string | number | symbol> = T extends {
|
|
48
|
+
[P in K]: any;
|
|
49
|
+
} ? NullUnionOmit<RecursiveOmitHelper<T, K>, K> : RecursiveOmitHelper<T, K>;
|
|
50
|
+
export type RecursivePartial<T> = T extends object ? {
|
|
51
|
+
[P in keyof T]?: RecursivePartial<T[P]> | null;
|
|
52
|
+
} : T;
|
|
53
|
+
export type PlainMessage<T> = RecursiveOmit<T, '$typeName'>;
|
|
54
|
+
export type PartialMessage<T> = RecursivePartial<RecursiveOmit<T, '$typeName'>>;
|
|
55
|
+
export { QuestionType, QuestionStatus, QuestionImages, QuestionPosition, NotificationPromotionImagePosition, ImagePosition, SilenceSetting, type QuestionOptions, PromotionType, PromotionButtonType, PromotionWallet, PromotionLogoMode, CtaIconMode, NotificationSponsorLogoMode, NotificationEnabled, NotificationUseContentMedia, NotificationUseContentTexts, CloseTimerAuto, NotificationPromotionMode, AutoPlayVideo, PlayVideoMuted, UseAsNotification, AdUnit, } from '@streamlayer/sl-eslib/interactive/interactive.common_pb';
|
|
56
|
+
export { PickHistoryStatus, type SubscriptionResponse, } from '@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb';
|
|
57
|
+
export type PickHistory = PlainMessage<IPickHistory>;
|
|
58
|
+
export type ExtendedQuestionAnswer = PlainMessage<IExtendedQuestionAnswer>;
|
|
59
|
+
export type InsightHistory = PlainMessage<IInsightHistory>;
|
|
60
|
+
export type TweetHistory = PlainMessage<ITweetHistory>;
|
|
61
|
+
export type OrganizationSettings = SLOrganizationSettings;
|
|
62
|
+
export type OrganizationAdvertising = Advertising;
|
|
63
|
+
export type FeatureConfig = PlainMessage<SdkOverlay>;
|
|
64
|
+
export type StreamSettings = SLStreamSettings;
|
|
65
|
+
export type User = {
|
|
66
|
+
data: ProtoUser | undefined;
|
|
67
|
+
};
|
|
68
|
+
export type UserSettings = ClientSettings;
|
|
69
|
+
export type LeaderboardItem = ILeaderboardItem;
|
|
70
|
+
export type FeedItem = PlainMessage<IFeedItem>;
|
|
71
|
+
export type FeedItemAttributes = PlainMessage<IFeedItemAttributes>;
|
|
72
|
+
export type InstantView = PlainMessage<IInstantView>;
|
|
73
|
+
export type GameSettings = PlainMessage<IGameSettings>;
|
|
74
|
+
export type Question = PlainMessage<IQuestion>;
|
|
75
|
+
export type ExtendedQuestion = PlainMessage<IExtendedQuestion>;
|
|
76
|
+
export type CloseTimer = PlainMessage<ICloseTimer>;
|
|
77
|
+
export type PromotionHistory = PlainMessage<IPromotionHistory>;
|
|
78
|
+
export type PromotionOptions = QuestionOptions_PromotionOptions;
|
|
79
|
+
export type Promotion = PlainMessage<IPromotion>;
|
|
80
|
+
export type QuestionNotification = PlainMessage<IQuestionNotification>;
|
|
81
|
+
export type PromotionNotification = PlainMessage<IPromotionNotification>;
|
|
82
|
+
export type EventSummary = PlainMessage<SummaryResponse_ResponseData_SummaryResponseAttributes>;
|
|
83
|
+
export type GamOptions = PlainMessage<QuestionOptions_GamOptions>;
|
|
84
|
+
export type AdCampaigns = PlainMessage<QuestionOptions_AdCampaigns>;
|
|
85
|
+
export { SdkOverlayType as FeatureType, type SdkOverlaySettings, type GamesOverlaySettings, } from '@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb';
|
|
86
|
+
export { InvitationFrom } from '@streamlayer/sl-eslib/analytics/v1/invitations/invitations_pb';
|
|
87
|
+
export enum NotificationType {
|
|
88
|
+
ONBOARDING = 1,
|
|
89
|
+
QUESTION = 2,
|
|
90
|
+
QUESTION_RESOLVED = 3
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
declare module "../../sdk-web-types/src/index" {
|
|
94
|
+
export * from "../../sdk-web-types/src/sl-types";
|
|
95
|
+
}
|
|
96
|
+
declare module "../../sdk-web-logger/src/index" {
|
|
97
|
+
import { pino, ChildLoggerOptions } from 'pino';
|
|
98
|
+
export const createLogger: (name: string, options?: ChildLoggerOptions) => pino.Logger<never, boolean>;
|
|
99
|
+
export type Logger = ReturnType<typeof createLogger>;
|
|
100
|
+
}
|
|
101
|
+
declare module "../../sdk-web-interfaces/src/event-bus/index" {
|
|
102
|
+
import { InvitationFrom, NotificationType, PromotionType, QuestionType } from '@streamlayer/sdk-web-types';
|
|
103
|
+
const EventBusActions: {
|
|
104
|
+
notification: {
|
|
105
|
+
received: string;
|
|
106
|
+
opened: string;
|
|
107
|
+
rendered: string;
|
|
108
|
+
closed: string;
|
|
109
|
+
};
|
|
110
|
+
app: {
|
|
111
|
+
close: string;
|
|
112
|
+
open: string;
|
|
113
|
+
};
|
|
114
|
+
exposedPauseAd: {
|
|
115
|
+
enabled: string;
|
|
116
|
+
disabled: string;
|
|
117
|
+
closed: string;
|
|
118
|
+
load: string;
|
|
119
|
+
loaded: string;
|
|
120
|
+
rendered: string;
|
|
121
|
+
navigated: string;
|
|
122
|
+
};
|
|
123
|
+
invitation: {
|
|
124
|
+
accepted: string;
|
|
125
|
+
sent: string;
|
|
126
|
+
};
|
|
127
|
+
interactions: {
|
|
128
|
+
tap: string;
|
|
129
|
+
scroll: string;
|
|
130
|
+
};
|
|
131
|
+
advertisement: {
|
|
132
|
+
opened: string;
|
|
133
|
+
'notification-opened': string;
|
|
134
|
+
'notification-received': string;
|
|
135
|
+
received: string;
|
|
136
|
+
viewed: string;
|
|
137
|
+
closed: string;
|
|
138
|
+
videoPlay: string;
|
|
139
|
+
videoEnd: string;
|
|
140
|
+
videoRendered: string;
|
|
141
|
+
videoMuted: string;
|
|
142
|
+
videoUnmuted: string;
|
|
143
|
+
videoReplayed: string;
|
|
144
|
+
quartileCompleted: string;
|
|
145
|
+
buttonSelect: string;
|
|
146
|
+
bannerSelect: string;
|
|
147
|
+
bannerShown: string;
|
|
148
|
+
};
|
|
149
|
+
poll: {
|
|
150
|
+
voted: string;
|
|
151
|
+
navigated: string;
|
|
152
|
+
opened: string;
|
|
153
|
+
viewed: string;
|
|
154
|
+
closed: string;
|
|
155
|
+
received: string;
|
|
156
|
+
onboardingOpen: string;
|
|
157
|
+
onboardingPassed: string;
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
export type EventBusActionPayload = {
|
|
161
|
+
notification: {
|
|
162
|
+
type?: NotificationType;
|
|
163
|
+
eventId?: string;
|
|
164
|
+
questionId?: string;
|
|
165
|
+
questionType?: QuestionType;
|
|
166
|
+
};
|
|
167
|
+
app: unknown;
|
|
168
|
+
exposedPauseAd: {
|
|
169
|
+
id?: string;
|
|
170
|
+
};
|
|
171
|
+
invitation: {
|
|
172
|
+
from?: InvitationFrom;
|
|
173
|
+
};
|
|
174
|
+
interactions: unknown;
|
|
175
|
+
advertisement: {
|
|
176
|
+
id: string;
|
|
177
|
+
type?: PromotionType;
|
|
178
|
+
isViewed?: boolean;
|
|
179
|
+
openedFrom?: 'auto' | 'notification';
|
|
180
|
+
hasNotification?: boolean;
|
|
181
|
+
hasBanner?: boolean;
|
|
182
|
+
quartile?: 25 | 50 | 75;
|
|
183
|
+
};
|
|
184
|
+
poll: {
|
|
185
|
+
questionId?: string;
|
|
186
|
+
questionType?: QuestionType;
|
|
187
|
+
questionOpenedFrom?: 'list' | 'notification';
|
|
188
|
+
hasBanner?: boolean;
|
|
189
|
+
isAd?: boolean;
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
type EventBusActionsKeys = keyof typeof EventBusActions;
|
|
193
|
+
type EventBusActions<T> = T extends EventBusActionsKeys ? keyof (typeof EventBusActions)[T] : never;
|
|
194
|
+
export type EventBusData<T extends EventBusActionsKeys = EventBusActionsKeys> = {
|
|
195
|
+
type: T;
|
|
196
|
+
action: EventBusActions<T>;
|
|
197
|
+
payload: EventBusActionPayload[T];
|
|
198
|
+
skipAnalytics?: boolean;
|
|
199
|
+
};
|
|
200
|
+
export class EventBusEvent<T extends EventBusActionsKeys = EventBusActionsKeys> extends Event {
|
|
201
|
+
slEventBus?: EventBusData<T>;
|
|
202
|
+
constructor(name: string, payload?: EventBusData<T>);
|
|
203
|
+
}
|
|
204
|
+
export class EventBus {
|
|
205
|
+
private name;
|
|
206
|
+
private listeners;
|
|
207
|
+
constructor(name?: string);
|
|
208
|
+
emit: <K extends EventBusActionsKeys = "notification" | "app" | "exposedPauseAd" | "invitation" | "interactions" | "advertisement" | "poll">(type: K, payload: Omit<EventBusData<K>, "type">) => void;
|
|
209
|
+
listen<T extends EventBusActionsKeys>(listener: (event: EventBusEvent<T>) => void): () => void;
|
|
210
|
+
off<T extends EventBusActionsKeys>(listener: (event: EventBusEvent<T>) => void): void;
|
|
211
|
+
destroy: () => void;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
declare module "../../sdk-web-interfaces/src/auth" {
|
|
215
|
+
export abstract class AbstractAuthenticationProvider {
|
|
216
|
+
abstract login(...args: unknown[]): Promise<unknown>;
|
|
217
|
+
abstract logout(): void;
|
|
218
|
+
abstract me(): Promise<unknown>;
|
|
219
|
+
abstract isAuthenticated(): Promise<unknown>;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
declare module "../../sdk-web-interfaces/src/store/abstract" {
|
|
223
|
+
import { type AnyStore } from 'nanostores';
|
|
224
|
+
global {
|
|
225
|
+
interface Window {
|
|
226
|
+
slStore: any;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* An abstract store is a wrapper for third-party stores,
|
|
231
|
+
* providing developers with a consistent interface inspired
|
|
232
|
+
* by the "nanostore" pattern. This simplifies
|
|
233
|
+
* interactions with different storage systems.
|
|
234
|
+
*/
|
|
235
|
+
export abstract class AbstractStore<T extends AnyStore> {
|
|
236
|
+
/**
|
|
237
|
+
* store instance (nanostores)
|
|
238
|
+
*/
|
|
239
|
+
protected readonly store: T;
|
|
240
|
+
protected readonly name: string;
|
|
241
|
+
constructor(store: T, name: string);
|
|
242
|
+
/**
|
|
243
|
+
* return store instance
|
|
244
|
+
*/
|
|
245
|
+
getStore(): T;
|
|
246
|
+
/**
|
|
247
|
+
* get all store values
|
|
248
|
+
*/
|
|
249
|
+
abstract getValues(): unknown;
|
|
250
|
+
/**
|
|
251
|
+
* get store value by key
|
|
252
|
+
*/
|
|
253
|
+
abstract getValue(...args: unknown[]): unknown;
|
|
254
|
+
/**
|
|
255
|
+
* subscribe directly to store changes
|
|
256
|
+
*/
|
|
257
|
+
abstract subscribe(...args: unknown[]): void;
|
|
258
|
+
/**
|
|
259
|
+
* unsubscribe directly to store change
|
|
260
|
+
*/
|
|
261
|
+
abstract unsubscribe(): void;
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Merge multiple stores into a single instance using a single
|
|
265
|
+
* subscribe handler, leveraging the `useStore` method from `@nanostores/react` for React subscriptions.
|
|
266
|
+
*/
|
|
267
|
+
export const mergeStores: <T extends Record<string, AbstractStore<AnyStore>>, K = { [Index in keyof T]: ReturnType<T[Index]["getStore"]>["value"]; }>(stores: T) => import("nanostores").ReadableAtom<K>;
|
|
268
|
+
}
|
|
269
|
+
declare module "../../sdk-web-interfaces/src/store/map" {
|
|
270
|
+
import { type MapStoreKeys, type MapStore as NMapStore } from 'nanostores';
|
|
271
|
+
import { AbstractStore } from "../../sdk-web-interfaces/src/store/abstract";
|
|
272
|
+
interface MapStoreObj {
|
|
273
|
+
[k: string]: any;
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Wrapper for nanostores MapStore
|
|
277
|
+
*/
|
|
278
|
+
export class MapStore<StoreInterface extends MapStoreObj, StoreInstance extends NMapStore<StoreInterface> = NMapStore<StoreInterface>> extends AbstractStore<StoreInstance> {
|
|
279
|
+
getValues: () => StoreInterface;
|
|
280
|
+
getValue: (key: MapStoreKeys<StoreInstance>) => StoreInterface[MapStoreKeys<StoreInstance>];
|
|
281
|
+
setValue: <Key extends MapStoreKeys<StoreInstance>>(path: Key, value: StoreInterface[Key]) => void;
|
|
282
|
+
subscribe: StoreInstance['subscribe'];
|
|
283
|
+
unsubscribe: () => void;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* create map store from nanostores
|
|
287
|
+
*/
|
|
288
|
+
export const createMapStore: <Data extends MapStoreObj>(initialData: Data) => import("nanostores").PreinitializedMapStore<Data> & object;
|
|
289
|
+
export type MapStoreListeners<StoreInstance extends NMapStore<StoreInterface>, StoreInterface extends MapStoreObj> = {
|
|
290
|
+
[T in MapStoreKeys<StoreInstance>]: (value: StoreInterface[T]) => void;
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
declare module "../../sdk-web-interfaces/src/feature" {
|
|
294
|
+
import { FeatureConfig as SdkOverlay, SdkOverlaySettings, PlainMessage } from '@streamlayer/sdk-web-types';
|
|
295
|
+
import { WritableAtom } from 'nanostores';
|
|
296
|
+
import { MapStore } from "../../sdk-web-interfaces/src/store/map";
|
|
297
|
+
type FeatureListener = {
|
|
298
|
+
name: string;
|
|
299
|
+
enabled: boolean;
|
|
300
|
+
onEvent: (...args: unknown[]) => void;
|
|
301
|
+
};
|
|
302
|
+
export type FeatureProps = SdkOverlay;
|
|
303
|
+
export enum FeatureSource {
|
|
304
|
+
ORGANIZATION = "ORGANIZATION",
|
|
305
|
+
STREAM = "STREAM"
|
|
306
|
+
}
|
|
307
|
+
type FeatureConfig = Omit<FeatureProps, 'settings'>;
|
|
308
|
+
type FeatureSettings = {
|
|
309
|
+
case: Exclude<SdkOverlaySettings['overlaySettings']['case'], 'inplay' | 'getstream' | undefined>;
|
|
310
|
+
value: PlainMessage<Exclude<SdkOverlaySettings['overlaySettings']['value'], undefined>>;
|
|
311
|
+
};
|
|
312
|
+
export enum FeatureStatus {
|
|
313
|
+
Ready = "ready",
|
|
314
|
+
Suspended = "suspended"
|
|
315
|
+
}
|
|
316
|
+
export class AbstractFeature<K extends FeatureSettings['case'] | undefined, C extends FeatureSettings['value'] = FeatureSettings['value']> {
|
|
317
|
+
status: WritableAtom<FeatureStatus>;
|
|
318
|
+
source: FeatureSource;
|
|
319
|
+
protected config: MapStore<FeatureConfig>;
|
|
320
|
+
protected settings: MapStore<C>;
|
|
321
|
+
protected listeners: Set<FeatureListener>;
|
|
322
|
+
protected settingsKey: K;
|
|
323
|
+
constructor({ settings, ...config }: FeatureProps, source: FeatureSource);
|
|
324
|
+
get featureConfig(): import("nanostores").MapStore<FeatureConfig>;
|
|
325
|
+
get featureSettings(): import("nanostores").MapStore<C>;
|
|
326
|
+
registerEventListener(listener: FeatureListener): void;
|
|
327
|
+
enable: () => void;
|
|
328
|
+
disable: () => void;
|
|
329
|
+
setFeatureConfig: ({ settings, ...config }: FeatureProps) => void;
|
|
330
|
+
update: (config: FeatureProps, source: FeatureSource) => void;
|
|
331
|
+
protected fireEvent(event: unknown): void;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
declare module "../../sdk-web-interfaces/src/store/single" {
|
|
335
|
+
import { type StoreValue, type WritableAtom } from 'nanostores';
|
|
336
|
+
import { AbstractStore } from "../../sdk-web-interfaces/src/store/abstract";
|
|
337
|
+
/**
|
|
338
|
+
* Wrapper for nanostores WritableAtom
|
|
339
|
+
*/
|
|
340
|
+
export class SingleStore<StoreValue, StoreInstance extends WritableAtom<StoreValue | undefined> = WritableAtom<StoreValue | undefined>> extends AbstractStore<StoreInstance> {
|
|
341
|
+
getValue: () => StoreInstance["value"];
|
|
342
|
+
getValues(): unknown;
|
|
343
|
+
setValue: (value?: StoreValue) => void;
|
|
344
|
+
subscribe: (listener: Parameters<StoreInstance["subscribe"]>[0]) => () => void;
|
|
345
|
+
unsubscribe: () => void;
|
|
346
|
+
listen(listener: Parameters<StoreInstance['subscribe']>[0]): () => void;
|
|
347
|
+
get(): StoreValue | undefined;
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* create atom store from nanostores
|
|
351
|
+
*/
|
|
352
|
+
export const createSingleStore: <T>(initialData: T) => import("nanostores").PreinitializedWritableAtom<T> & object;
|
|
353
|
+
export const createComputedStore: <Value, T extends WritableAtom = WritableAtom<any>>(store: T, mutator: (value: StoreValue<T>) => Value) => import("nanostores").ReadableAtom<Value>;
|
|
354
|
+
}
|
|
355
|
+
declare module "../../sdk-web-interfaces/src/store/api" {
|
|
356
|
+
import type { FetcherStore, FetcherValue } from '@nanostores/query';
|
|
357
|
+
import { WritableAtom } from 'nanostores';
|
|
358
|
+
import { AbstractStore } from "../../sdk-web-interfaces/src/store/abstract";
|
|
359
|
+
/**
|
|
360
|
+
* Wrapper for @nanostores/query FetcherStore
|
|
361
|
+
*/
|
|
362
|
+
export class ApiStore<StoreValue, StoreInstance extends FetcherStore<StoreValue, any> = FetcherStore<StoreValue, any>> extends AbstractStore<StoreInstance> {
|
|
363
|
+
private readonly atomStore;
|
|
364
|
+
constructor(store: StoreInstance, name: string, atomPicker?: (val: FetcherValue<StoreValue, unknown>, prevVal?: string) => string | undefined);
|
|
365
|
+
getAtomStore: () => WritableAtom<string | undefined>;
|
|
366
|
+
getValue: () => Promise<StoreValue | undefined>;
|
|
367
|
+
getValues: () => FetcherValue<StoreValue, any>;
|
|
368
|
+
setValue: (value?: StoreInstance["value"]) => void;
|
|
369
|
+
subscribe: StoreInstance['subscribe'];
|
|
370
|
+
unsubscribe: () => never;
|
|
371
|
+
invalidate: () => void;
|
|
372
|
+
listen: (cb: Parameters<StoreInstance["listen"]>[0]) => () => void;
|
|
373
|
+
get(): void;
|
|
374
|
+
key: () => string | undefined;
|
|
375
|
+
off: () => void;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
declare module "../../sdk-web-interfaces/src/index" {
|
|
379
|
+
import { FeatureType } from '@streamlayer/sdk-web-types';
|
|
380
|
+
import { EventBus, EventBusEvent, EventBusData, EventBusActionPayload } from "../../sdk-web-interfaces/src/event-bus/index";
|
|
381
|
+
export { AbstractAuthenticationProvider } from "../../sdk-web-interfaces/src/auth";
|
|
382
|
+
export { AbstractFeature, FeatureSource, type FeatureProps, FeatureStatus } from "../../sdk-web-interfaces/src/feature";
|
|
383
|
+
export { MapStore, createMapStore } from "../../sdk-web-interfaces/src/store/map";
|
|
384
|
+
export type { MapStoreListeners } from "../../sdk-web-interfaces/src/store/map";
|
|
385
|
+
export { SingleStore, createSingleStore, createComputedStore } from "../../sdk-web-interfaces/src/store/single";
|
|
386
|
+
export { AbstractStore, mergeStores } from "../../sdk-web-interfaces/src/store/abstract";
|
|
387
|
+
export { ApiStore } from "../../sdk-web-interfaces/src/store/api";
|
|
388
|
+
export type CancelMountCb = () => void;
|
|
389
|
+
export type OnMountCb = () => CancelMountCb;
|
|
390
|
+
export interface StreamLayerSDK {
|
|
391
|
+
onMount: (opts: {
|
|
392
|
+
name: string;
|
|
393
|
+
clear?: boolean;
|
|
394
|
+
}, cb: OnMountCb) => void;
|
|
395
|
+
closeFeature: (destroy?: boolean) => void;
|
|
396
|
+
openFeature: (featureType: FeatureType) => void;
|
|
397
|
+
}
|
|
398
|
+
export interface StreamLayerContext {
|
|
399
|
+
sdk: StreamLayerSDK;
|
|
400
|
+
}
|
|
401
|
+
type DoneFn = Function;
|
|
402
|
+
export type StreamLayerPlugin<T = unknown> = (instance: StreamLayerContext, opts: T, done: DoneFn) => void;
|
|
403
|
+
export const eventBus: EventBus;
|
|
404
|
+
export type { EventBusEvent, EventBusData, EventBusActionPayload };
|
|
405
|
+
}
|
|
406
|
+
declare module "app/bet-pack" {
|
|
407
|
+
export type BetPackProps = {
|
|
408
|
+
event: string;
|
|
409
|
+
theme?: string;
|
|
410
|
+
token?: string;
|
|
411
|
+
deviceId?: string;
|
|
412
|
+
sdkKey: string;
|
|
413
|
+
themeMode?: 'light' | 'dark';
|
|
414
|
+
production?: boolean;
|
|
415
|
+
};
|
|
416
|
+
export const BetPackProvider: () => import("react/jsx-runtime").JSX.Element | null;
|
|
417
|
+
}
|
|
418
|
+
declare module "../../sdk-web-api/src/utils/devtools" {
|
|
419
|
+
export const __GRPC_DEVTOOLS_EXTENSION__: any;
|
|
420
|
+
}
|
|
421
|
+
declare module "../../sdk-web-api/src/grpc/retry" {
|
|
422
|
+
import { type Interceptor } from '@connectrpc/connect';
|
|
423
|
+
/**
|
|
424
|
+
* Retry interceptor
|
|
425
|
+
*
|
|
426
|
+
* This interceptor is used to retry requests in case of network errors.
|
|
427
|
+
* Retries are performed according to the exponential backoff algorithm.
|
|
428
|
+
* Allowing retries for the following error codes:
|
|
429
|
+
* [
|
|
430
|
+
* Code.Unknown,
|
|
431
|
+
* Code.Internal,
|
|
432
|
+
* Code.DeadlineExceeded,
|
|
433
|
+
* Code.ResourceExhausted,
|
|
434
|
+
* Code.FailedPrecondition,
|
|
435
|
+
* Code.Unavailable,
|
|
436
|
+
* Code.DataLoss,
|
|
437
|
+
* ]
|
|
438
|
+
*
|
|
439
|
+
* Retry params:
|
|
440
|
+
* - retryAttempts: number of attempts to retry the request, 0 means no retries
|
|
441
|
+
* - retryDelay: max delay between retries in milliseconds
|
|
442
|
+
*
|
|
443
|
+
* Example:
|
|
444
|
+
* ```ts
|
|
445
|
+
const { client, createRequestOptions, queryKey } = transport.createPromiseClient(Leaderboard, {
|
|
446
|
+
method: 'summary',
|
|
447
|
+
params: [$eventId, $userId],
|
|
448
|
+
})
|
|
449
|
+
|
|
450
|
+
return transport.nanoquery.createFetcherStore(queryKey, {
|
|
451
|
+
fetcher: async (_, __, eventId, userId) => {
|
|
452
|
+
const contextValues = createRequestOptions({
|
|
453
|
+
retryAttempts: 5,
|
|
454
|
+
retryDelay: 10000,
|
|
455
|
+
})
|
|
456
|
+
|
|
457
|
+
const res = await client.summary(
|
|
458
|
+
{
|
|
459
|
+
eventId: eventId as unknown as bigint,
|
|
460
|
+
userId: userId as string,
|
|
461
|
+
},
|
|
462
|
+
{ contextValues }
|
|
463
|
+
)
|
|
464
|
+
|
|
465
|
+
return res.data?.attributes
|
|
466
|
+
},
|
|
467
|
+
})
|
|
468
|
+
* ```
|
|
469
|
+
*/
|
|
470
|
+
export const retry: Interceptor;
|
|
471
|
+
}
|
|
472
|
+
declare module "../../sdk-web-api/src/grpc/transport" {
|
|
473
|
+
import { MapStore } from '@streamlayer/sdk-web-interfaces';
|
|
474
|
+
import { createRouterTransport, ConnectRouter, Interceptor, Client, UnaryRequest, StreamRequest } from '@connectrpc/connect';
|
|
475
|
+
import { createGrpcWebTransport } from '@connectrpc/connect-web';
|
|
476
|
+
import { type KeyInput, nanoquery } from '@nanostores/query';
|
|
477
|
+
import { PreinitializedWritableAtom } from 'nanostores';
|
|
478
|
+
import { GenService, GenServiceMethods } from '@bufbuild/protobuf/codegenv1';
|
|
479
|
+
import { ServerStreamSubscription, StreamPromiseClient, type ServerStreamSubscriptionOptions } from "../../sdk-web-api/src/grpc/subscription";
|
|
480
|
+
type ServiceType = GenService<GenServiceMethods>;
|
|
481
|
+
type KnownHeaders = {
|
|
482
|
+
authorization?: string;
|
|
483
|
+
sdk?: string;
|
|
484
|
+
'sl-device-id': string;
|
|
485
|
+
'sl-device-os': string;
|
|
486
|
+
'sl-user-id'?: string;
|
|
487
|
+
} & Record<string, string>;
|
|
488
|
+
export type GrpcTransport = Transport['transport'];
|
|
489
|
+
type ReservedHeaders = 'sdk' | 'authorization';
|
|
490
|
+
type ExcludeReservedHeaders<T> = ReservedHeaders extends T ? never : T extends ReservedHeaders ? never : T;
|
|
491
|
+
global {
|
|
492
|
+
interface Window {
|
|
493
|
+
__GRPC_DEVTOOLS_EXTENSION__?: () => import('@connectrpc/connect').Interceptor;
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
type NanoqueryReturnType = ReturnType<typeof nanoquery>;
|
|
497
|
+
type NanoqueryObjectType = {
|
|
498
|
+
createFetcherStore: NanoqueryReturnType[0];
|
|
499
|
+
createMutatorStore: NanoqueryReturnType[1];
|
|
500
|
+
utils: NanoqueryReturnType[2];
|
|
501
|
+
};
|
|
502
|
+
export const RequestOptionsKeys: {
|
|
503
|
+
retryAttempts: import("@connectrpc/connect").ContextKey<number>;
|
|
504
|
+
retryDelay: import("@connectrpc/connect").ContextKey<number>;
|
|
505
|
+
};
|
|
506
|
+
type RequestOptionsKey = keyof typeof RequestOptionsKeys;
|
|
507
|
+
type RequestOptions = Partial<Record<RequestOptionsKey, (typeof RequestOptionsKeys)[RequestOptionsKey]['defaultValue']>>;
|
|
508
|
+
export interface DataObj {
|
|
509
|
+
[k: string]: any;
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* transport wrapper, initialize grpc transport, store headers and connect interceptors
|
|
513
|
+
*/
|
|
514
|
+
export class Transport {
|
|
515
|
+
toJsonOptions: {
|
|
516
|
+
emitDefaultValues: boolean;
|
|
517
|
+
enumAsInteger: boolean;
|
|
518
|
+
useProtoFieldName: boolean;
|
|
519
|
+
};
|
|
520
|
+
readonly transport: ReturnType<typeof createGrpcWebTransport>;
|
|
521
|
+
readonly streamTransport: ReturnType<typeof createGrpcWebTransport>;
|
|
522
|
+
nanoquery: NanoqueryObjectType;
|
|
523
|
+
readonly host: string;
|
|
524
|
+
readonly $headers: MapStore<KnownHeaders>;
|
|
525
|
+
storeCache: Map<string, any>;
|
|
526
|
+
protected interceptors: Interceptor[];
|
|
527
|
+
private clients;
|
|
528
|
+
private streamClients;
|
|
529
|
+
private subscriptions;
|
|
530
|
+
private opts?;
|
|
531
|
+
constructor(host: string, opts?: {
|
|
532
|
+
dedupeTime?: number;
|
|
533
|
+
refetchInterval?: number;
|
|
534
|
+
retryable?: boolean;
|
|
535
|
+
webOS?: boolean;
|
|
536
|
+
});
|
|
537
|
+
addSubscription: <T extends ServiceType, Req extends Record<string, unknown>, Res extends Record<string, unknown>, M extends keyof StreamPromiseClient<T> = keyof StreamPromiseClient<T>>(method: StreamPromiseClient<T>[M], params: PreinitializedWritableAtom<Req> | Req, options: ServerStreamSubscriptionOptions) => ServerStreamSubscription<ServiceType, DataObj, DataObj, never, never> | ServerStreamSubscription<T, Req, Res, keyof StreamPromiseClient<T>, StreamPromiseClient<T>[keyof StreamPromiseClient<T>]>;
|
|
538
|
+
removeSubscription: (subscription: ServerStreamSubscription<ServiceType, DataObj, DataObj>) => void;
|
|
539
|
+
disconnect: () => void;
|
|
540
|
+
registerInterceptor: (interceptor: Interceptor) => void;
|
|
541
|
+
removeInterceptor: (interceptor: Interceptor) => void;
|
|
542
|
+
getClient: <T extends ServiceType>(service: T) => Client<T>;
|
|
543
|
+
getStreamClient: <T extends ServiceType>(service: T) => Client<T>;
|
|
544
|
+
createPromiseClient: <T extends ServiceType>(service: T, { params, method }: {
|
|
545
|
+
params?: KeyInput;
|
|
546
|
+
method: keyof T["method"];
|
|
547
|
+
}) => {
|
|
548
|
+
client: Client<T>;
|
|
549
|
+
createRequestOptions: (options: RequestOptions) => import("@connectrpc/connect").ContextValues;
|
|
550
|
+
queryKey: ((string | number | true) | import("nanostores").ReadableAtom<(string | number | true) | (false | void | null | undefined)> | import("@nanostores/query").FetcherStore<any, any>)[];
|
|
551
|
+
queryKeyStr: string;
|
|
552
|
+
};
|
|
553
|
+
createStreamClient: <T extends ServiceType>(service: T) => {
|
|
554
|
+
client: Client<T>;
|
|
555
|
+
};
|
|
556
|
+
setSdkKey: (sdkKey: string) => void;
|
|
557
|
+
setAuth: (token: string, userId: string) => void;
|
|
558
|
+
setHeader: <T extends keyof KnownHeaders = string>(name: ExcludeReservedHeaders<T>, value: string) => void;
|
|
559
|
+
getHeader: (name: keyof KnownHeaders) => string;
|
|
560
|
+
getHeaders: () => KnownHeaders;
|
|
561
|
+
initInterceptors: () => void;
|
|
562
|
+
}
|
|
563
|
+
export class MockTransport extends Transport {
|
|
564
|
+
transport: ReturnType<typeof createRouterTransport>;
|
|
565
|
+
calls: Array<UnaryRequest | StreamRequest>;
|
|
566
|
+
constructor(transport: (router: ConnectRouter) => void);
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
declare module "../../sdk-web-api/src/grpc/subscription" {
|
|
570
|
+
import { Client } from '@connectrpc/connect';
|
|
571
|
+
import { PreinitializedWritableAtom } from 'nanostores';
|
|
572
|
+
import type { GenService, GenServiceMethods } from '@bufbuild/protobuf/codegenv1';
|
|
573
|
+
import type { DescMethodServerStreaming } from '@bufbuild/protobuf';
|
|
574
|
+
import { Transport } from "../../sdk-web-api/src/grpc/transport";
|
|
575
|
+
type ServiceType = GenService<GenServiceMethods>;
|
|
576
|
+
export type StreamMethodsDesc<T extends ServiceType> = {
|
|
577
|
+
[P in keyof T['method'] as T['method'][P] extends DescMethodServerStreaming ? P : never]: T['method'][P] extends DescMethodServerStreaming ? T['method'][P] : never;
|
|
578
|
+
};
|
|
579
|
+
export type StreamPromiseClient<T extends ServiceType> = {
|
|
580
|
+
[P in keyof T['method'] as T['method'][P] extends DescMethodServerStreaming ? P : never]: T['method'][P] extends DescMethodServerStreaming ? Client<T>[P] : never;
|
|
581
|
+
};
|
|
582
|
+
export type StreamMethods<T extends ServiceType> = {
|
|
583
|
+
[P in keyof StreamPromiseClient<T>]: P;
|
|
584
|
+
};
|
|
585
|
+
enum ServerStreamSubscriptionStatus {
|
|
586
|
+
Init = "init",
|
|
587
|
+
Ready = "ready",
|
|
588
|
+
Connecting = "connecting",
|
|
589
|
+
Connected = "connected",
|
|
590
|
+
Disconnected = "disconnected",
|
|
591
|
+
Failed = "failed",
|
|
592
|
+
Reconnect = "reconnect",
|
|
593
|
+
Reconnecting = "reconnecting"
|
|
594
|
+
}
|
|
595
|
+
export type ServerStreamSubscriptionOptions = {
|
|
596
|
+
name: string;
|
|
597
|
+
withStore?: boolean;
|
|
598
|
+
reconnectDelay?: number;
|
|
599
|
+
reconnectMaxDelay?: number;
|
|
600
|
+
reconnectMaxAttempts?: number;
|
|
601
|
+
};
|
|
602
|
+
interface DataObj {
|
|
603
|
+
[k: string]: any;
|
|
604
|
+
}
|
|
605
|
+
export class ServerStreamSubscription<T extends ServiceType, Request extends DataObj, Response extends DataObj, M extends keyof StreamMethods<T> = keyof StreamMethods<T>, Method extends StreamPromiseClient<T>[M] = StreamPromiseClient<T>[M]> {
|
|
606
|
+
params: PreinitializedWritableAtom<Request> | Request;
|
|
607
|
+
private streamCancel?;
|
|
608
|
+
private method;
|
|
609
|
+
private options;
|
|
610
|
+
private headers;
|
|
611
|
+
private listeners;
|
|
612
|
+
private state;
|
|
613
|
+
private store?;
|
|
614
|
+
private paramsListener?;
|
|
615
|
+
private reconnectTimeout?;
|
|
616
|
+
private attempt;
|
|
617
|
+
constructor(headers: Transport['$headers'], method: Method, params: PreinitializedWritableAtom<Request> | Request, options: ServerStreamSubscriptionOptions);
|
|
618
|
+
updateState: (status: ServerStreamSubscriptionStatus) => void;
|
|
619
|
+
addStateLog: (msg: string) => void;
|
|
620
|
+
addListener: (name: string, listener: (response: Response) => void) => (() => void);
|
|
621
|
+
removeListener: (name: string) => void;
|
|
622
|
+
connect: () => void;
|
|
623
|
+
disconnect: () => void;
|
|
624
|
+
/**
|
|
625
|
+
* Reconnect after delay, if not already reconnecting, otherwise do nothing
|
|
626
|
+
*/
|
|
627
|
+
reconnect: () => void;
|
|
628
|
+
getStore: () => import("nanostores").WritableAtom<Response | null | undefined> | undefined;
|
|
629
|
+
private onData;
|
|
630
|
+
/**
|
|
631
|
+
* Disconnect if error is not instance of ConnectError or stream is Canceled,
|
|
632
|
+
* Reconnect in other cases
|
|
633
|
+
* Do nothing if error is undefined
|
|
634
|
+
*/
|
|
635
|
+
private onStreamError;
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
declare module "../../sdk-web-api/src/grpc/queries/event" {
|
|
639
|
+
import { ReadableAtom } from 'nanostores';
|
|
640
|
+
import type { StreamSettings } from '@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb';
|
|
641
|
+
import { Transport } from "../../sdk-web-api/src/grpc/transport";
|
|
642
|
+
export const $retrieveEventId: ($providerStreamId: ReadableAtom<string | undefined>, transport: Transport) => import("@nanostores/query").FetcherStore<string | undefined, any>;
|
|
643
|
+
export const $streamSettings: (slStreamId: ReadableAtom<string | undefined>, transport: Transport) => import("@nanostores/query").FetcherStore<StreamSettings | undefined, any>;
|
|
644
|
+
export const $streamSummary: (slStreamId: ReadableAtom<string | undefined>, transport: Transport) => import("@nanostores/query").FetcherStore<import("@streamlayer/sl-eslib/sports/events/events_pb").SummaryResponse_ResponseData_SummaryResponseAttributes | undefined, any>;
|
|
645
|
+
}
|
|
646
|
+
declare module "../../sdk-web-api/src/grpc/queries/user" {
|
|
647
|
+
import { ReadableAtom } from 'nanostores';
|
|
648
|
+
import { type BypassAuthRequest } from '@streamlayer/sl-eslib/users/users_pb';
|
|
649
|
+
import { Transport } from "../../sdk-web-api/src/grpc/transport";
|
|
650
|
+
export const $user: ($userToken: ReadableAtom<string | undefined>, transport: Transport) => import("@nanostores/query").FetcherStore<{
|
|
651
|
+
data: import("@streamlayer/sl-eslib/users/users_common_pb").User | undefined;
|
|
652
|
+
}, any>;
|
|
653
|
+
export const bypassLogin: (transport: Transport) => ({ userKey, schema, init, inviterKey }: Omit<BypassAuthRequest, "$typeName">) => Promise<import("@streamlayer/sl-eslib/users/users_pb").BypassAuthResponse>;
|
|
654
|
+
export const bypassAuth: (transport: Transport, params: {
|
|
655
|
+
userKey?: string;
|
|
656
|
+
schema?: string;
|
|
657
|
+
init?: boolean;
|
|
658
|
+
}) => Promise<import("@streamlayer/sl-eslib/users/users_pb").BypassAuthResponse>;
|
|
659
|
+
export const $userSettings: ($userToken: ReadableAtom<string | undefined>, transport: Transport) => import("@nanostores/query").FetcherStore<import("@streamlayer/sl-eslib/sdkSettings/client/client_pb").ClientSettings | undefined, any>;
|
|
660
|
+
export const register: (transport: Transport, phone: string) => Promise<import("@streamlayer/sl-eslib/users/users_pb").RegisterResponse>;
|
|
661
|
+
}
|
|
662
|
+
declare module "../../sdk-web-api/src/grpc/queries/organization" {
|
|
663
|
+
import { ReadableAtom } from 'nanostores';
|
|
664
|
+
import { Transport } from "../../sdk-web-api/src/grpc/transport";
|
|
665
|
+
export { $user } from "../../sdk-web-api/src/grpc/queries/user";
|
|
666
|
+
export const $organizationSettings: ($enabled: ReadableAtom<"on" | undefined>, transport: Transport) => import("@nanostores/query").FetcherStore<{
|
|
667
|
+
id: string;
|
|
668
|
+
$typeName?: "streamlayer.sdkSettings.OrganizationSettings" | undefined;
|
|
669
|
+
$unknown?: import("@bufbuild/protobuf").UnknownField[];
|
|
670
|
+
overlays?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").SdkOverlay[] | undefined;
|
|
671
|
+
buttonIcon?: string | undefined;
|
|
672
|
+
tinodeHost?: string | undefined;
|
|
673
|
+
audience?: string | undefined;
|
|
674
|
+
name?: string | undefined;
|
|
675
|
+
provider?: string | undefined;
|
|
676
|
+
primaryColor?: string | undefined;
|
|
677
|
+
secondaryColor?: string | undefined;
|
|
678
|
+
moderationPrimaryColor?: string | undefined;
|
|
679
|
+
linkShareIcon?: string | undefined;
|
|
680
|
+
linkShareText?: string | undefined;
|
|
681
|
+
brandDefaults?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").BrandDefaults;
|
|
682
|
+
pub?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").JWK;
|
|
683
|
+
getstream?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").GetStreamSettingsClient;
|
|
684
|
+
publicName?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").PublicName | undefined;
|
|
685
|
+
analyticsVersion?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").AnalyticsVersion | undefined;
|
|
686
|
+
} | undefined, any>;
|
|
687
|
+
export const $organizationAdvertising: ($enabled: ReadableAtom<string | undefined>, transport: Transport) => import("@nanostores/query").FetcherStore<import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").Advertising | undefined, any>;
|
|
688
|
+
}
|
|
689
|
+
declare module "../../sdk-web-api/src/grpc/queries/index" {
|
|
690
|
+
export * from "../../sdk-web-api/src/grpc/queries/event";
|
|
691
|
+
export * from "../../sdk-web-api/src/grpc/queries/organization";
|
|
692
|
+
export * from "../../sdk-web-api/src/grpc/queries/user";
|
|
693
|
+
}
|
|
694
|
+
declare module "../../sdk-web-api/src/index" {
|
|
695
|
+
import { StreamLayerContext } from '@streamlayer/sdk-web-interfaces';
|
|
696
|
+
import { FetcherStore } from '@nanostores/query';
|
|
697
|
+
export type { ServerStreamSubscriptionOptions } from "../../sdk-web-api/src/grpc/subscription";
|
|
698
|
+
export { Transport } from "../../sdk-web-api/src/grpc/transport";
|
|
699
|
+
import { Transport } from "../../sdk-web-api/src/grpc/transport";
|
|
700
|
+
export type { GrpcTransport } from "../../sdk-web-api/src/grpc/transport";
|
|
701
|
+
export * as queries from "../../sdk-web-api/src/grpc/queries/index";
|
|
702
|
+
export type GetApiResponseType<T extends (...args: any[]) => FetcherStore> = ReturnType<ReturnType<T>['get']>['data'];
|
|
703
|
+
module '@streamlayer/sdk-web-interfaces' {
|
|
704
|
+
interface StreamLayerSDK {
|
|
705
|
+
host: string;
|
|
706
|
+
}
|
|
707
|
+
interface StreamLayerContext {
|
|
708
|
+
transport: Transport;
|
|
709
|
+
analyticsTransport: Transport;
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
export const transport: (instance: StreamLayerContext, opts: {
|
|
713
|
+
sdkKey: string;
|
|
714
|
+
host: string;
|
|
715
|
+
analyticsHost: string;
|
|
716
|
+
version?: string;
|
|
717
|
+
webOS?: boolean;
|
|
718
|
+
}, done: () => void) => void;
|
|
719
|
+
}
|
|
720
|
+
declare module "../../sdk-web-core/src/store/init" {
|
|
721
|
+
import { SingleStore, ApiStore } from '@streamlayer/sdk-web-interfaces';
|
|
722
|
+
import { Transport } from '@streamlayer/sdk-web-api';
|
|
723
|
+
import { User } from '@streamlayer/sdk-web-types';
|
|
724
|
+
export enum CoreStatus {
|
|
725
|
+
DISABLED = "disabled",
|
|
726
|
+
INITIALIZATION = "initialization",
|
|
727
|
+
READY = "ready",
|
|
728
|
+
FAILED = "failed",
|
|
729
|
+
SUSPENDED = "suspended"
|
|
730
|
+
}
|
|
731
|
+
export const initializeStore: (transport: Transport) => {
|
|
732
|
+
readonly enabled: SingleStore<unknown, import("nanostores").PreinitializedWritableAtom<"on" | undefined> & object>;
|
|
733
|
+
readonly status: SingleStore<unknown, import("nanostores").PreinitializedWritableAtom<CoreStatus> & object>;
|
|
734
|
+
readonly providerStreamId: SingleStore<unknown, import("nanostores").PreinitializedWritableAtom<string | undefined> & object>;
|
|
735
|
+
readonly slStreamId: ApiStore<string | undefined, import("@nanostores/query").FetcherStore<string | undefined, any>>;
|
|
736
|
+
readonly streamSettings: ApiStore<import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").StreamSettings | undefined, import("@nanostores/query").FetcherStore<import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").StreamSettings | undefined, any>>;
|
|
737
|
+
readonly streamSummary: ApiStore<import("@streamlayer/sl-eslib/sports/events/events_pb").SummaryResponse_ResponseData_SummaryResponseAttributes | undefined, import("@nanostores/query").FetcherStore<import("@streamlayer/sl-eslib/sports/events/events_pb").SummaryResponse_ResponseData_SummaryResponseAttributes | undefined, any>>;
|
|
738
|
+
readonly user: ApiStore<User, import("@nanostores/query").FetcherStore<User, any>>;
|
|
739
|
+
readonly userKey: SingleStore<unknown, import("nanostores").PreinitializedWritableAtom<string | undefined> & object>;
|
|
740
|
+
readonly userToken: SingleStore<unknown, import("nanostores").PreinitializedWritableAtom<string | undefined> & object>;
|
|
741
|
+
readonly userSettings: ApiStore<import("@streamlayer/sl-eslib/sdkSettings/client/client_pb").ClientSettings | undefined, import("@nanostores/query").FetcherStore<import("@streamlayer/sl-eslib/sdkSettings/client/client_pb").ClientSettings | undefined, any>>;
|
|
742
|
+
readonly organizationSettings: ApiStore<{
|
|
743
|
+
id: string;
|
|
744
|
+
$typeName?: "streamlayer.sdkSettings.OrganizationSettings" | undefined;
|
|
745
|
+
$unknown?: import("@bufbuild/protobuf").UnknownField[];
|
|
746
|
+
overlays?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").SdkOverlay[] | undefined;
|
|
747
|
+
buttonIcon?: string | undefined;
|
|
748
|
+
tinodeHost?: string | undefined;
|
|
749
|
+
audience?: string | undefined;
|
|
750
|
+
name?: string | undefined;
|
|
751
|
+
provider?: string | undefined;
|
|
752
|
+
primaryColor?: string | undefined;
|
|
753
|
+
secondaryColor?: string | undefined;
|
|
754
|
+
moderationPrimaryColor?: string | undefined;
|
|
755
|
+
linkShareIcon?: string | undefined;
|
|
756
|
+
linkShareText?: string | undefined;
|
|
757
|
+
brandDefaults?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").BrandDefaults;
|
|
758
|
+
pub?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").JWK;
|
|
759
|
+
getstream?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").GetStreamSettingsClient;
|
|
760
|
+
publicName?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").PublicName | undefined;
|
|
761
|
+
analyticsVersion?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").AnalyticsVersion | undefined;
|
|
762
|
+
} | undefined, import("@nanostores/query").FetcherStore<{
|
|
763
|
+
id: string;
|
|
764
|
+
$typeName?: "streamlayer.sdkSettings.OrganizationSettings" | undefined;
|
|
765
|
+
$unknown?: import("@bufbuild/protobuf").UnknownField[];
|
|
766
|
+
overlays?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").SdkOverlay[] | undefined;
|
|
767
|
+
buttonIcon?: string | undefined;
|
|
768
|
+
tinodeHost?: string | undefined;
|
|
769
|
+
audience?: string | undefined;
|
|
770
|
+
name?: string | undefined;
|
|
771
|
+
provider?: string | undefined;
|
|
772
|
+
primaryColor?: string | undefined;
|
|
773
|
+
secondaryColor?: string | undefined;
|
|
774
|
+
moderationPrimaryColor?: string | undefined;
|
|
775
|
+
linkShareIcon?: string | undefined;
|
|
776
|
+
linkShareText?: string | undefined;
|
|
777
|
+
brandDefaults?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").BrandDefaults;
|
|
778
|
+
pub?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").JWK;
|
|
779
|
+
getstream?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").GetStreamSettingsClient;
|
|
780
|
+
publicName?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").PublicName | undefined;
|
|
781
|
+
analyticsVersion?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").AnalyticsVersion | undefined;
|
|
782
|
+
} | undefined, any>>;
|
|
783
|
+
readonly organizationAdvertising: ApiStore<import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").Advertising | undefined, import("@nanostores/query").FetcherStore<import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").Advertising | undefined, any>>;
|
|
784
|
+
};
|
|
785
|
+
}
|
|
786
|
+
declare module "../../sdk-web-core/src/store/store" {
|
|
787
|
+
import type { OrganizationAdvertising, StreamSettings, OrganizationSettings, User, UserSettings, EventSummary } from '@streamlayer/sdk-web-types';
|
|
788
|
+
import { AbstractStore } from '@streamlayer/sdk-web-interfaces';
|
|
789
|
+
import { Transport } from '@streamlayer/sdk-web-api';
|
|
790
|
+
import { ReadableAtom } from 'nanostores';
|
|
791
|
+
import { FetcherValue } from '@nanostores/query';
|
|
792
|
+
import { initializeStore, CoreStatus } from "../../sdk-web-core/src/store/init";
|
|
793
|
+
export { CoreStatus };
|
|
794
|
+
export interface CoreStoreInterface {
|
|
795
|
+
enabled?: 'on';
|
|
796
|
+
status: string;
|
|
797
|
+
userKey?: string;
|
|
798
|
+
userToken?: string;
|
|
799
|
+
organizationSettings?: OrganizationSettings & {
|
|
800
|
+
id: string;
|
|
801
|
+
};
|
|
802
|
+
organizationAdvertising?: OrganizationAdvertising;
|
|
803
|
+
streamSettings?: StreamSettings;
|
|
804
|
+
streamSummary?: EventSummary;
|
|
805
|
+
user?: User;
|
|
806
|
+
userSettings?: UserSettings;
|
|
807
|
+
providerStreamId?: string;
|
|
808
|
+
slStreamId?: string;
|
|
809
|
+
}
|
|
810
|
+
export type StoreObj = ReturnType<typeof initializeStore>;
|
|
811
|
+
export type CoreStores = {
|
|
812
|
+
[Index in keyof StoreObj]: ReturnType<StoreObj[Index]['getStore']>;
|
|
813
|
+
};
|
|
814
|
+
export type CoreStoresValues = {
|
|
815
|
+
[Index in keyof StoreObj]: ReturnType<StoreObj[Index]['getStore']>['value'];
|
|
816
|
+
};
|
|
817
|
+
export type CoreStoreInstance = ReadableAtom<CoreStoresValues>;
|
|
818
|
+
/**
|
|
819
|
+
* @description `CoreStore` is a store that contains all the necessary data for the SDK to work.
|
|
820
|
+
* `CoreStore` is a singleton and is created when the SDK is initialized. It includes the following stores:
|
|
821
|
+
* - `enabled` - the status of the SDK. The SDK is enabled when the `on` value is set.
|
|
822
|
+
* - `status` - the status of the SDK. Can be one of the following values: `disabled`, `initialization`, `ready`, `failed`, `suspended`.
|
|
823
|
+
* - `userKey` - the user key provided by the host.
|
|
824
|
+
* - `userToken` - the user token received from the StreamLayer after login.
|
|
825
|
+
* - `organizationSettings` - the organization settings.
|
|
826
|
+
* - `organizationAdvertising` - the organization advertising.
|
|
827
|
+
* - `streamSettings` - the stream settings.
|
|
828
|
+
* - `user` - the user data.
|
|
829
|
+
* - `userSettings` - the user settings.
|
|
830
|
+
* - `providerStreamId` - the event id provided by the host.
|
|
831
|
+
* - `slStreamId` - the event id received from the StreamLayer, resolved by the `providerStreamId`.
|
|
832
|
+
*/
|
|
833
|
+
export class CoreStore extends AbstractStore<CoreStoreInstance> {
|
|
834
|
+
private stores;
|
|
835
|
+
constructor(transport: Transport);
|
|
836
|
+
getValue(): unknown;
|
|
837
|
+
getValues(): {
|
|
838
|
+
readonly enabled: import("@streamlayer/sdk-web-interfaces").SingleStore<unknown, import("nanostores").PreinitializedWritableAtom<"on" | undefined> & object>;
|
|
839
|
+
readonly status: import("@streamlayer/sdk-web-interfaces").SingleStore<unknown, import("nanostores").PreinitializedWritableAtom<CoreStatus> & object>;
|
|
840
|
+
readonly providerStreamId: import("@streamlayer/sdk-web-interfaces").SingleStore<unknown, import("nanostores").PreinitializedWritableAtom<string | undefined> & object>;
|
|
841
|
+
readonly slStreamId: import("@streamlayer/sdk-web-interfaces").ApiStore<string | undefined, import("@nanostores/query").FetcherStore<string | undefined, any>>;
|
|
842
|
+
readonly streamSettings: import("@streamlayer/sdk-web-interfaces").ApiStore<import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").StreamSettings | undefined, import("@nanostores/query").FetcherStore<import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").StreamSettings | undefined, any>>;
|
|
843
|
+
readonly streamSummary: import("@streamlayer/sdk-web-interfaces").ApiStore<import("@streamlayer/sl-eslib/sports/events/events_pb").SummaryResponse_ResponseData_SummaryResponseAttributes | undefined, import("@nanostores/query").FetcherStore<import("@streamlayer/sl-eslib/sports/events/events_pb").SummaryResponse_ResponseData_SummaryResponseAttributes | undefined, any>>;
|
|
844
|
+
readonly user: import("@streamlayer/sdk-web-interfaces").ApiStore<User, import("@nanostores/query").FetcherStore<User, any>>;
|
|
845
|
+
readonly userKey: import("@streamlayer/sdk-web-interfaces").SingleStore<unknown, import("nanostores").PreinitializedWritableAtom<string | undefined> & object>;
|
|
846
|
+
readonly userToken: import("@streamlayer/sdk-web-interfaces").SingleStore<unknown, import("nanostores").PreinitializedWritableAtom<string | undefined> & object>;
|
|
847
|
+
readonly userSettings: import("@streamlayer/sdk-web-interfaces").ApiStore<import("@streamlayer/sl-eslib/sdkSettings/client/client_pb").ClientSettings | undefined, import("@nanostores/query").FetcherStore<import("@streamlayer/sl-eslib/sdkSettings/client/client_pb").ClientSettings | undefined, any>>;
|
|
848
|
+
readonly organizationSettings: import("@streamlayer/sdk-web-interfaces").ApiStore<{
|
|
849
|
+
id: string;
|
|
850
|
+
$typeName?: "streamlayer.sdkSettings.OrganizationSettings" | undefined;
|
|
851
|
+
$unknown?: import("@bufbuild/protobuf").UnknownField[];
|
|
852
|
+
overlays?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").SdkOverlay[] | undefined;
|
|
853
|
+
buttonIcon?: string | undefined;
|
|
854
|
+
tinodeHost?: string | undefined;
|
|
855
|
+
audience?: string | undefined;
|
|
856
|
+
name?: string | undefined;
|
|
857
|
+
provider?: string | undefined;
|
|
858
|
+
primaryColor?: string | undefined;
|
|
859
|
+
secondaryColor?: string | undefined;
|
|
860
|
+
moderationPrimaryColor?: string | undefined;
|
|
861
|
+
linkShareIcon?: string | undefined;
|
|
862
|
+
linkShareText?: string | undefined;
|
|
863
|
+
brandDefaults?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").BrandDefaults;
|
|
864
|
+
pub?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").JWK;
|
|
865
|
+
getstream?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").GetStreamSettingsClient;
|
|
866
|
+
publicName?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").PublicName | undefined;
|
|
867
|
+
analyticsVersion?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").AnalyticsVersion | undefined;
|
|
868
|
+
} | undefined, import("@nanostores/query").FetcherStore<{
|
|
869
|
+
id: string;
|
|
870
|
+
$typeName?: "streamlayer.sdkSettings.OrganizationSettings" | undefined;
|
|
871
|
+
$unknown?: import("@bufbuild/protobuf").UnknownField[];
|
|
872
|
+
overlays?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").SdkOverlay[] | undefined;
|
|
873
|
+
buttonIcon?: string | undefined;
|
|
874
|
+
tinodeHost?: string | undefined;
|
|
875
|
+
audience?: string | undefined;
|
|
876
|
+
name?: string | undefined;
|
|
877
|
+
provider?: string | undefined;
|
|
878
|
+
primaryColor?: string | undefined;
|
|
879
|
+
secondaryColor?: string | undefined;
|
|
880
|
+
moderationPrimaryColor?: string | undefined;
|
|
881
|
+
linkShareIcon?: string | undefined;
|
|
882
|
+
linkShareText?: string | undefined;
|
|
883
|
+
brandDefaults?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").BrandDefaults;
|
|
884
|
+
pub?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").JWK;
|
|
885
|
+
getstream?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").GetStreamSettingsClient;
|
|
886
|
+
publicName?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").PublicName | undefined;
|
|
887
|
+
analyticsVersion?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").AnalyticsVersion | undefined;
|
|
888
|
+
} | undefined, any>>;
|
|
889
|
+
readonly organizationAdvertising: import("@streamlayer/sdk-web-interfaces").ApiStore<import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").Advertising | undefined, import("@nanostores/query").FetcherStore<import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").Advertising | undefined, any>>;
|
|
890
|
+
};
|
|
891
|
+
setValue(): void;
|
|
892
|
+
subscribe: (subscribes: Partial<StoreListeners>) => void;
|
|
893
|
+
unsubscribe: () => void;
|
|
894
|
+
}
|
|
895
|
+
export type StoreListeners = {
|
|
896
|
+
[Index in keyof StoreObj]: (params: FetcherValue<CoreStoreInterface[Index]>) => void;
|
|
897
|
+
};
|
|
898
|
+
}
|
|
899
|
+
declare module "../../sdk-web-core/src/deepLink/index" {
|
|
900
|
+
import { MapStore, StreamLayerContext } from '@streamlayer/sdk-web-interfaces';
|
|
901
|
+
type DeepLinkContextData = {
|
|
902
|
+
handled?: boolean;
|
|
903
|
+
parsed?: boolean;
|
|
904
|
+
used?: boolean;
|
|
905
|
+
data?: DeepLinkUrlParams;
|
|
906
|
+
};
|
|
907
|
+
export type DeepLinkCallback = (deepLinkData: DeepLinkContextData['data']) => void;
|
|
908
|
+
export interface DeepLinkContext {
|
|
909
|
+
$store: DeepLinkContextStore;
|
|
910
|
+
getDeepLinkData: () => Pick<DeepLinkContextData, 'data' | 'used'>;
|
|
911
|
+
deepLinkUsed: (inviterId: string) => void;
|
|
912
|
+
onDeepLinkHandlers: Set<DeepLinkCallback>;
|
|
913
|
+
}
|
|
914
|
+
export type DeepLinkContextStore = MapStore<DeepLinkContextData>;
|
|
915
|
+
module '@streamlayer/sdk-web-interfaces' {
|
|
916
|
+
interface StreamLayerContext {
|
|
917
|
+
deepLink: DeepLinkContext;
|
|
918
|
+
}
|
|
919
|
+
interface StreamLayerSDK {
|
|
920
|
+
addDeepLinkHandler: (cb: DeepLinkCallback) => void;
|
|
921
|
+
removeDeepLinkHandler: (cb: DeepLinkCallback) => void;
|
|
922
|
+
getInviter: () => string | undefined;
|
|
923
|
+
inviteDisplayed: () => void;
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
export const DEEP_LINK_PREFIX = "sldl";
|
|
927
|
+
export const DEEP_LINK_USER_ID = "sldl_uid";
|
|
928
|
+
export const DEEP_LINK_EVENT_ID = "sldl_eid";
|
|
929
|
+
export const DEEP_LINK_EXTERNAL_EVENT_ID = "sldl_e_eid";
|
|
930
|
+
export type DeepLinkUrlParams = {
|
|
931
|
+
[DEEP_LINK_USER_ID]?: string;
|
|
932
|
+
[DEEP_LINK_EVENT_ID]?: string;
|
|
933
|
+
[DEEP_LINK_EXTERNAL_EVENT_ID]?: string;
|
|
934
|
+
};
|
|
935
|
+
/**
|
|
936
|
+
* Bypass authorization, used for login with external token.
|
|
937
|
+
* Automatically login user if SDK initialized and READY.
|
|
938
|
+
*/
|
|
939
|
+
export const deepLink: (instance: StreamLayerContext, opts: {
|
|
940
|
+
onDeepLinkHandled?: DeepLinkCallback;
|
|
941
|
+
}, done: () => void) => void;
|
|
942
|
+
}
|
|
943
|
+
declare module "../../sdk-web-core/src/auth/bypass/index" {
|
|
944
|
+
import { AbstractAuthenticationProvider } from '@streamlayer/sdk-web-interfaces';
|
|
945
|
+
import { Transport } from '@streamlayer/sdk-web-api';
|
|
946
|
+
import { CoreStore } from "../../sdk-web-core/src/store/store";
|
|
947
|
+
import { DeepLinkContext } from "../../sdk-web-core/src/deepLink/index";
|
|
948
|
+
/**
|
|
949
|
+
* An authorization service manages user access by providing login, logout,
|
|
950
|
+
* authentication checks, and the ability to revoke access.
|
|
951
|
+
* Subscribed to $userStore and automatically updates the auth header for the Transport.
|
|
952
|
+
*/
|
|
953
|
+
export class BypassAuth extends AbstractAuthenticationProvider {
|
|
954
|
+
private readonly $coreStore;
|
|
955
|
+
private readonly deepLink;
|
|
956
|
+
private readonly transport;
|
|
957
|
+
private readonly bypassLogin;
|
|
958
|
+
constructor(store: CoreStore, transport: Transport, deepLink: DeepLinkContext);
|
|
959
|
+
me: () => Promise<import("@streamlayer/sl-eslib/users/users_common_pb").User | undefined>;
|
|
960
|
+
/**
|
|
961
|
+
* Login user by token and schema.
|
|
962
|
+
* On success, save the user and update the token to the Transport, UserStore and cache.
|
|
963
|
+
* @param schema - schema created by the host app and provided to the StreamLayer SDK.
|
|
964
|
+
* @param userKey - user token received from the host app.
|
|
965
|
+
*/
|
|
966
|
+
login: (schema: string, userKey: string) => Promise<string>;
|
|
967
|
+
isAuthenticated: () => Promise<import("@streamlayer/sl-eslib/users/users_common_pb").User | undefined>;
|
|
968
|
+
/**
|
|
969
|
+
* Logout user. Clears the all user data from the store.
|
|
970
|
+
*/
|
|
971
|
+
logout: () => void;
|
|
972
|
+
/**
|
|
973
|
+
* Soft logout, only clears the StreamLayer user data from the store.
|
|
974
|
+
* Does not clear the external token. And automatically tries to re-login by external token.
|
|
975
|
+
*/
|
|
976
|
+
softLogout: () => void;
|
|
977
|
+
/**
|
|
978
|
+
* Try to re-login.
|
|
979
|
+
* - If the user has an token, then try to login by it, by calling the me() method.
|
|
980
|
+
* - If the user has an external token, then try to login by it, by calling the login() method. On failure, logout.
|
|
981
|
+
* -
|
|
982
|
+
* - If no one of the above is true, then logout.
|
|
983
|
+
*/
|
|
984
|
+
reLogin: ({ skipLogin }?: {
|
|
985
|
+
skipLogin: boolean;
|
|
986
|
+
}) => Promise<import("@streamlayer/sl-eslib/users/users_common_pb").User | undefined> | undefined;
|
|
987
|
+
/**
|
|
988
|
+
* Write token to the Transport and UserStore
|
|
989
|
+
*/
|
|
990
|
+
private saveUser;
|
|
991
|
+
/**
|
|
992
|
+
* Add interceptor to the Transport to handle 401 and 403 errors.
|
|
993
|
+
* If the user is logged in (auth header is set), then make a soft logout.
|
|
994
|
+
*/
|
|
995
|
+
private connect;
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
declare module "../../sdk-web-core/src/auth/index" {
|
|
999
|
+
import { StreamLayerContext } from '@streamlayer/sdk-web-interfaces';
|
|
1000
|
+
import { CoreStores, StoreObj } from "../../sdk-web-core/src/store/store";
|
|
1001
|
+
import { UserStorage } from "../../sdk-web-core/src/storage";
|
|
1002
|
+
import { BypassAuth } from "../../sdk-web-core/src/auth/bypass/index";
|
|
1003
|
+
module '@streamlayer/sdk-web-interfaces' {
|
|
1004
|
+
interface StreamLayerSDK {
|
|
1005
|
+
authorizationBypass: (schema: string, userKey: string) => Promise<void>;
|
|
1006
|
+
logout: () => void;
|
|
1007
|
+
getUserStore: () => CoreStores['user'];
|
|
1008
|
+
userId: StoreObj['user']['getAtomStore'];
|
|
1009
|
+
isUserAuthorized: BypassAuth['isAuthenticated'];
|
|
1010
|
+
}
|
|
1011
|
+
interface StreamLayerContext {
|
|
1012
|
+
auth: BypassAuth;
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
export const storage: UserStorage;
|
|
1016
|
+
/**
|
|
1017
|
+
* Bypass authorization, used for login with external token.
|
|
1018
|
+
* Automatically login user if SDK initialized and READY.
|
|
1019
|
+
*/
|
|
1020
|
+
export const bypass: (instance: StreamLayerContext, opts: unknown, done: () => void) => void;
|
|
1021
|
+
}
|
|
1022
|
+
declare module "../../sdk-web-core/src/store/index" {
|
|
1023
|
+
import { StreamLayerContext } from '@streamlayer/sdk-web-interfaces';
|
|
1024
|
+
import { CoreStore, CoreStores, StoreObj } from "../../sdk-web-core/src/store/store";
|
|
1025
|
+
module '@streamlayer/sdk-web-interfaces' {
|
|
1026
|
+
interface StreamLayerSDK {
|
|
1027
|
+
sdkStore: CoreStores;
|
|
1028
|
+
enabled: CoreStores['enabled'];
|
|
1029
|
+
status: CoreStores['status'];
|
|
1030
|
+
organizationStore: () => CoreStores['organizationSettings'];
|
|
1031
|
+
streamStore: () => CoreStores['streamSettings'];
|
|
1032
|
+
streamSummary: () => CoreStores['streamSummary'];
|
|
1033
|
+
}
|
|
1034
|
+
interface ContextConfig {
|
|
1035
|
+
skipOrganizationSettings?: boolean;
|
|
1036
|
+
}
|
|
1037
|
+
interface StreamLayerContext {
|
|
1038
|
+
contextConfig?: ContextConfig;
|
|
1039
|
+
}
|
|
1040
|
+
interface StreamLayerContext {
|
|
1041
|
+
store: CoreStore;
|
|
1042
|
+
stores: StoreObj;
|
|
1043
|
+
storeSubscribe: () => void;
|
|
1044
|
+
storeUnsubscribe: () => void;
|
|
1045
|
+
contextConfig?: ContextConfig;
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
/**
|
|
1049
|
+
* store plugin, connect store to sdk
|
|
1050
|
+
*/
|
|
1051
|
+
export const store: (instance: StreamLayerContext, opts: unknown, done: () => void) => void;
|
|
1052
|
+
}
|
|
1053
|
+
declare module "../../sdk-web-core/src/videoPlayer/index" {
|
|
1054
|
+
import { StreamLayerContext } from '@streamlayer/sdk-web-interfaces';
|
|
1055
|
+
export type VideoPlayerData = {
|
|
1056
|
+
muted?: boolean;
|
|
1057
|
+
play?: boolean;
|
|
1058
|
+
};
|
|
1059
|
+
export type VideoPlayerCallback = (videoPlayerData: VideoPlayerData) => void;
|
|
1060
|
+
export interface VideoPlayerContext {
|
|
1061
|
+
controllers: Set<VideoPlayerCallback>;
|
|
1062
|
+
}
|
|
1063
|
+
module '@streamlayer/sdk-web-interfaces' {
|
|
1064
|
+
interface StreamLayerContext {
|
|
1065
|
+
videoPlayer: VideoPlayerContext;
|
|
1066
|
+
}
|
|
1067
|
+
interface StreamLayerSDK {
|
|
1068
|
+
addVideoPlayerController: (cb: VideoPlayerCallback) => void;
|
|
1069
|
+
removeVideoPlayerController: (cb: VideoPlayerCallback) => void;
|
|
1070
|
+
controlVideoPlayer: VideoPlayerCallback;
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
export const videoPlayer: (instance: StreamLayerContext, opts: {
|
|
1074
|
+
videoPlayerController?: VideoPlayerCallback;
|
|
1075
|
+
}, done: () => void) => void;
|
|
1076
|
+
}
|
|
1077
|
+
declare module "../../sdk-web-core/src/ui/index" {
|
|
1078
|
+
import { createMapStore, StreamLayerContext } from '@streamlayer/sdk-web-interfaces';
|
|
1079
|
+
import { QuestionType } from '@streamlayer/sdk-web-types';
|
|
1080
|
+
export type UIData = {
|
|
1081
|
+
stage: 'activate' | 'deactivate';
|
|
1082
|
+
id: string;
|
|
1083
|
+
isViewed?: boolean;
|
|
1084
|
+
hasNotification?: boolean;
|
|
1085
|
+
type: 'advertisement' | 'insight' | 'poll' | 'trivia' | 'prediction' | 'tweet' | 'question';
|
|
1086
|
+
hasBanner?: boolean;
|
|
1087
|
+
};
|
|
1088
|
+
export type OnContentActivateCallback = (renderData: UIData) => void;
|
|
1089
|
+
export type UIState = {
|
|
1090
|
+
promotionExternalAd?: boolean;
|
|
1091
|
+
promotionSidebar?: boolean;
|
|
1092
|
+
promotionOverlay?: boolean;
|
|
1093
|
+
promotionBanner?: boolean;
|
|
1094
|
+
promotionNotification?: boolean;
|
|
1095
|
+
app?: boolean;
|
|
1096
|
+
appSidebar?: boolean;
|
|
1097
|
+
appNotification?: boolean;
|
|
1098
|
+
appBanner?: boolean;
|
|
1099
|
+
onboardingNotification?: boolean;
|
|
1100
|
+
exposedPauseAd?: boolean;
|
|
1101
|
+
};
|
|
1102
|
+
export interface UIContext {
|
|
1103
|
+
disableApp: () => void;
|
|
1104
|
+
enableApp: () => void;
|
|
1105
|
+
disableAppNotification: () => void;
|
|
1106
|
+
enableAppNotification: () => void;
|
|
1107
|
+
disableOnboardingNotification: () => void;
|
|
1108
|
+
enableOnboardingNotification: () => void;
|
|
1109
|
+
onContentActivate?: OnContentActivateCallback;
|
|
1110
|
+
enableExposedPauseAd: () => void;
|
|
1111
|
+
disableExposedPauseAd: () => void;
|
|
1112
|
+
}
|
|
1113
|
+
module '@streamlayer/sdk-web-interfaces' {
|
|
1114
|
+
interface StreamLayerContext {
|
|
1115
|
+
ui: UIContext;
|
|
1116
|
+
onQuestionActivate: (params: Omit<UIData, 'type'> & {
|
|
1117
|
+
type?: string;
|
|
1118
|
+
questionType?: QuestionType;
|
|
1119
|
+
}) => void;
|
|
1120
|
+
}
|
|
1121
|
+
interface StreamLayerSDK {
|
|
1122
|
+
uiState: ReturnType<typeof createMapStore<UIState>>;
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
export const ui: (instance: StreamLayerContext, opts: {
|
|
1126
|
+
onContentActivate?: OnContentActivateCallback;
|
|
1127
|
+
withAdNotification?: boolean;
|
|
1128
|
+
withAd?: boolean;
|
|
1129
|
+
}, done: () => void) => void;
|
|
1130
|
+
}
|
|
1131
|
+
declare module "../../sdk-web-core/src/index" {
|
|
1132
|
+
import { StreamLayerContext, createMapStore, StreamLayerOptions } from '@streamlayer/sdk-web-interfaces';
|
|
1133
|
+
export { bypass, storage } from "../../sdk-web-core/src/auth/index";
|
|
1134
|
+
export { store } from "../../sdk-web-core/src/store/index";
|
|
1135
|
+
export { deepLink, type DeepLinkUrlParams, type DeepLinkCallback, type DeepLinkContext, DEEP_LINK_PREFIX, DEEP_LINK_USER_ID, DEEP_LINK_EVENT_ID, DEEP_LINK_EXTERNAL_EVENT_ID, } from "../../sdk-web-core/src/deepLink/index";
|
|
1136
|
+
export { videoPlayer, type VideoPlayerCallback } from "../../sdk-web-core/src/videoPlayer/index";
|
|
1137
|
+
export { ui, type UIContext, type OnContentActivateCallback, type UIData } from "../../sdk-web-core/src/ui/index";
|
|
1138
|
+
import "../../sdk-web-core/src/store/index";
|
|
1139
|
+
import "../../sdk-web-core/src/auth/index";
|
|
1140
|
+
module '@streamlayer/sdk-web-interfaces' {
|
|
1141
|
+
interface StreamLayerOptions {
|
|
1142
|
+
friendsTab: 'enabled' | 'disabled' | 'activatedGame';
|
|
1143
|
+
theme?: string;
|
|
1144
|
+
themeMode?: 'light' | 'dark';
|
|
1145
|
+
skipOnboarding?: boolean;
|
|
1146
|
+
hideFriends?: boolean;
|
|
1147
|
+
betPack?: boolean;
|
|
1148
|
+
containerId?: string;
|
|
1149
|
+
parentClassName?: string;
|
|
1150
|
+
}
|
|
1151
|
+
interface StreamLayerSDK {
|
|
1152
|
+
initializeApp: (contextConfig?: ContextConfig) => Promise<{
|
|
1153
|
+
enabled?: boolean;
|
|
1154
|
+
err?: string;
|
|
1155
|
+
}>;
|
|
1156
|
+
disableApp: () => void;
|
|
1157
|
+
createEventSession: (providerStreamId: string, internal?: boolean) => void;
|
|
1158
|
+
withAuth: boolean;
|
|
1159
|
+
options: ReturnType<typeof createMapStore<StreamLayerOptions>>;
|
|
1160
|
+
}
|
|
1161
|
+
interface StreamLayerContext {
|
|
1162
|
+
ready: () => void;
|
|
1163
|
+
}
|
|
1164
|
+
}
|
|
1165
|
+
/**
|
|
1166
|
+
* The main application instance is the core of a application. It includes:
|
|
1167
|
+
* Store: Manages data storage.
|
|
1168
|
+
* Public Methods: Provides a way to interact with the application.
|
|
1169
|
+
* Connect Features: Handles communication between components through store.
|
|
1170
|
+
* Connect Transport: Handles communication with api.
|
|
1171
|
+
* Dependency Injection: Incorporates other necessary instances.
|
|
1172
|
+
* Error Handling: Manages errors and logs them.
|
|
1173
|
+
* Security: Implements authentication and authorization.
|
|
1174
|
+
*/
|
|
1175
|
+
export const core: (instance: StreamLayerContext, opts: StreamLayerOptions, done: () => void) => void;
|
|
1176
|
+
}
|
|
1177
|
+
declare module "app/masters" {
|
|
1178
|
+
import { Component, ErrorInfo } from 'react';
|
|
1179
|
+
import '@streamlayer/react-ui/style.css';
|
|
1180
|
+
export { useStreamLayer } from '@streamlayer/react-ui/core/hooks';
|
|
1181
|
+
export { MastersStreamLayerProvider } from '@streamlayer/react-ui/masters';
|
|
1182
|
+
export class MastersStreamLayerSDKReact extends Component<{
|
|
1183
|
+
betPack?: boolean;
|
|
1184
|
+
useContainer?: boolean;
|
|
1185
|
+
}, {
|
|
1186
|
+
hasError: boolean;
|
|
1187
|
+
}> {
|
|
1188
|
+
constructor(props: {
|
|
1189
|
+
betPack?: boolean;
|
|
1190
|
+
useContainer?: boolean;
|
|
1191
|
+
});
|
|
1192
|
+
static getDerivedStateFromError(): {
|
|
1193
|
+
hasError: boolean;
|
|
1194
|
+
};
|
|
1195
|
+
componentDidCatch(error: Error, info: ErrorInfo): void;
|
|
1196
|
+
render(): import("react/jsx-runtime").JSX.Element | null;
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
declare module "app/auth" {
|
|
1200
|
+
export const StreamLayerLogin: React.FC<{
|
|
1201
|
+
token: string;
|
|
1202
|
+
schema: string;
|
|
1203
|
+
}>;
|
|
1204
|
+
}
|
|
1205
|
+
/// <amd-module name="@streamlayer/react/masters" />
|
|
1206
|
+
declare module "@streamlayer/react/masters" {
|
|
1207
|
+
export * from "app/masters";
|
|
1208
|
+
export * from "app/auth";
|
|
1209
|
+
export { type DeepLinkCallback, type VideoPlayerCallback, type VideoPlayerData, } from '@streamlayer/react-ui/core/provider';
|
|
1210
|
+
export const BetPackStandalone: React.FC<{
|
|
1211
|
+
production?: boolean;
|
|
1212
|
+
}>;
|
|
1213
|
+
export const StreamLayerSDKPoints: () => import("react/jsx-runtime").JSX.Element | null;
|
|
1214
|
+
}
|
|
1215
|
+
declare module "app/notification" {
|
|
1216
|
+
import { StreamLayerSDKNotification as StreamLayerSDKNotificationUI } from '@streamlayer/react-ui/notification';
|
|
1217
|
+
export { StreamLayerSDKNotificationUI };
|
|
1218
|
+
export const StreamLayerSDKNotification: React.FC<{
|
|
1219
|
+
theme?: string;
|
|
1220
|
+
}>;
|
|
1221
|
+
}
|
|
1222
|
+
declare module "index" {
|
|
1223
|
+
export { useStreamLayer, useStreamLayerUI, useStreamLayerTheme } from '@streamlayer/react-ui/core/hooks';
|
|
1224
|
+
export { StreamLayerProvider, type DeepLinkCallback, type VideoPlayerCallback, type VideoPlayerData, type ContentActivateParams, type OnContentActivateCallback, } from '@streamlayer/react-ui/core/provider';
|
|
1225
|
+
export { StreamLayerThemeProvider } from '@streamlayer/react-ui/ui/theme';
|
|
1226
|
+
export { StreamLayerSDKEvent, type StreamLayerSDKEventProps } from '@streamlayer/react-ui/core/event';
|
|
1227
|
+
export { StreamLayerSDKReact } from '@streamlayer/react-ui/core/app';
|
|
1228
|
+
export { StreamLayerSDKNotification, StreamLayerSDKNotificationUI } from "app/notification";
|
|
1229
|
+
}
|
|
1230
|
+
declare module "app/advertisement" {
|
|
1231
|
+
import { StreamLayerSDKAdvertisement as StreamLayerSDKAdvertisementUI } from '@streamlayer/react-ui/advertisement';
|
|
1232
|
+
export type StreamLayerSDKAdvertisementProps = {
|
|
1233
|
+
/**
|
|
1234
|
+
* @deprecated Pass event to StreamLayerProvider or StreamLayerSDKEvent component instead, see docs for more info
|
|
1235
|
+
*/
|
|
1236
|
+
event?: string;
|
|
1237
|
+
theme?: string;
|
|
1238
|
+
sidebar?: 'left' | 'right';
|
|
1239
|
+
banner?: 'top' | 'bottom';
|
|
1240
|
+
isMobileScreen?: boolean;
|
|
1241
|
+
persistent?: boolean;
|
|
1242
|
+
notification?: boolean;
|
|
1243
|
+
skipAutoClose?: boolean;
|
|
1244
|
+
skipTypeCheck?: boolean;
|
|
1245
|
+
externalAd?: boolean;
|
|
1246
|
+
muted?: boolean;
|
|
1247
|
+
};
|
|
1248
|
+
export { StreamLayerSDKAdvertisementUI };
|
|
1249
|
+
export const StreamLayerSDKAdvertisement: React.FC<StreamLayerSDKAdvertisementProps>;
|
|
1250
|
+
}
|
|
1251
|
+
declare module "../../react-ui/src/index" {
|
|
1252
|
+
export { App } from 'app/app';
|
|
1253
|
+
}
|
|
1254
|
+
declare module "app/app" {
|
|
1255
|
+
import type { StreamLayerOptions, StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
|
|
1256
|
+
export const useStreamLayer: () => StreamLayerSDK | null;
|
|
1257
|
+
export const useStreamLayerEvent: () => import("react").MutableRefObject<string> | undefined;
|
|
1258
|
+
export const useStreamLayerTheme: () => Pick<StreamLayerOptions, "theme" | "themeMode">;
|
|
1259
|
+
export const useStreamLayerUI: () => {
|
|
1260
|
+
promotionExternalAd?: boolean;
|
|
1261
|
+
promotionSidebar?: boolean;
|
|
1262
|
+
promotionOverlay?: boolean;
|
|
1263
|
+
promotionNotification?: boolean;
|
|
1264
|
+
promotionBanner?: boolean;
|
|
1265
|
+
app?: boolean;
|
|
1266
|
+
appNotification?: boolean;
|
|
1267
|
+
appSidebar?: boolean;
|
|
1268
|
+
appBanner?: boolean;
|
|
1269
|
+
onboardingNotification?: boolean;
|
|
1270
|
+
};
|
|
1271
|
+
export const StreamLayerSDKReact: React.FC<{
|
|
1272
|
+
event?: string;
|
|
1273
|
+
topNavigation?: boolean;
|
|
1274
|
+
withSidebarNotification?: boolean;
|
|
1275
|
+
muted?: boolean;
|
|
1276
|
+
theme?: string;
|
|
1277
|
+
}>;
|
|
1278
|
+
}
|
|
1279
|
+
declare module "app/insight" {
|
|
1280
|
+
import { StreamLayerSDKInsight as StreamLayerSDKInsightUI } from '@streamlayer/react-ui/insight';
|
|
1281
|
+
export type StreamLayerSDKInsightProps = {
|
|
1282
|
+
/**
|
|
1283
|
+
* @deprecated Pass event to StreamLayerProvider or StreamLayerSDKEvent component instead, see docs for more info
|
|
1284
|
+
*/
|
|
1285
|
+
event?: string;
|
|
1286
|
+
theme?: string;
|
|
1287
|
+
hideHeader?: boolean;
|
|
1288
|
+
persistent?: boolean;
|
|
1289
|
+
skipAutoClose?: boolean;
|
|
1290
|
+
};
|
|
1291
|
+
export { StreamLayerSDKInsightUI };
|
|
1292
|
+
export const StreamLayerSDKInsight: React.FC<StreamLayerSDKInsightProps>;
|
|
1293
|
+
}
|
|
1294
|
+
declare module "app/pause-ad" {
|
|
1295
|
+
import { Component } from 'react';
|
|
1296
|
+
import { VideoPlayerCallback } from '@streamlayer/react-ui/core/provider';
|
|
1297
|
+
export type StreamLayerPauseAdProps = {
|
|
1298
|
+
children?: React.ReactNode;
|
|
1299
|
+
showPauseAd?: boolean;
|
|
1300
|
+
pauseAdVastUrl?: Array<{
|
|
1301
|
+
template?: 'default';
|
|
1302
|
+
url: string;
|
|
1303
|
+
}>;
|
|
1304
|
+
onClosePauseAd?: () => void;
|
|
1305
|
+
videoPlayerController?: VideoPlayerCallback;
|
|
1306
|
+
onRenderPauseAd?: (params: {
|
|
1307
|
+
rendered: boolean;
|
|
1308
|
+
}) => void;
|
|
1309
|
+
options?: {
|
|
1310
|
+
showPauseButton?: boolean;
|
|
1311
|
+
pauseAdDelay?: number;
|
|
1312
|
+
};
|
|
1313
|
+
};
|
|
1314
|
+
export class StreamLayerPauseAd extends Component<StreamLayerPauseAdProps, {
|
|
1315
|
+
hasError: boolean;
|
|
1316
|
+
}> {
|
|
1317
|
+
constructor(props: StreamLayerPauseAdProps);
|
|
1318
|
+
static getDerivedStateFromError(): {
|
|
1319
|
+
hasError: boolean;
|
|
1320
|
+
};
|
|
1321
|
+
componentDidCatch(error: Error, info: React.ErrorInfo): void;
|
|
1322
|
+
render(): string | number | boolean | import("react/jsx-runtime").JSX.Element | Iterable<import("react").ReactNode> | null | undefined;
|
|
1323
|
+
}
|
|
1324
|
+
}
|
|
1325
|
+
declare module "app/points" {
|
|
1326
|
+
export const StreamLayerSDKPoints: React.FC<{
|
|
1327
|
+
theme?: string;
|
|
1328
|
+
}>;
|
|
1329
|
+
}
|
|
1330
|
+
declare module "app/useStreamLayerApp" {
|
|
1331
|
+
export { useStreamLayerApp } from '@streamlayer/react-ui/useStreamLayerApp';
|
|
1332
|
+
}
|