From 99625f47f6c065684e0a2107d232dcc50f980a9f Mon Sep 17 00:00:00 2001 From: William Wong Date: Mon, 30 Aug 2021 15:35:24 -0700 Subject: [PATCH] Fix typing for `usePerformCardAction` hook (#3969) * Fix typing for usePerformCardAction * Update entry * Fix ESLint --- CHANGELOG.md | 4 + .../createDefaultCardActionMiddleware.ts | 8 +- .../api/src/hooks/usePerformCardAction.ts | 5 +- .../api/src/types/CardActionMiddleware.ts | 26 ++-- .../Attachment/AdaptiveCardBuilder.ts | 20 +-- .../Attachment/AdaptiveCardRenderer.tsx | 62 +++++++-- .../src/SendBox/SuggestedActions.tsx | 54 +++++--- .../src/types/external/DirectLineActivity.ts | 1 + .../types/external/DirectLineAnimationCard.ts | 1 + .../types/external/DirectLineAttachment.ts | 1 + .../src/types/external/DirectLineAudioCard.ts | 1 + .../types/external/DirectLineCardAction.ts | 127 +++++++++++++++++- .../src/types/external/DirectLineHeroCard.ts | 1 + .../external/DirectLineJSBotConnection.ts | 1 + .../src/types/external/DirectLineOAuthCard.ts | 1 + .../types/external/DirectLineReceiptCard.ts | 1 + .../types/external/DirectLineSignInCard.ts | 1 + .../external/DirectLineSuggestedAction.ts | 1 + .../types/external/DirectLineThumbnailCard.ts | 1 + .../src/types/external/DirectLineVideoCard.ts | 1 + 20 files changed, 256 insertions(+), 62 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b2466d50e..b29c1d89dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Fixed + +- Fixes [#3968](https://github.com/microsoft/BotFramework-WebChat/issues/3968). Fix typing for `usePerformCardAction` hook, by [@compulim](https://github.com/compulim), in PR [#3969](https://github.com/microsoft/BotFramework-WebChat/pull/3969) + ### Changed - Resolves [#4017](https://github.com/microsoft/BotFramework-WebChat/issues/4017). In samples, moved [`react-scripts`](https://npmjs.com/package/react-scripts`) to `devDependencies`, in PR [#4023](https://github.com/microsoft/BotFramework-WebChat/pull/4023) diff --git a/packages/api/src/hooks/middleware/createDefaultCardActionMiddleware.ts b/packages/api/src/hooks/middleware/createDefaultCardActionMiddleware.ts index 9b98ae90a1..b10111dfce 100644 --- a/packages/api/src/hooks/middleware/createDefaultCardActionMiddleware.ts +++ b/packages/api/src/hooks/middleware/createDefaultCardActionMiddleware.ts @@ -6,11 +6,13 @@ export default function createDefaultCardActionMiddleware(): CardActionMiddlewar return ({ dispatch }) => next => (...args) => { const [ { - cardAction: { displayText, text, type, value } + cardAction, + cardAction: { value } } ] = args; - switch (type) { + // We cannot use destructured "type" here because TypeScript don't recognize "messageBack" is "MessageBackCardAction". + switch (cardAction.type) { case 'imBack': if (typeof value === 'string') { // TODO: [P4] Instead of calling dispatch, we should move to dispatchers instead for completeness @@ -22,7 +24,7 @@ export default function createDefaultCardActionMiddleware(): CardActionMiddlewar break; case 'messageBack': - dispatch(sendMessageBack(value, text, displayText)); + dispatch(sendMessageBack(value, cardAction.text, cardAction.displayText)); break; diff --git a/packages/api/src/hooks/usePerformCardAction.ts b/packages/api/src/hooks/usePerformCardAction.ts index 83e8bca24c..2938d96cd8 100644 --- a/packages/api/src/hooks/usePerformCardAction.ts +++ b/packages/api/src/hooks/usePerformCardAction.ts @@ -1,6 +1,7 @@ -import { PerformCardAction } from '../types/CardActionMiddleware'; +import { DirectLineCardAction } from 'botframework-webchat-core'; + import useWebChatAPIContext from './internal/useWebChatAPIContext'; -export default function usePerformCardAction(): PerformCardAction { +export default function usePerformCardAction(): (cardAction: DirectLineCardAction) => void { return useWebChatAPIContext().onCardAction; } diff --git a/packages/api/src/types/CardActionMiddleware.ts b/packages/api/src/types/CardActionMiddleware.ts index 30bc3de33f..6ae7b58b53 100644 --- a/packages/api/src/types/CardActionMiddleware.ts +++ b/packages/api/src/types/CardActionMiddleware.ts @@ -1,20 +1,20 @@ import { DirectLineCardAction } from 'botframework-webchat-core'; -import FunctionMiddleware, { CallFunction } from './FunctionMiddleware'; +import FunctionMiddleware from './FunctionMiddleware'; -type PerformCardActionParameter = { - cardAction?: DirectLineCardAction; - displayText?: string; - getSignInUrl?: () => string; - target?: any; - text?: string; - type?: string; - value?: any; -}; +type PerformCardAction = (cardAction: DirectLineCardAction) => void; -type PerformCardAction = CallFunction<[PerformCardActionParameter], void>; - -type CardActionMiddleware = FunctionMiddleware<[{ dispatch: (action: any) => void }], [PerformCardActionParameter], {}>; +type CardActionMiddleware = FunctionMiddleware< + [{ dispatch: (action: any) => void }], + [ + { + cardAction: DirectLineCardAction; + getSignInUrl?: () => string; + target: any; + } + ], + {} +>; export default CardActionMiddleware; diff --git a/packages/bundle/src/adaptiveCards/Attachment/AdaptiveCardBuilder.ts b/packages/bundle/src/adaptiveCards/Attachment/AdaptiveCardBuilder.ts index f678910018..ff933df688 100644 --- a/packages/bundle/src/adaptiveCards/Attachment/AdaptiveCardBuilder.ts +++ b/packages/bundle/src/adaptiveCards/Attachment/AdaptiveCardBuilder.ts @@ -16,16 +16,16 @@ import { TextWeight } from 'adaptivecards'; -import { CardAction } from 'botframework-directlinejs'; +import { DirectLineCardAction } from 'botframework-webchat-core'; import AdaptiveCardsPackage from '../../types/AdaptiveCardsPackage'; import AdaptiveCardsStyleOptions from '../AdaptiveCardsStyleOptions'; export interface BotFrameworkCardAction { - __isBotFrameworkCardAction: boolean; - cardAction: CardAction; + __isBotFrameworkCardAction: true; + cardAction: DirectLineCardAction; } -function addCardAction(cardAction: CardAction, includesOAuthButtons?: boolean) { +function addCardAction(cardAction: DirectLineCardAction, includesOAuthButtons?: boolean) { const { type } = cardAction; let action; @@ -42,11 +42,11 @@ function addCardAction(cardAction: CardAction, includesOAuthButtons?: boolean) { cardAction }; - action.title = cardAction.title; + action.title = (cardAction as { title: string }).title; } else { action = new OpenUrlAction(); - action.title = cardAction.title; + action.title = (cardAction as { title: string }).title; action.url = cardAction.type === 'call' ? `tel:${cardAction.value}` : cardAction.value; } @@ -71,7 +71,7 @@ export default class AdaptiveCardBuilder { this.card.addItem(this.container); } - addColumnSet(sizes: number[], container: Container = this.container, selectAction?: CardAction) { + addColumnSet(sizes: number[], container: Container = this.container, selectAction?: DirectLineCardAction) { const columnSet = new ColumnSet(); columnSet.selectAction = selectAction && addCardAction(selectAction); @@ -107,7 +107,7 @@ export default class AdaptiveCardBuilder { } } - addButtons(cardActions: CardAction[], includesOAuthButtons?: boolean) { + addButtons(cardActions: DirectLineCardAction[], includesOAuthButtons?: boolean) { cardActions && cardActions.forEach(cardAction => { this.card.addAction(addCardAction(cardAction, includesOAuthButtons)); @@ -131,7 +131,7 @@ export default class AdaptiveCardBuilder { this.addButtons(content.buttons); } - addImage(url: string, container?: Container, selectAction?: CardAction, altText?: string) { + addImage(url: string, container?: Container, selectAction?: DirectLineCardAction, altText?: string) { container = container || this.container; const image = new Image(); @@ -146,7 +146,7 @@ export default class AdaptiveCardBuilder { } export interface ICommonContent { - buttons?: CardAction[]; + buttons?: DirectLineCardAction[]; subtitle?: string; text?: string; title?: string; diff --git a/packages/bundle/src/adaptiveCards/Attachment/AdaptiveCardRenderer.tsx b/packages/bundle/src/adaptiveCards/Attachment/AdaptiveCardRenderer.tsx index b1b27dd1de..7044b0d8a3 100644 --- a/packages/bundle/src/adaptiveCards/Attachment/AdaptiveCardRenderer.tsx +++ b/packages/bundle/src/adaptiveCards/Attachment/AdaptiveCardRenderer.tsx @@ -1,12 +1,15 @@ /* eslint no-magic-numbers: ["error", { "ignore": [-1, 0, 2] }] */ +import { Action, OpenUrlAction, SubmitAction } from 'adaptivecards'; import { Components, getTabIndex, hooks } from 'botframework-webchat-component'; +import { DirectLineCardAction } from 'botframework-webchat-core'; import classNames from 'classnames'; import PropTypes from 'prop-types'; -import React, { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react'; +import React, { useCallback, useEffect, useLayoutEffect, useRef, useState, VFC } from 'react'; import useAdaptiveCardsHostConfig from '../hooks/useAdaptiveCardsHostConfig'; import useAdaptiveCardsPackage from '../hooks/useAdaptiveCardsPackage'; +import { BotFrameworkCardAction } from './AdaptiveCardBuilder'; const { ErrorBox } = Components; const { useDisabled, useLocalizer, usePerformCardAction, useRenderMarkdownAsHTML, useScrollToEnd, useStyleSet } = hooks; @@ -384,7 +387,19 @@ function saveInputValues(element) { }); } -const AdaptiveCardRenderer = ({ actionPerformedClassName, adaptiveCard, disabled: disabledFromProps, tapAction }) => { +type AdaptiveCardRendererProps = { + actionPerformedClassName?: string; + adaptiveCard: any; + disabled?: boolean; + tapAction?: DirectLineCardAction; +}; + +const AdaptiveCardRenderer: VFC = ({ + actionPerformedClassName, + adaptiveCard, + disabled: disabledFromProps, + tapAction +}) => { const [{ adaptiveCardRenderer: adaptiveCardRendererStyleSet }] = useStyleSet(); const [{ GlobalSettings, HostConfig }] = useAdaptiveCardsPackage(); const [actionsPerformed, setActionsPerformed] = useState([]); @@ -456,7 +471,7 @@ const AdaptiveCardRenderer = ({ actionPerformedClassName, adaptiveCard, disabled ); const handleExecuteAction = useCallback( - action => { + (action: Action) => { // Some items, e.g. tappable image, cannot be disabled thru DOM attributes if (disabled) { return; @@ -465,25 +480,40 @@ const AdaptiveCardRenderer = ({ actionPerformedClassName, adaptiveCard, disabled addActionsPerformed(action); const actionTypeName = action.getJsonTypeName(); + const { iconUrl: image, title } = action; + // We cannot use "instanceof" check here, because web devs may bring their own version of Adaptive Cards package. + // We need to check using "getJsonTypeName()" instead. if (actionTypeName === 'Action.OpenUrl') { + const { url: value } = action as OpenUrlAction; + performCardAction({ + image, + title, type: 'openUrl', - value: action.url + value }); } else if (actionTypeName === 'Action.Submit') { - if (typeof action.data !== 'undefined') { - const { data: actionData } = action; - - if (actionData && actionData.__isBotFrameworkCardAction) { - const { cardAction } = actionData; - const { displayText, text, type, value } = cardAction; + const { data } = action as SubmitAction as { + data: string | BotFrameworkCardAction; + }; - performCardAction({ displayText, text, type, value }); + if (typeof data !== 'undefined') { + if (typeof data === 'string') { + performCardAction({ + image, + title, + type: 'imBack', + value: data + }); + } else if (data.__isBotFrameworkCardAction) { + performCardAction(data.cardAction); } else { performCardAction({ - type: typeof action.data === 'string' ? 'imBack' : 'postBack', - value: action.data + image, + title, + type: 'postBack', + value: data }); } } @@ -629,7 +659,13 @@ AdaptiveCardRenderer.propTypes = { actionPerformedClassName: PropTypes.string, adaptiveCard: PropTypes.any.isRequired, disabled: PropTypes.bool, + + // TypeScript class is not mappable to PropTypes.func + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore tapAction: PropTypes.shape({ + image: PropTypes.string, + title: PropTypes.string, type: PropTypes.string.isRequired, value: PropTypes.string }) diff --git a/packages/component/src/SendBox/SuggestedActions.tsx b/packages/component/src/SendBox/SuggestedActions.tsx index 9c9437f77a..402b5f26f2 100644 --- a/packages/component/src/SendBox/SuggestedActions.tsx +++ b/packages/component/src/SendBox/SuggestedActions.tsx @@ -209,7 +209,7 @@ SuggestedActionStackedContainer.propTypes = { type SuggestedActionsProps = { className?: string; - suggestedActions?: DirectLineCardAction; + suggestedActions?: DirectLineCardAction[]; }; const SuggestedActions: FC = ({ className, suggestedActions = [] }) => { @@ -227,24 +227,36 @@ const SuggestedActions: FC = ({ className, suggestedActio : localize('SUGGESTED_ACTIONS_ALT_NO_CONTENT') ); - const children = suggestedActions.map(({ displayText, image, imageAltText, text, title, type, value }, index) => ( - - )); + const children = suggestedActions.map((cardAction, index) => { + const { displayText, image, imageAltText, text, title, type, value } = cardAction as { + displayText?: string; + image?: string; + imageAltText?: string; + text?: string; + title?: string; + type: string; + value?: { [key: string]: any } | string; + }; + + return ( + + ); + }); if (suggestedActionLayout === 'flow') { return ( @@ -273,6 +285,10 @@ SuggestedActions.defaultProps = { SuggestedActions.propTypes = { className: PropTypes.string, + + // TypeScript class is not mappable to PropTypes.func + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore suggestedActions: PropTypes.arrayOf( PropTypes.shape({ displayText: PropTypes.string, diff --git a/packages/core/src/types/external/DirectLineActivity.ts b/packages/core/src/types/external/DirectLineActivity.ts index cc35e57db0..8f5c59d9db 100644 --- a/packages/core/src/types/external/DirectLineActivity.ts +++ b/packages/core/src/types/external/DirectLineActivity.ts @@ -1,5 +1,6 @@ // TODO: [P1] #3953 We should fully type it out. +// eslint-disable-next-line @typescript-eslint/no-explicit-any type DirectLineActivity = any; export default DirectLineActivity; diff --git a/packages/core/src/types/external/DirectLineAnimationCard.ts b/packages/core/src/types/external/DirectLineAnimationCard.ts index 39c188c424..ce6f419cc2 100644 --- a/packages/core/src/types/external/DirectLineAnimationCard.ts +++ b/packages/core/src/types/external/DirectLineAnimationCard.ts @@ -1,5 +1,6 @@ // TODO: [P1] #3953 We should fully type it out. +// eslint-disable-next-line @typescript-eslint/no-explicit-any type DirectLineAnimationCard = any; export default DirectLineAnimationCard; diff --git a/packages/core/src/types/external/DirectLineAttachment.ts b/packages/core/src/types/external/DirectLineAttachment.ts index e8123b479b..3cc83912e2 100644 --- a/packages/core/src/types/external/DirectLineAttachment.ts +++ b/packages/core/src/types/external/DirectLineAttachment.ts @@ -1,5 +1,6 @@ // TODO: [P1] #3953 We should fully type it out. +// eslint-disable-next-line @typescript-eslint/no-explicit-any type DirectLineAttachment = any; export default DirectLineAttachment; diff --git a/packages/core/src/types/external/DirectLineAudioCard.ts b/packages/core/src/types/external/DirectLineAudioCard.ts index 1aa6b663ed..34aeae20bc 100644 --- a/packages/core/src/types/external/DirectLineAudioCard.ts +++ b/packages/core/src/types/external/DirectLineAudioCard.ts @@ -1,5 +1,6 @@ // TODO: [P1] #3953 We should fully type it out. +// eslint-disable-next-line @typescript-eslint/no-explicit-any type DirectLineAudioCard = any; export default DirectLineAudioCard; diff --git a/packages/core/src/types/external/DirectLineCardAction.ts b/packages/core/src/types/external/DirectLineCardAction.ts index c61ace6d7f..ed819a429a 100644 --- a/packages/core/src/types/external/DirectLineCardAction.ts +++ b/packages/core/src/types/external/DirectLineCardAction.ts @@ -1,5 +1,128 @@ -// TODO: [P1] #3953 We should fully type it out. +type CardActionWithImageAndTitle = + | { image: string } + | { title: string } + | { + image: string; + title: string; + }; -type DirectLineCardAction = any; +/** + * A `call` action represents a telephone number that may be called. + * + * https://github.com/Microsoft/botframework-sdk/blob/main/specs/botframework-activity/botframework-activity.md#call + */ +type CallCardAction = CardActionWithImageAndTitle & { + type: 'call'; + value: string; +}; + +/** + * A `downloadFile` action represents a hyperlink to be downloaded. + * + * https://github.com/Microsoft/botframework-sdk/blob/main/specs/botframework-activity/botframework-activity.md#download-file-actions + */ +type DownloadFileCardAction = CardActionWithImageAndTitle & { + type: 'downloadFile'; + value: string; +}; + +/** + * An `imBack` action represents a text response that is added to the chat feed. + * + * https://github.com/Microsoft/botframework-sdk/blob/main/specs/botframework-activity/botframework-activity.md#im-back + */ +type IMBackCardAction = CardActionWithImageAndTitle & { + type: 'imBack'; + value: string; +}; + +/** + * A `messageBack` action represents a text response to be sent via the chat system. + * + * https://github.com/Microsoft/botframework-sdk/blob/main/specs/botframework-activity/botframework-activity.md#message-back + */ +type MessageBackCardAction = CardActionWithImageAndTitle & { + displayText?: string; + text?: string; + type: 'messageBack'; + value?: { [key: string]: any }; +}; + +/** + * An `openUrl` action represents a hyperlink to be handled by the client. + * + * https://github.com/Microsoft/botframework-sdk/blob/main/specs/botframework-activity/botframework-activity.md#open-url-actions + */ +type OpenURLCardAction = CardActionWithImageAndTitle & { + type: 'openUrl'; + value: string; +}; + +/** + * A `playAudio` action represents audio media that may be played. + * + * https://github.com/Microsoft/botframework-sdk/blob/main/specs/botframework-activity/botframework-activity.md#play-audio + */ +type PlayAudioCardAction = CardActionWithImageAndTitle & { + type: 'playAudio'; + value: string; +}; + +/** + * A `playVideo` action represents video media that may be played. + * + * https://github.com/Microsoft/botframework-sdk/blob/main/specs/botframework-activity/botframework-activity.md#play-video + */ +type PlayVideoCardAction = CardActionWithImageAndTitle & { + type: 'playVideo'; + value: string; +}; + +/** + * A `postBack` action represents a text response that is not added to the chat feed. + * + * https://github.com/Microsoft/botframework-sdk/blob/main/specs/botframework-activity/botframework-activity.md#post-back + */ +type PostBackCardAction = CardActionWithImageAndTitle & { + type: 'postBack'; + value: any; // For legacy reason, postBack support any. +}; + +/** + * A `showImage` action represents an image that may be displayed. + * + * https://github.com/Microsoft/botframework-sdk/blob/main/specs/botframework-activity/botframework-activity.md#show-image-file-actions + */ +type ShowImageCardAction = CardActionWithImageAndTitle & { + type: 'showImage'; + value: string; +}; + +/** + * A `signin` action represents a hyperlink to be handled by the client's signin system. + * + * https://github.com/Microsoft/botframework-sdk/blob/main/specs/botframework-activity/botframework-activity.md#signin + */ +type SignInCardAction = CardActionWithImageAndTitle & { + type: 'signin'; + value: string; +}; + +/** + * A card action represents a clickable or interactive button for use within cards or as suggested actions. They are used to solicit input from users. Despite their name, card actions are not limited to use solely on cards. + * + * https://github.com/Microsoft/botframework-sdk/blob/main/specs/botframework-activity/botframework-activity.md#card-action + */ +type DirectLineCardAction = + | CallCardAction + | DownloadFileCardAction + | IMBackCardAction + | MessageBackCardAction + | OpenURLCardAction + | PlayAudioCardAction + | PlayVideoCardAction + | PostBackCardAction + | ShowImageCardAction + | SignInCardAction; export default DirectLineCardAction; diff --git a/packages/core/src/types/external/DirectLineHeroCard.ts b/packages/core/src/types/external/DirectLineHeroCard.ts index ed0fe0b700..2336555c0f 100644 --- a/packages/core/src/types/external/DirectLineHeroCard.ts +++ b/packages/core/src/types/external/DirectLineHeroCard.ts @@ -1,5 +1,6 @@ // TODO: [P1] #3953 We should fully type it out. +// eslint-disable-next-line @typescript-eslint/no-explicit-any type DirectLineHeroCard = any; export default DirectLineHeroCard; diff --git a/packages/core/src/types/external/DirectLineJSBotConnection.ts b/packages/core/src/types/external/DirectLineJSBotConnection.ts index 0623afd84b..7aa62e7be3 100644 --- a/packages/core/src/types/external/DirectLineJSBotConnection.ts +++ b/packages/core/src/types/external/DirectLineJSBotConnection.ts @@ -1,5 +1,6 @@ // TODO: [P1] #3953 We should fully type it out. +// eslint-disable-next-line @typescript-eslint/no-explicit-any type DirectLineJSBotConnection = any; export default DirectLineJSBotConnection; diff --git a/packages/core/src/types/external/DirectLineOAuthCard.ts b/packages/core/src/types/external/DirectLineOAuthCard.ts index d769e4ee90..3763bf2081 100644 --- a/packages/core/src/types/external/DirectLineOAuthCard.ts +++ b/packages/core/src/types/external/DirectLineOAuthCard.ts @@ -1,5 +1,6 @@ // TODO: [P1] #3953 We should fully type it out. +// eslint-disable-next-line @typescript-eslint/no-explicit-any type DirectLineOAuthCard = any; export default DirectLineOAuthCard; diff --git a/packages/core/src/types/external/DirectLineReceiptCard.ts b/packages/core/src/types/external/DirectLineReceiptCard.ts index 3f540b4cfb..f6953fe1b0 100644 --- a/packages/core/src/types/external/DirectLineReceiptCard.ts +++ b/packages/core/src/types/external/DirectLineReceiptCard.ts @@ -1,5 +1,6 @@ // TODO: [P1] #3953 We should fully type it out. +// eslint-disable-next-line @typescript-eslint/no-explicit-any type DirectLineReceiptCard = any; export default DirectLineReceiptCard; diff --git a/packages/core/src/types/external/DirectLineSignInCard.ts b/packages/core/src/types/external/DirectLineSignInCard.ts index aa744aecfb..0984bd3eae 100644 --- a/packages/core/src/types/external/DirectLineSignInCard.ts +++ b/packages/core/src/types/external/DirectLineSignInCard.ts @@ -1,5 +1,6 @@ // TODO: [P1] #3953 We should fully type it out. +// eslint-disable-next-line @typescript-eslint/no-explicit-any type DirectLineSignInCard = any; export default DirectLineSignInCard; diff --git a/packages/core/src/types/external/DirectLineSuggestedAction.ts b/packages/core/src/types/external/DirectLineSuggestedAction.ts index 1172ffe544..6c9c5bffd3 100644 --- a/packages/core/src/types/external/DirectLineSuggestedAction.ts +++ b/packages/core/src/types/external/DirectLineSuggestedAction.ts @@ -1,5 +1,6 @@ // TODO: [P1] #3953 We should fully type it out. +// eslint-disable-next-line @typescript-eslint/no-explicit-any type DirectLineSuggestedAction = any; export default DirectLineSuggestedAction; diff --git a/packages/core/src/types/external/DirectLineThumbnailCard.ts b/packages/core/src/types/external/DirectLineThumbnailCard.ts index 2853a06395..2fb346236e 100644 --- a/packages/core/src/types/external/DirectLineThumbnailCard.ts +++ b/packages/core/src/types/external/DirectLineThumbnailCard.ts @@ -1,5 +1,6 @@ // TODO: [P1] #3953 We should fully type it out. +// eslint-disable-next-line @typescript-eslint/no-explicit-any type DirectLineThumbnailCard = any; export default DirectLineThumbnailCard; diff --git a/packages/core/src/types/external/DirectLineVideoCard.ts b/packages/core/src/types/external/DirectLineVideoCard.ts index 5a50b480cf..5ac8487db0 100644 --- a/packages/core/src/types/external/DirectLineVideoCard.ts +++ b/packages/core/src/types/external/DirectLineVideoCard.ts @@ -1,5 +1,6 @@ // TODO: [P1] #3953 We should fully type it out. +// eslint-disable-next-line @typescript-eslint/no-explicit-any type DirectLineVideoCard = any; export default DirectLineVideoCard;