@engagently/types 2.2.3 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { defaultResources } from '../../i18n/i18n';
|
|
2
|
+
import type { AvailableThemes, ColorSchemesConfig } from '../../ui/themes/_types';
|
|
1
3
|
import type { PaletteConfig } from '../../ui/themes/config';
|
|
2
|
-
import type { ColorSchemesConfig, AvailableThemes } from '../../ui/themes/_types';
|
|
3
|
-
import type { Resource } from 'i18next';
|
|
4
4
|
import type { CombinedError, Operation } from '@urql/preact';
|
|
5
5
|
import type { EgyEntities, MessageEvents } from './WidgetDefinitions';
|
|
6
6
|
import type { DsmFeatureName, PlmFeatureName } from '../lib/api/enums';
|
|
@@ -18,13 +18,12 @@ export declare const EventHookMessageEventMap: Record<EventHooks, MessageEvents
|
|
|
18
18
|
*/
|
|
19
19
|
export interface EngageConfig {
|
|
20
20
|
communityId: string;
|
|
21
|
-
token?: string;
|
|
21
|
+
token?: string | null;
|
|
22
22
|
strategy?: string;
|
|
23
|
-
anonymous?: boolean;
|
|
24
23
|
palette?: PaletteConfig;
|
|
25
24
|
theme?: `${AvailableThemes}`;
|
|
26
25
|
defaultLanguage?: string;
|
|
27
|
-
translations?:
|
|
26
|
+
translations?: Record<string, Partial<typeof defaultResources.en>>;
|
|
28
27
|
dev?: boolean;
|
|
29
28
|
colorScheme?: `${ColorSchemesConfig}`;
|
|
30
29
|
cta?: Partial<Record<DsmFeatureName | PlmFeatureName, CallbackFn>>;
|
|
@@ -88,12 +88,11 @@ export interface PollWidget {
|
|
|
88
88
|
/**
|
|
89
89
|
* Events that can be used by the pub/sub implementation for window.postMessage
|
|
90
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';
|
|
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' | 'EGY_REINIT';
|
|
92
92
|
export declare const EGY_AUTH = "egy_auth";
|
|
93
93
|
export type EgyAuth = {
|
|
94
94
|
accessToken: string;
|
|
95
95
|
expiresAt: string;
|
|
96
|
-
anonymous: boolean;
|
|
97
96
|
};
|
|
98
97
|
export type ChangeLanguagePayload = {
|
|
99
98
|
language: string;
|
|
@@ -2,6 +2,12 @@ export declare enum DsmCommentariesSort {
|
|
|
2
2
|
CreatedAtAsc = "CREATED_AT_ASC",
|
|
3
3
|
CreatedAtDesc = "CREATED_AT_DESC"
|
|
4
4
|
}
|
|
5
|
+
export declare enum DsmDiscussionEffectiveState {
|
|
6
|
+
Archived = "ARCHIVED",
|
|
7
|
+
Closed = "CLOSED",
|
|
8
|
+
Open = "OPEN",
|
|
9
|
+
TransientClosed = "TRANSIENT_CLOSED"
|
|
10
|
+
}
|
|
5
11
|
export declare enum DsmDiscussionState {
|
|
6
12
|
Archived = "ARCHIVED",
|
|
7
13
|
Closed = "CLOSED",
|
package/dist/i18n/i18n.d.ts
CHANGED
|
@@ -151,6 +151,11 @@ export declare const defaultResources: {
|
|
|
151
151
|
"recently-used": string;
|
|
152
152
|
search: string;
|
|
153
153
|
};
|
|
154
|
+
errors: {
|
|
155
|
+
inline: {
|
|
156
|
+
"write-comment": string;
|
|
157
|
+
};
|
|
158
|
+
};
|
|
154
159
|
features: {
|
|
155
160
|
COMMENT: {
|
|
156
161
|
"call-to-action": string;
|
|
@@ -206,6 +211,7 @@ export declare const defaultResources: {
|
|
|
206
211
|
};
|
|
207
212
|
messages: {
|
|
208
213
|
"discussion-closed": string;
|
|
214
|
+
"discussion-global-closed": string;
|
|
209
215
|
"log-in-to-comment": string;
|
|
210
216
|
"user-suspended": string;
|
|
211
217
|
};
|
|
@@ -366,6 +372,11 @@ export declare const defaultResources: {
|
|
|
366
372
|
"recently-used": string;
|
|
367
373
|
search: string;
|
|
368
374
|
};
|
|
375
|
+
errors: {
|
|
376
|
+
inline: {
|
|
377
|
+
"write-comment": string;
|
|
378
|
+
};
|
|
379
|
+
};
|
|
369
380
|
features: {
|
|
370
381
|
COMMENT: {
|
|
371
382
|
"call-to-action": string;
|
|
@@ -421,6 +432,7 @@ export declare const defaultResources: {
|
|
|
421
432
|
};
|
|
422
433
|
messages: {
|
|
423
434
|
"discussion-closed": string;
|
|
435
|
+
"discussion-global-closed": string;
|
|
424
436
|
"log-in-to-comment": string;
|
|
425
437
|
"user-suspended": string;
|
|
426
438
|
};
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import type { CommunityConfig, EngageConfig } from '../../common/_types/ConfigDefinition';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import type { SignOutOptions } from '../../common/lib/api/session';
|
|
3
|
+
export type Engagently = {
|
|
4
|
+
config?: EngageConfig;
|
|
5
|
+
communityConfig?: DeepPartial<CommunityConfig>;
|
|
5
6
|
changeLanguage: (languageCode: string) => void;
|
|
6
7
|
toggleColorScheme: (mode: 'auto' | 'dark' | 'light') => void;
|
|
7
|
-
|
|
8
|
+
signOut: (options?: SignOutOptions) => Promise<null | void>;
|
|
9
|
+
reinit: (config: Partial<EngageConfig>) => Promise<void>;
|
|
10
|
+
} & {
|
|
8
11
|
Configuration: (config: EngageConfig) => Promise<EngageConfig>;
|
|
9
12
|
};
|
|
10
13
|
declare const main: void;
|