@engagently/types 2.6.0 → 2.6.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.
|
@@ -10,7 +10,7 @@ export type CallbackFn = (data: {
|
|
|
10
10
|
payload?: unknown;
|
|
11
11
|
}) => void;
|
|
12
12
|
export type ErrorCallbackFn = (error: CombinedError, operation: Operation) => void;
|
|
13
|
-
export type EventHooks = 'onAny' | 'onChangeViewMode' | 'onLoadMoreComments' | 'onLoadMoreReplies';
|
|
13
|
+
export type EventHooks = 'onAny' | 'onChangeViewMode' | 'onLoadMoreComments' | 'onLoadMoreReplies' | 'onSetup';
|
|
14
14
|
export declare const EventHookMessageEventMap: Record<EventHooks, MessageEvents | MessageEvents[]>;
|
|
15
15
|
export type Translations = Record<string, DeepPartial<typeof defaultResources.en>>;
|
|
16
16
|
/**
|
|
@@ -94,7 +94,7 @@ export interface PollWidget {
|
|
|
94
94
|
/**
|
|
95
95
|
* Events that can be used by the pub/sub implementation for window.postMessage
|
|
96
96
|
*/
|
|
97
|
-
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';
|
|
97
|
+
export type MessageEvents = 'EGY_SETUP' | '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';
|
|
98
98
|
export declare const EGY_AUTH = "egy_auth";
|
|
99
99
|
export type EgyAuth = {
|
|
100
100
|
accessToken: string;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import type { CommunityConfig, EngageConfig, Translations } from '../../common/_types/ConfigDefinition';
|
|
2
2
|
import type { SignOutOptions } from '../../common/lib/api/session';
|
|
3
|
+
type SignInOptions = Partial<{
|
|
4
|
+
token: string | null;
|
|
5
|
+
}>;
|
|
3
6
|
export type Engagently = {
|
|
4
7
|
config?: EngageConfig;
|
|
5
8
|
communityConfig?: DeepPartial<CommunityConfig>;
|
|
6
9
|
changeLanguage: (languageCode: string) => void;
|
|
7
10
|
toggleColorScheme: (mode: 'auto' | 'dark' | 'light') => void;
|
|
8
|
-
signOut: (options?: SignOutOptions) => Promise<
|
|
11
|
+
signOut: (options?: SignOutOptions) => Promise<void>;
|
|
12
|
+
signIn: (options?: SignInOptions) => Promise<void>;
|
|
9
13
|
reinit: (config: Partial<EngageConfig>) => Promise<void>;
|
|
10
14
|
remoteTranslations?: Translations | null;
|
|
11
15
|
} & {
|