@unblu/floating-js-api 7.37.2
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/LICENSE.md +184 -0
- package/README.md +26 -0
- package/dist/lib/index.d.ts +93 -0
- package/dist/lib/index.js +49 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/internal/internal-api.d.ts +18 -0
- package/dist/lib/internal/internal-api.js +20 -0
- package/dist/lib/internal/internal-api.js.map +1 -0
- package/dist/lib/internal/module/general-lazy-module.d.ts +17 -0
- package/dist/lib/internal/module/general-lazy-module.js +16 -0
- package/dist/lib/internal/module/general-lazy-module.js.map +1 -0
- package/dist/lib/internal/module/general-module.d.ts +31 -0
- package/dist/lib/internal/module/general-module.js +37 -0
- package/dist/lib/internal/module/general-module.js.map +1 -0
- package/dist/lib/internal/module/meta-module.d.ts +17 -0
- package/dist/lib/internal/module/meta-module.js +19 -0
- package/dist/lib/internal/module/meta-module.js.map +1 -0
- package/dist/lib/model/individualui_component.d.ts +29 -0
- package/dist/lib/model/individualui_component.js +2 -0
- package/dist/lib/model/individualui_component.js.map +1 -0
- package/dist/lib/model/individualui_state.d.ts +14 -0
- package/dist/lib/model/individualui_state.js +2 -0
- package/dist/lib/model/individualui_state.js.map +1 -0
- package/dist/lib/shared/api-state.d.ts +8 -0
- package/dist/lib/shared/api-state.js +10 -0
- package/dist/lib/shared/api-state.js.map +1 -0
- package/dist/lib/shared/conversation.d.ts +320 -0
- package/dist/lib/shared/conversation.js +384 -0
- package/dist/lib/shared/conversation.js.map +1 -0
- package/dist/lib/shared/internal/api-bridge.d.ts +36 -0
- package/dist/lib/shared/internal/api-bridge.js +97 -0
- package/dist/lib/shared/internal/api-bridge.js.map +1 -0
- package/dist/lib/shared/internal/event.d.ts +6 -0
- package/dist/lib/shared/internal/event.js +2 -0
- package/dist/lib/shared/internal/event.js.map +1 -0
- package/dist/lib/shared/internal/initialized-unblu-api.d.ts +6 -0
- package/dist/lib/shared/internal/initialized-unblu-api.js +2 -0
- package/dist/lib/shared/internal/initialized-unblu-api.js.map +1 -0
- package/dist/lib/shared/internal/initialized-unblu-element.d.ts +6 -0
- package/dist/lib/shared/internal/initialized-unblu-element.js +2 -0
- package/dist/lib/shared/internal/initialized-unblu-element.js.map +1 -0
- package/dist/lib/shared/internal/java-error-codes.d.ts +5 -0
- package/dist/lib/shared/internal/java-error-codes.js +6 -0
- package/dist/lib/shared/internal/java-error-codes.js.map +1 -0
- package/dist/lib/shared/internal/module/agent-availability-module.d.ts +14 -0
- package/dist/lib/shared/internal/module/agent-availability-module.js +13 -0
- package/dist/lib/shared/internal/module/agent-availability-module.js.map +1 -0
- package/dist/lib/shared/internal/module/base-general-module.d.ts +31 -0
- package/dist/lib/shared/internal/module/base-general-module.js +46 -0
- package/dist/lib/shared/internal/module/base-general-module.js.map +1 -0
- package/dist/lib/shared/internal/module/conversation-module.d.ts +57 -0
- package/dist/lib/shared/internal/module/conversation-module.js +49 -0
- package/dist/lib/shared/internal/module/conversation-module.js.map +1 -0
- package/dist/lib/shared/internal/module/module.d.ts +10 -0
- package/dist/lib/shared/internal/module/module.js +16 -0
- package/dist/lib/shared/internal/module/module.js.map +1 -0
- package/dist/lib/shared/internal/unblu-api-factory.d.ts +9 -0
- package/dist/lib/shared/internal/unblu-api-factory.js +2 -0
- package/dist/lib/shared/internal/unblu-api-factory.js.map +1 -0
- package/dist/lib/shared/internal/unblu-util.d.ts +63 -0
- package/dist/lib/shared/internal/unblu-util.js +220 -0
- package/dist/lib/shared/internal/unblu-util.js.map +1 -0
- package/dist/lib/shared/internal/util/event-emitter.d.ts +44 -0
- package/dist/lib/shared/internal/util/event-emitter.js +85 -0
- package/dist/lib/shared/internal/util/event-emitter.js.map +1 -0
- package/dist/lib/shared/model/agent-availability-state.d.ts +18 -0
- package/dist/lib/shared/model/agent-availability-state.js +20 -0
- package/dist/lib/shared/model/agent-availability-state.js.map +1 -0
- package/dist/lib/shared/model/call-state.d.ts +26 -0
- package/dist/lib/shared/model/call-state.js +28 -0
- package/dist/lib/shared/model/call-state.js.map +1 -0
- package/dist/lib/shared/model/configuration.d.ts +46 -0
- package/dist/lib/shared/model/configuration.js +2 -0
- package/dist/lib/shared/model/configuration.js.map +1 -0
- package/dist/lib/shared/model/connection-state.d.ts +27 -0
- package/dist/lib/shared/model/connection-state.js +29 -0
- package/dist/lib/shared/model/connection-state.js.map +1 -0
- package/dist/lib/shared/model/conversation-info.d.ts +34 -0
- package/dist/lib/shared/model/conversation-info.js +2 -0
- package/dist/lib/shared/model/conversation-info.js.map +1 -0
- package/dist/lib/shared/model/conversation-message-info.d.ts +14 -0
- package/dist/lib/shared/model/conversation-message-info.js +2 -0
- package/dist/lib/shared/model/conversation-message-info.js.map +1 -0
- package/dist/lib/shared/model/conversation-recipient-type.d.ts +10 -0
- package/dist/lib/shared/model/conversation-recipient-type.js +12 -0
- package/dist/lib/shared/model/conversation-recipient-type.js.map +1 -0
- package/dist/lib/shared/model/conversation-recipient.d.ts +14 -0
- package/dist/lib/shared/model/conversation-recipient.js +2 -0
- package/dist/lib/shared/model/conversation-recipient.js.map +1 -0
- package/dist/lib/shared/model/conversation-state.d.ts +37 -0
- package/dist/lib/shared/model/conversation-state.js +39 -0
- package/dist/lib/shared/model/conversation-state.js.map +1 -0
- package/dist/lib/shared/model/conversation-type.d.ts +43 -0
- package/dist/lib/shared/model/conversation-type.js +45 -0
- package/dist/lib/shared/model/conversation-type.js.map +1 -0
- package/dist/lib/shared/model/customaction/custom-action-invocation.d.ts +27 -0
- package/dist/lib/shared/model/customaction/custom-action-invocation.js +2 -0
- package/dist/lib/shared/model/customaction/custom-action-invocation.js.map +1 -0
- package/dist/lib/shared/model/customaction/custom-conversation-action-invocation.d.ts +6 -0
- package/dist/lib/shared/model/customaction/custom-conversation-action-invocation.js +2 -0
- package/dist/lib/shared/model/customaction/custom-conversation-action-invocation.js.map +1 -0
- package/dist/lib/shared/model/customaction/custom-message-action-invocation.d.ts +16 -0
- package/dist/lib/shared/model/customaction/custom-message-action-invocation.js +2 -0
- package/dist/lib/shared/model/customaction/custom-message-action-invocation.js.map +1 -0
- package/dist/lib/shared/model/customaction/custom-person-action-invocation.d.ts +11 -0
- package/dist/lib/shared/model/customaction/custom-person-action-invocation.js +2 -0
- package/dist/lib/shared/model/customaction/custom-person-action-invocation.js.map +1 -0
- package/dist/lib/shared/model/invitation-status.d.ts +14 -0
- package/dist/lib/shared/model/invitation-status.js +16 -0
- package/dist/lib/shared/model/invitation-status.js.map +1 -0
- package/dist/lib/shared/model/invitation.d.ts +24 -0
- package/dist/lib/shared/model/invitation.js +2 -0
- package/dist/lib/shared/model/invitation.js.map +1 -0
- package/dist/lib/shared/model/new-conversation-interceptor-result.d.ts +14 -0
- package/dist/lib/shared/model/new-conversation-interceptor-result.js +2 -0
- package/dist/lib/shared/model/new-conversation-interceptor-result.js.map +1 -0
- package/dist/lib/shared/model/person-info.d.ts +4 -0
- package/dist/lib/shared/model/person-info.js +2 -0
- package/dist/lib/shared/model/person-info.js.map +1 -0
- package/dist/lib/shared/new-conversation-interceptor.d.ts +24 -0
- package/dist/lib/shared/new-conversation-interceptor.js +2 -0
- package/dist/lib/shared/new-conversation-interceptor.js.map +1 -0
- package/dist/lib/shared/unblu-api-error.d.ts +117 -0
- package/dist/lib/shared/unblu-api-error.js +122 -0
- package/dist/lib/shared/unblu-api-error.js.map +1 -0
- package/dist/lib/unblu-api-ui.d.ts +137 -0
- package/dist/lib/unblu-api-ui.js +199 -0
- package/dist/lib/unblu-api-ui.js.map +1 -0
- package/dist/lib/unblu-api.d.ts +363 -0
- package/dist/lib/unblu-api.js +433 -0
- package/dist/lib/unblu-api.js.map +1 -0
- package/dist/lib/unblu-static-api.d.ts +237 -0
- package/dist/lib/unblu-static-api.js +318 -0
- package/dist/lib/unblu-static-api.js.map +1 -0
- package/package.json +23 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ApiBridge } from "../api-bridge";
|
|
2
|
+
import { InternalModule } from "./module";
|
|
3
|
+
import { NewConversationInterceptor } from "../../new-conversation-interceptor";
|
|
4
|
+
import { ConversationType } from "../../model/conversation-type";
|
|
5
|
+
import { PersonInfo } from "../../model/person-info";
|
|
6
|
+
import { ConversationInfo } from "../../model/conversation-info";
|
|
7
|
+
import { ConversationRecipient } from "../../model/conversation-recipient";
|
|
8
|
+
export type BaseGeneralEventType = 'activeConversationChange' | 'conversationsChange' | 'notificationCountChange' | 'personChange' | 'personActivity';
|
|
9
|
+
export declare enum BaseGeneralFunction {
|
|
10
|
+
startConversation = "startConversation",
|
|
11
|
+
setNewConversationInterceptor = "setNewConversationInterceptor",
|
|
12
|
+
joinConversation = "joinConversation",
|
|
13
|
+
openConversation = "openConversation",
|
|
14
|
+
getActiveConversation = "getActiveConversation",
|
|
15
|
+
getConversations = "getConversations",
|
|
16
|
+
getNotificationCount = "getNotificationCount",
|
|
17
|
+
getPersonInfo = "getPersonInfo",
|
|
18
|
+
setPersonNickname = "setPersonNickname"
|
|
19
|
+
}
|
|
20
|
+
export declare class BaseGeneralModule<T extends string | BaseGeneralFunction, E extends BaseGeneralEventType | string> extends InternalModule<BaseGeneralFunction | T, E> {
|
|
21
|
+
constructor(bridge: ApiBridge);
|
|
22
|
+
startConversation(type: ConversationType, visitorName?: string, visitorData?: string, recipient?: ConversationRecipient): Promise<string>;
|
|
23
|
+
setNewConversationInterceptor(callback: NewConversationInterceptor): Promise<void>;
|
|
24
|
+
joinConversation(pin: string, visitorName?: string): Promise<string>;
|
|
25
|
+
openConversation(conversationId: string): Promise<void>;
|
|
26
|
+
getActiveConversation(): Promise<string | null>;
|
|
27
|
+
getConversations(): Promise<ConversationInfo[]>;
|
|
28
|
+
getNotificationCount(): Promise<number>;
|
|
29
|
+
getPersonInfo(): Promise<PersonInfo>;
|
|
30
|
+
setPersonNickname(nickname: string): Promise<void>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { InternalModule } from "./module";
|
|
2
|
+
export var BaseGeneralFunction;
|
|
3
|
+
(function (BaseGeneralFunction) {
|
|
4
|
+
BaseGeneralFunction["startConversation"] = "startConversation";
|
|
5
|
+
BaseGeneralFunction["setNewConversationInterceptor"] = "setNewConversationInterceptor";
|
|
6
|
+
BaseGeneralFunction["joinConversation"] = "joinConversation";
|
|
7
|
+
BaseGeneralFunction["openConversation"] = "openConversation";
|
|
8
|
+
BaseGeneralFunction["getActiveConversation"] = "getActiveConversation";
|
|
9
|
+
BaseGeneralFunction["getConversations"] = "getConversations";
|
|
10
|
+
BaseGeneralFunction["getNotificationCount"] = "getNotificationCount";
|
|
11
|
+
BaseGeneralFunction["getPersonInfo"] = "getPersonInfo";
|
|
12
|
+
BaseGeneralFunction["setPersonNickname"] = "setPersonNickname";
|
|
13
|
+
})(BaseGeneralFunction || (BaseGeneralFunction = {}));
|
|
14
|
+
export class BaseGeneralModule extends InternalModule {
|
|
15
|
+
constructor(bridge) {
|
|
16
|
+
super(bridge, 'general');
|
|
17
|
+
}
|
|
18
|
+
startConversation(type, visitorName, visitorData, recipient) {
|
|
19
|
+
return this.callApiFunction(BaseGeneralFunction.startConversation, [type, visitorName, visitorData, recipient]);
|
|
20
|
+
}
|
|
21
|
+
setNewConversationInterceptor(callback) {
|
|
22
|
+
return this.callApiFunction(BaseGeneralFunction.setNewConversationInterceptor, [callback]);
|
|
23
|
+
}
|
|
24
|
+
joinConversation(pin, visitorName) {
|
|
25
|
+
return this.callApiFunction(BaseGeneralFunction.joinConversation, [pin, visitorName]);
|
|
26
|
+
}
|
|
27
|
+
openConversation(conversationId) {
|
|
28
|
+
return this.callApiFunction(BaseGeneralFunction.openConversation, [conversationId]);
|
|
29
|
+
}
|
|
30
|
+
getActiveConversation() {
|
|
31
|
+
return this.callApiFunction(BaseGeneralFunction.getActiveConversation, []);
|
|
32
|
+
}
|
|
33
|
+
getConversations() {
|
|
34
|
+
return this.callApiFunction(BaseGeneralFunction.getConversations, []);
|
|
35
|
+
}
|
|
36
|
+
getNotificationCount() {
|
|
37
|
+
return this.callApiFunction(BaseGeneralFunction.getNotificationCount, []);
|
|
38
|
+
}
|
|
39
|
+
getPersonInfo() {
|
|
40
|
+
return this.callApiFunction(BaseGeneralFunction.getPersonInfo, []);
|
|
41
|
+
}
|
|
42
|
+
setPersonNickname(nickname) {
|
|
43
|
+
return this.callApiFunction(BaseGeneralFunction.setPersonNickname, [nickname]);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=base-general-module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-general-module.js","sourceRoot":"","sources":["../../../../../src/shared/internal/module/base-general-module.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,cAAc,EAAC,MAAM,UAAU,CAAA;AAcvC,MAAM,CAAN,IAAY,mBAUX;AAVD,WAAY,mBAAmB;IAC3B,8DAAuC,CAAA;IACvC,sFAA+D,CAAA;IAC/D,4DAAqC,CAAA;IACrC,4DAAqC,CAAA;IACrC,sEAA+C,CAAA;IAC/C,4DAAqC,CAAA;IACrC,oEAA6C,CAAA;IAC7C,sDAA+B,CAAA;IAC/B,8DAAuC,CAAA;AAC3C,CAAC,EAVW,mBAAmB,KAAnB,mBAAmB,QAU9B;AAED,MAAM,OAAO,iBAAmG,SAAQ,cAA0C;IAC9J,YAAY,MAAiB;QACzB,KAAK,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;IAC5B,CAAC;IAEM,iBAAiB,CAAC,IAAsB,EAAE,WAAoB,EAAE,WAAoB,EAAE,SAAiC;QAC1H,OAAO,IAAI,CAAC,eAAe,CAAC,mBAAmB,CAAC,iBAAiB,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC,CAAA;IACnH,CAAC;IAEM,6BAA6B,CAAC,QAAoC;QACrE,OAAO,IAAI,CAAC,eAAe,CAAC,mBAAmB,CAAC,6BAA6B,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAA;IAC9F,CAAC;IAEM,gBAAgB,CAAC,GAAW,EAAE,WAAoB;QACrD,OAAO,IAAI,CAAC,eAAe,CAAC,mBAAmB,CAAC,gBAAgB,EAAE,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC,CAAA;IACzF,CAAC;IAEM,gBAAgB,CAAC,cAAsB;QAC1C,OAAO,IAAI,CAAC,eAAe,CAAC,mBAAmB,CAAC,gBAAgB,EAAE,CAAC,cAAc,CAAC,CAAC,CAAA;IACvF,CAAC;IAEM,qBAAqB;QACxB,OAAO,IAAI,CAAC,eAAe,CAAC,mBAAmB,CAAC,qBAAqB,EAAE,EAAE,CAAC,CAAA;IAC9E,CAAC;IAEM,gBAAgB;QACnB,OAAO,IAAI,CAAC,eAAe,CAAC,mBAAmB,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAA;IACzE,CAAC;IAEM,oBAAoB;QACvB,OAAO,IAAI,CAAC,eAAe,CAAC,mBAAmB,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAA;IAC7E,CAAC;IAEM,aAAa;QAChB,OAAO,IAAI,CAAC,eAAe,CAAC,mBAAmB,CAAC,aAAa,EAAE,EAAE,CAAC,CAAA;IACtE,CAAC;IAEM,iBAAiB,CAAC,QAAgB;QACrC,OAAO,IAAI,CAAC,eAAe,CAAC,mBAAmB,CAAC,iBAAiB,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAA;IAClF,CAAC;CACJ"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { InternalModule } from './module';
|
|
2
|
+
import { ApiBridge } from '../api-bridge';
|
|
3
|
+
import { CallState } from '../../model/call-state';
|
|
4
|
+
import { ConversationState } from '../../model/conversation-state';
|
|
5
|
+
import { ConnectionState } from '../../model/connection-state';
|
|
6
|
+
import { Invitation } from "../../model/invitation";
|
|
7
|
+
export interface ConversationCallState {
|
|
8
|
+
conversationId: string;
|
|
9
|
+
callState: CallState;
|
|
10
|
+
}
|
|
11
|
+
export interface ConversationConnectionState {
|
|
12
|
+
conversationId: string;
|
|
13
|
+
connectionState: ConnectionState;
|
|
14
|
+
}
|
|
15
|
+
export interface ConversationWithState {
|
|
16
|
+
conversationId: string;
|
|
17
|
+
conversationState: ConversationState;
|
|
18
|
+
}
|
|
19
|
+
export interface ConversationInvitations {
|
|
20
|
+
conversationId: string;
|
|
21
|
+
invitations: Invitation[];
|
|
22
|
+
}
|
|
23
|
+
export type ConversationEventType = 'connectionStateChange' | 'conversationStateChange' | 'end' | 'close' | 'personChange' | 'callStateChange' | 'invitationsChange' | 'customActionInvocation';
|
|
24
|
+
declare const enum ConversationFunction {
|
|
25
|
+
getConnectionState = "getConnectionState",
|
|
26
|
+
getConversationState = "getConversationState",
|
|
27
|
+
getCallState = "getCallState",
|
|
28
|
+
startAudioCall = "startAudioCall",
|
|
29
|
+
startVideoCall = "startVideoCall",
|
|
30
|
+
endConversation = "endConversation",
|
|
31
|
+
leaveConversation = "leaveConversation",
|
|
32
|
+
closeConversation = "closeConversation",
|
|
33
|
+
createAnonymousPinInvitation = "createAnonymousPinInvitation",
|
|
34
|
+
createAnonymousEmailInvitation = "createAnonymousEmailInvitation",
|
|
35
|
+
getInvitations = "getInvitations",
|
|
36
|
+
revokeInvitation = "revokeInvitation",
|
|
37
|
+
renewInvitationPin = "renewInvitationPin",
|
|
38
|
+
setVisitorData = "setVisitorData"
|
|
39
|
+
}
|
|
40
|
+
export declare class ConversationModule extends InternalModule<ConversationFunction, ConversationEventType> {
|
|
41
|
+
constructor(bridge: ApiBridge);
|
|
42
|
+
getConnectionState(conversationId: string): Promise<ConnectionState>;
|
|
43
|
+
getConversationState(conversationId: string): Promise<ConversationState>;
|
|
44
|
+
getCallState(conversationId: string): Promise<CallState>;
|
|
45
|
+
startAudioCall(conversationId: string): Promise<void>;
|
|
46
|
+
startVideoCall(conversationId: string): Promise<void>;
|
|
47
|
+
endConversation(conversationId: string): Promise<void>;
|
|
48
|
+
leaveConversation(conversationId: string): Promise<void>;
|
|
49
|
+
closeConversation(conversationId: string): Promise<void>;
|
|
50
|
+
createAnonymousPinInvitation(conversationId: string): Promise<Invitation>;
|
|
51
|
+
createAnonymousEmailInvitation(conversationId: string, email: String): Promise<Invitation>;
|
|
52
|
+
getInvitations(conversationId: string): Promise<Invitation[]>;
|
|
53
|
+
revokeInvitation(conversationId: string, invitationId: String): Promise<void>;
|
|
54
|
+
renewInvitationPin(conversationId: string, invitationId: String): Promise<Invitation>;
|
|
55
|
+
setVisitorData(visitorData: String): Promise<void>;
|
|
56
|
+
}
|
|
57
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { InternalModule } from './module';
|
|
2
|
+
export class ConversationModule extends InternalModule {
|
|
3
|
+
constructor(bridge) {
|
|
4
|
+
super(bridge, 'conversation');
|
|
5
|
+
}
|
|
6
|
+
getConnectionState(conversationId) {
|
|
7
|
+
return this.callApiFunction("getConnectionState" /* ConversationFunction.getConnectionState */, [conversationId]);
|
|
8
|
+
}
|
|
9
|
+
getConversationState(conversationId) {
|
|
10
|
+
return this.callApiFunction("getConversationState" /* ConversationFunction.getConversationState */, [conversationId]);
|
|
11
|
+
}
|
|
12
|
+
getCallState(conversationId) {
|
|
13
|
+
return this.callApiFunction("getCallState" /* ConversationFunction.getCallState */, [conversationId]);
|
|
14
|
+
}
|
|
15
|
+
startAudioCall(conversationId) {
|
|
16
|
+
return this.callApiFunction("startAudioCall" /* ConversationFunction.startAudioCall */, [conversationId]);
|
|
17
|
+
}
|
|
18
|
+
startVideoCall(conversationId) {
|
|
19
|
+
return this.callApiFunction("startVideoCall" /* ConversationFunction.startVideoCall */, [conversationId]);
|
|
20
|
+
}
|
|
21
|
+
endConversation(conversationId) {
|
|
22
|
+
return this.callApiFunction("endConversation" /* ConversationFunction.endConversation */, [conversationId]);
|
|
23
|
+
}
|
|
24
|
+
leaveConversation(conversationId) {
|
|
25
|
+
return this.callApiFunction("leaveConversation" /* ConversationFunction.leaveConversation */, [conversationId]);
|
|
26
|
+
}
|
|
27
|
+
closeConversation(conversationId) {
|
|
28
|
+
return this.callApiFunction("closeConversation" /* ConversationFunction.closeConversation */, [conversationId]);
|
|
29
|
+
}
|
|
30
|
+
createAnonymousPinInvitation(conversationId) {
|
|
31
|
+
return this.callApiFunction("createAnonymousPinInvitation" /* ConversationFunction.createAnonymousPinInvitation */, [conversationId]);
|
|
32
|
+
}
|
|
33
|
+
createAnonymousEmailInvitation(conversationId, email) {
|
|
34
|
+
return this.callApiFunction("createAnonymousEmailInvitation" /* ConversationFunction.createAnonymousEmailInvitation */, [conversationId, email]);
|
|
35
|
+
}
|
|
36
|
+
async getInvitations(conversationId) {
|
|
37
|
+
return this.callApiFunction("getInvitations" /* ConversationFunction.getInvitations */, [conversationId]);
|
|
38
|
+
}
|
|
39
|
+
async revokeInvitation(conversationId, invitationId) {
|
|
40
|
+
return this.callApiFunction("revokeInvitation" /* ConversationFunction.revokeInvitation */, [conversationId, invitationId]);
|
|
41
|
+
}
|
|
42
|
+
async renewInvitationPin(conversationId, invitationId) {
|
|
43
|
+
return this.callApiFunction("renewInvitationPin" /* ConversationFunction.renewInvitationPin */, [conversationId, invitationId]);
|
|
44
|
+
}
|
|
45
|
+
async setVisitorData(visitorData) {
|
|
46
|
+
return this.callApiFunction("setVisitorData" /* ConversationFunction.setVisitorData */, [visitorData]);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=conversation-module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation-module.js","sourceRoot":"","sources":["../../../../../src/shared/internal/module/conversation-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,UAAU,CAAA;AAuDvC,MAAM,OAAO,kBAAmB,SAAQ,cAA2D;IAC/F,YAAY,MAAiB;QACzB,KAAK,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;IACjC,CAAC;IAEM,kBAAkB,CAAC,cAAsB;QAC5C,OAAO,IAAI,CAAC,eAAe,qEAA0C,CAAC,cAAc,C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wC,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC,CAAA;IACtG,CAAC;IAEM,KAAK,CAAC,kBAAkB,CAAC,cAAsB,EAAE,YAAoB;QACxE,OAAO,IAAI,CAAC,eAAe,qEAA0C,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC,CAAA;IACxG,CAAC;IAEM,KAAK,CAAC,cAAc,CAAC,WAAmB;QAC3C,OAAO,IAAI,CAAC,eAAe,6DAAsC,CAAC,WAAW,CAAC,CAAC,CAAC;IACpF,CAAC;CACJ"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ApiBridge } from '../api-bridge';
|
|
2
|
+
import { EventCallback } from '../event';
|
|
3
|
+
export declare class InternalModule<T extends string, E extends string> {
|
|
4
|
+
private bridge;
|
|
5
|
+
moduleName: string;
|
|
6
|
+
constructor(bridge: ApiBridge, moduleName: string);
|
|
7
|
+
protected callApiFunction(functionName: T, args: any[]): Promise<any>;
|
|
8
|
+
on(eventName: E, listener: EventCallback): Promise<void>;
|
|
9
|
+
off(eventName: E, listener: EventCallback): Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export class InternalModule {
|
|
2
|
+
constructor(bridge, moduleName) {
|
|
3
|
+
this.bridge = bridge;
|
|
4
|
+
this.moduleName = moduleName;
|
|
5
|
+
}
|
|
6
|
+
callApiFunction(functionName, args) {
|
|
7
|
+
return this.bridge.callApiFunction(this.moduleName, functionName, args);
|
|
8
|
+
}
|
|
9
|
+
on(eventName, listener) {
|
|
10
|
+
return this.bridge.on(this.moduleName, eventName, listener);
|
|
11
|
+
}
|
|
12
|
+
off(eventName, listener) {
|
|
13
|
+
return this.bridge.off(this.moduleName, eventName, listener);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../../../src/shared/internal/module/module.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,cAAc;IACvB,YAAoB,MAAiB,EAAS,UAAkB;QAA5C,WAAM,GAAN,MAAM,CAAW;QAAS,eAAU,GAAV,UAAU,CAAQ;IAEhE,CAAC;IAES,eAAe,CAAC,YAAe,EAAE,IAAW;QAClD,OAAO,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,UAAU,EAAE,YAAY,EAAE,IAAI,CAAC,CAAA;IAC3E,CAAC;IAEM,EAAE,CAAC,SAAY,EAAE,QAAuB;QAC3C,OAAO,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAA;IAC/D,CAAC;IAEM,GAAG,CAAC,SAAY,EAAE,QAAuB;QAC5C,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAA;IAChE,CAAC;CAEJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unblu-api-factory.js","sourceRoot":"","sources":["../../../../src/shared/internal/unblu-api-factory.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { UnbluApiFactory } from "./unblu-api-factory";
|
|
2
|
+
import { InitializedUnbluElement } from "./initialized-unblu-element";
|
|
3
|
+
import { Configuration } from "../model/configuration";
|
|
4
|
+
export declare enum IntegrationType {
|
|
5
|
+
embedded = "embedded",
|
|
6
|
+
floating = "floating"
|
|
7
|
+
}
|
|
8
|
+
declare enum EntryPoint {
|
|
9
|
+
siteIntegrationGreedyMain = "SiteIntegrationGreedyMain",
|
|
10
|
+
siteIntegrationLazyMain = "SiteIntegrationLazyMain",
|
|
11
|
+
siteEmbeddedMain = "SiteEmbeddedMain"
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Internal type definition of the unblu object.
|
|
15
|
+
*/
|
|
16
|
+
export interface UnbluObject {
|
|
17
|
+
api?: UnbluApiFactory;
|
|
18
|
+
/**
|
|
19
|
+
* internal unblu field
|
|
20
|
+
* @hidden
|
|
21
|
+
*/
|
|
22
|
+
APIKEY?: string;
|
|
23
|
+
/**
|
|
24
|
+
* internal unblu field
|
|
25
|
+
* @hidden
|
|
26
|
+
*/
|
|
27
|
+
SERVER?: string;
|
|
28
|
+
/**
|
|
29
|
+
* internal unblu field
|
|
30
|
+
* @hidden
|
|
31
|
+
*/
|
|
32
|
+
l?: string;
|
|
33
|
+
/**
|
|
34
|
+
* internal unblu field
|
|
35
|
+
* @hidden
|
|
36
|
+
*/
|
|
37
|
+
entryPoint?: EntryPoint;
|
|
38
|
+
/**
|
|
39
|
+
* internal unblu field
|
|
40
|
+
* @hidden
|
|
41
|
+
*/
|
|
42
|
+
globalPrefix?: string;
|
|
43
|
+
}
|
|
44
|
+
export declare class UnbluUtil {
|
|
45
|
+
static loadScript(uri: string, timeout: number): Promise<void>;
|
|
46
|
+
static getNamedArea(): string | undefined;
|
|
47
|
+
static setNamedArea(namedArea: string): void;
|
|
48
|
+
static removeNamedArea(): void;
|
|
49
|
+
static setLocale(locale: string): void;
|
|
50
|
+
static loginWithSecureToken(serverUrl: string, apiKey: string, entryPath: string, accessToken: string): Promise<void>;
|
|
51
|
+
static isAuthenticated(serverUrl: string, entryPath: string): Promise<boolean>;
|
|
52
|
+
static logout(serverUrl: string, entryPath: string): Promise<void>;
|
|
53
|
+
static isUnbluLoaded(integrationType: IntegrationType): boolean;
|
|
54
|
+
static generateConfigurationFromLoadedUnblu(): Configuration;
|
|
55
|
+
private static entryPointMatches;
|
|
56
|
+
static getUnbluObject(): UnbluObject;
|
|
57
|
+
static createUnbluObject(): UnbluObject;
|
|
58
|
+
static getOrCreateUnbluObject(): UnbluObject;
|
|
59
|
+
static deinitializeFloatingIfNeeded(): Promise<void>;
|
|
60
|
+
static deinitializeEmbeddedIfNeeded(excludedAppElement?: InitializedUnbluElement): Promise<void>;
|
|
61
|
+
static sanitizeParameter(param: string): string;
|
|
62
|
+
}
|
|
63
|
+
export {};
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
// Typedef Helpers
|
|
2
|
+
/**
|
|
3
|
+
* @hidden
|
|
4
|
+
*/
|
|
5
|
+
import { ApiState } from "../api-state";
|
|
6
|
+
import { UnbluApiError, UnbluErrorType } from "../unblu-api-error";
|
|
7
|
+
export var IntegrationType;
|
|
8
|
+
(function (IntegrationType) {
|
|
9
|
+
IntegrationType["embedded"] = "embedded";
|
|
10
|
+
IntegrationType["floating"] = "floating";
|
|
11
|
+
})(IntegrationType || (IntegrationType = {}));
|
|
12
|
+
var EntryPoint;
|
|
13
|
+
(function (EntryPoint) {
|
|
14
|
+
EntryPoint["siteIntegrationGreedyMain"] = "SiteIntegrationGreedyMain";
|
|
15
|
+
EntryPoint["siteIntegrationLazyMain"] = "SiteIntegrationLazyMain";
|
|
16
|
+
EntryPoint["siteEmbeddedMain"] = "SiteEmbeddedMain";
|
|
17
|
+
})(EntryPoint || (EntryPoint = {}));
|
|
18
|
+
class NamedAreaMetaTag extends Element {
|
|
19
|
+
}
|
|
20
|
+
export class UnbluUtil {
|
|
21
|
+
static async loadScript(uri, timeout) {
|
|
22
|
+
const timeoutTime = timeout || 30000;
|
|
23
|
+
const script = document.createElement('script');
|
|
24
|
+
script.setAttribute('charset', 'UTF-8');
|
|
25
|
+
script.setAttribute('type', 'text/javascript');
|
|
26
|
+
script.setAttribute('async', 'true');
|
|
27
|
+
script.setAttribute('timeout', timeoutTime.toString());
|
|
28
|
+
script.src = uri;
|
|
29
|
+
return new Promise(function (resolve, reject) {
|
|
30
|
+
let timeoutId;
|
|
31
|
+
const cleanup = () => {
|
|
32
|
+
// avoid mem leaks in IE.
|
|
33
|
+
script.onerror = script.onload = null;
|
|
34
|
+
window.clearTimeout(timeoutId);
|
|
35
|
+
};
|
|
36
|
+
const onError = (error) => {
|
|
37
|
+
cleanup();
|
|
38
|
+
console.error('Failed to load script! Uri:', uri, 'Error:', error);
|
|
39
|
+
reject(error);
|
|
40
|
+
};
|
|
41
|
+
script.onload = () => {
|
|
42
|
+
cleanup();
|
|
43
|
+
resolve();
|
|
44
|
+
};
|
|
45
|
+
script.onerror = onError;
|
|
46
|
+
timeoutId = window.setTimeout(() => onError('Timeout'), timeoutTime);
|
|
47
|
+
const head = document.getElementsByTagName('HEAD')[0];
|
|
48
|
+
head.appendChild(script);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
static getNamedArea() {
|
|
52
|
+
const existingMetaTag = window.document.querySelector('meta[name="unblu:named-area"]');
|
|
53
|
+
return existingMetaTag ? existingMetaTag.getAttribute('content') : undefined;
|
|
54
|
+
}
|
|
55
|
+
static setNamedArea(namedArea) {
|
|
56
|
+
const existingMetaTag = window.document.querySelector('meta[name="unblu:named-area"]');
|
|
57
|
+
if (existingMetaTag && !existingMetaTag.originalContent) {
|
|
58
|
+
existingMetaTag.originalContent = existingMetaTag.getAttribute('content');
|
|
59
|
+
}
|
|
60
|
+
const metaTag = existingMetaTag || window.document.createElement('meta');
|
|
61
|
+
metaTag.setAttribute('name', 'unblu:named-area');
|
|
62
|
+
metaTag.setAttribute('content', namedArea);
|
|
63
|
+
if (!metaTag.parentElement) {
|
|
64
|
+
window.document.head.appendChild(metaTag);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
static removeNamedArea() {
|
|
68
|
+
const metaTag = window.document.querySelector('meta[name="unblu:named-area"]');
|
|
69
|
+
if (metaTag === null || metaTag === void 0 ? void 0 : metaTag.originalContent) {
|
|
70
|
+
metaTag.setAttribute('content', metaTag.originalContent);
|
|
71
|
+
metaTag.originalContent = null;
|
|
72
|
+
}
|
|
73
|
+
else if (metaTag) {
|
|
74
|
+
metaTag.remove();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
static setLocale(locale) {
|
|
78
|
+
// unblu.l will be read in user-locale-util.js
|
|
79
|
+
UnbluUtil.getUnbluObject().l = locale;
|
|
80
|
+
}
|
|
81
|
+
static async loginWithSecureToken(serverUrl, apiKey, entryPath, accessToken) {
|
|
82
|
+
const url = `${serverUrl}${entryPath}/rest/v3/authenticator/loginWithSecureToken?x-unblu-apikey=${apiKey}`;
|
|
83
|
+
let response;
|
|
84
|
+
try {
|
|
85
|
+
response = await fetch(url, {
|
|
86
|
+
method: 'POST',
|
|
87
|
+
mode: 'cors',
|
|
88
|
+
cache: 'no-cache',
|
|
89
|
+
credentials: 'include',
|
|
90
|
+
headers: {
|
|
91
|
+
'Content-Type': 'application/json'
|
|
92
|
+
},
|
|
93
|
+
redirect: 'follow',
|
|
94
|
+
body: JSON.stringify({
|
|
95
|
+
token: accessToken,
|
|
96
|
+
type: 'JWT'
|
|
97
|
+
})
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
catch (e) {
|
|
101
|
+
throw new UnbluApiError(UnbluErrorType.AUTHENTICATION_FAILED, `Failed to authenticate with provided access token! Reason: ${e}`);
|
|
102
|
+
}
|
|
103
|
+
if (!response.ok) {
|
|
104
|
+
throw new UnbluApiError(UnbluErrorType.AUTHENTICATION_FAILED, `Failed to authenticate with provided access token! Status: ${response.status}; StatusText: ${response.statusText}`);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
static async isAuthenticated(serverUrl, entryPath) {
|
|
108
|
+
const url = `${serverUrl}${entryPath}/rest/v3/authenticator/isAuthenticated`;
|
|
109
|
+
let response;
|
|
110
|
+
try {
|
|
111
|
+
response = await fetch(url, {
|
|
112
|
+
method: 'GET',
|
|
113
|
+
mode: 'cors',
|
|
114
|
+
cache: 'no-cache',
|
|
115
|
+
credentials: 'include',
|
|
116
|
+
headers: {
|
|
117
|
+
'Content-Type': 'application/json'
|
|
118
|
+
},
|
|
119
|
+
redirect: 'follow',
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
catch (e) {
|
|
123
|
+
throw new UnbluApiError(UnbluErrorType.AUTHENTICATION_FAILED, `Failed to check if authenticated! Reason: ${e}`);
|
|
124
|
+
}
|
|
125
|
+
if (!response.ok) {
|
|
126
|
+
throw new UnbluApiError(UnbluErrorType.AUTHENTICATION_FAILED, `Failed to check if authenticated! Status: ${response.status}; StatusText: ${response.statusText}`);
|
|
127
|
+
}
|
|
128
|
+
return true === await response.json();
|
|
129
|
+
}
|
|
130
|
+
static async logout(serverUrl, entryPath) {
|
|
131
|
+
const url = `${serverUrl}${entryPath}/rest/v3/authenticator/logout`;
|
|
132
|
+
let response;
|
|
133
|
+
try {
|
|
134
|
+
response = await fetch(url, {
|
|
135
|
+
method: 'POST',
|
|
136
|
+
mode: 'cors',
|
|
137
|
+
cache: 'no-cache',
|
|
138
|
+
credentials: 'include',
|
|
139
|
+
headers: {
|
|
140
|
+
'Content-Type': 'application/json'
|
|
141
|
+
},
|
|
142
|
+
redirect: 'follow',
|
|
143
|
+
body: ''
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
catch (e) {
|
|
147
|
+
throw new UnbluApiError(UnbluErrorType.AUTHENTICATION_FAILED, `Failed to logout! Reason: ${e}`);
|
|
148
|
+
}
|
|
149
|
+
if (!response.ok) {
|
|
150
|
+
throw new UnbluApiError(UnbluErrorType.AUTHENTICATION_FAILED, `Failed to logout! Status: ${response.status}; StatusText: ${response.statusText}`);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
static isUnbluLoaded(integrationType) {
|
|
154
|
+
return UnbluUtil.getUnbluObject() && !!UnbluUtil.getUnbluObject().APIKEY && UnbluUtil.entryPointMatches(integrationType);
|
|
155
|
+
}
|
|
156
|
+
static generateConfigurationFromLoadedUnblu() {
|
|
157
|
+
const unblu = UnbluUtil.getUnbluObject();
|
|
158
|
+
// @ts-ignore
|
|
159
|
+
const unbluInternal = window[unblu.globalPrefix];
|
|
160
|
+
return {
|
|
161
|
+
apiKey: unblu.APIKEY,
|
|
162
|
+
serverUrl: unblu.SERVER,
|
|
163
|
+
entryPath: unbluInternal === null || unbluInternal === void 0 ? void 0 : unbluInternal.$_baseCfg.entryPath,
|
|
164
|
+
locale: unblu.l,
|
|
165
|
+
namedArea: UnbluUtil.getNamedArea()
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
static entryPointMatches(integrationType) {
|
|
169
|
+
if (integrationType === IntegrationType.embedded) {
|
|
170
|
+
return UnbluUtil.getUnbluObject().entryPoint === EntryPoint.siteEmbeddedMain;
|
|
171
|
+
}
|
|
172
|
+
else if (integrationType === IntegrationType.floating) {
|
|
173
|
+
return UnbluUtil.getUnbluObject().entryPoint === EntryPoint.siteIntegrationGreedyMain || UnbluUtil.getUnbluObject().entryPoint === EntryPoint.siteIntegrationLazyMain;
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
return false;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
static getUnbluObject() {
|
|
180
|
+
// @ts-ignore
|
|
181
|
+
return window.unblu;
|
|
182
|
+
}
|
|
183
|
+
static createUnbluObject() {
|
|
184
|
+
// @ts-ignore
|
|
185
|
+
return window.unblu = {};
|
|
186
|
+
}
|
|
187
|
+
static getOrCreateUnbluObject() {
|
|
188
|
+
// @ts-ignore
|
|
189
|
+
return window.unblu || (window.unblu = {});
|
|
190
|
+
}
|
|
191
|
+
static async deinitializeFloatingIfNeeded() {
|
|
192
|
+
if (!UnbluUtil.isUnbluLoaded(IntegrationType.floating)) {
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
const apiState = UnbluUtil.getUnbluObject().api.getApiState();
|
|
196
|
+
let unbluApi;
|
|
197
|
+
if (apiState == ApiState.INITIALIZING || apiState == ApiState.INITIALIZED) {
|
|
198
|
+
unbluApi = await UnbluUtil.getUnbluObject().api.initialize();
|
|
199
|
+
await unbluApi.deinitialize();
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
static async deinitializeEmbeddedIfNeeded(excludedAppElement) {
|
|
203
|
+
const unbluAppElements = document.getElementsByTagName('unblu-embedded-app');
|
|
204
|
+
for (let i = 0; i < unbluAppElements.length; i++) {
|
|
205
|
+
const appElement = unbluAppElements[i];
|
|
206
|
+
if (appElement === excludedAppElement) {
|
|
207
|
+
continue;
|
|
208
|
+
}
|
|
209
|
+
console.log("Deinitializing existing embedded integration:", appElement);
|
|
210
|
+
await appElement.deinitialize();
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
static sanitizeParameter(param) {
|
|
214
|
+
if (!param || !param.trim()) {
|
|
215
|
+
return null;
|
|
216
|
+
}
|
|
217
|
+
return param;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
//# sourceMappingURL=unblu-util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unblu-util.js","sourceRoot":"","sources":["../../../../src/shared/internal/unblu-util.ts"],"names":[],"mappings":"AAAA,kBAAkB;AAClB;;GAEG;AACH,OAAO,EAAC,QAAQ,EAAC,MAAM,cAAc,CAAA;AAIrC,OAAO,EAAC,aAAa,EAAE,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAGjE,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IACvB,wCAAqB,CAAA;IACrB,wCAAqB,CAAA;AACzB,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B;AAED,IAAK,UAIJ;AAJD,WAAK,UAAU;IACX,qEAAuD,CAAA;IACvD,iEAAmD,CAAA;IACnD,mDAAqC,CAAA;AACzC,CAAC,EAJI,UAAU,KAAV,UAAU,QAId;AAmCD,MAAM,gBAAiB,SAAQ,OAAO;CAErC;AAUD,MAAM,OAAO,SAAS;IAClB,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,GAAW,EAAE,OAAe;QAChD,MAAM,WAAW,GAAG,OAAO,IAAI,KAAK,CAAA;QACpC,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAA;QAC/C,MAAM,CAAC,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;QACvC,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,i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|
5
|
+
* Resets the emitter by removing all registered listeners.
|
|
6
|
+
*/
|
|
7
|
+
reset(): void;
|
|
8
|
+
/**
|
|
9
|
+
* Adds an event listeners
|
|
10
|
+
* @param event the event to listen to
|
|
11
|
+
* @param listener the listener to be called.
|
|
12
|
+
*/
|
|
13
|
+
on(event: string, listener: Listener): void;
|
|
14
|
+
/**
|
|
15
|
+
* removes a previously registered listener
|
|
16
|
+
* @param event the event
|
|
17
|
+
* @param listener the listener that should be removed.
|
|
18
|
+
* @return `true` if the listener was removed, `false` otherwise.
|
|
19
|
+
*/
|
|
20
|
+
off(event: string, listener: any): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* removes all listeners for the given event.
|
|
23
|
+
* @param event the event for which all listeners will be removed.
|
|
24
|
+
*/
|
|
25
|
+
offAll(event: string): void;
|
|
26
|
+
/**
|
|
27
|
+
* Checks weather at least one listener exists for a given event.
|
|
28
|
+
* @param event the event to check for
|
|
29
|
+
* @return weather or not any listeners for the given event are registered.
|
|
30
|
+
*/
|
|
31
|
+
hasListeners(event: string): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Returns all events that have at least one listeners registered to them.
|
|
34
|
+
* @return An array containing all events that have at least one listener.
|
|
35
|
+
* If no listeners are registered at all, an empty array will be returned.
|
|
36
|
+
*/
|
|
37
|
+
getEventsWithListeners(): string[];
|
|
38
|
+
/**
|
|
39
|
+
* Emits an event dispatching it to all listeners registered for it.
|
|
40
|
+
* @param event the event name.
|
|
41
|
+
* @param data the event data.
|
|
42
|
+
*/
|
|
43
|
+
emit(event: string, data?: any): void;
|
|
44
|
+
}
|