@engagently/types 2.2.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.
@@ -0,0 +1,54 @@
1
+ import type { PaletteConfig } from '../../ui/themes/config';
2
+ import type { ColorSchemesConfig, AvailableThemes } from '../../ui/themes/_types';
3
+ import type { Resource } from 'i18next';
4
+ import type { CombinedError, Operation } from '@urql/preact';
5
+ import type { EgyEntities, MessageEvents } from './WidgetDefinitions';
6
+ import type { DsmFeatureName, PlmFeatureName } from '../lib/api/enums';
7
+ export type CallbackFn = (data: {
8
+ from: EgyEntities;
9
+ type?: string;
10
+ payload?: unknown;
11
+ }) => void;
12
+ export type ErrorCallbackFn = (error: CombinedError, operation: Operation) => void;
13
+ export type EventHooks = 'onAny' | 'onChangeViewMode' | 'onLoadMoreComments' | 'onLoadMoreReplies';
14
+ export declare const EventHookMessageEventMap: Record<EventHooks, MessageEvents | MessageEvents[]>;
15
+ /**
16
+ * Definition for the configuration that the client will pass when
17
+ * initializing engagently
18
+ */
19
+ export interface EngageConfig {
20
+ communityId: string;
21
+ token?: string;
22
+ strategy?: string;
23
+ anonymous?: boolean;
24
+ palette?: PaletteConfig;
25
+ theme?: `${AvailableThemes}`;
26
+ defaultLanguage?: string;
27
+ translations?: Resource;
28
+ dev?: boolean;
29
+ colorScheme?: `${ColorSchemesConfig}`;
30
+ cta?: Partial<Record<DsmFeatureName | PlmFeatureName, CallbackFn>>;
31
+ error?: ErrorCallbackFn;
32
+ events?: Partial<Record<EventHooks, CallbackFn>>;
33
+ }
34
+ /**
35
+ * Definition for the configuration related to the current community
36
+ */
37
+ export type CommunityConfig = {
38
+ Appearance: {
39
+ logo_url: string | null;
40
+ title: string | null;
41
+ url: string | null;
42
+ } | null;
43
+ CommunityId: string | null;
44
+ ServiceId: string | null;
45
+ Config?: {
46
+ poll: {
47
+ settings: Record<string, number>;
48
+ };
49
+ discussion: {
50
+ settings: Record<CommentarySetting, number>;
51
+ };
52
+ } | null;
53
+ };
54
+ export type CommentarySetting = 'COMMENTARY_MAX_LENGTH' | 'COMMENTARY_PREVIEW_LENGTH' | 'THREAD_MORE_COMMENTS_SIZE' | 'THREAD_REPLIES_SIZE' | 'THREAD_COMMENTS_SIZE' | 'THREAD_MORE_REPLIES_SIZE' | 'LIST_COMMENTARIES_SIZE' | 'LIST_MORE_COMMENTARIES_SIZE';
@@ -0,0 +1,117 @@
1
+ /**
2
+ * Type Definitions for all available entities
3
+ *
4
+ * Includes widget tag name, attributes and configuration options, this is used
5
+ * anywhere a component is defined as a single source of truth, and ensures
6
+ * that the loading scripts have the same types as the widgets themselves.
7
+ *
8
+ * When adding a new widget, make sure to update the types package!
9
+ */
10
+ export declare enum EgyEntities {
11
+ EGY_TS = "engagently.ts",
12
+ EGY_DISCUSSION = "egy-discussion",
13
+ EGY_POLL = "egy-poll"
14
+ }
15
+ export type EgyEntitiesValues = `${EgyEntities}`;
16
+ /**
17
+ * MAKE SURE TO UPDATE THE TYPES IN THE FOLLOWING PLACES WHEN CHANGING ATTRS:
18
+ * - DiscussionAttributesHTMLElement
19
+ * - DiscussionAttributesComponent
20
+ */
21
+ export declare enum DiscussionAttributes {
22
+ DISCUSSION_ID = "discussionId",
23
+ SCROLL_CONTAINER_ID = "scrollContainerId",
24
+ DISCUSSION_TITLE = "discussionTitle",
25
+ SIGNATURE = "signature",
26
+ URL = "url",
27
+ IS_LIVE = "isLive",
28
+ IMAGE_URL = "imageUrl"
29
+ }
30
+ export type DiscussionAttributesHTMLElement = {
31
+ 'discussion-id': string;
32
+ 'scroll-container-id'?: string;
33
+ 'discussion-title'?: string;
34
+ signature?: string;
35
+ url?: string;
36
+ 'is-live'?: string;
37
+ 'image-url'?: string;
38
+ };
39
+ export type DiscussionAttributesComponent = {
40
+ discussionId: string;
41
+ scrollContainerId?: string;
42
+ discussionTitle?: string;
43
+ signature?: string;
44
+ url?: string;
45
+ isLive?: string;
46
+ imageUrl?: string;
47
+ };
48
+ export declare enum DiscussionSlots {
49
+ REPLY_ICON = "replyIcon",
50
+ REACTION1 = "reaction1",
51
+ REACTION1_active = "reaction1_active",
52
+ REACTION2 = "reaction2",
53
+ REACTION2_active = "reaction2_active",
54
+ REACTION3 = "reaction3",
55
+ REACTION3_active = "reaction3_active",
56
+ WELCOME_MESSAGE = "welcome"
57
+ }
58
+ export interface DiscussionWidget {
59
+ name: EgyEntities.EGY_DISCUSSION;
60
+ slots: Array<`${DiscussionSlots}`>;
61
+ attributes: Array<`${DiscussionAttributes}`>;
62
+ }
63
+ /**
64
+ * MAKE SURE TO UPDATE THE TYPES IN THE FOLLOWING PLACES WHEN CHANGING ATTRS:
65
+ * - PollAttributesHTMLElement
66
+ * - PollAttributesComponent
67
+ */
68
+ export declare enum PollAttributes {
69
+ POLL_ID = "pollId",
70
+ TYPE = "type"
71
+ }
72
+ export type PollAttributesHTMLElement = {
73
+ 'poll-id': string;
74
+ type?: string;
75
+ };
76
+ export type PollAttributesComponent = {
77
+ pollId: string;
78
+ type?: string;
79
+ };
80
+ export declare enum PollSlots {
81
+ ICON = "icon"
82
+ }
83
+ export interface PollWidget {
84
+ name: EgyEntities.EGY_POLL;
85
+ attributes: Array<`${PollAttributes}`>;
86
+ slots: Array<`${PollSlots}`>;
87
+ }
88
+ /**
89
+ * Events that can be used by the pub/sub implementation for window.postMessage
90
+ */
91
+ export type MessageEvents = 'EGY_SIGN_IN' | 'EGY_SIGN_OUT' | 'EGY_SIGNED_OUT' | 'EGY_AUTHENTICATED' | 'EGY_AUTHENTICATION_FAILED' | 'EGY_TOGGLE_COLOR_SCHEME' | 'EGY_CHANGE_LANGUAGE' | 'EGY_CHANGE_VIEW_MODE' | 'EGY_LOAD_MORE_COMMENTS' | 'EGY_LOAD_MORE_REPLIES';
92
+ export declare const EGY_AUTH = "egy_auth";
93
+ export type EgyAuth = {
94
+ accessToken: string;
95
+ expiresAt: string;
96
+ anonymous: boolean;
97
+ };
98
+ export type ChangeLanguagePayload = {
99
+ language: string;
100
+ };
101
+ export type ToggleColorSchemePayload = {
102
+ mode: string;
103
+ };
104
+ /**
105
+ * Will convert an array type -> ["foo", "bar"] as keys for an object type
106
+ * requiring strings -> { foo: string; bar: string }
107
+ */
108
+ export type AttributesToComponentProps<T extends Array<string>> = {
109
+ [Key in T[number]]: string;
110
+ };
111
+ /**
112
+ * Will convert an array type -> ["foo", "bar"] as keys for an object type
113
+ * requiring React Elements -> { foo: JSX.Element; bar: JSX.Element }
114
+ */
115
+ export type SlotsToComponentProps<T extends Array<string>> = {
116
+ [Key in T[number]]: HTMLElement;
117
+ };
@@ -0,0 +1,56 @@
1
+ export declare enum DsmCommentariesSort {
2
+ CreatedAtAsc = "CREATED_AT_ASC",
3
+ CreatedAtDesc = "CREATED_AT_DESC"
4
+ }
5
+ export declare enum DsmDiscussionState {
6
+ Archived = "ARCHIVED",
7
+ Closed = "CLOSED",
8
+ Open = "OPEN"
9
+ }
10
+ export declare enum DsmFeatureName {
11
+ Comment = "COMMENT",
12
+ CommentaryRead = "COMMENTARY_READ",
13
+ Profile = "PROFILE",
14
+ Reaction = "REACTION",
15
+ Reply = "REPLY",
16
+ Report = "REPORT",
17
+ Share = "SHARE"
18
+ }
19
+ export declare enum DsmReactionName {
20
+ Reaction1 = "REACTION1",
21
+ Reaction2 = "REACTION2",
22
+ Reaction3 = "REACTION3"
23
+ }
24
+ export declare enum DsmViewName {
25
+ Featured = "FEATURED",
26
+ List = "LIST",
27
+ Live = "LIVE",
28
+ Share = "SHARE",
29
+ Thread = "THREAD"
30
+ }
31
+ export declare enum PlmFeatureName {
32
+ SimpleResult = "SIMPLE_RESULT",
33
+ SimpleVote = "SIMPLE_VOTE"
34
+ }
35
+ export declare enum PageStatus {
36
+ Empty = "EMPTY",
37
+ Full = "FULL",
38
+ Partial = "PARTIAL"
39
+ }
40
+ export declare enum UserFlag {
41
+ Anonymous = "ANONYMOUS",
42
+ Any = "ANY",
43
+ Authenticated = "AUTHENTICATED",
44
+ Eligible = "ELIGIBLE",
45
+ Paid = "PAID",
46
+ Sanctioned = "SANCTIONED"
47
+ }
48
+ export declare enum UserPenalty {
49
+ Block = "BLOCK",
50
+ Mute = "MUTE",
51
+ Suspend = "SUSPEND"
52
+ }
53
+ export declare enum UserRole {
54
+ Moderator = "MODERATOR",
55
+ Staff = "STAFF"
56
+ }
@@ -0,0 +1 @@
1
+
@@ -0,0 +1 @@
1
+ (function(n){typeof define=="function"&&define.amd?define(n):n()})(function(){"use strict"});
@@ -0,0 +1,432 @@
1
+ import i18n from 'i18next';
2
+ export declare const defaultResources: {
3
+ de: {
4
+ common: {
5
+ account: {
6
+ account: string;
7
+ bookmarks: string;
8
+ "last-active": string;
9
+ "member-since": string;
10
+ profile: string;
11
+ "profile-not-public": string;
12
+ "recent-activity": string;
13
+ settings: string;
14
+ };
15
+ actions: {
16
+ bookmarked: string;
17
+ cancel: string;
18
+ close: string;
19
+ "create-bookmark": string;
20
+ delete: string;
21
+ "delete-bookmark": string;
22
+ edit: string;
23
+ "open-discussion": string;
24
+ "go-to-discussion": string;
25
+ moderation: string;
26
+ na: string;
27
+ report: string;
28
+ reported: string;
29
+ save: string;
30
+ send: string;
31
+ share: string;
32
+ "show-all-comments": string;
33
+ view: string;
34
+ };
35
+ and: string;
36
+ comment: string;
37
+ "comment-in-thread": string;
38
+ comment_other: string;
39
+ commentary: string;
40
+ commentary_other: string;
41
+ "copy-to-clipboard": string;
42
+ "date-and-time": string;
43
+ "featured-comment": string;
44
+ live: string;
45
+ "load-more": string;
46
+ "load-newer-comments": string;
47
+ "load-older-comments": string;
48
+ reply: string;
49
+ "reply-do": string;
50
+ reply_other: string;
51
+ "reply-count": string;
52
+ "reply-count_other": string;
53
+ "shared-comment": string;
54
+ user: {
55
+ bio: string;
56
+ name: string;
57
+ "private-profile": string;
58
+ };
59
+ vote: string;
60
+ vote_other: string;
61
+ };
62
+ discussions: {
63
+ alerts: {
64
+ "featured-comments-only": {
65
+ message: string;
66
+ title_one: string;
67
+ title_other: string;
68
+ };
69
+ limit: {
70
+ message: string;
71
+ };
72
+ "no-bookmarks": {
73
+ message: string;
74
+ title: string;
75
+ };
76
+ "no-comments": {
77
+ message: string;
78
+ title: string;
79
+ };
80
+ };
81
+ "comment-as": string;
82
+ "commentary-not-available": string;
83
+ filters: {
84
+ CREATED_AT_ASC: {
85
+ description: string;
86
+ header: string;
87
+ title: string;
88
+ };
89
+ CREATED_AT_DESC: {
90
+ description: string;
91
+ header: string;
92
+ title: string;
93
+ };
94
+ LIST: {
95
+ description: string;
96
+ header: string;
97
+ title: string;
98
+ };
99
+ THREAD: {
100
+ description: string;
101
+ header: string;
102
+ title: string;
103
+ };
104
+ sort: string;
105
+ };
106
+ labels: {
107
+ "sort-comments": string;
108
+ };
109
+ "live-controls": {
110
+ pause: string;
111
+ resume: string;
112
+ };
113
+ "new-commentary": string;
114
+ "new-commentary_other": string;
115
+ "no-more-comments": string;
116
+ "no-recent-comments": string;
117
+ placeholders: {
118
+ "new-commentary": string;
119
+ "new-reply": string;
120
+ };
121
+ reactions: {
122
+ REACTION1: string;
123
+ REACTION2: string;
124
+ REACTION3: string;
125
+ };
126
+ "reply-as": string;
127
+ "reply-to": string;
128
+ "show-less": string;
129
+ "show-more": string;
130
+ "view-modes": {
131
+ "all-comments": string;
132
+ featured: string;
133
+ focus: string;
134
+ list: string;
135
+ live: string;
136
+ thread: string;
137
+ };
138
+ };
139
+ emojis: {
140
+ categories: {
141
+ people: string;
142
+ nature: string;
143
+ foods: string;
144
+ activity: string;
145
+ places: string;
146
+ objects: string;
147
+ symbols: string;
148
+ flags: string;
149
+ };
150
+ choose: string;
151
+ "recently-used": string;
152
+ search: string;
153
+ };
154
+ features: {
155
+ COMMENT: {
156
+ "call-to-action": string;
157
+ };
158
+ COMMENTARY_READ: {
159
+ "call-to-action": string;
160
+ };
161
+ PROFILE: {
162
+ "call-to-action": string;
163
+ };
164
+ REACTION: {
165
+ "call-to-action": string;
166
+ };
167
+ REPLY: {
168
+ "call-to-action": string;
169
+ };
170
+ REPORT: {
171
+ "call-to-action": string;
172
+ };
173
+ SHARE: {
174
+ "call-to-action": string;
175
+ };
176
+ SIMPLE_RESULT: {
177
+ "call-to-action": string;
178
+ };
179
+ SIMPLE_VOTE: {
180
+ "call-to-action": string;
181
+ };
182
+ };
183
+ interpolation: {
184
+ comment: string;
185
+ "comment-do": string;
186
+ comments: string;
187
+ conversation: string;
188
+ conversations: string;
189
+ discussion: string;
190
+ discussions: string;
191
+ list: string;
192
+ lists: string;
193
+ message: string;
194
+ messages: string;
195
+ poll: string;
196
+ polls: string;
197
+ replies: string;
198
+ reply: string;
199
+ "reply-do": string;
200
+ "sub-thread": string;
201
+ "sub-threads": string;
202
+ thread: string;
203
+ threads: string;
204
+ vote: string;
205
+ votes: string;
206
+ };
207
+ messages: {
208
+ "discussion-closed": string;
209
+ "log-in-to-comment": string;
210
+ "user-suspended": string;
211
+ };
212
+ poll: {
213
+ "thank-you-for-vote": string;
214
+ };
215
+ };
216
+ en: {
217
+ common: {
218
+ account: {
219
+ account: string;
220
+ bookmarks: string;
221
+ "last-active": string;
222
+ "member-since": string;
223
+ profile: string;
224
+ "profile-not-public": string;
225
+ "recent-activity": string;
226
+ settings: string;
227
+ "sign-in": string;
228
+ "sign-out": string;
229
+ };
230
+ actions: {
231
+ bookmarked: string;
232
+ cancel: string;
233
+ close: string;
234
+ "create-bookmark": string;
235
+ delete: string;
236
+ "delete-bookmark": string;
237
+ edit: string;
238
+ "open-discussion": string;
239
+ "go-to-discussion": string;
240
+ moderation: string;
241
+ na: string;
242
+ report: string;
243
+ reported: string;
244
+ save: string;
245
+ send: string;
246
+ share: string;
247
+ "show-all-comments": string;
248
+ view: string;
249
+ };
250
+ and: string;
251
+ comment: string;
252
+ "comment-in-thread": string;
253
+ comment_other: string;
254
+ commentary: string;
255
+ commentary_other: string;
256
+ "copy-to-clipboard": string;
257
+ "date-and-time": string;
258
+ "featured-comment": string;
259
+ live: string;
260
+ "load-more": string;
261
+ "load-newer-comments": string;
262
+ "load-older-comments": string;
263
+ reply: string;
264
+ "reply-do": string;
265
+ reply_other: string;
266
+ "reply-count": string;
267
+ "reply-count_other": string;
268
+ "shared-comment": string;
269
+ user: {
270
+ bio: string;
271
+ name: string;
272
+ "private-profile": string;
273
+ };
274
+ vote: string;
275
+ vote_other: string;
276
+ };
277
+ discussions: {
278
+ alerts: {
279
+ "featured-comments-only": {
280
+ message: string;
281
+ title_one: string;
282
+ title_other: string;
283
+ };
284
+ limit: {
285
+ message: string;
286
+ };
287
+ "no-bookmarks": {
288
+ message: string;
289
+ title: string;
290
+ };
291
+ "no-comments": {
292
+ message: string;
293
+ title: string;
294
+ };
295
+ };
296
+ "comment-as": string;
297
+ "commentary-not-available": string;
298
+ filters: {
299
+ CREATED_AT_ASC: {
300
+ description: string;
301
+ header: string;
302
+ title: string;
303
+ };
304
+ CREATED_AT_DESC: {
305
+ description: string;
306
+ header: string;
307
+ title: string;
308
+ };
309
+ LIST: {
310
+ description: string;
311
+ header: string;
312
+ title: string;
313
+ };
314
+ THREAD: {
315
+ description: string;
316
+ header: string;
317
+ title: string;
318
+ };
319
+ sort: string;
320
+ };
321
+ labels: {
322
+ "sort-comments": string;
323
+ };
324
+ "live-controls": {
325
+ pause: string;
326
+ resume: string;
327
+ };
328
+ "new-commentary": string;
329
+ "new-commentary_other": string;
330
+ "no-more-comments": string;
331
+ "no-recent-comments": string;
332
+ placeholders: {
333
+ "new-commentary": string;
334
+ "new-reply": string;
335
+ };
336
+ reactions: {
337
+ REACTION1: string;
338
+ REACTION2: string;
339
+ REACTION3: string;
340
+ };
341
+ "reply-as": string;
342
+ "reply-to": string;
343
+ "show-less": string;
344
+ "show-more": string;
345
+ "view-modes": {
346
+ "all-comments": string;
347
+ featured: string;
348
+ focus: string;
349
+ list: string;
350
+ live: string;
351
+ thread: string;
352
+ };
353
+ };
354
+ emojis: {
355
+ categories: {
356
+ people: string;
357
+ nature: string;
358
+ foods: string;
359
+ activity: string;
360
+ places: string;
361
+ objects: string;
362
+ symbols: string;
363
+ flags: string;
364
+ };
365
+ choose: string;
366
+ "recently-used": string;
367
+ search: string;
368
+ };
369
+ features: {
370
+ COMMENT: {
371
+ "call-to-action": string;
372
+ };
373
+ COMMENTARY_READ: {
374
+ "call-to-action": string;
375
+ };
376
+ PROFILE: {
377
+ "call-to-action": string;
378
+ };
379
+ REACTION: {
380
+ "call-to-action": string;
381
+ };
382
+ REPLY: {
383
+ "call-to-action": string;
384
+ };
385
+ REPORT: {
386
+ "call-to-action": string;
387
+ };
388
+ SHARE: {
389
+ "call-to-action": string;
390
+ };
391
+ SIMPLE_RESULT: {
392
+ "call-to-action": string;
393
+ };
394
+ SIMPLE_VOTE: {
395
+ "call-to-action": string;
396
+ };
397
+ };
398
+ interpolation: {
399
+ comment: string;
400
+ "comment-do": string;
401
+ comments: string;
402
+ conversation: string;
403
+ conversations: string;
404
+ discussion: string;
405
+ discussions: string;
406
+ list: string;
407
+ lists: string;
408
+ message: string;
409
+ messages: string;
410
+ poll: string;
411
+ polls: string;
412
+ replies: string;
413
+ reply: string;
414
+ "reply-do": string;
415
+ "sub-thread": string;
416
+ "sub-threads": string;
417
+ thread: string;
418
+ threads: string;
419
+ vote: string;
420
+ votes: string;
421
+ };
422
+ messages: {
423
+ "discussion-closed": string;
424
+ "log-in-to-comment": string;
425
+ "user-suspended": string;
426
+ };
427
+ poll: {
428
+ "thank-you-for-vote": string;
429
+ };
430
+ };
431
+ };
432
+ export default i18n;
@@ -0,0 +1,11 @@
1
+ import type { CommunityConfig, EngageConfig } from '../../common/_types/ConfigDefinition';
2
+ export type Engagently = Partial<{
3
+ config: EngageConfig;
4
+ communityConfig: DeepPartial<CommunityConfig>;
5
+ changeLanguage: (languageCode: string) => void;
6
+ toggleColorScheme: (mode: 'auto' | 'dark' | 'light') => void;
7
+ }> & {
8
+ Configuration: (config: EngageConfig) => Promise<EngageConfig>;
9
+ };
10
+ declare const main: void;
11
+ export default main;
@@ -0,0 +1,72 @@
1
+ import type { HTMLAttributes } from 'vue';
2
+
3
+ import type { Engagently } from '../main/lib/engagently';
4
+ import type {
5
+ DiscussionAttributesHTMLElement,
6
+ PollAttributesHTMLElement,
7
+ DiscussionAttributesComponent,
8
+ PollAttributesComponent,
9
+ } from '../common/_types/WidgetDefinitions';
10
+
11
+ declare const webkit: Webkit;
12
+
13
+ declare module 'vue' {
14
+ export interface GlobalComponents {
15
+ EgyDiscussion: HTMLAttributes & DiscussionAttributesComponent;
16
+ EgyPoll: HTMLAttributes & PollAttributesComponent;
17
+ }
18
+ }
19
+
20
+ declare global {
21
+ type DeepPartial<T> = T extends object
22
+ ? {
23
+ [P in keyof T]?: DeepPartial<T[P]>;
24
+ }
25
+ : T;
26
+
27
+ namespace JSX {
28
+ interface IntrinsicElements {
29
+ 'egy-discussion': React.DetailedHTMLProps<
30
+ React.HTMLAttributes<HTMLElement> & DiscussionAttributesHTMLElement,
31
+ HTMLElement
32
+ >;
33
+ 'egy-poll': React.DetailedHTMLProps<
34
+ React.HTMLAttributes<HTMLElement> & PollAttributesHTMLElement,
35
+ HTMLElement
36
+ >;
37
+ }
38
+ }
39
+
40
+ interface Window {
41
+ engagently?: Engagently;
42
+ initEngagently?: () => void;
43
+ webkit: Webkit;
44
+ /**
45
+ * A convenience API that we seem to expose in iOS.
46
+ * Not sure whether Android does the same.
47
+ * @see: https://github.com/react-native-community/react-native-webview/blob/25552977852427cf5fdc7b233fd1bbc7c77c18b0/ios/RNCWebView.m#L1128-L1146
48
+ */
49
+ ReactNativeWebView: {
50
+ postMessage(msg: string): void;
51
+ };
52
+ }
53
+
54
+ interface Webkit {
55
+ messageHandlers: {
56
+ /**
57
+ * Added due to our call to addScriptMessageHandler.
58
+ * @see: https://github.com/react-native-community/react-native-webview/blob/25552977852427cf5fdc7b233fd1bbc7c77c18b0/ios/RNCWebView.m#L1244
59
+ */
60
+ ReactNativeWebView: {
61
+ postMessage(message: string): void;
62
+ };
63
+ /**
64
+ * Added due to our call to addScriptMessageHandler.
65
+ * @see: https://github.com/react-native-community/react-native-webview/blob/25552977852427cf5fdc7b233fd1bbc7c77c18b0/ios/RNCWebView.m#L214
66
+ */
67
+ ReactNativeHistoryShim: {
68
+ postMessage(message: string): void;
69
+ };
70
+ };
71
+ }
72
+ }
@@ -0,0 +1,9 @@
1
+ export declare enum AvailableThemes {
2
+ default = "default",
3
+ unstyled = "unstyled"
4
+ }
5
+ export declare enum ColorSchemesConfig {
6
+ auto = "auto",
7
+ light = "light",
8
+ dark = "dark"
9
+ }
@@ -0,0 +1,60 @@
1
+ export type ThemePalette = {
2
+ primary: {
3
+ color: string;
4
+ contrast: string;
5
+ };
6
+ secondary: {
7
+ color: string;
8
+ contrast: string;
9
+ };
10
+ background: string;
11
+ error: {
12
+ color: string;
13
+ contrast: string;
14
+ };
15
+ info: {
16
+ color: string;
17
+ contrast: string;
18
+ };
19
+ warning: {
20
+ color: string;
21
+ contrast: string;
22
+ };
23
+ success: {
24
+ color: string;
25
+ contrast: string;
26
+ };
27
+ default: {
28
+ color: string;
29
+ contrast: string;
30
+ };
31
+ elements: {
32
+ line: string;
33
+ paper: string;
34
+ textEditor: {
35
+ background: string;
36
+ color: string;
37
+ placeholder: string;
38
+ };
39
+ button: {
40
+ disabled: string;
41
+ };
42
+ };
43
+ text: {
44
+ primary: string;
45
+ secondary: string;
46
+ hint: string;
47
+ };
48
+ black: string;
49
+ white: string;
50
+ mode: 'light' | 'dark';
51
+ };
52
+ export type PaletteConfig = {
53
+ dark: DeepPartial<Omit<ThemePalette, 'mode'>>;
54
+ light: DeepPartial<Omit<ThemePalette, 'mode'>>;
55
+ };
56
+ declare const generateDefaultPalette: () => Omit<ThemePalette, 'background' | 'text' | 'mode' | 'elements' | 'default'>;
57
+ declare const generatePaletteLight: () => ThemePalette;
58
+ declare const generatePaletteDark: () => ThemePalette;
59
+ declare const mergePalette: (p1: ThemePalette, p2?: DeepPartial<ThemePalette>) => ThemePalette;
60
+ export { generateDefaultPalette, generatePaletteDark, generatePaletteLight, mergePalette, };
package/package.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "@engagently/types",
3
+ "version": "2.2.1",
4
+ "main": "./index.ts",
5
+ "types": "dist/types/engagently.d.ts",
6
+ "files": [
7
+ "dist"
8
+ ],
9
+ "keywords": [],
10
+ "author": {
11
+ "name": "ferret go GmbH",
12
+ "email": "support@ferret-go.com"
13
+ },
14
+ "license": "UNLICENSED",
15
+ "scripts": {
16
+ "build": "vite build",
17
+ "clean": "rimraf dist"
18
+ },
19
+ "devDependencies": {
20
+ "vite": "^3.0.0",
21
+ "vite-plugin-dts": "^3.4.0"
22
+ }
23
+ }
package/readme.md ADDED
@@ -0,0 +1,40 @@
1
+ # @engagently/types
2
+
3
+ Type definitions for integrating Engagently into your typescript project.
4
+
5
+ ## Installation
6
+
7
+ 1. Install the package via npm or yarn:
8
+
9
+ ```sh
10
+ npm install @engagently/types --save-dev
11
+ ```
12
+
13
+ Or if you are using yarn:
14
+
15
+ ```sh
16
+ yarn add @engagently/types --dev
17
+ ```
18
+
19
+ ## Important Notes
20
+
21
+ - Always make sure to use the latest version of `@engagently/types`. Regular updates are made to ensure the types are in sync with the latest features and changes. To ensure you're using the latest, always check the version in your `package.json` and compare it with the latest version on the npm registry.
22
+
23
+ - After installing or updating, you need to include `@engagently/types` in the `types` array of your `tsconfig.json` to ensure TypeScript recognizes and uses the types from this package.
24
+
25
+ ## Configuration
26
+
27
+ In your `tsconfig.json`, add `@engagently/types` to the types array:
28
+
29
+ ```json
30
+ {
31
+ "compilerOptions": {
32
+ // ... other options
33
+ "types": ["@engagently/types", ...otherTypes]
34
+ }
35
+ }
36
+ ```
37
+
38
+ ## Support
39
+
40
+ For any issues or questions related to `@engagently/types`, please contact our support or refer to the official documentation.