-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathexports-minimal.ts
More file actions
81 lines (68 loc) · 2.48 KB
/
exports-minimal.ts
File metadata and controls
81 lines (68 loc) · 2.48 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import { StrictStyleOptions, StyleOptions } from 'botframework-webchat-api';
import * as apiDecorator from 'botframework-webchat-api/decorator';
import * as compoonentDecorator from 'botframework-webchat-component/decorator';
import * as internal from 'botframework-webchat-component/internal';
import { Constants, createStore, createStoreWithDevTools, createStoreWithOptions } from 'botframework-webchat-core';
import ReactWebChat, {
Components,
concatMiddleware,
createStyleSet,
hooks,
testIds,
withEmoji
} from 'botframework-webchat-component';
import createBrowserWebSpeechPonyfillFactory from '../createBrowserWebSpeechPonyfillFactory';
import defaultCreateDirectLine from '../createDirectLine';
import defaultCreateDirectLineAppServiceExtension from '../createDirectLineAppServiceExtension';
import coreRenderWebChat from '../renderWebChat';
const renderWebChat = coreRenderWebChat.bind(null, ReactWebChat);
const buildTool = process.env.build_tool;
const moduleFormat = process.env.module_format;
const version = process.env.npm_package_version;
const buildInfo = Object.freeze({
buildTool,
moduleFormat,
variant: 'minimal',
version
});
export const createDirectLine = (options: Omit<Parameters<typeof defaultCreateDirectLine>[0], 'botAgent'>) => {
(options as any).botAgent &&
console.warn(
'Web Chat: Developers are not currently allowed to set botAgent. See https://github.com/microsoft/BotFramework-WebChat/issues/2119 for more details.'
);
return defaultCreateDirectLine({ ...options, botAgent: `WebChat/${version} (Minimal)` });
};
export const createDirectLineAppServiceExtension = (
options: Omit<Parameters<typeof defaultCreateDirectLineAppServiceExtension>[0], 'botAgent'>
) => {
(options as any).botAgent &&
console.warn(
'Web Chat: Developers are not currently allowed to set botAgent. See https://github.com/microsoft/BotFramework-WebChat/issues/2119 for more details.'
);
return defaultCreateDirectLineAppServiceExtension({ ...options, botAgent: `WebChat/${version} (Minimal)` });
};
export default ReactWebChat;
const decorator = Object.freeze({
...apiDecorator,
...compoonentDecorator
});
export {
buildInfo,
Components,
concatMiddleware,
Constants,
createBrowserWebSpeechPonyfillFactory,
createStore,
createStoreWithDevTools,
createStoreWithOptions,
createStyleSet,
decorator,
hooks,
internal,
ReactWebChat,
renderWebChat,
testIds,
version,
withEmoji
};
export { type StrictStyleOptions, type StyleOptions };