Skip to content

Commit 614c336

Browse files
committed
Re-export useSuggestedActionsHooks
1 parent 37a0d37 commit 614c336

3 files changed

Lines changed: 23 additions & 3 deletions

File tree

packages/api/src/hooks/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ import useUserID from './useUserID';
7272
import useUsername from './useUsername';
7373
import useVoiceSelector from './useVoiceSelector';
7474

75-
export { useSuggestedActionsHooks } from '@msinternal/botframework-webchat-redux-store';
7675
export { useBuildRenderActivityCallback } from '../package-api-middleware/index';
76+
export { default as useSuggestedActionsHooks } from './useSuggestedActionsHooks';
7777

7878
export {
7979
useActiveTyping,
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// tsup wrongly included typings from private packages marked as `noExternal` or `devDependencies`.
2+
// We cannot direct re-export from private packages without rebuilding their types.
3+
// tsup bug: https://github.com/egoist/tsup/issues/1071
4+
5+
import { useSuggestedActionsHooks as useSuggestedActionsHooks_ } from '@msinternal/botframework-webchat-redux-store';
6+
import { type DirectLineCardAction, type WebChatActivity } from 'botframework-webchat-core';
7+
import { type Dispatch, type SetStateAction } from 'react';
8+
9+
type SuggestedActionsContextType = Readonly<{
10+
useSuggestedActions: () => readonly [
11+
readonly DirectLineCardAction[],
12+
Dispatch<SetStateAction<readonly DirectLineCardAction[]>>,
13+
Readonly<{
14+
activity: undefined | WebChatActivity;
15+
}>
16+
];
17+
}>;
18+
19+
const useSuggestedActionsHooks = useSuggestedActionsHooks_ as () => SuggestedActionsContextType;
20+
21+
export default useSuggestedActionsHooks;

packages/bundle/test-d/fail-once/no-full-bundle-style-options-in-minimal-for-hooks.test-d.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import '../setup';
22

33
import { expectNotAssignable } from 'tsd';
4-
import '../../src/iife/minimal';
54

6-
const { hooks } = window['WebChat'];
5+
import { hooks } from '../../src/boot/exports/minimal';
76

87
type StyleOptions = ReturnType<typeof hooks.useStyleOptions>[0];
98

0 commit comments

Comments
 (0)