-
Notifications
You must be signed in to change notification settings - Fork 118
/
Copy pathUIKitLivechatInteractionContext.ts
32 lines (25 loc) · 1.32 KB
/
UIKitLivechatInteractionContext.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// tslint:disable:max-classes-per-file
import { IUIKitBaseIncomingInteraction } from '../UIKitIncomingInteractionTypes';
import { UIKitInteractionResponder } from '../UIKitInteractionResponder';
import { IUIKitLivechatBaseIncomingInteraction, IUIKitLivechatBlockIncomingInteraction } from './UIKitLivechatIncomingInteractionType';
export abstract class UIKitLivechatInteractionContext {
private baseContext: IUIKitLivechatBaseIncomingInteraction;
private responder: UIKitInteractionResponder;
constructor(baseContext: IUIKitLivechatBaseIncomingInteraction) {
const { appId, actionId, room, visitor, triggerId } = baseContext;
this.baseContext = { appId, actionId, room, visitor, triggerId };
this.responder = new UIKitInteractionResponder(this.baseContext as any as IUIKitBaseIncomingInteraction);
}
public getInteractionResponder() {
return this.responder;
}
public abstract getInteractionData(): IUIKitLivechatBaseIncomingInteraction;
}
export class UIKitLivechatBlockInteractionContext extends UIKitLivechatInteractionContext {
constructor(private readonly interactionData: IUIKitLivechatBlockIncomingInteraction) {
super(interactionData);
}
public getInteractionData(): IUIKitLivechatBlockIncomingInteraction {
return this.interactionData;
}
}