Skip to content

Commit 8224cd7

Browse files
committed
Use re-export
1 parent d3c2b2c commit 8224cd7

1 file changed

Lines changed: 41 additions & 80 deletions

File tree

packages/api/src/index.ts

Lines changed: 41 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,60 @@
1-
// TODO: Move the pattern to re-export.
2-
import {
3-
type LegacyActivityComponentFactory,
4-
type LegacyActivityMiddleware,
5-
type LegacyAttachmentMiddleware,
6-
type LegacyRenderAttachment
1+
export type {
2+
/** @deprecated Use `polymiddleware` instead, this will be removed on or after 2027-08-16. */
3+
LegacyActivityComponentFactory as ActivityComponentFactory,
4+
/** @deprecated Use `polymiddleware` instead, this will be removed on or after 2027-08-16. */
5+
LegacyActivityMiddleware as ActivityMiddleware,
6+
/** @deprecated Use `polymiddleware` instead, this will be removed on or after 2027-08-16. */
7+
LegacyAttachmentMiddleware as AttachmentMiddleware,
8+
LegacyRenderAttachment as RenderAttachment
79
} from '@msinternal/botframework-webchat-api-middleware/legacy';
8-
import StyleOptions, { StrictStyleOptions } from './StyleOptions';
9-
import defaultStyleOptions from './defaultStyleOptions';
10-
import Composer, { ComposerProps } from './hooks/Composer';
11-
import concatMiddleware from './hooks/middleware/concatMiddleware';
12-
import { type ActivityStatusRenderer } from './hooks/useCreateActivityStatusRenderer'; // TODO: [P1] This line should export the one from the version from "middleware rework" workstream.
13-
import { type DebouncedNotification, type DebouncedNotifications } from './hooks/useDebouncedNotifications';
14-
import { type PostActivityFile } from './hooks/useSendFiles';
15-
import { localize } from './localization/Localize';
16-
import normalizeStyleOptions from './normalizeStyleOptions';
17-
import { type ActivityStatusMiddleware, type RenderActivityStatus } from './types/ActivityStatusMiddleware';
18-
import AttachmentForScreenReaderMiddleware, {
19-
AttachmentForScreenReaderComponentFactory
20-
} from './types/AttachmentForScreenReaderMiddleware';
21-
import AvatarMiddleware, { type AvatarComponentFactory } from './types/AvatarMiddleware';
22-
import CardActionMiddleware, { type PerformCardAction } from './types/CardActionMiddleware';
23-
import { type ContextOf } from './types/ContextOf';
24-
import GroupActivitiesMiddleware, { type GroupActivities } from './types/GroupActivitiesMiddleware';
25-
import { type Notification } from './types/Notification';
26-
import ScrollToEndButtonMiddleware, {
27-
type ScrollToEndButtonComponentFactory
28-
} from './types/ScrollToEndButtonMiddleware';
29-
import { type SendStatus } from './types/SendStatus';
30-
import ToastMiddleware, { type RenderToast } from './types/ToastMiddleware';
31-
import { type Typing } from './types/Typing';
32-
import TypingIndicatorMiddleware, { type RenderTypingIndicator } from './types/TypingIndicatorMiddleware';
33-
import { type WebSpeechPonyfill } from './types/WebSpeechPonyfill';
34-
import { type WebSpeechPonyfillFactory } from './types/WebSpeechPonyfillFactory';
35-
36-
// #region Re-export
3710

11+
export * as hooks from './boot/hook';
12+
export { default as defaultStyleOptions } from './defaultStyleOptions';
13+
export { default as Composer, type ComposerProps } from './hooks/Composer';
14+
export { default as concatMiddleware } from './hooks/middleware/concatMiddleware';
15+
export { type ActivityStatusRenderer } from './hooks/useCreateActivityStatusRenderer'; // TODO: [P1] This line should export the one from the version from "middleware rework" workstream.
16+
export { type DebouncedNotification, type DebouncedNotifications } from './hooks/useDebouncedNotifications';
17+
export { type PostActivityFile } from './hooks/useSendFiles';
18+
export { localize } from './localization/Localize';
3819
export {
3920
extractSendBoxMiddleware,
4021
SendBoxMiddlewareProxy,
4122
type SendBoxMiddleware,
4223
type SendBoxMiddlewareProps,
4324
type SendBoxMiddlewareRequest
4425
} from './middleware/SendBoxMiddleware';
45-
4626
export {
4727
extractSendBoxToolbarMiddleware,
4828
SendBoxToolbarMiddlewareProxy,
4929
type SendBoxToolbarMiddleware,
5030
type SendBoxToolbarMiddlewareProps,
5131
type SendBoxToolbarMiddlewareRequest
5232
} from './middleware/SendBoxToolbarMiddleware';
53-
// #endregion
54-
55-
export * as hooks from './boot/hook';
56-
57-
export { Composer, concatMiddleware, defaultStyleOptions, localize, normalizeStyleOptions };
58-
59-
export type {
60-
/** @deprecated Use `polymiddleware` instead, this will be removed on or after 2027-08-16. */
61-
LegacyActivityComponentFactory as ActivityComponentFactory,
62-
/** @deprecated Use `polymiddleware` instead, this will be removed on or after 2027-08-16. */
63-
LegacyActivityMiddleware as ActivityMiddleware,
64-
ActivityStatusMiddleware,
65-
ActivityStatusRenderer,
66-
AttachmentForScreenReaderComponentFactory,
67-
AttachmentForScreenReaderMiddleware,
68-
/** @deprecated Use `polymiddleware` instead, this will be removed on or after 2027-08-16. */
69-
LegacyAttachmentMiddleware as AttachmentMiddleware,
70-
AvatarComponentFactory,
71-
AvatarMiddleware,
72-
CardActionMiddleware,
73-
ComposerProps,
74-
ContextOf,
75-
DebouncedNotification,
76-
DebouncedNotifications,
77-
GroupActivities,
78-
GroupActivitiesMiddleware,
79-
Notification,
80-
PerformCardAction,
81-
PostActivityFile,
82-
RenderActivityStatus,
83-
LegacyRenderAttachment as RenderAttachment,
84-
RenderToast,
85-
RenderTypingIndicator,
86-
ScrollToEndButtonComponentFactory,
87-
ScrollToEndButtonMiddleware,
88-
SendStatus,
89-
StrictStyleOptions,
90-
StyleOptions,
91-
ToastMiddleware,
92-
Typing,
93-
TypingIndicatorMiddleware,
94-
WebSpeechPonyfill,
95-
WebSpeechPonyfillFactory
96-
};
33+
export { default as normalizeStyleOptions } from './normalizeStyleOptions';
34+
export { type StrictStyleOptions, type default as StyleOptions } from './StyleOptions';
35+
export { type ActivityStatusMiddleware, type RenderActivityStatus } from './types/ActivityStatusMiddleware';
36+
export {
37+
type AttachmentForScreenReaderComponentFactory,
38+
type default as AttachmentForScreenReaderMiddleware
39+
} from './types/AttachmentForScreenReaderMiddleware';
40+
export { type AvatarComponentFactory, type default as AvatarMiddleware } from './types/AvatarMiddleware';
41+
export { type default as CardActionMiddleware, type PerformCardAction } from './types/CardActionMiddleware';
42+
export { type ContextOf } from './types/ContextOf';
43+
export { type GroupActivities, type default as GroupActivitiesMiddleware } from './types/GroupActivitiesMiddleware';
44+
export { type Notification } from './types/Notification';
45+
export {
46+
type ScrollToEndButtonComponentFactory,
47+
type default as ScrollToEndButtonMiddleware
48+
} from './types/ScrollToEndButtonMiddleware';
49+
export { type SendStatus } from './types/SendStatus';
50+
export { type RenderToast, type default as ToastMiddleware } from './types/ToastMiddleware';
51+
export { type Typing } from './types/Typing';
52+
export {
53+
type RenderTypingIndicator,
54+
type default as TypingIndicatorMiddleware
55+
} from './types/TypingIndicatorMiddleware';
56+
export { type WebSpeechPonyfill } from './types/WebSpeechPonyfill';
57+
export { type WebSpeechPonyfillFactory } from './types/WebSpeechPonyfillFactory';
9758

9859
// #region Build info
9960
import buildInfo from './buildInfo';

0 commit comments

Comments
 (0)