@lumiastream/ui 0.2.8-alpha.8 → 0.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,106 @@
1
+ declare const MEDIA_PREVIEW_USER_LEVEL_VALUES: readonly ["streamer", "moderators", "vips", "tier3", "tier2", "subscribers", "regular", "follower", "anyone"];
2
+ type MediaPreviewUserLevel = (typeof MEDIA_PREVIEW_USER_LEVEL_VALUES)[number];
3
+ type ChatboxMediaPreviewKind = 'image' | 'video' | 'audio' | 'youtube' | 'youtubeShort' | 'spotify';
4
+ type ChatboxMediaPreview = {
5
+ kind: ChatboxMediaPreviewKind;
6
+ src: string;
7
+ title?: string;
8
+ };
9
+ type MessageLinkPart = {
10
+ text: string;
11
+ url?: string;
12
+ };
13
+ type ChatMessageToken = {
14
+ type: 'text';
15
+ text: string;
16
+ } | {
17
+ type: 'link';
18
+ text: string;
19
+ url: string;
20
+ } | {
21
+ type: 'media';
22
+ text: string;
23
+ url: string;
24
+ media: ChatboxMediaPreview;
25
+ };
26
+ type MediaPreviewRoleSettings = {
27
+ previewMediaForViewers: boolean;
28
+ previewMediaForSubscribers: boolean;
29
+ previewMediaForVips: boolean;
30
+ previewMediaForModerators: boolean;
31
+ previewMediaForStreamer: boolean;
32
+ previewMediaForTier3: boolean;
33
+ previewMediaForTier2: boolean;
34
+ previewMediaForRegular: boolean;
35
+ previewMediaForFollower: boolean;
36
+ previewMediaForAnyone: boolean;
37
+ };
38
+ type MediaPreviewRoleSettingsInput = Partial<Record<keyof MediaPreviewRoleSettings, unknown>> & {
39
+ previewMediaUserLevels?: unknown;
40
+ };
41
+ type ChatMessageTokenizationOptions = {
42
+ hyperClickableLinks?: boolean;
43
+ previewMediaInChat?: boolean;
44
+ };
45
+ type ChatterProfileUrlInput = {
46
+ platform?: unknown;
47
+ username?: unknown;
48
+ displayname?: unknown;
49
+ userId?: unknown;
50
+ };
51
+ type ChatMessageEmoteStore = {
52
+ ffz?: Record<string, string>;
53
+ bttv?: Record<string, string>;
54
+ seventv?: Record<string, string>;
55
+ };
56
+ type ChatMessageContentItem = string | {
57
+ id: string;
58
+ urls: string[];
59
+ key: string;
60
+ } | {
61
+ id: string;
62
+ type: 'cheer';
63
+ roundedAmount: number;
64
+ cheerAmount: number;
65
+ bitColor: string;
66
+ key: string;
67
+ };
68
+ type BuildChatMessageContentOptions = {
69
+ message?: string;
70
+ replaceWord?: string;
71
+ filteredWordsRegex?: RegExp;
72
+ emotesRaw?: string;
73
+ emotesPack?: Record<string, any> | any[];
74
+ origin?: string;
75
+ emoteParserType?: string;
76
+ isCheer?: boolean;
77
+ storeEmotes?: ChatMessageEmoteStore;
78
+ youtubeEmotes?: Record<string, string>;
79
+ allowParserTypes?: string[];
80
+ };
81
+ type ChatterProfileResolverPayload = {
82
+ username?: string;
83
+ displayname?: string;
84
+ userId?: string;
85
+ platform?: string;
86
+ extraSettings?: Record<string, any>;
87
+ };
88
+ type ChatterProfileResolver = (payload: ChatterProfileResolverPayload) => Promise<unknown> | unknown;
89
+ type ResolveChatterProfileUrlWithResolversInput = ChatterProfileUrlInput & {
90
+ extraSettings?: Record<string, any>;
91
+ resolvers?: Array<ChatterProfileResolver | null | undefined>;
92
+ };
93
+ declare const parseMessageLinks: (value: string) => MessageLinkPart[];
94
+ declare const tokenizeChatMessage: (value: string, options?: ChatMessageTokenizationOptions) => ChatMessageToken[];
95
+ declare const buildChatMessageContent: ({ message, replaceWord, filteredWordsRegex, emotesRaw, emotesPack, origin, emoteParserType, isCheer, storeEmotes, youtubeEmotes, allowParserTypes, }: BuildChatMessageContentOptions) => ChatMessageContentItem[];
96
+ declare const resolveMediaPreviewSetting: (value: unknown, fallback: boolean) => boolean;
97
+ declare const normalizeMediaPreviewUserLevels: (value: unknown) => MediaPreviewUserLevel[];
98
+ declare const resolveMediaPreviewRoleSettings: (settings: MediaPreviewRoleSettingsInput) => MediaPreviewRoleSettings;
99
+ declare const getNormalizedUserLevels: (value: unknown) => Record<string, boolean>;
100
+ declare const isMediaPreviewAllowedForUser: (userLevelsRaw: unknown, roleSettings: MediaPreviewRoleSettings) => boolean;
101
+ declare const getMediaPreviewFromUrl: (url: string) => ChatboxMediaPreview | null;
102
+ declare const resolvePlatformChatterProfileUrl: ({ platform, username, displayname, userId }: ChatterProfileUrlInput) => string | null;
103
+ declare const normalizeHttpUrl: (value: unknown) => string | null;
104
+ declare const resolveChatterProfileUrlWithResolvers: ({ platform, username, displayname, userId, extraSettings, resolvers, }: ResolveChatterProfileUrlWithResolversInput) => Promise<string | null>;
105
+
106
+ export { type BuildChatMessageContentOptions, type ChatMessageContentItem, type ChatMessageEmoteStore, type ChatMessageToken, type ChatMessageTokenizationOptions, type ChatboxMediaPreview, type ChatboxMediaPreviewKind, type ChatterProfileResolver, type ChatterProfileResolverPayload, type ChatterProfileUrlInput, MEDIA_PREVIEW_USER_LEVEL_VALUES, type MediaPreviewRoleSettings, type MediaPreviewRoleSettingsInput, type MediaPreviewUserLevel, type MessageLinkPart, type ResolveChatterProfileUrlWithResolversInput, buildChatMessageContent, getMediaPreviewFromUrl, getNormalizedUserLevels, isMediaPreviewAllowedForUser, normalizeHttpUrl, normalizeMediaPreviewUserLevels, parseMessageLinks, resolveChatterProfileUrlWithResolvers, resolveMediaPreviewRoleSettings, resolveMediaPreviewSetting, resolvePlatformChatterProfileUrl, tokenizeChatMessage };