-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.ts
More file actions
44 lines (36 loc) · 1.42 KB
/
index.ts
File metadata and controls
44 lines (36 loc) · 1.42 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
import React from 'react';
import ReactDOM from 'react-dom';
//@ts-ignore
import reactToWebComponent from 'react-to-webcomponent';
import { EVENTS } from '/src/constants/events';
import { DEBOT_INTERFACE_ID } from '/src/constants/debot';
import StandaloneBrowser from '/src/StandaloneBrowser';
import StandaloneDebot from '/src/StandaloneDebot';
import StandaloneDebotEvents from '/src/StandaloneDebotEvents';
import EventBus, { IEventBus } from '/src/EventBus';
import { decodeString, TDecodeString } from '/src/helpers/decodeString';
import encodeString, { TEncodeString } from '/src/helpers/encodeString';
import '/src/styles/normalize.scss';
window.customElements.define("standalone-browser", reactToWebComponent(StandaloneBrowser, React, ReactDOM) as any);
window.customElements.define("standalone-debot", reactToWebComponent(StandaloneDebot, React, ReactDOM) as any);
window.customElements.define("standalone-debot-events", reactToWebComponent(StandaloneDebotEvents, React, ReactDOM) as any);
declare global {
const __LIB_VERSION__: string;
interface Window {
DEBOT_EMBEDDING: {
EventBus: IEventBus,
EVENTS: typeof EVENTS;
DEBOT_INTERFACE_ID: typeof DEBOT_INTERFACE_ID;
encodeString: TEncodeString;
decodeString: TDecodeString;
}
}
}
window.DEBOT_EMBEDDING = {
EventBus,
EVENTS,
DEBOT_INTERFACE_ID,
encodeString,
decodeString,
}
export { EventBus, EVENTS, DEBOT_INTERFACE_ID, decodeString, encodeString };