diff --git a/packages/cards/src/actions/submit/collab-stage.spec.ts b/packages/cards/src/actions/submit/collab-stage.spec.ts index 6e3e25277..2a7b7c685 100644 --- a/packages/cards/src/actions/submit/collab-stage.spec.ts +++ b/packages/cards/src/actions/submit/collab-stage.spec.ts @@ -1,14 +1,20 @@ -import { CollabStageAction, CollabStageData, CollabStageValueData } from './collab-stage'; +import { CollabStageInvokeDataValue, InvokeSubmitActionData, SubmitActionData } from '../../core'; + +import { CollabStageAction } from './collab-stage'; describe('Actions.Submit.CollabStage', () => { it('should build', () => { - const action = new CollabStageAction().withData(new CollabStageData()).withValue({ + const action = new CollabStageAction().withData( + new InvokeSubmitActionData(undefined) + ).withValue({ name: 'test', entityId: 'test', contentUrl: 'http://localhost/tabs/test', }); - expect(action.data.msteams.value?.tabInfo).toEqual({ + const msteams = action.data.msteams as InvokeSubmitActionData; + const value = msteams.value as CollabStageInvokeDataValue; + expect(value.tabInfo).toEqual({ name: 'test', entityId: 'test', contentUrl: 'http://localhost/tabs/test', @@ -17,18 +23,22 @@ describe('Actions.Submit.CollabStage', () => { it('should build from interface', () => { const action = CollabStageAction.from({ - data: { - msteams: new CollabStageData( - new CollabStageValueData({ - name: 'test', - entityId: 'test', - contentUrl: 'http://localhost/tabs/test', + data: new SubmitActionData({ + msteams: new InvokeSubmitActionData( + new CollabStageInvokeDataValue({ + tabInfo: { + name: 'test', + entityId: 'test', + contentUrl: 'http://localhost/tabs/test', + }, }) ), - }, + }), }); - expect(action.data.msteams.value?.tabInfo).toEqual({ + const msteams = action.data.msteams as InvokeSubmitActionData; + const value = msteams.value as CollabStageInvokeDataValue; + expect(value.tabInfo).toEqual({ name: 'test', entityId: 'test', contentUrl: 'http://localhost/tabs/test', diff --git a/packages/cards/src/actions/submit/collab-stage.ts b/packages/cards/src/actions/submit/collab-stage.ts index e7cf9f69c..a0da237df 100644 --- a/packages/cards/src/actions/submit/collab-stage.ts +++ b/packages/cards/src/actions/submit/collab-stage.ts @@ -1,11 +1,18 @@ -import { ITabInfo } from '../../common'; - -import { ISubmitAction, SubmitAction, SubmitActionOptions } from '../../core'; - -import { MSTeamsData } from './ms-teams-data'; +import { + CollabStageInvokeDataValue, + ICollabStageInvokeDataValue, + IInvokeSubmitActionData, + InvokeSubmitActionData, + ISubmitAction, + ISubmitActionData, + ITabInfo, + SubmitAction, + SubmitActionData, + SubmitActionOptions, +} from '../../core'; export type CollabStageActionOptions = SubmitActionOptions & { - data: MSTeamsData; + data: ISubmitActionData; }; /** @@ -13,9 +20,9 @@ export type CollabStageActionOptions = SubmitActionOptions & { */ export interface ICollabStageAction extends ISubmitAction { /** - * Initial data that input fields will be combined with. These are essentially ‘hidden’ properties. + * Initial data that input fields will be combined with. These are essentially 'hidden' properties. */ - data: MSTeamsData; + data: ISubmitActionData; } /** @@ -23,95 +30,38 @@ export interface ICollabStageAction extends ISubmitAction { */ export class CollabStageAction extends SubmitAction implements ICollabStageAction { /** - * Initial data that input fields will be combined with. These are essentially ‘hidden’ properties. + * Initial data that input fields will be combined with. These are essentially 'hidden' properties. */ - data: MSTeamsData; + data: ISubmitActionData; constructor(tab?: ITabInfo, options: SubmitActionOptions = {}) { super(options); Object.assign(this, options); - this.data = { - msteams: { - type: 'invoke', - value: tab - ? { - type: 'tab/tabInfoAction', - tabInfo: tab, - } + this.data = new SubmitActionData({ + msteams: new InvokeSubmitActionData( + tab + ? new CollabStageInvokeDataValue({ tabInfo: tab }) : undefined, - }, - }; + ), + }); } static from(options: CollabStageActionOptions) { - return new CollabStageAction(options.data.msteams.value?.tabInfo, options); + const msteams = options.data.msteams as IInvokeSubmitActionData | undefined; + const value = msteams?.value as ICollabStageInvokeDataValue | undefined; + return new CollabStageAction(value?.tabInfo, options); } - withData(value: ICollabStageData) { - super.withData({ msteams: value }); + withData(value: IInvokeSubmitActionData) { + super.withData(new SubmitActionData({ msteams: value })); return this; } withValue(value: ITabInfo) { - this.data.msteams.value = new CollabStageValueData(value); + const msteams = this.data.msteams as IInvokeSubmitActionData | undefined; + if (msteams) { + msteams.value = new CollabStageInvokeDataValue({ tabInfo: value }); + } return this; } } - -/** - * Contains the Adaptive Card action data in {@link CollabStageAction}. - */ -export interface ICollabStageData { - type: 'invoke'; - - /** - * Set the value to send with the invoke - */ - value?: ICollabStageValueData; -} - -/** - * Contains the Adaptive Card action data in {@link CollabStageAction}. - */ -export class CollabStageData implements ICollabStageData { - type: 'invoke'; - - /** - * Set the value to send with the invoke - */ - value?: ICollabStageValueData; - - constructor(value?: ICollabStageValueData) { - this.type = 'invoke'; - this.value = value; - } -} - -/** - * Contains the Adaptive Card action value data in {@link CollabStageActionData}. - */ -export interface ICollabStageValueData { - type: 'tab/tabInfoAction'; - - /** - * Information about the iFrame content, rendered in the collab stage popout window. - */ - tabInfo: ITabInfo; -} - -/** - * Contains the Adaptive Card action value data in {@link CollabStageActionData}. - */ -export class CollabStageValueData implements ICollabStageValueData { - type: 'tab/tabInfoAction'; - - /** - * Information about the iFrame content, rendered in the collab stage popout window. - */ - tabInfo: ITabInfo; - - constructor(tab: ITabInfo) { - this.type = 'tab/tabInfoAction'; - this.tabInfo = tab; - } -} diff --git a/packages/cards/src/actions/submit/im-back.ts b/packages/cards/src/actions/submit/im-back.ts index 9c5219284..466a60ed0 100644 --- a/packages/cards/src/actions/submit/im-back.ts +++ b/packages/cards/src/actions/submit/im-back.ts @@ -4,6 +4,9 @@ import { MSTeamsData } from './ms-teams-data'; export type IMBackActionOptions = SubmitActionOptions & { data: MSTeamsData }; +/** + * @deprecated This type is deprecated. Please use {@link IImBackSubmitActionData} instead. This will be removed in a future version of the SDK. + */ export interface IIMBackAction extends ISubmitAction { /** * Initial data that input fields will be combined with. These are essentially ‘hidden’ properties. @@ -11,6 +14,9 @@ export interface IIMBackAction extends ISubmitAction { data: MSTeamsData; } +/** + * @deprecated This class is deprecated. Please use {@link ImBackSubmitActionData} instead. This will be removed in a future version of the SDK. + */ export class IMBackAction extends SubmitAction implements IIMBackAction { /** * Initial data that input fields will be combined with. These are essentially ‘hidden’ properties. @@ -38,6 +44,9 @@ export class IMBackAction extends SubmitAction implements IIMBackAction { } } +/** + * @deprecated This type is deprecated. Please use {@link IImBackSubmitActionData} instead. This will be removed in a future version of the SDK. + */ export interface IIMBackData { type: 'imBack'; @@ -47,6 +56,9 @@ export interface IIMBackData { value: string; } +/** + * @deprecated This class is deprecated. Please use {@link ImBackSubmitActionData} instead. This will be removed in a future version of the SDK. + */ export class IMBackData implements IIMBackData { type: 'imBack'; diff --git a/packages/cards/src/actions/submit/invoke.ts b/packages/cards/src/actions/submit/invoke.ts index 84892bf36..277b6a5bd 100644 --- a/packages/cards/src/actions/submit/invoke.ts +++ b/packages/cards/src/actions/submit/invoke.ts @@ -4,6 +4,9 @@ import { MSTeamsData } from './ms-teams-data'; export type InvokeActionOptions = SubmitActionOptions & { data: MSTeamsData }; +/** + * @deprecated This type is deprecated. Please use {@link IInvokeSubmitActionData} instead. This will be removed in a future version of the SDK. + */ export interface IInvokeAction extends ISubmitAction { /** * Initial data that input fields will be combined with. These are essentially ‘hidden’ properties. @@ -11,6 +14,9 @@ export interface IInvokeAction extends ISubmitAction { data: MSTeamsData; } +/** + * @deprecated This class is deprecated. Please use {@link InvokeSubmitActionData} instead. This will be removed in a future version of the SDK. + */ export class InvokeAction extends SubmitAction implements IInvokeAction { /** * Initial data that input fields will be combined with. These are essentially ‘hidden’ properties. @@ -38,6 +44,9 @@ export class InvokeAction extends SubmitAction implements IInvokeAction { } } +/** + * @deprecated This type is deprecated. Please use {@link IInvokeSubmitActionData} instead. This will be removed in a future version of the SDK. + */ export interface IInvokeData { type: 'invoke'; @@ -47,6 +56,9 @@ export interface IInvokeData { value?: any; } +/** + * @deprecated This class is deprecated. Please use {@link InvokeSubmitActionData} instead. This will be removed in a future version of the SDK. + */ export class InvokeData implements IInvokeData { type: 'invoke'; diff --git a/packages/cards/src/actions/submit/message-back.ts b/packages/cards/src/actions/submit/message-back.ts index b01cdccb0..54de4555d 100644 --- a/packages/cards/src/actions/submit/message-back.ts +++ b/packages/cards/src/actions/submit/message-back.ts @@ -6,6 +6,9 @@ export type MessageBackActionOptions = SubmitActionOptions & { data: MSTeamsData; }; +/** + * @deprecated This type is deprecated. Please use {@link IMessageBackSubmitActionData} instead. This will be removed in a future version of the SDK. + */ export interface IMessageBackAction extends ISubmitAction { /** * Initial data that input fields will be combined with. These are essentially ‘hidden’ properties. @@ -13,6 +16,9 @@ export interface IMessageBackAction extends ISubmitAction { data: MSTeamsData; } +/** + * @deprecated This class is deprecated. Please use {@link MessageBackSubmitActionData} instead. This will be removed in a future version of the SDK. + */ export class MessageBackAction extends SubmitAction implements IMessageBackAction { /** * Initial data that input fields will be combined with. These are essentially ‘hidden’ properties. @@ -37,6 +43,9 @@ export class MessageBackAction extends SubmitAction implements IMessageBackActio } } +/** + * @deprecated This type is deprecated. Please use {@link IMessageBackSubmitActionData} instead. This will be removed in a future version of the SDK. + */ export interface IMessageBackData { type: 'messageBack'; @@ -58,6 +67,9 @@ export interface IMessageBackData { value: string; } +/** + * @deprecated This class is deprecated. Please use {@link MessageBackSubmitActionData} instead. This will be removed in a future version of the SDK. + */ export class MessageBackData implements IMessageBackData { type: 'messageBack'; diff --git a/packages/cards/src/actions/submit/sign-in.ts b/packages/cards/src/actions/submit/sign-in.ts index facdf9cb9..84bb429da 100644 --- a/packages/cards/src/actions/submit/sign-in.ts +++ b/packages/cards/src/actions/submit/sign-in.ts @@ -4,6 +4,9 @@ import { MSTeamsData } from './ms-teams-data'; export type SignInActionOptions = SubmitActionOptions & { data: MSTeamsData }; +/** + * @deprecated This type is deprecated. Please use {@link ISigninSubmitActionData} instead. This will be removed in a future version of the SDK. + */ export interface ISignInAction extends ISubmitAction { /** * Initial data that input fields will be combined with. These are essentially ‘hidden’ properties. @@ -11,6 +14,9 @@ export interface ISignInAction extends ISubmitAction { data: MSTeamsData; } +/** + * @deprecated This class is deprecated. Please use {@link SigninSubmitActionData} instead. This will be removed in a future version of the SDK. + */ export class SignInAction extends SubmitAction implements ISignInAction { /** * Initial data that input fields will be combined with. These are essentially ‘hidden’ properties. @@ -38,6 +44,9 @@ export class SignInAction extends SubmitAction implements ISignInAction { } } +/** + * @deprecated This type is deprecated. Please use {@link ISigninSubmitActionData} instead. This will be removed in a future version of the SDK. + */ export interface ISignInData { type: 'signin'; @@ -47,6 +56,9 @@ export interface ISignInData { value: string; } +/** + * @deprecated This class is deprecated. Please use {@link SigninSubmitActionData} instead. This will be removed in a future version of the SDK. + */ export class SignInData implements ISignInData { type: 'signin'; diff --git a/packages/cards/src/actions/submit/task-fetch.ts b/packages/cards/src/actions/submit/task-fetch.ts index 8bda1f414..b84e6855f 100644 --- a/packages/cards/src/actions/submit/task-fetch.ts +++ b/packages/cards/src/actions/submit/task-fetch.ts @@ -11,6 +11,9 @@ export type TaskFetchDataValues = { type?: never; }; +/** + * @deprecated This type is deprecated. Please use {@link ITaskFetchSubmitActionData} instead. This will be removed in a future version of the SDK. + */ export interface ITaskFetchAction extends ISubmitAction { /** * Initial data that input fields will be combined with. These are essentially ‘hidden’ properties. @@ -18,6 +21,9 @@ export interface ITaskFetchAction extends ISubmitAction { data: MSTeamsData; } +/** + * @deprecated This class is deprecated. Please use {@link TaskFetchSubmitActionData} instead. This will be removed in a future version of the SDK. + */ export class TaskFetchAction extends SubmitAction implements ITaskFetchAction { /** * Initial data that input fields will be combined with. These are essentially ‘hidden’ properties. @@ -50,10 +56,16 @@ export class TaskFetchAction extends SubmitAction implements ITaskFetchAction { } } +/** + * @deprecated This type is deprecated. Please use {@link ITaskFetchSubmitActionData} instead. This will be removed in a future version of the SDK. + */ export interface ITaskFetchData { type: 'task/fetch'; } +/** + * @deprecated This class is deprecated. Please use {@link TaskFetchSubmitActionData} instead. This will be removed in a future version of the SDK. + */ export class TaskFetchData implements MSTeamsData { msteams = { type: 'task/fetch' as const, diff --git a/packages/cards/src/common/index.ts b/packages/cards/src/common/index.ts deleted file mode 100644 index 4725e4672..000000000 --- a/packages/cards/src/common/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './tab-info'; diff --git a/packages/cards/src/common/tab-info.ts b/packages/cards/src/common/tab-info.ts deleted file mode 100644 index 4c0ebd4ef..000000000 --- a/packages/cards/src/common/tab-info.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Information about the content to embed in an iFrame. - */ -export interface ITabInfo { - /** - * The URL to open in an iFrame. - */ - contentUrl: string; - - /** - * Optional. Website URL to the content, allowing users to open this content in the browser (if they prefer). - */ - websiteUrl?: string; - - /** - * Name for the content. This will be displayed as the title of the window hosting the iFrame. - */ - name: string; - - /** - * Unique entity id for this content (e.g., random UUID). - */ - entityId: string; -} diff --git a/packages/cards/src/core.ts b/packages/cards/src/core.ts index ba582596f..2ec4b4a00 100644 --- a/packages/cards/src/core.ts +++ b/packages/cards/src/core.ts @@ -1,2667 +1,37 @@ - - -/* - This file was automatically generated by a tool on 05/02/2025, 4:26 PM UTC. - It includes declarations for Adaptive Card features available in Teams. -*/ -export type CardElement = - | IContainer - | IActionSet - | IColumnSet - | IMedia - | IRichTextBlock - | ITable - | ITextBlock - | IFactSet - | IImageSet - | IImage - | ITextInput - | IDateInput - | ITimeInput - | INumberInput - | IToggleInput - | IChoiceSetInput - | IRatingInput - | IRating - | ICompoundButton - | IIcon - | ICarousel - | IBadge - | IDonutChart - | IPieChart - | IGroupedVerticalBarChart - | IVerticalBarChart - | IHorizontalBarChart - | IStackedHorizontalBarChart - | ILineChart - | IGaugeChart - | ICodeBlock - | IComUserMicrosoftGraphComponent - | IComUsersMicrosoftGraphComponent - | IComResourceMicrosoftGraphComponent - | IComFileMicrosoftGraphComponent - | IComEventMicrosoftGraphComponent; - -export type CardAction = - | ISubmitAction - | IOpenUrlAction - | IExecuteAction - | IToggleVisibilityAction - | IShowCardAction - | IResetInputsAction; - -export type IconName = - | 'AccessTime' - | 'Accessibility' - | 'AccessibilityCheckmark' - | 'Add' - | 'AddCircle' - | 'AddSquare' - | 'AddSquareMultiple' - | 'AddSubtractCircle' - | 'Airplane' - | 'AirplaneLanding' - | 'AirplaneTakeOff' - | 'Album' - | 'AlbumAdd' - | 'Alert' - | 'AlertBadge' - | 'AlertOff' - | 'AlertOn' - | 'AlertSnooze' - | 'AlertUrgent' - | 'AlignBottom' - | 'AlignCenterHorizontal' - | 'AlignCenterVertical' - | 'AlignDistributeBottom' - | 'AlignDistributeLeft' - | 'AlignDistributeRight' - | 'AlignDistributeTop' - | 'AlignEndHorizontal' - | 'AlignEndVertical' - | 'AlignLeft' - | 'AlignRight' - | 'AlignSpaceAroundHorizontal' - | 'AlignSpaceAroundVertical' - | 'AlignSpaceBetweenHorizontal' - | 'AlignSpaceBetweenVertical' - | 'AlignSpaceEvenlyHorizontal' - | 'AlignSpaceEvenlyVertical' - | 'AlignSpaceFitVertical' - | 'AlignStartHorizontal' - | 'AlignStartVertical' - | 'AlignStraighten' - | 'AlignStretchHorizontal' - | 'AlignStretchVertical' - | 'AlignTop' - | 'AnimalCat' - | 'AnimalDog' - | 'AnimalRabbit' - | 'AnimalRabbitOff' - | 'AnimalTurtle' - | 'AppFolder' - | 'AppGeneric' - | 'AppRecent' - | 'AppStore' - | 'AppTitle' - | 'ApprovalsApp' - | 'Apps' - | 'AppsAddIn' - | 'AppsList' - | 'AppsListDetail' - | 'Archive' - | 'ArchiveArrowBack' - | 'ArchiveMultiple' - | 'ArchiveSettings' - | 'ArrowAutofitContent' - | 'ArrowAutofitDown' - | 'ArrowAutofitHeight' - | 'ArrowAutofitHeightDotted' - | 'ArrowAutofitHeightIn' - | 'ArrowAutofitUp' - | 'ArrowAutofitWidth' - | 'ArrowAutofitWidthDotted' - | 'ArrowBetweenDown' - | 'ArrowBetweenUp' - | 'ArrowBidirectionalLeftRight' - | 'ArrowBidirectionalUpDown' - | 'ArrowBounce' - | 'ArrowCircleDown' - | 'ArrowCircleDownDouble' - | 'ArrowCircleDownRight' - | 'ArrowCircleDownSplit' - | 'ArrowCircleDownUp' - | 'ArrowCircleLeft' - | 'ArrowCircleRight' - | 'ArrowCircleUp' - | 'ArrowCircleUpLeft' - | 'ArrowCircleUpRight' - | 'ArrowClockwise' - | 'ArrowClockwiseDashes' - | 'ArrowCollapseAll' - | 'ArrowCounterclockwise' - | 'ArrowCounterclockwiseDashes' - | 'ArrowCurveDownLeft' - | 'ArrowCurveDownRight' - | 'ArrowCurveUpLeft' - | 'ArrowCurveUpRight' - | 'ArrowDown' - | 'ArrowDownExclamation' - | 'ArrowDownLeft' - | 'ArrowDownload' - | 'ArrowDownloadOff' - | 'ArrowEject' - | 'ArrowEnter' - | 'ArrowEnterLeft' - | 'ArrowEnterUp' - | 'ArrowExit' - | 'ArrowExpand' - | 'ArrowExport' - | 'ArrowExportLtr' - | 'ArrowExportRtl' - | 'ArrowExportUp' - | 'ArrowFit' - | 'ArrowFitIn' - | 'ArrowFlowDiagonalUpRight' - | 'ArrowFlowUpRight' - | 'ArrowFlowUpRightRectangleMultiple' - | 'ArrowForward' - | 'ArrowForwardDownLightning' - | 'ArrowForwardDownPerson' - | 'ArrowHookDownLeft' - | 'ArrowHookDownRight' - | 'ArrowHookUpLeft' - | 'ArrowHookUpRight' - | 'ArrowImport' - | 'ArrowJoin' - | 'ArrowLeft' - | 'ArrowMaximize' - | 'ArrowMaximizeVertical' - | 'ArrowMinimize' - | 'ArrowMinimizeVertical' - | 'ArrowMove' - | 'ArrowMoveInward' - | 'ArrowNext' - | 'ArrowOutlineDownLeft' - | 'ArrowOutlineUpRight' - | 'ArrowParagraph' - | 'ArrowPrevious' - | 'ArrowRedo' - | 'ArrowRepeat1' - | 'ArrowRepeatAll' - | 'ArrowRepeatAllOff' - | 'ArrowReply' - | 'ArrowReplyAll' - | 'ArrowReplyDown' - | 'ArrowReset' - | 'ArrowRight' - | 'ArrowRotateClockwise' - | 'ArrowRotateCounterclockwise' - | 'ArrowRouting' - | 'ArrowRoutingRectangleMultiple' - | 'ArrowShuffle' - | 'ArrowShuffleOff' - | 'ArrowSort' - | 'ArrowSortDown' - | 'ArrowSortDownLines' - | 'ArrowSortUp' - | 'ArrowSplit' - | 'ArrowSprint' - | 'ArrowSquareDown' - | 'ArrowSquareUpRight' - | 'ArrowStepBack' - | 'ArrowStepIn' - | 'ArrowStepInDiagonalDownLeft' - | 'ArrowStepInLeft' - | 'ArrowStepInRight' - | 'ArrowStepOut' - | 'ArrowStepOver' - | 'ArrowSwap' - | 'ArrowSync' - | 'ArrowSyncCheckmark' - | 'ArrowSyncCircle' - | 'ArrowSyncDismiss' - | 'ArrowSyncOff' - | 'ArrowTrending' - | 'ArrowTrendingCheckmark' - | 'ArrowTrendingDown' - | 'ArrowTrendingLines' - | 'ArrowTrendingSettings' - | 'ArrowTrendingSparkle' - | 'ArrowTrendingText' - | 'ArrowTrendingWrench' - | 'ArrowTurnBidirectionalDownRight' - | 'ArrowTurnDownLeft' - | 'ArrowTurnDownRight' - | 'ArrowTurnDownUp' - | 'ArrowTurnLeftDown' - | 'ArrowTurnLeftRight' - | 'ArrowTurnLeftUp' - | 'ArrowTurnRight' - | 'ArrowTurnRightDown' - | 'ArrowTurnRightLeft' - | 'ArrowTurnRightUp' - | 'ArrowTurnUpDown' - | 'ArrowTurnUpLeft' - | 'ArrowUndo' - | 'ArrowUp' - | 'ArrowUpLeft' - | 'ArrowUpRight' - | 'ArrowUpRightDashes' - | 'ArrowUpSquareSettings' - | 'ArrowUpload' - | 'ArrowWrap' - | 'ArrowWrapOff' - | 'ArrowsBidirectional' - | 'Attach' - | 'AttachArrowRight' - | 'AttachText' - | 'AutoFitHeight' - | 'AutoFitWidth' - | 'Autocorrect' - | 'Autosum' - | 'Backpack' - | 'BackpackAdd' - | 'Backspace' - | 'Badge' - | 'Balloon' - | 'BarcodeScanner' - | 'Battery0' - | 'Battery10' - | 'Battery1' - | 'Battery2' - | 'Battery3' - | 'Battery4' - | 'Battery5' - | 'Battery6' - | 'Battery7' - | 'Battery8' - | 'Battery9' - | 'BatteryCharge' - | 'BatteryCheckmark' - | 'BatterySaver' - | 'BatteryWarning' - | 'Beach' - | 'Beaker' - | 'BeakerAdd' - | 'BeakerDismiss' - | 'BeakerEdit' - | 'BeakerEmpty' - | 'BeakerOff' - | 'BeakerSettings' - | 'Bed' - | 'BezierCurveSquare' - | 'BinFull' - | 'BinRecycle' - | 'BinRecycleFull' - | 'BinderTriangle' - | 'Bluetooth' - | 'BluetoothConnected' - | 'BluetoothDisabled' - | 'BluetoothSearching' - | 'Blur' - | 'Board' - | 'BoardGames' - | 'BoardHeart' - | 'BoardSplit' - | 'Book' - | 'BookAdd' - | 'BookArrowClockwise' - | 'BookClock' - | 'BookCoins' - | 'BookCompass' - | 'BookContacts' - | 'BookDatabase' - | 'BookDefault' - | 'BookDismiss' - | 'BookExclamationMark' - | 'BookGlobe' - | 'BookInformation' - | 'BookLetter' - | 'BookNumber' - | 'BookOpen' - | 'BookOpenGlobe' - | 'BookOpenMicrophone' - | 'BookPulse' - | 'BookQuestionMark' - | 'BookQuestionMarkRtl' - | 'BookSearch' - | 'BookStar' - | 'BookTemplate' - | 'BookTheta' - | 'BookToolbox' - | 'Bookmark' - | 'BookmarkAdd' - | 'BookmarkMultiple' - | 'BookmarkOff' - | 'BookmarkSearch' - | 'BorderAll' - | 'BorderBottom' - | 'BorderBottomDouble' - | 'BorderBottomThick' - | 'BorderInside' - | 'BorderLeft' - | 'BorderLeftRight' - | 'BorderNone' - | 'BorderOutside' - | 'BorderOutsideThick' - | 'BorderRight' - | 'BorderTop' - | 'BorderTopBottom' - | 'BorderTopBottomDouble' - | 'BorderTopBottomThick' - | 'Bot' - | 'BotAdd' - | 'BotSparkle' - | 'BowTie' - | 'BowlChopsticks' - | 'BowlSalad' - | 'Box' - | 'BoxArrowLeft' - | 'BoxArrowUp' - | 'BoxCheckmark' - | 'BoxDismiss' - | 'BoxEdit' - | 'BoxMultiple' - | 'BoxMultipleArrowLeft' - | 'BoxMultipleArrowRight' - | 'BoxMultipleCheckmark' - | 'BoxMultipleSearch' - | 'BoxSearch' - | 'BoxToolbox' - | 'Braces' - | 'BracesCheckmark' - | 'BracesDismiss' - | 'BracesVariable' - | 'BrainCircuit' - | 'Branch' - | 'BranchCompare' - | 'BranchFork' - | 'BranchForkHint' - | 'BranchForkLink' - | 'BranchRequest' - | 'BreakoutRoom' - | 'Briefcase' - | 'BriefcaseMedical' - | 'BriefcaseOff' - | 'BriefcasePerson' - | 'BriefcaseSearch' - | 'BrightnessHigh' - | 'BrightnessLow' - | 'BroadActivityFeed' - | 'Broom' - | 'BubbleMultiple' - | 'Bug' - | 'BugArrowCounterclockwise' - | 'BugProhibited' - | 'Building' - | 'BuildingBank' - | 'BuildingBankLink' - | 'BuildingBankToolbox' - | 'BuildingCloud' - | 'BuildingDesktop' - | 'BuildingFactory' - | 'BuildingGovernment' - | 'BuildingGovernmentSearch' - | 'BuildingHome' - | 'BuildingLighthouse' - | 'BuildingMosque' - | 'BuildingMultiple' - | 'BuildingPeople' - | 'BuildingRetail' - | 'BuildingRetailMoney' - | 'BuildingRetailMore' - | 'BuildingRetailShield' - | 'BuildingRetailToolbox' - | 'BuildingShop' - | 'BuildingSkyscraper' - | 'BuildingSwap' - | 'BuildingTownhouse' - | 'Button' - | 'Calculator' - | 'CalculatorArrowClockwise' - | 'CalculatorMultiple' - | 'Calendar' - | 'Calendar3Day' - | 'CalendarAdd' - | 'CalendarAgenda' - | 'CalendarArrowCounterclockwise' - | 'CalendarArrowDown' - | 'CalendarArrowRight' - | 'CalendarAssistant' - | 'CalendarCancel' - | 'CalendarChat' - | 'CalendarCheckmark' - | 'CalendarClock' - | 'CalendarDataBar' - | 'CalendarDate' - | 'CalendarDay' - | 'CalendarEdit' - | 'CalendarEmpty' - | 'CalendarError' - | 'CalendarEye' - | 'CalendarInfo' - | 'CalendarLink' - | 'CalendarLock' - | 'CalendarLtr' - | 'CalendarMail' - | 'CalendarMention' - | 'CalendarMonth' - | 'CalendarMultiple' - | 'CalendarNote' - | 'CalendarPattern' - | 'CalendarPerson' - | 'CalendarPhone' - | 'CalendarPlay' - | 'CalendarQuestionMark' - | 'CalendarRecord' - | 'CalendarReply' - | 'CalendarRtl' - | 'CalendarSearch' - | 'CalendarSettings' - | 'CalendarShield' - | 'CalendarStar' - | 'CalendarSync' - | 'CalendarToday' - | 'CalendarToolbox' - | 'CalendarVideo' - | 'CalendarWeekNumbers' - | 'CalendarWeekStart' - | 'CalendarWorkWeek' - | 'Call' - | 'CallAdd' - | 'CallCheckmark' - | 'CallConnecting' - | 'CallDismiss' - | 'CallEnd' - | 'CallExclamation' - | 'CallForward' - | 'CallInbound' - | 'CallMissed' - | 'CallOutbound' - | 'CallPark' - | 'CallPause' - | 'CallProhibited' - | 'CallTransfer' - | 'CallWarning' - | 'CalligraphyPen' - | 'CalligraphyPenCheckmark' - | 'CalligraphyPenError' - | 'CalligraphyPenQuestionMark' - | 'Camera' - | 'CameraAdd' - | 'CameraDome' - | 'CameraEdit' - | 'CameraOff' - | 'CameraSparkles' - | 'CameraSwitch' - | 'CardUi' - | 'CaretDown' - | 'CaretDownRight' - | 'CaretLeft' - | 'CaretRight' - | 'CaretUp' - | 'Cart' - | 'Cast' - | 'CastMultiple' - | 'CatchUp' - | 'Cd' - | 'Cellular3G' - | 'Cellular4G' - | 'Cellular5G' - | 'CellularData1' - | 'CellularData2' - | 'CellularData3' - | 'CellularData4' - | 'CellularData5' - | 'CellularOff' - | 'CellularWarning' - | 'CenterHorizontal' - | 'CenterVertical' - | 'Certificate' - | 'Channel' - | 'ChannelAdd' - | 'ChannelAlert' - | 'ChannelArrowLeft' - | 'ChannelDismiss' - | 'ChannelShare' - | 'ChannelSubtract' - | 'ChartMultiple' - | 'ChartPerson' - | 'Chat' - | 'ChatAdd' - | 'ChatArrowBack' - | 'ChatArrowDoubleBack' - | 'ChatBubblesQuestion' - | 'ChatCursor' - | 'ChatDismiss' - | 'ChatEmpty' - | 'ChatHelp' - | 'ChatLock' - | 'ChatMail' - | 'ChatMultiple' - | 'ChatMultipleHeart' - | 'ChatOff' - | 'ChatSettings' - | 'ChatSparkle' - | 'ChatVideo' - | 'ChatWarning' - | 'Check' - | 'Checkbox1' - | 'Checkbox2' - | 'CheckboxArrowRight' - | 'CheckboxChecked' - | 'CheckboxCheckedSync' - | 'CheckboxIndeterminate' - | 'CheckboxPerson' - | 'CheckboxUnchecked' - | 'CheckboxWarning' - | 'Checkmark' - | 'CheckmarkCircle' - | 'CheckmarkCircleSquare' - | 'CheckmarkLock' - | 'CheckmarkNote' - | 'CheckmarkSquare' - | 'CheckmarkStarburst' - | 'CheckmarkUnderlineCircle' - | 'Chess' - | 'ChevronCircleDown' - | 'ChevronCircleLeft' - | 'ChevronCircleRight' - | 'ChevronCircleUp' - | 'ChevronDoubleDown' - | 'ChevronDoubleLeft' - | 'ChevronDoubleRight' - | 'ChevronDoubleUp' - | 'ChevronDown' - | 'ChevronDownUp' - | 'ChevronLeft' - | 'ChevronRight' - | 'ChevronUp' - | 'ChevronUpDown' - | 'Circle' - | 'CircleEdit' - | 'CircleEraser' - | 'CircleHalfFill' - | 'CircleHint' - | 'CircleHintHalfVertical' - | 'CircleImage' - | 'CircleLine' - | 'CircleMultipleSubtractCheckmark' - | 'CircleOff' - | 'CircleSmall' - | 'City' - | 'Class' - | 'Classification' - | 'ClearFormatting' - | 'Clipboard' - | 'Clipboard3Day' - | 'ClipboardArrowRight' - | 'ClipboardBrush' - | 'ClipboardBulletList' - | 'ClipboardBulletListLtr' - | 'ClipboardBulletListRtl' - | 'ClipboardCheckmark' - | 'ClipboardClock' - | 'ClipboardCode' - | 'ClipboardDataBar' - | 'ClipboardDay' - | 'ClipboardEdit' - | 'ClipboardError' - | 'ClipboardHeart' - | 'ClipboardImage' - | 'ClipboardLetter' - | 'ClipboardLink' - | 'ClipboardMathFormula' - | 'ClipboardMonth' - | 'ClipboardMore' - | 'ClipboardMultiple' - | 'ClipboardNote' - | 'ClipboardNumber123' - | 'ClipboardPaste' - | 'ClipboardPulse' - | 'ClipboardSearch' - | 'ClipboardSettings' - | 'ClipboardTask' - | 'ClipboardTaskAdd' - | 'ClipboardTaskList' - | 'ClipboardTaskListLtr' - | 'ClipboardTaskListRtl' - | 'ClipboardText' - | 'ClipboardTextEdit' - | 'ClipboardTextLtr' - | 'ClipboardTextRtl' - | 'Clock' - | 'ClockAlarm' - | 'ClockArrowDownload' - | 'ClockDismiss' - | 'ClockLock' - | 'ClockPause' - | 'ClockToolbox' - | 'ClosedCaption' - | 'ClosedCaptionOff' - | 'Cloud' - | 'CloudAdd' - | 'CloudArchive' - | 'CloudArrowDown' - | 'CloudArrowUp' - | 'CloudBeaker' - | 'CloudBidirectional' - | 'CloudCheckmark' - | 'CloudCube' - | 'CloudDatabase' - | 'CloudDesktop' - | 'CloudDismiss' - | 'CloudEdit' - | 'CloudError' - | 'CloudFlow' - | 'CloudLink' - | 'CloudOff' - | 'CloudSwap' - | 'CloudSync' - | 'CloudWords' - | 'Clover' - | 'Code' - | 'CodeBlock' - | 'CodeCircle' - | 'CodeCs' - | 'CodeCsRectangle' - | 'CodeFs' - | 'CodeFsRectangle' - | 'CodeJs' - | 'CodeJsRectangle' - | 'CodePy' - | 'CodePyRectangle' - | 'CodeRb' - | 'CodeRbRectangle' - | 'CodeText' - | 'CodeTextEdit' - | 'CodeTextOff' - | 'CodeTs' - | 'CodeTsRectangle' - | 'CodeVb' - | 'CodeVbRectangle' - | 'Collections' - | 'CollectionsAdd' - | 'Color' - | 'ColorBackground' - | 'ColorBackgroundAccent' - | 'ColorFill' - | 'ColorFillAccent' - | 'ColorLine' - | 'ColorLineAccent' - | 'Column' - | 'ColumnArrowRight' - | 'ColumnDoubleCompare' - | 'ColumnEdit' - | 'ColumnSingle' - | 'ColumnSingleCompare' - | 'ColumnTriple' - | 'ColumnTripleEdit' - | 'Comma' - | 'Comment' - | 'CommentAdd' - | 'CommentArrowLeft' - | 'CommentArrowRight' - | 'CommentCheckmark' - | 'CommentDismiss' - | 'CommentEdit' - | 'CommentError' - | 'CommentLightning' - | 'CommentLink' - | 'CommentMention' - | 'CommentMultiple' - | 'CommentMultipleCheckmark' - | 'CommentMultipleLink' - | 'CommentNote' - | 'CommentOff' - | 'Communication' - | 'CommunicationPerson' - | 'CommunicationShield' - | 'CompassNorthwest' - | 'Component2DoubleTapSwipeDown' - | 'Component2DoubleTapSwipeUp' - | 'Compose' - | 'Cone' - | 'ConferenceRoom' - | 'Connected' - | 'Connector' - | 'ContactCard' - | 'ContactCardGroup' - | 'ContactCardLink' - | 'ContactCardRibbon' - | 'ContentSettings' - | 'ContentView' - | 'ContentViewGallery' - | 'ContentViewGalleryLightning' - | 'ContractDownLeft' - | 'ContractUpRight' - | 'ControlButton' - | 'ConvertRange' - | 'Cookies' - | 'Copy' - | 'CopyAdd' - | 'CopyArrowRight' - | 'CopySelect' - | 'Couch' - | 'CreditCardClock' - | 'CreditCardPerson' - | 'CreditCardToolbox' - | 'Crop' - | 'CropInterim' - | 'CropInterimOff' - | 'CropSparkle' - | 'Crown' - | 'CrownSubtract' - | 'Cube' - | 'CubeAdd' - | 'CubeArrowCurveDown' - | 'CubeLink' - | 'CubeMultiple' - | 'CubeQuick' - | 'CubeRotate' - | 'CubeSync' - | 'CubeTree' - | 'CurrencyDollarEuro' - | 'CurrencyDollarRupee' - | 'Cursor' - | 'CursorClick' - | 'CursorHover' - | 'CursorHoverOff' - | 'CursorProhibited' - | 'Cut' - | 'DarkTheme' - | 'DataArea' - | 'DataBarHorizontal' - | 'DataBarHorizontalDescending' - | 'DataBarVertical' - | 'DataBarVerticalAdd' - | 'DataBarVerticalAscending' - | 'DataBarVerticalStar' - | 'DataFunnel' - | 'DataHistogram' - | 'DataLine' - | 'DataPie' - | 'DataScatter' - | 'DataSunburst' - | 'DataTreemap' - | 'DataTrending' - | 'DataUsage' - | 'DataUsageEdit' - | 'DataUsageSettings' - | 'DataUsageToolbox' - | 'DataWaterfall' - | 'DataWhisker' - | 'Database' - | 'DatabaseArrowDown' - | 'DatabaseArrowRight' - | 'DatabaseArrowUp' - | 'DatabaseLightning' - | 'DatabaseLink' - | 'DatabaseMultiple' - | 'DatabasePerson' - | 'DatabasePlugConnected' - | 'DatabaseSearch' - | 'DatabaseStack' - | 'DatabaseSwitch' - | 'DatabaseWarning' - | 'DatabaseWindow' - | 'DecimalArrowLeft' - | 'DecimalArrowRight' - | 'Delete' - | 'DeleteArrowBack' - | 'DeleteDismiss' - | 'DeleteLines' - | 'DeleteOff' - | 'Dentist' - | 'DesignIdeas' - | 'Desk' - | 'Desktop' - | 'DesktopArrowDown' - | 'DesktopArrowRight' - | 'DesktopCheckmark' - | 'DesktopCursor' - | 'DesktopEdit' - | 'DesktopFlow' - | 'DesktopKeyboard' - | 'DesktopMac' - | 'DesktopPulse' - | 'DesktopSignal' - | 'DesktopSpeaker' - | 'DesktopSpeakerOff' - | 'DesktopSync' - | 'DesktopToolbox' - | 'DesktopTower' - | 'DeveloperBoard' - | 'DeveloperBoardLightning' - | 'DeveloperBoardLightningToolbox' - | 'DeveloperBoardSearch' - | 'DeviceEq' - | 'DeviceMeetingRoom' - | 'DeviceMeetingRoomRemote' - | 'Diagram' - | 'Dialpad' - | 'DialpadOff' - | 'DialpadQuestionMark' - | 'Diamond' - | 'Directions' - | 'Dishwasher' - | 'Dismiss' - | 'DismissCircle' - | 'DismissSquare' - | 'DismissSquareMultiple' - | 'Diversity' - | 'DividerShort' - | 'DividerTall' - | 'Dock' - | 'DockRow' - | 'Doctor' - | 'Document100' - | 'Document' - | 'DocumentAdd' - | 'DocumentArrowDown' - | 'DocumentArrowLeft' - | 'DocumentArrowRight' - | 'DocumentArrowUp' - | 'DocumentBorder' - | 'DocumentBorderPrint' - | 'DocumentBriefcase' - | 'DocumentBulletList' - | 'DocumentBulletListArrowLeft' - | 'DocumentBulletListClock' - | 'DocumentBulletListCube' - | 'DocumentBulletListMultiple' - | 'DocumentBulletListOff' - | 'DocumentCatchUp' - | 'DocumentCheckmark' - | 'DocumentChevronDouble' - | 'DocumentContract' - | 'DocumentCopy' - | 'DocumentCs' - | 'DocumentCss' - | 'DocumentCube' - | 'DocumentData' - | 'DocumentDataLink' - | 'DocumentDataLock' - | 'DocumentDatabase' - | 'DocumentDismiss' - | 'DocumentEdit' - | 'DocumentEndnote' - | 'DocumentError' - | 'DocumentFit' - | 'DocumentFlowchart' - | 'DocumentFolder' - | 'DocumentFooter' - | 'DocumentFooterDismiss' - | 'DocumentFs' - | 'DocumentHeader' - | 'DocumentHeaderArrowDown' - | 'DocumentHeaderDismiss' - | 'DocumentHeaderFooter' - | 'DocumentHeart' - | 'DocumentHeartPulse' - | 'DocumentImage' - | 'DocumentJava' - | 'DocumentJavascript' - | 'DocumentJs' - | 'DocumentKey' - | 'DocumentLandscape' - | 'DocumentLandscapeData' - | 'DocumentLandscapeSplit' - | 'DocumentLandscapeSplitHint' - | 'DocumentLightning' - | 'DocumentLink' - | 'DocumentLock' - | 'DocumentMargins' - | 'DocumentMention' - | 'DocumentMultiple' - | 'DocumentMultiplePercent' - | 'DocumentMultipleProhibited' - | 'DocumentMultipleSync' - | 'DocumentNumber1' - | 'DocumentOnePage' - | 'DocumentOnePageAdd' - | 'DocumentOnePageBeaker' - | 'DocumentOnePageColumns' - | 'DocumentOnePageLink' - | 'DocumentOnePageMultiple' - | 'DocumentOnePageSparkle' - | 'DocumentPageBottomCenter' - | 'DocumentPageBottomLeft' - | 'DocumentPageBottomRight' - | 'DocumentPageBreak' - | 'DocumentPageNumber' - | 'DocumentPageTopCenter' - | 'DocumentPageTopLeft' - | 'DocumentPageTopRight' - | 'DocumentPdf' - | 'DocumentPercent' - | 'DocumentPerson' - | 'DocumentPill' - | 'DocumentPrint' - | 'DocumentProhibited' - | 'DocumentPy' - | 'DocumentQuestionMark' - | 'DocumentQueue' - | 'DocumentQueueAdd' - | 'DocumentQueueMultiple' - | 'DocumentRb' - | 'DocumentRibbon' - | 'DocumentSass' - | 'DocumentSave' - | 'DocumentSearch' - | 'DocumentSettings' - | 'DocumentSplitHint' - | 'DocumentSplitHintOff' - | 'DocumentSync' - | 'DocumentTable' - | 'DocumentTableArrowRight' - | 'DocumentTableCheckmark' - | 'DocumentTableCube' - | 'DocumentTableSearch' - | 'DocumentTableTruck' - | 'DocumentTarget' - | 'DocumentText' - | 'DocumentTextClock' - | 'DocumentTextExtract' - | 'DocumentTextLink' - | 'DocumentTextToolbox' - | 'DocumentToolbox' - | 'DocumentTs' - | 'DocumentVb' - | 'DocumentWidth' - | 'DocumentYml' - | 'Door' - | 'DoorArrowLeft' - | 'DoorArrowRight' - | 'DoorTag' - | 'DoubleSwipeDown' - | 'DoubleSwipeUp' - | 'DoubleTapSwipeDown' - | 'DoubleTapSwipeUp' - | 'Drafts' - | 'Drag' - | 'DrawImage' - | 'DrawShape' - | 'DrawText' - | 'Drawer' - | 'DrawerAdd' - | 'DrawerArrowDownload' - | 'DrawerDismiss' - | 'DrawerPlay' - | 'DrawerSubtract' - | 'DrinkBeer' - | 'DrinkBottle' - | 'DrinkBottleOff' - | 'DrinkCoffee' - | 'DrinkMargarita' - | 'DrinkToGo' - | 'DrinkWine' - | 'DriveTrain' - | 'Drop' - | 'DualScreen' - | 'DualScreenAdd' - | 'DualScreenArrowRight' - | 'DualScreenArrowUp' - | 'DualScreenClock' - | 'DualScreenClosedAlert' - | 'DualScreenDesktop' - | 'DualScreenDismiss' - | 'DualScreenGroup' - | 'DualScreenHeader' - | 'DualScreenLock' - | 'DualScreenMirror' - | 'DualScreenPagination' - | 'DualScreenSettings' - | 'DualScreenSpan' - | 'DualScreenSpeaker' - | 'DualScreenStatusBar' - | 'DualScreenTablet' - | 'DualScreenUpdate' - | 'DualScreenVerticalScroll' - | 'DualScreenVibrate' - | 'Dumbbell' - | 'Dust' - | 'Earth' - | 'EarthLeaf' - | 'Edit' - | 'EditArrowBack' - | 'EditOff' - | 'EditProhibited' - | 'EditSettings' - | 'Elevator' - | 'Emoji' - | 'EmojiAdd' - | 'EmojiAngry' - | 'EmojiEdit' - | 'EmojiHand' - | 'EmojiHint' - | 'EmojiLaugh' - | 'EmojiMeh' - | 'EmojiMultiple' - | 'EmojiSad' - | 'EmojiSadSlight' - | 'EmojiSmileSlight' - | 'EmojiSparkle' - | 'EmojiSurprise' - | 'Engine' - | 'EqualCircle' - | 'EqualOff' - | 'Eraser' - | 'EraserMedium' - | 'EraserSegment' - | 'EraserSmall' - | 'EraserTool' - | 'ErrorCircle' - | 'ErrorCircleSettings' - | 'ExpandUpLeft' - | 'ExpandUpRight' - | 'ExtendedDock' - | 'Eye' - | 'EyeLines' - | 'EyeOff' - | 'EyeTracking' - | 'EyeTrackingOff' - | 'Eyedropper' - | 'EyedropperOff' - | 'FStop' - | 'FastAcceleration' - | 'FastForward' - | 'Fax' - | 'Feed' - | 'Filmstrip' - | 'FilmstripImage' - | 'FilmstripOff' - | 'FilmstripPlay' - | 'FilmstripSplit' - | 'Filter' - | 'FilterAdd' - | 'FilterDismiss' - | 'FilterSync' - | 'Fingerprint' - | 'Fire' - | 'Fireplace' - | 'FixedWidth' - | 'Flag' - | 'FlagCheckered' - | 'FlagClock' - | 'FlagOff' - | 'FlagPride' - | 'FlagPrideIntersexInclusiveProgress' - | 'FlagPridePhiladelphia' - | 'FlagPrideProgress' - | 'Flash' - | 'FlashAdd' - | 'FlashAuto' - | 'FlashCheckmark' - | 'FlashFlow' - | 'FlashOff' - | 'FlashPlay' - | 'FlashSettings' - | 'FlashSparkle' - | 'Flashlight' - | 'FlashlightOff' - | 'FlipHorizontal' - | 'FlipVertical' - | 'Flow' - | 'Flowchart' - | 'FlowchartCircle' - | 'Fluent' - | 'Fluid' - | 'Folder' - | 'FolderAdd' - | 'FolderArrowLeft' - | 'FolderArrowRight' - | 'FolderArrowUp' - | 'FolderBriefcase' - | 'FolderGlobe' - | 'FolderLightning' - | 'FolderLink' - | 'FolderList' - | 'FolderMail' - | 'FolderMultiple' - | 'FolderOpen' - | 'FolderOpenVertical' - | 'FolderPeople' - | 'FolderPerson' - | 'FolderProhibited' - | 'FolderSearch' - | 'FolderSwap' - | 'FolderSync' - | 'FolderZip' - | 'FontDecrease' - | 'FontIncrease' - | 'FontSpaceTrackingIn' - | 'FontSpaceTrackingOut' - | 'Food' - | 'FoodApple' - | 'FoodCake' - | 'FoodCarrot' - | 'FoodChickenLeg' - | 'FoodEgg' - | 'FoodFish' - | 'FoodGrains' - | 'FoodPizza' - | 'FoodToast' - | 'Form' - | 'FormMultiple' - | 'FormNew' - | 'Fps120' - | 'Fps240' - | 'Fps30' - | 'Fps60' - | 'Fps960' - | 'Frame' - | 'FullScreenMaximize' - | 'FullScreenMinimize' - | 'Games' - | 'GanttChart' - | 'Gas' - | 'GasPump' - | 'Gather' - | 'Gauge' - | 'GaugeAdd' - | 'Gavel' - | 'GavelProhibited' - | 'Gesture' - | 'Gif' - | 'Gift' - | 'GiftCard' - | 'GiftCardAdd' - | 'GiftCardArrowRight' - | 'GiftCardMoney' - | 'GiftCardMultiple' - | 'GiftOpen' - | 'Glance' - | 'GlanceDefault' - | 'GlanceHorizontal' - | 'GlanceHorizontalSparkle' - | 'GlanceHorizontalSparkles' - | 'Glasses' - | 'GlassesOff' - | 'Globe' - | 'GlobeAdd' - | 'GlobeArrowForward' - | 'GlobeArrowUp' - | 'GlobeClock' - | 'GlobeDesktop' - | 'GlobeError' - | 'GlobeLocation' - | 'GlobePerson' - | 'GlobeProhibited' - | 'GlobeSearch' - | 'GlobeShield' - | 'GlobeStar' - | 'GlobeSurface' - | 'GlobeSync' - | 'GlobeVideo' - | 'GlobeWarning' - | 'Grid' - | 'GridCircles' - | 'GridDots' - | 'GridKanban' - | 'Group' - | 'GroupDismiss' - | 'GroupList' - | 'GroupReturn' - | 'Guardian' - | 'Guest' - | 'GuestAdd' - | 'Guitar' - | 'HandDraw' - | 'HandLeft' - | 'HandLeftChat' - | 'HandOpenHeart' - | 'HandRight' - | 'HandRightOff' - | 'HandWave' - | 'Handshake' - | 'HardDrive' - | 'HardDriveCall' - | 'HatGraduation' - | 'HatGraduationAdd' - | 'HatGraduationSparkle' - | 'Hd' - | 'Hdr' - | 'HdrOff' - | 'Headphones' - | 'HeadphonesSoundWave' - | 'Headset' - | 'HeadsetAdd' - | 'HeadsetVr' - | 'Heart' - | 'HeartBroken' - | 'HeartCircle' - | 'HeartCircleHint' - | 'HeartOff' - | 'HeartPulse' - | 'HeartPulseCheckmark' - | 'HeartPulseError' - | 'HeartPulseWarning' - | 'Hexagon' - | 'HexagonThree' - | 'Highlight' - | 'HighlightAccent' - | 'HighlightLink' - | 'History' - | 'HistoryDismiss' - | 'Home' - | 'HomeAdd' - | 'HomeCheckmark' - | 'HomeDatabase' - | 'HomeHeart' - | 'HomeMore' - | 'HomePerson' - | 'HomeSplit' - | 'Hourglass' - | 'HourglassHalf' - | 'HourglassOneQuarter' - | 'HourglassThreeQuarter' - | 'Icons' - | 'Image' - | 'ImageAdd' - | 'ImageAltText' - | 'ImageArrowBack' - | 'ImageArrowCounterclockwise' - | 'ImageArrowForward' - | 'ImageBorder' - | 'ImageCircle' - | 'ImageCopy' - | 'ImageEdit' - | 'ImageGlobe' - | 'ImageMultiple' - | 'ImageMultipleOff' - | 'ImageOff' - | 'ImageProhibited' - | 'ImageReflection' - | 'ImageSearch' - | 'ImageShadow' - | 'ImageSparkle' - | 'ImageStack' - | 'ImageTable' - | 'ImmersiveReader' - | 'Important' - | 'Incognito' - | 'Info' - | 'InfoShield' - | 'InkStroke' - | 'InkStrokeArrowDown' - | 'InkStrokeArrowUpDown' - | 'InkingTool' - | 'InkingToolAccent' - | 'InprivateAccount' - | 'Insert' - | 'IosArrow' - | 'IosArrowLtr' - | 'IosArrowRtl' - | 'IosChevronRight' - | 'Iot' - | 'IotAlert' - | 'Javascript' - | 'Joystick' - | 'Key' - | 'KeyCommand' - | 'KeyMultiple' - | 'KeyReset' - | 'Keyboard123' - | 'Keyboard' - | 'KeyboardDock' - | 'KeyboardLayoutFloat' - | 'KeyboardLayoutOneHandedLeft' - | 'KeyboardLayoutResize' - | 'KeyboardLayoutSplit' - | 'KeyboardMouse' - | 'KeyboardShift' - | 'KeyboardShiftUppercase' - | 'KeyboardTab' - | 'Kiosk' - | 'Laptop' - | 'LaptopDismiss' - | 'LaptopMultiple' - | 'LaptopSettings' - | 'LaptopShield' - | 'LaserTool' - | 'Lasso' - | 'LauncherSettings' - | 'Layer' - | 'LayerDiagonal' - | 'LayerDiagonalAdd' - | 'LayerDiagonalPerson' - | 'LayoutCellFour' - | 'LayoutCellFourFocusBottomLeft' - | 'LayoutCellFourFocusBottomRight' - | 'LayoutCellFourFocusTopLeft' - | 'LayoutCellFourFocusTopRight' - | 'LayoutColumnFour' - | 'LayoutColumnFourFocusCenterLeft' - | 'LayoutColumnFourFocusCenterRight' - | 'LayoutColumnFourFocusLeft' - | 'LayoutColumnFourFocusRight' - | 'LayoutColumnOneThirdLeft' - | 'LayoutColumnOneThirdRight' - | 'LayoutColumnOneThirdRightHint' - | 'LayoutColumnThree' - | 'LayoutColumnThreeFocusCenter' - | 'LayoutColumnThreeFocusLeft' - | 'LayoutColumnThreeFocusRight' - | 'LayoutColumnTwo' - | 'LayoutColumnTwoFocusLeft' - | 'LayoutColumnTwoFocusRight' - | 'LayoutColumnTwoSplitLeft' - | 'LayoutColumnTwoSplitLeftFocusBottomLeft' - | 'LayoutColumnTwoSplitLeftFocusRight' - | 'LayoutColumnTwoSplitLeftFocusTopLeft' - | 'LayoutColumnTwoSplitRight' - | 'LayoutColumnTwoSplitRightFocusBottomRight' - | 'LayoutColumnTwoSplitRightFocusLeft' - | 'LayoutColumnTwoSplitRightFocusTopRight' - | 'LayoutRowFour' - | 'LayoutRowFourFocusBottom' - | 'LayoutRowFourFocusCenterBottom' - | 'LayoutRowFourFocusCenterTop' - | 'LayoutRowFourFocusTop' - | 'LayoutRowThree' - | 'LayoutRowThreeFocusBottom' - | 'LayoutRowThreeFocusCenter' - | 'LayoutRowThreeFocusTop' - | 'LayoutRowTwo' - | 'LayoutRowTwoFocusBottom' - | 'LayoutRowTwoFocusTop' - | 'LayoutRowTwoSplitBottom' - | 'LayoutRowTwoSplitBottomFocusBottomLeft' - | 'LayoutRowTwoSplitBottomFocusBottomRight' - | 'LayoutRowTwoSplitBottomFocusTop' - | 'LayoutRowTwoSplitTop' - | 'LayoutRowTwoSplitTopFocusBottom' - | 'LayoutRowTwoSplitTopFocusTopLeft' - | 'LayoutRowTwoSplitTopFocusTopRight' - | 'LeafOne' - | 'LeafThree' - | 'LeafTwo' - | 'LearningApp' - | 'Library' - | 'Lightbulb' - | 'LightbulbCheckmark' - | 'LightbulbCircle' - | 'LightbulbFilament' - | 'LightbulbPerson' - | 'Likert' - | 'Line' - | 'LineDashes' - | 'LineHorizontal1' - | 'LineHorizontal1Dashes' - | 'LineHorizontal2DashesSolid' - | 'LineHorizontal3' - | 'LineHorizontal4' - | 'LineHorizontal4Search' - | 'LineHorizontal5' - | 'LineHorizontal5Error' - | 'LineStyle' - | 'LineThickness' - | 'Link' - | 'LinkAdd' - | 'LinkDismiss' - | 'LinkEdit' - | 'LinkMultiple' - | 'LinkPerson' - | 'LinkSettings' - | 'LinkSquare' - | 'LinkToolbox' - | 'List' - | 'ListBar' - | 'ListBarTree' - | 'ListBarTreeOffset' - | 'ListRtl' - | 'Live' - | 'LiveOff' - | 'LocalLanguage' - | 'Location' - | 'LocationAdd' - | 'LocationAddLeft' - | 'LocationAddRight' - | 'LocationAddUp' - | 'LocationArrow' - | 'LocationArrowLeft' - | 'LocationArrowRight' - | 'LocationArrowUp' - | 'LocationDismiss' - | 'LocationLive' - | 'LocationOff' - | 'LocationTargetSquare' - | 'LockClosed' - | 'LockClosedKey' - | 'LockMultiple' - | 'LockOpen' - | 'LockShield' - | 'Lottery' - | 'Luggage' - | 'Mail' - | 'MailAdd' - | 'MailAlert' - | 'MailAllRead' - | 'MailAllUnread' - | 'MailArrowDoubleBack' - | 'MailArrowDown' - | 'MailArrowForward' - | 'MailArrowUp' - | 'MailAttach' - | 'MailCheckmark' - | 'MailClock' - | 'MailCopy' - | 'MailDismiss' - | 'MailEdit' - | 'MailError' - | 'MailInbox' - | 'MailInboxAdd' - | 'MailInboxAll' - | 'MailInboxArrowDown' - | 'MailInboxArrowRight' - | 'MailInboxArrowUp' - | 'MailInboxCheckmark' - | 'MailInboxDismiss' - | 'MailLink' - | 'MailList' - | 'MailMultiple' - | 'MailOff' - | 'MailOpenPerson' - | 'MailPause' - | 'MailProhibited' - | 'MailRead' - | 'MailReadMultiple' - | 'MailRewind' - | 'MailSettings' - | 'MailShield' - | 'MailTemplate' - | 'MailUnread' - | 'MailWarning' - | 'Mailbox' - | 'Map' - | 'MapDrive' - | 'Markdown' - | 'MatchAppLayout' - | 'MathFormatLinear' - | 'MathFormatProfessional' - | 'MathFormula' - | 'MathSymbols' - | 'Maximize' - | 'MeetNow' - | 'Megaphone' - | 'MegaphoneCircle' - | 'MegaphoneLoud' - | 'MegaphoneOff' - | 'Memory' - | 'Mention' - | 'MentionArrowDown' - | 'MentionBrackets' - | 'Merge' - | 'Mic' - | 'MicOff' - | 'MicProhibited' - | 'MicPulse' - | 'MicPulseOff' - | 'MicRecord' - | 'MicSettings' - | 'MicSparkle' - | 'MicSync' - | 'Microscope' - | 'Midi' - | 'MobileOptimized' - | 'Mold' - | 'Molecule' - | 'Money' - | 'MoneyCalculator' - | 'MoneyDismiss' - | 'MoneyHand' - | 'MoneyOff' - | 'MoneySettings' - | 'MoreCircle' - | 'MoreHorizontal' - | 'MoreVertical' - | 'MountainLocationBottom' - | 'MountainLocationTop' - | 'MountainTrail' - | 'MoviesAndTv' - | 'Multiplier12X' - | 'Multiplier15X' - | 'Multiplier18X' - | 'Multiplier1X' - | 'Multiplier2X' - | 'Multiplier5X' - | 'MultiselectLtr' - | 'MultiselectRtl' - | 'MusicNote1' - | 'MusicNote2' - | 'MusicNote2Play' - | 'MusicNoteOff1' - | 'MusicNoteOff2' - | 'MyLocation' - | 'Navigation' - | 'NavigationLocationTarget' - | 'NavigationPlay' - | 'NavigationUnread' - | 'NetworkAdapter' - | 'NetworkCheck' - | 'New' - | 'News' - | 'Next' - | 'NextFrame' - | 'Note' - | 'NoteAdd' - | 'NoteEdit' - | 'NotePin' - | 'Notebook' - | 'NotebookAdd' - | 'NotebookArrowCurveDown' - | 'NotebookError' - | 'NotebookEye' - | 'NotebookLightning' - | 'NotebookQuestionMark' - | 'NotebookSection' - | 'NotebookSectionArrowRight' - | 'NotebookSubsection' - | 'NotebookSync' - | 'Notepad' - | 'NotepadEdit' - | 'NotepadPerson' - | 'NumberCircle0' - | 'NumberCircle1' - | 'NumberCircle2' - | 'NumberCircle3' - | 'NumberCircle4' - | 'NumberCircle5' - | 'NumberCircle6' - | 'NumberCircle7' - | 'NumberCircle8' - | 'NumberCircle9' - | 'NumberRow' - | 'NumberSymbol' - | 'NumberSymbolDismiss' - | 'NumberSymbolSquare' - | 'Open' - | 'OpenFolder' - | 'OpenOff' - | 'Options' - | 'Organization' - | 'OrganizationHorizontal' - | 'Orientation' - | 'Oval' - | 'Oven' - | 'PaddingDown' - | 'PaddingLeft' - | 'PaddingRight' - | 'PaddingTop' - | 'PageFit' - | 'PaintBrush' - | 'PaintBrushArrowDown' - | 'PaintBrushArrowUp' - | 'PaintBucket' - | 'Pair' - | 'PanelBottom' - | 'PanelBottomContract' - | 'PanelBottomExpand' - | 'PanelLeft' - | 'PanelLeftAdd' - | 'PanelLeftContract' - | 'PanelLeftExpand' - | 'PanelLeftFocusRight' - | 'PanelLeftHeader' - | 'PanelLeftHeaderAdd' - | 'PanelLeftHeaderKey' - | 'PanelLeftKey' - | 'PanelLeftText' - | 'PanelLeftTextAdd' - | 'PanelLeftTextDismiss' - | 'PanelRight' - | 'PanelRightAdd' - | 'PanelRightContract' - | 'PanelRightCursor' - | 'PanelRightExpand' - | 'PanelRightGallery' - | 'PanelSeparateWindow' - | 'PanelTopContract' - | 'PanelTopExpand' - | 'PanelTopGallery' - | 'Password' - | 'Patch' - | 'Patient' - | 'Pause' - | 'PauseCircle' - | 'PauseOff' - | 'PauseSettings' - | 'Payment' - | 'Pen' - | 'PenDismiss' - | 'PenOff' - | 'PenProhibited' - | 'PenSparkle' - | 'Pentagon' - | 'People' - | 'PeopleAdd' - | 'PeopleAudience' - | 'PeopleCall' - | 'PeopleChat' - | 'PeopleCheckmark' - | 'PeopleCommunity' - | 'PeopleCommunityAdd' - | 'PeopleEdit' - | 'PeopleError' - | 'PeopleList' - | 'PeopleLock' - | 'PeopleMoney' - | 'PeopleProhibited' - | 'PeopleQueue' - | 'PeopleSearch' - | 'PeopleSettings' - | 'PeopleStar' - | 'PeopleSwap' - | 'PeopleSync' - | 'PeopleTeam' - | 'PeopleTeamAdd' - | 'PeopleTeamDelete' - | 'PeopleTeamToolbox' - | 'PeopleToolbox' - | 'Person' - | 'Person5' - | 'Person6' - | 'PersonAccounts' - | 'PersonAdd' - | 'PersonAlert' - | 'PersonArrowBack' - | 'PersonArrowLeft' - | 'PersonArrowRight' - | 'PersonAvailable' - | 'PersonBoard' - | 'PersonCall' - | 'PersonChat' - | 'PersonCircle' - | 'PersonClock' - | 'PersonDelete' - | 'PersonDesktop' - | 'PersonEdit' - | 'PersonFeedback' - | 'PersonHeart' - | 'PersonInfo' - | 'PersonKey' - | 'PersonLightbulb' - | 'PersonLightning' - | 'PersonLink' - | 'PersonLock' - | 'PersonMail' - | 'PersonMoney' - | 'PersonNote' - | 'PersonPhone' - | 'PersonPill' - | 'PersonProhibited' - | 'PersonQuestionMark' - | 'PersonRibbon' - | 'PersonRunning' - | 'PersonSearch' - | 'PersonSettings' - | 'PersonSquare' - | 'PersonSquareCheckmark' - | 'PersonStanding' - | 'PersonStar' - | 'PersonStarburst' - | 'PersonSubtract' - | 'PersonSupport' - | 'PersonSwap' - | 'PersonSync' - | 'PersonTag' - | 'PersonVoice' - | 'PersonWalking' - | 'PersonWarning' - | 'PersonWrench' - | 'Phone' - | 'PhoneAdd' - | 'PhoneArrowRight' - | 'PhoneBriefcase' - | 'PhoneChat' - | 'PhoneCheckmark' - | 'PhoneDesktop' - | 'PhoneDesktopAdd' - | 'PhoneDismiss' - | 'PhoneEdit' - | 'PhoneEraser' - | 'PhoneFooterArrowDown' - | 'PhoneHeaderArrowUp' - | 'PhoneKey' - | 'PhoneLaptop' - | 'PhoneLinkSetup' - | 'PhoneLock' - | 'PhoneMultiple' - | 'PhoneMultipleSettings' - | 'PhonePageHeader' - | 'PhonePagination' - | 'PhonePerson' - | 'PhoneScreenTime' - | 'PhoneShake' - | 'PhoneSpanIn' - | 'PhoneSpanOut' - | 'PhoneSpeaker' - | 'PhoneStatusBar' - | 'PhoneSubtract' - | 'PhoneTablet' - | 'PhoneUpdate' - | 'PhoneUpdateCheckmark' - | 'PhoneVerticalScroll' - | 'PhoneVibrate' - | 'PhotoFilter' - | 'Pi' - | 'PictureInPicture' - | 'PictureInPictureEnter' - | 'PictureInPictureExit' - | 'Pill' - | 'Pin' - | 'PinOff' - | 'Pipeline' - | 'PipelineAdd' - | 'PipelineArrowCurveDown' - | 'PipelinePlay' - | 'Pivot' - | 'PlantGrass' - | 'PlantRagweed' - | 'Play' - | 'PlayCircle' - | 'PlayCircleHint' - | 'PlayMultiple' - | 'PlaySettings' - | 'PlayingCards' - | 'PlugConnected' - | 'PlugConnectedAdd' - | 'PlugConnectedCheckmark' - | 'PlugConnectedSettings' - | 'PlugDisconnected' - | 'PointScan' - | 'Poll' - | 'PollHorizontal' - | 'PollOff' - | 'PortHdmi' - | 'PortMicroUsb' - | 'PortUsbA' - | 'PortUsbC' - | 'PositionBackward' - | 'PositionForward' - | 'PositionToBack' - | 'PositionToFront' - | 'Power' - | 'Predictions' - | 'Premium' - | 'PremiumPerson' - | 'PresenceAvailable' - | 'PresenceAway' - | 'PresenceBlocked' - | 'PresenceBusy' - | 'PresenceDnd' - | 'PresenceOffline' - | 'PresenceOof' - | 'PresenceUnknown' - | 'Presenter' - | 'PresenterOff' - | 'PreviewLink' - | 'Previous' - | 'PreviousFrame' - | 'Print' - | 'PrintAdd' - | 'Production' - | 'ProductionCheckmark' - | 'Prohibited' - | 'ProhibitedMultiple' - | 'ProhibitedNote' - | 'ProjectionScreen' - | 'ProjectionScreenDismiss' - | 'ProjectionScreenText' - | 'ProtocolHandler' - | 'Pulse' - | 'PulseSquare' - | 'PuzzleCube' - | 'PuzzleCubePiece' - | 'PuzzlePiece' - | 'PuzzlePieceShield' - | 'QrCode' - | 'Question' - | 'QuestionCircle' - | 'QuizNew' - | 'Radar' - | 'RadarCheckmark' - | 'RadarRectangleMultiple' - | 'RadioButton' - | 'RadioButtonOff' - | 'Ram' - | 'RatingMature' - | 'RatioOneToOne' - | 'ReOrder' - | 'ReOrderDotsHorizontal' - | 'ReOrderDotsVertical' - | 'ReadAloud' - | 'ReadingList' - | 'ReadingListAdd' - | 'ReadingModeMobile' - | 'RealEstate' - | 'Receipt' - | 'ReceiptAdd' - | 'ReceiptBag' - | 'ReceiptCube' - | 'ReceiptMoney' - | 'ReceiptPlay' - | 'ReceiptSearch' - | 'ReceiptSparkles' - | 'Record' - | 'RecordStop' - | 'RectangleLandscape' - | 'RectangleLandscapeHintCopy' - | 'RectangleLandscapeSparkle' - | 'RectangleLandscapeSync' - | 'RectangleLandscapeSyncOff' - | 'RectanglePortraitLocationTarget' - | 'Recycle' - | 'RemixAdd' - | 'Remote' - | 'Rename' - | 'Reorder' - | 'Replay' - | 'Resize' - | 'ResizeImage' - | 'ResizeLarge' - | 'ResizeSmall' - | 'ResizeTable' - | 'ResizeVideo' - | 'Reward' - | 'Rewind' - | 'Rhombus' - | 'Ribbon' - | 'RibbonAdd' - | 'RibbonOff' - | 'RibbonStar' - | 'RoadCone' - | 'Rocket' - | 'RotateLeft' - | 'RotateRight' - | 'Router' - | 'RowTriple' - | 'Rss' - | 'Ruler' - | 'Run' - | 'Sanitize' - | 'Save' - | 'SaveArrowRight' - | 'SaveCopy' - | 'SaveEdit' - | 'SaveImage' - | 'SaveMultiple' - | 'SaveSearch' - | 'SaveSync' - | 'Savings' - | 'ScaleFill' - | 'ScaleFit' - | 'Scales' - | 'Scan' - | 'ScanCamera' - | 'ScanDash' - | 'ScanObject' - | 'ScanPerson' - | 'ScanQrCode' - | 'ScanTable' - | 'ScanText' - | 'ScanThumbUp' - | 'ScanThumbUpOff' - | 'ScanType' - | 'ScanTypeCheckmark' - | 'ScanTypeOff' - | 'Scratchpad' - | 'ScreenCut' - | 'ScreenPerson' - | 'ScreenSearch' - | 'Screenshot' - | 'ScreenshotRecord' - | 'Script' - | 'Search' - | 'SearchInfo' - | 'SearchSettings' - | 'SearchShield' - | 'SearchSquare' - | 'SearchVisual' - | 'Seat' - | 'SeatAdd' - | 'SelectAllOff' - | 'SelectAllOn' - | 'SelectObject' - | 'SelectObjectSkew' - | 'SelectObjectSkewDismiss' - | 'SelectObjectSkewEdit' - | 'Send' - | 'SendBeaker' - | 'SendClock' - | 'SendCopy' - | 'SerialPort' - | 'Server' - | 'ServerLink' - | 'ServerMultiple' - | 'ServerPlay' - | 'ServerSurface' - | 'ServerSurfaceMultiple' - | 'ServiceBell' - | 'Settings' - | 'SettingsChat' - | 'SettingsCogMultiple' - | 'ShapeExclude' - | 'ShapeIntersect' - | 'ShapeOrganic' - | 'ShapeSubtract' - | 'ShapeUnion' - | 'Shapes' - | 'Share' - | 'ShareAndroid' - | 'ShareCloseTray' - | 'ShareIos' - | 'ShareScreenPerson' - | 'ShareScreenPersonOverlay' - | 'ShareScreenPersonOverlayInside' - | 'ShareScreenPersonP' - | 'ShareScreenStart' - | 'ShareScreenStop' - | 'Shield' - | 'ShieldAdd' - | 'ShieldBadge' - | 'ShieldCheckmark' - | 'ShieldDismiss' - | 'ShieldDismissShield' - | 'ShieldError' - | 'ShieldGlobe' - | 'ShieldKeyhole' - | 'ShieldLock' - | 'ShieldPerson' - | 'ShieldPersonAdd' - | 'ShieldProhibited' - | 'ShieldQuestion' - | 'ShieldTask' - | 'Shifts' - | 'Shifts30Minutes' - | 'ShiftsActivity' - | 'ShiftsAdd' - | 'ShiftsAvailability' - | 'ShiftsCheckmark' - | 'ShiftsDay' - | 'ShiftsOpen' - | 'ShiftsProhibited' - | 'ShiftsQuestionMark' - | 'ShiftsTeam' - | 'ShoppingBag' - | 'ShoppingBagAdd' - | 'ShoppingBagArrowLeft' - | 'ShoppingBagDismiss' - | 'ShoppingBagPause' - | 'ShoppingBagPercent' - | 'ShoppingBagPlay' - | 'ShoppingBagTag' - | 'Shortpick' - | 'Showerhead' - | 'SidebarSearchLtr' - | 'SidebarSearchRtl' - | 'SignOut' - | 'Signature' - | 'Sim' - | 'SkipBack10' - | 'SkipForward10' - | 'SkipForward30' - | 'SkipForwardTab' - | 'SlashForward' - | 'Sleep' - | 'SlideAdd' - | 'SlideArrowRight' - | 'SlideContent' - | 'SlideEraser' - | 'SlideGrid' - | 'SlideHide' - | 'SlideLayout' - | 'SlideLink' - | 'SlideMicrophone' - | 'SlideMultiple' - | 'SlideMultipleArrowRight' - | 'SlideMultipleSearch' - | 'SlideRecord' - | 'SlideSearch' - | 'SlideSettings' - | 'SlideSize' - | 'SlideText' - | 'SlideTextEdit' - | 'SlideTextMultiple' - | 'SlideTextPerson' - | 'SlideTextSparkle' - | 'SlideTransition' - | 'Smartwatch' - | 'SmartwatchDot' - | 'Snooze' - | 'SoundSource' - | 'SoundWaveCircle' - | 'Space3D' - | 'Spacebar' - | 'Sparkle' - | 'SparkleCircle' - | 'Speaker0' - | 'Speaker1' - | 'Speaker2' - | 'SpeakerBluetooth' - | 'SpeakerBox' - | 'SpeakerEdit' - | 'SpeakerMute' - | 'SpeakerOff' - | 'SpeakerSettings' - | 'SpeakerUsb' - | 'SpinnerIos' - | 'SplitHint' - | 'SplitHorizontal' - | 'SplitVertical' - | 'Sport' - | 'SportAmericanFootball' - | 'SportBaseball' - | 'SportBasketball' - | 'SportHockey' - | 'SportSoccer' - | 'SprayCan' - | 'Square' - | 'SquareAdd' - | 'SquareArrowForward' - | 'SquareDismiss' - | 'SquareEraser' - | 'SquareHint' - | 'SquareHintApps' - | 'SquareHintArrowBack' - | 'SquareHintHexagon' - | 'SquareHintSparkles' - | 'SquareMultiple' - | 'SquareShadow' - | 'SquaresNested' - | 'Stack' - | 'StackAdd' - | 'StackArrowForward' - | 'StackStar' - | 'StackVertical' - | 'Star' - | 'StarAdd' - | 'StarArrowBack' - | 'StarArrowRightEnd' - | 'StarArrowRightStart' - | 'StarCheckmark' - | 'StarDismiss' - | 'StarEdit' - | 'StarEmphasis' - | 'StarHalf' - | 'StarLineHorizontal3' - | 'StarOff' - | 'StarOneQuarter' - | 'StarProhibited' - | 'StarSettings' - | 'StarThreeQuarter' - | 'Status' - | 'Step' - | 'Steps' - | 'Stethoscope' - | 'Sticker' - | 'StickerAdd' - | 'Stop' - | 'Storage' - | 'StoreMicrosoft' - | 'Stream' - | 'StreamInput' - | 'StreamInputOutput' - | 'StreamOutput' - | 'StreetSign' - | 'StyleGuide' - | 'SubGrid' - | 'Subtitles' - | 'Subtract' - | 'SubtractCircle' - | 'SubtractCircleArrowBack' - | 'SubtractCircleArrowForward' - | 'SubtractParentheses' - | 'SubtractSquare' - | 'SubtractSquareMultiple' - | 'SurfaceEarbuds' - | 'SurfaceHub' - | 'SwimmingPool' - | 'SwipeDown' - | 'SwipeRight' - | 'SwipeUp' - | 'Symbols' - | 'SyncOff' - | 'Syringe' - | 'System' - | 'Tab' - | 'TabAdd' - | 'TabArrowLeft' - | 'TabDesktop' - | 'TabDesktopArrowClockwise' - | 'TabDesktopArrowLeft' - | 'TabDesktopBottom' - | 'TabDesktopClock' - | 'TabDesktopCopy' - | 'TabDesktopImage' - | 'TabDesktopLink' - | 'TabDesktopMultiple' - | 'TabDesktopMultipleAdd' - | 'TabDesktopMultipleBottom' - | 'TabDesktopNewPage' - | 'TabInPrivate' - | 'TabInprivateAccount' - | 'TabProhibited' - | 'TabShieldDismiss' - | 'Table' - | 'TableAdd' - | 'TableArrowUp' - | 'TableBottomRow' - | 'TableCalculator' - | 'TableCellEdit' - | 'TableCellsMerge' - | 'TableCellsSplit' - | 'TableChecker' - | 'TableColumnTopBottom' - | 'TableCopy' - | 'TableDefault' - | 'TableDeleteColumn' - | 'TableDeleteRow' - | 'TableDismiss' - | 'TableEdit' - | 'TableFreezeColumn' - | 'TableFreezeColumnAndRow' - | 'TableFreezeRow' - | 'TableImage' - | 'TableInsertColumn' - | 'TableInsertRow' - | 'TableLightning' - | 'TableLink' - | 'TableLock' - | 'TableMoveAbove' - | 'TableMoveBelow' - | 'TableMoveLeft' - | 'TableMoveRight' - | 'TableMultiple' - | 'TableOffset' - | 'TableOffsetAdd' - | 'TableOffsetLessThanOrEqualTo' - | 'TableOffsetSettings' - | 'TableResizeColumn' - | 'TableResizeRow' - | 'TableSearch' - | 'TableSettings' - | 'TableSimple' - | 'TableSimpleCheckmark' - | 'TableSimpleExclude' - | 'TableSimpleInclude' - | 'TableSimpleMultiple' - | 'TableSplit' - | 'TableStackAbove' - | 'TableStackBelow' - | 'TableStackLeft' - | 'TableStackRight' - | 'TableSwitch' - | 'Tablet' - | 'TabletLaptop' - | 'TabletSpeaker' - | 'Tabs' - | 'Tag' - | 'TagCircle' - | 'TagDismiss' - | 'TagError' - | 'TagLock' - | 'TagLockAccent' - | 'TagMultiple' - | 'TagOff' - | 'TagQuestionMark' - | 'TagReset' - | 'TagSearch' - | 'TapDouble' - | 'TapSingle' - | 'Target' - | 'TargetAdd' - | 'TargetArrow' - | 'TargetDismiss' - | 'TargetEdit' - | 'TaskListAdd' - | 'TaskListLtr' - | 'TaskListRtl' - | 'TaskListSquareAdd' - | 'TaskListSquareDatabase' - | 'TaskListSquareLtr' - | 'TaskListSquarePerson' - | 'TaskListSquareRtl' - | 'TaskListSquareSettings' - | 'TasksApp' - | 'TeardropBottomRight' - | 'Teddy' - | 'Temperature' - | 'Tent' - | 'TetrisApp' - | 'Text' - | 'TextAbcUnderlineDouble' - | 'TextAdd' - | 'TextAddSpaceAfter' - | 'TextAddSpaceBefore' - | 'TextAddT' - | 'TextAlignCenter' - | 'TextAlignCenterRotate270' - | 'TextAlignCenterRotate90' - | 'TextAlignDistributed' - | 'TextAlignDistributedEvenly' - | 'TextAlignDistributedVertical' - | 'TextAlignJustify' - | 'TextAlignJustifyLow' - | 'TextAlignJustifyLow90' - | 'TextAlignJustifyLowRotate270' - | 'TextAlignJustifyLowRotate90' - | 'TextAlignJustifyRotate270' - | 'TextAlignJustifyRotate90' - | 'TextAlignLeft' - | 'TextAlignLeftRotate270' - | 'TextAlignLeftRotate90' - | 'TextAlignRight' - | 'TextAlignRightRotate270' - | 'TextAlignRightRotate90' - | 'TextArrowDownRightColumn' - | 'TextAsterisk' - | 'TextBaseline' - | 'TextBold' - | 'TextBoxSettings' - | 'TextBulletList' - | 'TextBulletList270' - | 'TextBulletList90' - | 'TextBulletListAdd' - | 'TextBulletListCheckmark' - | 'TextBulletListDismiss' - | 'TextBulletListLtr' - | 'TextBulletListLtr90' - | 'TextBulletListLtrRotate270' - | 'TextBulletListRtl' - | 'TextBulletListRtl90' - | 'TextBulletListSquare' - | 'TextBulletListSquareClock' - | 'TextBulletListSquareEdit' - | 'TextBulletListSquarePerson' - | 'TextBulletListSquareSearch' - | 'TextBulletListSquareSettings' - | 'TextBulletListSquareShield' - | 'TextBulletListSquareSparkle' - | 'TextBulletListSquareToolbox' - | 'TextBulletListSquareWarning' - | 'TextBulletListTree' - | 'TextCaseLowercase' - | 'TextCaseTitle' - | 'TextCaseUppercase' - | 'TextChangeCase' - | 'TextClearFormatting' - | 'TextCollapse' - | 'TextColor' - | 'TextColorAccent' - | 'TextColumnOne' - | 'TextColumnOneNarrow' - | 'TextColumnOneSemiNarrow' - | 'TextColumnOneWide' - | 'TextColumnOneWideLightning' - | 'TextColumnThree' - | 'TextColumnTwo' - | 'TextColumnTwoLeft' - | 'TextColumnTwoRight' - | 'TextColumnWide' - | 'TextContinuous' - | 'TextDensity' - | 'TextDescription' - | 'TextDescriptionLtr' - | 'TextDescriptionRtl' - | 'TextDirectionHorizontalLeft' - | 'TextDirectionHorizontalLtr' - | 'TextDirectionHorizontalRight' - | 'TextDirectionHorizontalRtl' - | 'TextDirectionRotate270Right' - | 'TextDirectionRotate315Right' - | 'TextDirectionRotate45Right' - | 'TextDirectionRotate90Left' - | 'TextDirectionRotate90Ltr' - | 'TextDirectionRotate90Right' - | 'TextDirectionRotate90Rtl' - | 'TextDirectionVertical' - | 'TextEditStyle' - | 'TextEditStyleCharacterA' - | 'TextEditStyleCharacterGa' - | 'TextEffects' - | 'TextEffectsSparkle' - | 'TextExpand' - | 'TextField' - | 'TextFirstLine' - | 'TextFont' - | 'TextFontInfo' - | 'TextFontSize' - | 'TextFootnote' - | 'TextGrammarArrowLeft' - | 'TextGrammarArrowRight' - | 'TextGrammarCheckmark' - | 'TextGrammarDismiss' - | 'TextGrammarError' - | 'TextGrammarLightning' - | 'TextGrammarSettings' - | 'TextGrammarWand' - | 'TextHanging' - | 'TextHeader1' - | 'TextHeader1Lines' - | 'TextHeader1LinesCaret' - | 'TextHeader2' - | 'TextHeader2Lines' - | 'TextHeader2LinesCaret' - | 'TextHeader3' - | 'TextHeader3Lines' - | 'TextHeader3LinesCaret' - | 'TextIndentDecrease' - | 'TextIndentDecreaseLtr' - | 'TextIndentDecreaseLtr90' - | 'TextIndentDecreaseLtrRotate270' - | 'TextIndentDecreaseRotate270' - | 'TextIndentDecreaseRotate90' - | 'TextIndentDecreaseRtl' - | 'TextIndentDecreaseRtl90' - | 'TextIndentDecreaseRtlRotate270' - | 'TextIndentIncrease' - | 'TextIndentIncreaseLtr' - | 'TextIndentIncreaseLtr90' - | 'TextIndentIncreaseLtrRotate270' - | 'TextIndentIncreaseRotate270' - | 'TextIndentIncreaseRotate90' - | 'TextIndentIncreaseRtl' - | 'TextIndentIncreaseRtl90' - | 'TextIndentIncreaseRtlRotate270' - | 'TextItalic' - | 'TextLineSpacing' - | 'TextMore' - | 'TextNumberFormat' - | 'TextNumberListLtr' - | 'TextNumberListLtr90' - | 'TextNumberListLtrRotate270' - | 'TextNumberListRotate270' - | 'TextNumberListRotate90' - | 'TextNumberListRtl' - | 'TextNumberListRtl90' - | 'TextNumberListRtlRotate270' - | 'TextParagraph' - | 'TextParagraphDirection' - | 'TextParagraphDirectionLeft' - | 'TextParagraphDirectionRight' - | 'TextPeriodAsterisk' - | 'TextPositionBehind' - | 'TextPositionFront' - | 'TextPositionLine' - | 'TextPositionSquare' - | 'TextPositionSquareLeft' - | 'TextPositionSquareRight' - | 'TextPositionThrough' - | 'TextPositionTight' - | 'TextPositionTopBottom' - | 'TextProofingTools' - | 'TextQuote' - | 'TextSortAscending' - | 'TextSortDescending' - | 'TextStrikethrough' - | 'TextSubscript' - | 'TextSuperscript' - | 'TextT' - | 'TextTTag' - | 'TextUnderline' - | 'TextUnderlineCharacterU' - | 'TextUnderlineDouble' - | 'TextWholeWord' - | 'TextWordCount' - | 'TextWrap' - | 'TextWrapOff' - | 'Textbox' - | 'TextboxAlignBottom' - | 'TextboxAlignBottomCenter' - | 'TextboxAlignBottomLeft' - | 'TextboxAlignBottomRight' - | 'TextboxAlignBottomRotate90' - | 'TextboxAlignCenter' - | 'TextboxAlignMiddle' - | 'TextboxAlignMiddleLeft' - | 'TextboxAlignMiddleRight' - | 'TextboxAlignMiddleRotate90' - | 'TextboxAlignTop' - | 'TextboxAlignTopCenter' - | 'TextboxAlignTopLeft' - | 'TextboxAlignTopRight' - | 'TextboxAlignTopRotate90' - | 'TextboxMore' - | 'TextboxRotate90' - | 'TextboxSettings' - | 'Thinking' - | 'ThumbDislike' - | 'ThumbLike' - | 'ThumbLikeDislike' - | 'TicketDiagonal' - | 'TicketHorizontal' - | 'TimeAndWeather' - | 'TimePicker' - | 'Timeline' - | 'Timer10' - | 'Timer' - | 'Timer2' - | 'Timer3' - | 'TimerOff' - | 'ToggleLeft' - | 'ToggleMultiple' - | 'ToggleRight' - | 'Toolbox' - | 'TooltipQuote' - | 'TopSpeed' - | 'Translate' - | 'TranslateAuto' - | 'TranslateOff' - | 'Transmission' - | 'TrayItemAdd' - | 'TrayItemRemove' - | 'TreeDeciduous' - | 'TreeEvergreen' - | 'Triangle' - | 'TriangleDown' - | 'TriangleLeft' - | 'TriangleRight' - | 'TriangleUp' - | 'Trophy' - | 'TrophyLock' - | 'TrophyOff' - | 'Tv' - | 'TvArrowRight' - | 'TvUsb' - | 'Umbrella' - | 'UninstallApp' - | 'UsbPlug' - | 'UsbStick' - | 'Vault' - | 'VehicleBicycle' - | 'VehicleBus' - | 'VehicleCab' - | 'VehicleCableCar' - | 'VehicleCar' - | 'VehicleCarCollision' - | 'VehicleCarParking' - | 'VehicleCarProfile' - | 'VehicleCarProfileLtr' - | 'VehicleCarProfileLtrClock' - | 'VehicleCarProfileRtl' - | 'VehicleShip' - | 'VehicleSubway' - | 'VehicleSubwayClock' - | 'VehicleTruck' - | 'VehicleTruckBag' - | 'VehicleTruckCube' - | 'VehicleTruckProfile' - | 'Video' - | 'Video360' - | 'Video360Off' - | 'VideoAdd' - | 'VideoBackgroundEffect' - | 'VideoBackgroundEffectHorizontal' - | 'VideoChat' - | 'VideoClip' - | 'VideoClipMultiple' - | 'VideoClipOff' - | 'VideoClipOptimize' - | 'VideoLink' - | 'VideoOff' - | 'VideoPeople' - | 'VideoPerson' - | 'VideoPersonCall' - | 'VideoPersonClock' - | 'VideoPersonOff' - | 'VideoPersonPulse' - | 'VideoPersonSparkle' - | 'VideoPersonSparkleOff' - | 'VideoPersonStar' - | 'VideoPersonStarOff' - | 'VideoPlayPause' - | 'VideoProhibited' - | 'VideoRecording' - | 'VideoSecurity' - | 'VideoSwitch' - | 'VideoSync' - | 'ViewDesktop' - | 'ViewDesktopMobile' - | 'VirtualNetwork' - | 'VirtualNetworkToolbox' - | 'Voicemail' - | 'VoicemailArrowBack' - | 'VoicemailArrowForward' - | 'VoicemailArrowSubtract' - | 'VoicemailShield' - | 'VoicemailSubtract' - | 'Vote' - | 'WalkieTalkie' - | 'Wallet' - | 'WalletCreditCard' - | 'Wallpaper' - | 'Wand' - | 'Warning' - | 'WarningShield' - | 'Washer' - | 'Water' - | 'WeatherBlowingSnow' - | 'WeatherCloudy' - | 'WeatherDrizzle' - | 'WeatherDuststorm' - | 'WeatherFog' - | 'WeatherHailDay' - | 'WeatherHailNight' - | 'WeatherHaze' - | 'WeatherMoon' - | 'WeatherMoonOff' - | 'WeatherPartlyCloudyDay' - | 'WeatherPartlyCloudyNight' - | 'WeatherRain' - | 'WeatherRainShowersDay' - | 'WeatherRainShowersNight' - | 'WeatherRainSnow' - | 'WeatherSnow' - | 'WeatherSnowShowerDay' - | 'WeatherSnowShowerNight' - | 'WeatherSnowflake' - | 'WeatherSqualls' - | 'WeatherSunny' - | 'WeatherSunnyHigh' - | 'WeatherSunnyLow' - | 'WeatherThunderstorm' - | 'WebAsset' - | 'Whiteboard' - | 'WhiteboardOff' - | 'Wifi1' - | 'Wifi2' - | 'Wifi3' - | 'Wifi4' - | 'WifiLock' - | 'WifiOff' - | 'WifiSettings' - | 'WifiWarning' - | 'Window' - | 'WindowAd' - | 'WindowAdOff' - | 'WindowAdPerson' - | 'WindowApps' - | 'WindowArrowUp' - | 'WindowBulletList' - | 'WindowBulletListAdd' - | 'WindowConsole' - | 'WindowDatabase' - | 'WindowDevEdit' - | 'WindowDevTools' - | 'WindowEdit' - | 'WindowHeaderHorizontal' - | 'WindowHeaderHorizontalOff' - | 'WindowHeaderVertical' - | 'WindowInprivate' - | 'WindowInprivateAccount' - | 'WindowLocationTarget' - | 'WindowMultiple' - | 'WindowMultipleSwap' - | 'WindowNew' - | 'WindowPlay' - | 'WindowSettings' - | 'WindowShield' - | 'WindowText' - | 'WindowWrench' - | 'Wrench' - | 'WrenchScrewdriver' - | 'WrenchSettings' - | 'XboxConsole' - | 'XboxController' - | 'XboxControllerError' - | 'Xray' - | 'ZoomFit' - | 'ZoomIn' - | 'ZoomOut'; + /* cSpell:disable */ + +// This file was automatically generated by a tool on 03/19/2026, 9:27 PM UTC. DO NOT UPDATE MANUALLY. +// It includes declarations for Adaptive Card features available in Teams, Copilot, Outlook, Word, Excel, PowerPoint. + +export type CardElement = IContainer | IActionSet | IColumnSet | IMedia | IRichTextBlock | ITable | ITextBlock | IFactSet | IImageSet | IImage | ITextInput | IDateInput | ITimeInput | INumberInput | IToggleInput | IChoiceSetInput | IRatingInput | IRating | ICompoundButton | IIcon | ICarousel | IBadge | IProgressRing | IProgressBar | IDonutChart | IPieChart | IGroupedVerticalBarChart | IVerticalBarChart | IHorizontalBarChart | IStackedHorizontalBarChart | ILineChart | IGaugeChart | ICodeBlock | IComUserMicrosoftGraphComponent | IComUsersMicrosoftGraphComponent | IComResourceMicrosoftGraphComponent | IComFileMicrosoftGraphComponent | IComEventMicrosoftGraphComponent; + +export type Action = ISubmitAction | IOpenUrlAction | IExecuteAction | IToggleVisibilityAction | IShowCardAction | IResetInputsAction | IPopoverAction | IOpenUrlDialogAction | IInsertImageAction; + +export type IconName = 'AccessTime' | 'Accessibility' | 'AccessibilityCheckmark' | 'Add' | 'AddCircle' | 'AddSquare' | 'AddSquareMultiple' | 'AddSubtractCircle' | 'Airplane' | 'AirplaneLanding' | 'AirplaneTakeOff' | 'Album' | 'AlbumAdd' | 'Alert' | 'AlertBadge' | 'AlertOff' | 'AlertOn' | 'AlertSnooze' | 'AlertUrgent' | 'AlignBottom' | 'AlignCenterHorizontal' | 'AlignCenterVertical' | 'AlignDistributeBottom' | 'AlignDistributeLeft' | 'AlignDistributeRight' | 'AlignDistributeTop' | 'AlignEndHorizontal' | 'AlignEndVertical' | 'AlignLeft' | 'AlignRight' | 'AlignSpaceAroundHorizontal' | 'AlignSpaceAroundVertical' | 'AlignSpaceBetweenHorizontal' | 'AlignSpaceBetweenVertical' | 'AlignSpaceEvenlyHorizontal' | 'AlignSpaceEvenlyVertical' | 'AlignSpaceFitVertical' | 'AlignStartHorizontal' | 'AlignStartVertical' | 'AlignStraighten' | 'AlignStretchHorizontal' | 'AlignStretchVertical' | 'AlignTop' | 'AnimalCat' | 'AnimalDog' | 'AnimalRabbit' | 'AnimalRabbitOff' | 'AnimalTurtle' | 'AppFolder' | 'AppGeneric' | 'AppRecent' | 'AppStore' | 'AppTitle' | 'ApprovalsApp' | 'Apps' | 'AppsAddIn' | 'AppsList' | 'AppsListDetail' | 'Archive' | 'ArchiveArrowBack' | 'ArchiveMultiple' | 'ArchiveSettings' | 'ArrowAutofitContent' | 'ArrowAutofitDown' | 'ArrowAutofitHeight' | 'ArrowAutofitHeightDotted' | 'ArrowAutofitHeightIn' | 'ArrowAutofitUp' | 'ArrowAutofitWidth' | 'ArrowAutofitWidthDotted' | 'ArrowBetweenDown' | 'ArrowBetweenUp' | 'ArrowBidirectionalLeftRight' | 'ArrowBidirectionalUpDown' | 'ArrowBounce' | 'ArrowCircleDown' | 'ArrowCircleDownDouble' | 'ArrowCircleDownRight' | 'ArrowCircleDownSplit' | 'ArrowCircleDownUp' | 'ArrowCircleLeft' | 'ArrowCircleRight' | 'ArrowCircleUp' | 'ArrowCircleUpLeft' | 'ArrowCircleUpRight' | 'ArrowClockwise' | 'ArrowClockwiseDashes' | 'ArrowCollapseAll' | 'ArrowCounterclockwise' | 'ArrowCounterclockwiseDashes' | 'ArrowCurveDownLeft' | 'ArrowCurveDownRight' | 'ArrowCurveUpLeft' | 'ArrowCurveUpRight' | 'ArrowDown' | 'ArrowDownExclamation' | 'ArrowDownLeft' | 'ArrowDownload' | 'ArrowDownloadOff' | 'ArrowEject' | 'ArrowEnter' | 'ArrowEnterLeft' | 'ArrowEnterUp' | 'ArrowExit' | 'ArrowExpand' | 'ArrowExport' | 'ArrowExportLtr' | 'ArrowExportRtl' | 'ArrowExportUp' | 'ArrowFit' | 'ArrowFitIn' | 'ArrowFlowDiagonalUpRight' | 'ArrowFlowUpRight' | 'ArrowFlowUpRightRectangleMultiple' | 'ArrowForward' | 'ArrowForwardDownLightning' | 'ArrowForwardDownPerson' | 'ArrowHookDownLeft' | 'ArrowHookDownRight' | 'ArrowHookUpLeft' | 'ArrowHookUpRight' | 'ArrowImport' | 'ArrowJoin' | 'ArrowLeft' | 'ArrowMaximize' | 'ArrowMaximizeVertical' | 'ArrowMinimize' | 'ArrowMinimizeVertical' | 'ArrowMove' | 'ArrowMoveInward' | 'ArrowNext' | 'ArrowOutlineDownLeft' | 'ArrowOutlineUpRight' | 'ArrowParagraph' | 'ArrowPrevious' | 'ArrowRedo' | 'ArrowRepeat1' | 'ArrowRepeatAll' | 'ArrowRepeatAllOff' | 'ArrowReply' | 'ArrowReplyAll' | 'ArrowReplyDown' | 'ArrowReset' | 'ArrowRight' | 'ArrowRotateClockwise' | 'ArrowRotateCounterclockwise' | 'ArrowRouting' | 'ArrowRoutingRectangleMultiple' | 'ArrowShuffle' | 'ArrowShuffleOff' | 'ArrowSort' | 'ArrowSortDown' | 'ArrowSortDownLines' | 'ArrowSortUp' | 'ArrowSplit' | 'ArrowSprint' | 'ArrowSquareDown' | 'ArrowSquareUpRight' | 'ArrowStepBack' | 'ArrowStepIn' | 'ArrowStepInDiagonalDownLeft' | 'ArrowStepInLeft' | 'ArrowStepInRight' | 'ArrowStepOut' | 'ArrowStepOver' | 'ArrowSwap' | 'ArrowSync' | 'ArrowSyncCheckmark' | 'ArrowSyncCircle' | 'ArrowSyncDismiss' | 'ArrowSyncOff' | 'ArrowTrending' | 'ArrowTrendingCheckmark' | 'ArrowTrendingDown' | 'ArrowTrendingLines' | 'ArrowTrendingSettings' | 'ArrowTrendingSparkle' | 'ArrowTrendingText' | 'ArrowTrendingWrench' | 'ArrowTurnBidirectionalDownRight' | 'ArrowTurnDownLeft' | 'ArrowTurnDownRight' | 'ArrowTurnDownUp' | 'ArrowTurnLeftDown' | 'ArrowTurnLeftRight' | 'ArrowTurnLeftUp' | 'ArrowTurnRight' | 'ArrowTurnRightDown' | 'ArrowTurnRightLeft' | 'ArrowTurnRightUp' | 'ArrowTurnUpDown' | 'ArrowTurnUpLeft' | 'ArrowUndo' | 'ArrowUp' | 'ArrowUpLeft' | 'ArrowUpRight' | 'ArrowUpRightDashes' | 'ArrowUpSquareSettings' | 'ArrowUpload' | 'ArrowWrap' | 'ArrowWrapOff' | 'ArrowsBidirectional' | 'Attach' | 'AttachArrowRight' | 'AttachText' | 'AutoFitHeight' | 'AutoFitWidth' | 'Autocorrect' | 'Autosum' | 'Backpack' | 'BackpackAdd' | 'Backspace' | 'Badge' | 'Balloon' | 'BarcodeScanner' | 'Battery0' | 'Battery10' | 'Battery1' | 'Battery2' | 'Battery3' | 'Battery4' | 'Battery5' | 'Battery6' | 'Battery7' | 'Battery8' | 'Battery9' | 'BatteryCharge' | 'BatteryCheckmark' | 'BatterySaver' | 'BatteryWarning' | 'Beach' | 'Beaker' | 'BeakerAdd' | 'BeakerDismiss' | 'BeakerEdit' | 'BeakerEmpty' | 'BeakerOff' | 'BeakerSettings' | 'Bed' | 'BezierCurveSquare' | 'BinFull' | 'BinRecycle' | 'BinRecycleFull' | 'BinderTriangle' | 'Bluetooth' | 'BluetoothConnected' | 'BluetoothDisabled' | 'BluetoothSearching' | 'Blur' | 'Board' | 'BoardGames' | 'BoardHeart' | 'BoardSplit' | 'Book' | 'BookAdd' | 'BookArrowClockwise' | 'BookClock' | 'BookCoins' | 'BookCompass' | 'BookContacts' | 'BookDatabase' | 'BookDefault' | 'BookDismiss' | 'BookExclamationMark' | 'BookGlobe' | 'BookInformation' | 'BookLetter' | 'BookNumber' | 'BookOpen' | 'BookOpenGlobe' | 'BookOpenMicrophone' | 'BookPulse' | 'BookQuestionMark' | 'BookQuestionMarkRtl' | 'BookSearch' | 'BookStar' | 'BookTemplate' | 'BookTheta' | 'BookToolbox' | 'Bookmark' | 'BookmarkAdd' | 'BookmarkMultiple' | 'BookmarkOff' | 'BookmarkSearch' | 'BorderAll' | 'BorderBottom' | 'BorderBottomDouble' | 'BorderBottomThick' | 'BorderInside' | 'BorderLeft' | 'BorderLeftRight' | 'BorderNone' | 'BorderOutside' | 'BorderOutsideThick' | 'BorderRight' | 'BorderTop' | 'BorderTopBottom' | 'BorderTopBottomDouble' | 'BorderTopBottomThick' | 'Bot' | 'BotAdd' | 'BotSparkle' | 'BowTie' | 'BowlChopsticks' | 'BowlSalad' | 'Box' | 'BoxArrowLeft' | 'BoxArrowUp' | 'BoxCheckmark' | 'BoxDismiss' | 'BoxEdit' | 'BoxMultiple' | 'BoxMultipleArrowLeft' | 'BoxMultipleArrowRight' | 'BoxMultipleCheckmark' | 'BoxMultipleSearch' | 'BoxSearch' | 'BoxToolbox' | 'Braces' | 'BracesCheckmark' | 'BracesDismiss' | 'BracesVariable' | 'BrainCircuit' | 'Branch' | 'BranchCompare' | 'BranchFork' | 'BranchForkHint' | 'BranchForkLink' | 'BranchRequest' | 'BreakoutRoom' | 'Briefcase' | 'BriefcaseMedical' | 'BriefcaseOff' | 'BriefcasePerson' | 'BriefcaseSearch' | 'BrightnessHigh' | 'BrightnessLow' | 'BroadActivityFeed' | 'Broom' | 'BubbleMultiple' | 'Bug' | 'BugArrowCounterclockwise' | 'BugProhibited' | 'Building' | 'BuildingBank' | 'BuildingBankLink' | 'BuildingBankToolbox' | 'BuildingCloud' | 'BuildingDesktop' | 'BuildingFactory' | 'BuildingGovernment' | 'BuildingGovernmentSearch' | 'BuildingHome' | 'BuildingLighthouse' | 'BuildingMosque' | 'BuildingMultiple' | 'BuildingPeople' | 'BuildingRetail' | 'BuildingRetailMoney' | 'BuildingRetailMore' | 'BuildingRetailShield' | 'BuildingRetailToolbox' | 'BuildingShop' | 'BuildingSkyscraper' | 'BuildingSwap' | 'BuildingTownhouse' | 'Button' | 'Calculator' | 'CalculatorArrowClockwise' | 'CalculatorMultiple' | 'Calendar' | 'Calendar3Day' | 'CalendarAdd' | 'CalendarAgenda' | 'CalendarArrowCounterclockwise' | 'CalendarArrowDown' | 'CalendarArrowRight' | 'CalendarAssistant' | 'CalendarCancel' | 'CalendarChat' | 'CalendarCheckmark' | 'CalendarClock' | 'CalendarDataBar' | 'CalendarDate' | 'CalendarDay' | 'CalendarEdit' | 'CalendarEmpty' | 'CalendarError' | 'CalendarEye' | 'CalendarInfo' | 'CalendarLink' | 'CalendarLock' | 'CalendarLtr' | 'CalendarMail' | 'CalendarMention' | 'CalendarMonth' | 'CalendarMultiple' | 'CalendarNote' | 'CalendarPattern' | 'CalendarPerson' | 'CalendarPhone' | 'CalendarPlay' | 'CalendarQuestionMark' | 'CalendarRecord' | 'CalendarReply' | 'CalendarRtl' | 'CalendarSearch' | 'CalendarSettings' | 'CalendarShield' | 'CalendarStar' | 'CalendarSync' | 'CalendarToday' | 'CalendarToolbox' | 'CalendarVideo' | 'CalendarWeekNumbers' | 'CalendarWeekStart' | 'CalendarWorkWeek' | 'Call' | 'CallAdd' | 'CallCheckmark' | 'CallConnecting' | 'CallDismiss' | 'CallEnd' | 'CallExclamation' | 'CallForward' | 'CallInbound' | 'CallMissed' | 'CallOutbound' | 'CallPark' | 'CallPause' | 'CallProhibited' | 'CallTransfer' | 'CallWarning' | 'CalligraphyPen' | 'CalligraphyPenCheckmark' | 'CalligraphyPenError' | 'CalligraphyPenQuestionMark' | 'Camera' | 'CameraAdd' | 'CameraDome' | 'CameraEdit' | 'CameraOff' | 'CameraSparkles' | 'CameraSwitch' | 'CardUi' | 'CaretDown' | 'CaretDownRight' | 'CaretLeft' | 'CaretRight' | 'CaretUp' | 'Cart' | 'Cast' | 'CastMultiple' | 'CatchUp' | 'Cd' | 'Cellular3G' | 'Cellular4G' | 'Cellular5G' | 'CellularData1' | 'CellularData2' | 'CellularData3' | 'CellularData4' | 'CellularData5' | 'CellularOff' | 'CellularWarning' | 'CenterHorizontal' | 'CenterVertical' | 'Certificate' | 'Channel' | 'ChannelAdd' | 'ChannelAlert' | 'ChannelArrowLeft' | 'ChannelDismiss' | 'ChannelShare' | 'ChannelSubtract' | 'ChartMultiple' | 'ChartPerson' | 'Chat' | 'ChatAdd' | 'ChatArrowBack' | 'ChatArrowDoubleBack' | 'ChatBubblesQuestion' | 'ChatCursor' | 'ChatDismiss' | 'ChatEmpty' | 'ChatHelp' | 'ChatLock' | 'ChatMail' | 'ChatMultiple' | 'ChatMultipleHeart' | 'ChatOff' | 'ChatSettings' | 'ChatSparkle' | 'ChatVideo' | 'ChatWarning' | 'Check' | 'Checkbox1' | 'Checkbox2' | 'CheckboxArrowRight' | 'CheckboxChecked' | 'CheckboxCheckedSync' | 'CheckboxIndeterminate' | 'CheckboxPerson' | 'CheckboxUnchecked' | 'CheckboxWarning' | 'Checkmark' | 'CheckmarkCircle' | 'CheckmarkCircleSquare' | 'CheckmarkLock' | 'CheckmarkNote' | 'CheckmarkSquare' | 'CheckmarkStarburst' | 'CheckmarkUnderlineCircle' | 'Chess' | 'ChevronCircleDown' | 'ChevronCircleLeft' | 'ChevronCircleRight' | 'ChevronCircleUp' | 'ChevronDoubleDown' | 'ChevronDoubleLeft' | 'ChevronDoubleRight' | 'ChevronDoubleUp' | 'ChevronDown' | 'ChevronDownUp' | 'ChevronLeft' | 'ChevronRight' | 'ChevronUp' | 'ChevronUpDown' | 'Circle' | 'CircleEdit' | 'CircleEraser' | 'CircleHalfFill' | 'CircleHint' | 'CircleHintHalfVertical' | 'CircleImage' | 'CircleLine' | 'CircleMultipleSubtractCheckmark' | 'CircleOff' | 'CircleSmall' | 'City' | 'Class' | 'Classification' | 'ClearFormatting' | 'Clipboard' | 'Clipboard3Day' | 'ClipboardArrowRight' | 'ClipboardBrush' | 'ClipboardBulletList' | 'ClipboardBulletListLtr' | 'ClipboardBulletListRtl' | 'ClipboardCheckmark' | 'ClipboardClock' | 'ClipboardCode' | 'ClipboardDataBar' | 'ClipboardDay' | 'ClipboardEdit' | 'ClipboardError' | 'ClipboardHeart' | 'ClipboardImage' | 'ClipboardLetter' | 'ClipboardLink' | 'ClipboardMathFormula' | 'ClipboardMonth' | 'ClipboardMore' | 'ClipboardMultiple' | 'ClipboardNote' | 'ClipboardNumber123' | 'ClipboardPaste' | 'ClipboardPulse' | 'ClipboardSearch' | 'ClipboardSettings' | 'ClipboardTask' | 'ClipboardTaskAdd' | 'ClipboardTaskList' | 'ClipboardTaskListLtr' | 'ClipboardTaskListRtl' | 'ClipboardText' | 'ClipboardTextEdit' | 'ClipboardTextLtr' | 'ClipboardTextRtl' | 'Clock' | 'ClockAlarm' | 'ClockArrowDownload' | 'ClockDismiss' | 'ClockLock' | 'ClockPause' | 'ClockToolbox' | 'ClosedCaption' | 'ClosedCaptionOff' | 'Cloud' | 'CloudAdd' | 'CloudArchive' | 'CloudArrowDown' | 'CloudArrowUp' | 'CloudBeaker' | 'CloudBidirectional' | 'CloudCheckmark' | 'CloudCube' | 'CloudDatabase' | 'CloudDesktop' | 'CloudDismiss' | 'CloudEdit' | 'CloudError' | 'CloudFlow' | 'CloudLink' | 'CloudOff' | 'CloudSwap' | 'CloudSync' | 'CloudWords' | 'Clover' | 'Code' | 'CodeBlock' | 'CodeCircle' | 'CodeCs' | 'CodeCsRectangle' | 'CodeFs' | 'CodeFsRectangle' | 'CodeJs' | 'CodeJsRectangle' | 'CodePy' | 'CodePyRectangle' | 'CodeRb' | 'CodeRbRectangle' | 'CodeText' | 'CodeTextEdit' | 'CodeTextOff' | 'CodeTs' | 'CodeTsRectangle' | 'CodeVb' | 'CodeVbRectangle' | 'Collections' | 'CollectionsAdd' | 'Color' | 'ColorBackground' | 'ColorBackgroundAccent' | 'ColorFill' | 'ColorFillAccent' | 'ColorLine' | 'ColorLineAccent' | 'Column' | 'ColumnArrowRight' | 'ColumnDoubleCompare' | 'ColumnEdit' | 'ColumnSingle' | 'ColumnSingleCompare' | 'ColumnTriple' | 'ColumnTripleEdit' | 'Comma' | 'Comment' | 'CommentAdd' | 'CommentArrowLeft' | 'CommentArrowRight' | 'CommentCheckmark' | 'CommentDismiss' | 'CommentEdit' | 'CommentError' | 'CommentLightning' | 'CommentLink' | 'CommentMention' | 'CommentMultiple' | 'CommentMultipleCheckmark' | 'CommentMultipleLink' | 'CommentNote' | 'CommentOff' | 'Communication' | 'CommunicationPerson' | 'CommunicationShield' | 'CompassNorthwest' | 'Component2DoubleTapSwipeDown' | 'Component2DoubleTapSwipeUp' | 'Compose' | 'Cone' | 'ConferenceRoom' | 'Connected' | 'Connector' | 'ContactCard' | 'ContactCardGroup' | 'ContactCardLink' | 'ContactCardRibbon' | 'ContentSettings' | 'ContentView' | 'ContentViewGallery' | 'ContentViewGalleryLightning' | 'ContractDownLeft' | 'ContractUpRight' | 'ControlButton' | 'ConvertRange' | 'Cookies' | 'Copy' | 'CopyAdd' | 'CopyArrowRight' | 'CopySelect' | 'Couch' | 'CreditCardClock' | 'CreditCardPerson' | 'CreditCardToolbox' | 'Crop' | 'CropInterim' | 'CropInterimOff' | 'CropSparkle' | 'Crown' | 'CrownSubtract' | 'Cube' | 'CubeAdd' | 'CubeArrowCurveDown' | 'CubeLink' | 'CubeMultiple' | 'CubeQuick' | 'CubeRotate' | 'CubeSync' | 'CubeTree' | 'CurrencyDollarEuro' | 'CurrencyDollarRupee' | 'Cursor' | 'CursorClick' | 'CursorHover' | 'CursorHoverOff' | 'CursorProhibited' | 'Cut' | 'DarkTheme' | 'DataArea' | 'DataBarHorizontal' | 'DataBarHorizontalDescending' | 'DataBarVertical' | 'DataBarVerticalAdd' | 'DataBarVerticalAscending' | 'DataBarVerticalStar' | 'DataFunnel' | 'DataHistogram' | 'DataLine' | 'DataPie' | 'DataScatter' | 'DataSunburst' | 'DataTreemap' | 'DataTrending' | 'DataUsage' | 'DataUsageEdit' | 'DataUsageSettings' | 'DataUsageToolbox' | 'DataWaterfall' | 'DataWhisker' | 'Database' | 'DatabaseArrowDown' | 'DatabaseArrowRight' | 'DatabaseArrowUp' | 'DatabaseLightning' | 'DatabaseLink' | 'DatabaseMultiple' | 'DatabasePerson' | 'DatabasePlugConnected' | 'DatabaseSearch' | 'DatabaseStack' | 'DatabaseSwitch' | 'DatabaseWarning' | 'DatabaseWindow' | 'DecimalArrowLeft' | 'DecimalArrowRight' | 'Delete' | 'DeleteArrowBack' | 'DeleteDismiss' | 'DeleteLines' | 'DeleteOff' | 'Dentist' | 'DesignIdeas' | 'Desk' | 'Desktop' | 'DesktopArrowDown' | 'DesktopArrowRight' | 'DesktopCheckmark' | 'DesktopCursor' | 'DesktopEdit' | 'DesktopFlow' | 'DesktopKeyboard' | 'DesktopMac' | 'DesktopPulse' | 'DesktopSignal' | 'DesktopSpeaker' | 'DesktopSpeakerOff' | 'DesktopSync' | 'DesktopToolbox' | 'DesktopTower' | 'DeveloperBoard' | 'DeveloperBoardLightning' | 'DeveloperBoardLightningToolbox' | 'DeveloperBoardSearch' | 'DeviceEq' | 'DeviceMeetingRoom' | 'DeviceMeetingRoomRemote' | 'Diagram' | 'Dialpad' | 'DialpadOff' | 'DialpadQuestionMark' | 'Diamond' | 'Directions' | 'Dishwasher' | 'Dismiss' | 'DismissCircle' | 'DismissSquare' | 'DismissSquareMultiple' | 'Diversity' | 'DividerShort' | 'DividerTall' | 'Dock' | 'DockRow' | 'Doctor' | 'Document100' | 'Document' | 'DocumentAdd' | 'DocumentArrowDown' | 'DocumentArrowLeft' | 'DocumentArrowRight' | 'DocumentArrowUp' | 'DocumentBorder' | 'DocumentBorderPrint' | 'DocumentBriefcase' | 'DocumentBulletList' | 'DocumentBulletListArrowLeft' | 'DocumentBulletListClock' | 'DocumentBulletListCube' | 'DocumentBulletListMultiple' | 'DocumentBulletListOff' | 'DocumentCatchUp' | 'DocumentCheckmark' | 'DocumentChevronDouble' | 'DocumentContract' | 'DocumentCopy' | 'DocumentCs' | 'DocumentCss' | 'DocumentCube' | 'DocumentData' | 'DocumentDataLink' | 'DocumentDataLock' | 'DocumentDatabase' | 'DocumentDismiss' | 'DocumentEdit' | 'DocumentEndnote' | 'DocumentError' | 'DocumentFit' | 'DocumentFlowchart' | 'DocumentFolder' | 'DocumentFooter' | 'DocumentFooterDismiss' | 'DocumentFs' | 'DocumentHeader' | 'DocumentHeaderArrowDown' | 'DocumentHeaderDismiss' | 'DocumentHeaderFooter' | 'DocumentHeart' | 'DocumentHeartPulse' | 'DocumentImage' | 'DocumentJava' | 'DocumentJavascript' | 'DocumentJs' | 'DocumentKey' | 'DocumentLandscape' | 'DocumentLandscapeData' | 'DocumentLandscapeSplit' | 'DocumentLandscapeSplitHint' | 'DocumentLightning' | 'DocumentLink' | 'DocumentLock' | 'DocumentMargins' | 'DocumentMention' | 'DocumentMultiple' | 'DocumentMultiplePercent' | 'DocumentMultipleProhibited' | 'DocumentMultipleSync' | 'DocumentNumber1' | 'DocumentOnePage' | 'DocumentOnePageAdd' | 'DocumentOnePageBeaker' | 'DocumentOnePageColumns' | 'DocumentOnePageLink' | 'DocumentOnePageMultiple' | 'DocumentOnePageSparkle' | 'DocumentPageBottomCenter' | 'DocumentPageBottomLeft' | 'DocumentPageBottomRight' | 'DocumentPageBreak' | 'DocumentPageNumber' | 'DocumentPageTopCenter' | 'DocumentPageTopLeft' | 'DocumentPageTopRight' | 'DocumentPdf' | 'DocumentPercent' | 'DocumentPerson' | 'DocumentPill' | 'DocumentPrint' | 'DocumentProhibited' | 'DocumentPy' | 'DocumentQuestionMark' | 'DocumentQueue' | 'DocumentQueueAdd' | 'DocumentQueueMultiple' | 'DocumentRb' | 'DocumentRibbon' | 'DocumentSass' | 'DocumentSave' | 'DocumentSearch' | 'DocumentSettings' | 'DocumentSplitHint' | 'DocumentSplitHintOff' | 'DocumentSync' | 'DocumentTable' | 'DocumentTableArrowRight' | 'DocumentTableCheckmark' | 'DocumentTableCube' | 'DocumentTableSearch' | 'DocumentTableTruck' | 'DocumentTarget' | 'DocumentText' | 'DocumentTextClock' | 'DocumentTextExtract' | 'DocumentTextLink' | 'DocumentTextToolbox' | 'DocumentToolbox' | 'DocumentTs' | 'DocumentVb' | 'DocumentWidth' | 'DocumentYml' | 'Door' | 'DoorArrowLeft' | 'DoorArrowRight' | 'DoorTag' | 'DoubleSwipeDown' | 'DoubleSwipeUp' | 'DoubleTapSwipeDown' | 'DoubleTapSwipeUp' | 'Drafts' | 'Drag' | 'DrawImage' | 'DrawShape' | 'DrawText' | 'Drawer' | 'DrawerAdd' | 'DrawerArrowDownload' | 'DrawerDismiss' | 'DrawerPlay' | 'DrawerSubtract' | 'DrinkBeer' | 'DrinkBottle' | 'DrinkBottleOff' | 'DrinkCoffee' | 'DrinkMargarita' | 'DrinkToGo' | 'DrinkWine' | 'DriveTrain' | 'Drop' | 'DualScreen' | 'DualScreenAdd' | 'DualScreenArrowRight' | 'DualScreenArrowUp' | 'DualScreenClock' | 'DualScreenClosedAlert' | 'DualScreenDesktop' | 'DualScreenDismiss' | 'DualScreenGroup' | 'DualScreenHeader' | 'DualScreenLock' | 'DualScreenMirror' | 'DualScreenPagination' | 'DualScreenSettings' | 'DualScreenSpan' | 'DualScreenSpeaker' | 'DualScreenStatusBar' | 'DualScreenTablet' | 'DualScreenUpdate' | 'DualScreenVerticalScroll' | 'DualScreenVibrate' | 'Dumbbell' | 'Dust' | 'Earth' | 'EarthLeaf' | 'Edit' | 'EditArrowBack' | 'EditOff' | 'EditProhibited' | 'EditSettings' | 'Elevator' | 'Emoji' | 'EmojiAdd' | 'EmojiAngry' | 'EmojiEdit' | 'EmojiHand' | 'EmojiHint' | 'EmojiLaugh' | 'EmojiMeh' | 'EmojiMultiple' | 'EmojiSad' | 'EmojiSadSlight' | 'EmojiSmileSlight' | 'EmojiSparkle' | 'EmojiSurprise' | 'Engine' | 'EqualCircle' | 'EqualOff' | 'Eraser' | 'EraserMedium' | 'EraserSegment' | 'EraserSmall' | 'EraserTool' | 'ErrorCircle' | 'ErrorCircleSettings' | 'ExpandUpLeft' | 'ExpandUpRight' | 'ExtendedDock' | 'Eye' | 'EyeLines' | 'EyeOff' | 'EyeTracking' | 'EyeTrackingOff' | 'Eyedropper' | 'EyedropperOff' | 'FStop' | 'FastAcceleration' | 'FastForward' | 'Fax' | 'Feed' | 'Filmstrip' | 'FilmstripImage' | 'FilmstripOff' | 'FilmstripPlay' | 'FilmstripSplit' | 'Filter' | 'FilterAdd' | 'FilterDismiss' | 'FilterSync' | 'Fingerprint' | 'Fire' | 'Fireplace' | 'FixedWidth' | 'Flag' | 'FlagCheckered' | 'FlagClock' | 'FlagOff' | 'FlagPride' | 'FlagPrideIntersexInclusiveProgress' | 'FlagPridePhiladelphia' | 'FlagPrideProgress' | 'Flash' | 'FlashAdd' | 'FlashAuto' | 'FlashCheckmark' | 'FlashFlow' | 'FlashOff' | 'FlashPlay' | 'FlashSettings' | 'FlashSparkle' | 'Flashlight' | 'FlashlightOff' | 'FlipHorizontal' | 'FlipVertical' | 'Flow' | 'Flowchart' | 'FlowchartCircle' | 'Fluent' | 'Fluid' | 'Folder' | 'FolderAdd' | 'FolderArrowLeft' | 'FolderArrowRight' | 'FolderArrowUp' | 'FolderBriefcase' | 'FolderGlobe' | 'FolderLightning' | 'FolderLink' | 'FolderList' | 'FolderMail' | 'FolderMultiple' | 'FolderOpen' | 'FolderOpenVertical' | 'FolderPeople' | 'FolderPerson' | 'FolderProhibited' | 'FolderSearch' | 'FolderSwap' | 'FolderSync' | 'FolderZip' | 'FontDecrease' | 'FontIncrease' | 'FontSpaceTrackingIn' | 'FontSpaceTrackingOut' | 'Food' | 'FoodApple' | 'FoodCake' | 'FoodCarrot' | 'FoodChickenLeg' | 'FoodEgg' | 'FoodFish' | 'FoodGrains' | 'FoodPizza' | 'FoodToast' | 'Form' | 'FormMultiple' | 'FormNew' | 'Fps120' | 'Fps240' | 'Fps30' | 'Fps60' | 'Fps960' | 'Frame' | 'FullScreenMaximize' | 'FullScreenMinimize' | 'Games' | 'GanttChart' | 'Gas' | 'GasPump' | 'Gather' | 'Gauge' | 'GaugeAdd' | 'Gavel' | 'GavelProhibited' | 'Gesture' | 'Gif' | 'Gift' | 'GiftCard' | 'GiftCardAdd' | 'GiftCardArrowRight' | 'GiftCardMoney' | 'GiftCardMultiple' | 'GiftOpen' | 'Glance' | 'GlanceDefault' | 'GlanceHorizontal' | 'GlanceHorizontalSparkle' | 'GlanceHorizontalSparkles' | 'Glasses' | 'GlassesOff' | 'Globe' | 'GlobeAdd' | 'GlobeArrowForward' | 'GlobeArrowUp' | 'GlobeClock' | 'GlobeDesktop' | 'GlobeError' | 'GlobeLocation' | 'GlobePerson' | 'GlobeProhibited' | 'GlobeSearch' | 'GlobeShield' | 'GlobeStar' | 'GlobeSurface' | 'GlobeSync' | 'GlobeVideo' | 'GlobeWarning' | 'Grid' | 'GridCircles' | 'GridDots' | 'GridKanban' | 'Group' | 'GroupDismiss' | 'GroupList' | 'GroupReturn' | 'Guardian' | 'Guest' | 'GuestAdd' | 'Guitar' | 'HandDraw' | 'HandLeft' | 'HandLeftChat' | 'HandOpenHeart' | 'HandRight' | 'HandRightOff' | 'HandWave' | 'Handshake' | 'HardDrive' | 'HardDriveCall' | 'HatGraduation' | 'HatGraduationAdd' | 'HatGraduationSparkle' | 'Hd' | 'Hdr' | 'HdrOff' | 'Headphones' | 'HeadphonesSoundWave' | 'Headset' | 'HeadsetAdd' | 'HeadsetVr' | 'Heart' | 'HeartBroken' | 'HeartCircle' | 'HeartCircleHint' | 'HeartOff' | 'HeartPulse' | 'HeartPulseCheckmark' | 'HeartPulseError' | 'HeartPulseWarning' | 'Hexagon' | 'HexagonThree' | 'Highlight' | 'HighlightAccent' | 'HighlightLink' | 'History' | 'HistoryDismiss' | 'Home' | 'HomeAdd' | 'HomeCheckmark' | 'HomeDatabase' | 'HomeHeart' | 'HomeMore' | 'HomePerson' | 'HomeSplit' | 'Hourglass' | 'HourglassHalf' | 'HourglassOneQuarter' | 'HourglassThreeQuarter' | 'Icons' | 'Image' | 'ImageAdd' | 'ImageAltText' | 'ImageArrowBack' | 'ImageArrowCounterclockwise' | 'ImageArrowForward' | 'ImageBorder' | 'ImageCircle' | 'ImageCopy' | 'ImageEdit' | 'ImageGlobe' | 'ImageMultiple' | 'ImageMultipleOff' | 'ImageOff' | 'ImageProhibited' | 'ImageReflection' | 'ImageSearch' | 'ImageShadow' | 'ImageSparkle' | 'ImageStack' | 'ImageTable' | 'ImmersiveReader' | 'Important' | 'Incognito' | 'Info' | 'InfoShield' | 'InkStroke' | 'InkStrokeArrowDown' | 'InkStrokeArrowUpDown' | 'InkingTool' | 'InkingToolAccent' | 'InprivateAccount' | 'Insert' | 'IosArrow' | 'IosArrowLtr' | 'IosArrowRtl' | 'IosChevronRight' | 'Iot' | 'IotAlert' | 'Javascript' | 'Joystick' | 'Key' | 'KeyCommand' | 'KeyMultiple' | 'KeyReset' | 'Keyboard123' | 'Keyboard' | 'KeyboardDock' | 'KeyboardLayoutFloat' | 'KeyboardLayoutOneHandedLeft' | 'KeyboardLayoutResize' | 'KeyboardLayoutSplit' | 'KeyboardMouse' | 'KeyboardShift' | 'KeyboardShiftUppercase' | 'KeyboardTab' | 'Kiosk' | 'Laptop' | 'LaptopDismiss' | 'LaptopMultiple' | 'LaptopSettings' | 'LaptopShield' | 'LaserTool' | 'Lasso' | 'LauncherSettings' | 'Layer' | 'LayerDiagonal' | 'LayerDiagonalAdd' | 'LayerDiagonalPerson' | 'LayoutCellFour' | 'LayoutCellFourFocusBottomLeft' | 'LayoutCellFourFocusBottomRight' | 'LayoutCellFourFocusTopLeft' | 'LayoutCellFourFocusTopRight' | 'LayoutColumnFour' | 'LayoutColumnFourFocusCenterLeft' | 'LayoutColumnFourFocusCenterRight' | 'LayoutColumnFourFocusLeft' | 'LayoutColumnFourFocusRight' | 'LayoutColumnOneThirdLeft' | 'LayoutColumnOneThirdRight' | 'LayoutColumnOneThirdRightHint' | 'LayoutColumnThree' | 'LayoutColumnThreeFocusCenter' | 'LayoutColumnThreeFocusLeft' | 'LayoutColumnThreeFocusRight' | 'LayoutColumnTwo' | 'LayoutColumnTwoFocusLeft' | 'LayoutColumnTwoFocusRight' | 'LayoutColumnTwoSplitLeft' | 'LayoutColumnTwoSplitLeftFocusBottomLeft' | 'LayoutColumnTwoSplitLeftFocusRight' | 'LayoutColumnTwoSplitLeftFocusTopLeft' | 'LayoutColumnTwoSplitRight' | 'LayoutColumnTwoSplitRightFocusBottomRight' | 'LayoutColumnTwoSplitRightFocusLeft' | 'LayoutColumnTwoSplitRightFocusTopRight' | 'LayoutRowFour' | 'LayoutRowFourFocusBottom' | 'LayoutRowFourFocusCenterBottom' | 'LayoutRowFourFocusCenterTop' | 'LayoutRowFourFocusTop' | 'LayoutRowThree' | 'LayoutRowThreeFocusBottom' | 'LayoutRowThreeFocusCenter' | 'LayoutRowThreeFocusTop' | 'LayoutRowTwo' | 'LayoutRowTwoFocusBottom' | 'LayoutRowTwoFocusTop' | 'LayoutRowTwoSplitBottom' | 'LayoutRowTwoSplitBottomFocusBottomLeft' | 'LayoutRowTwoSplitBottomFocusBottomRight' | 'LayoutRowTwoSplitBottomFocusTop' | 'LayoutRowTwoSplitTop' | 'LayoutRowTwoSplitTopFocusBottom' | 'LayoutRowTwoSplitTopFocusTopLeft' | 'LayoutRowTwoSplitTopFocusTopRight' | 'LeafOne' | 'LeafThree' | 'LeafTwo' | 'LearningApp' | 'Library' | 'Lightbulb' | 'LightbulbCheckmark' | 'LightbulbCircle' | 'LightbulbFilament' | 'LightbulbPerson' | 'Likert' | 'Line' | 'LineDashes' | 'LineHorizontal1' | 'LineHorizontal1Dashes' | 'LineHorizontal2DashesSolid' | 'LineHorizontal3' | 'LineHorizontal4' | 'LineHorizontal4Search' | 'LineHorizontal5' | 'LineHorizontal5Error' | 'LineStyle' | 'LineThickness' | 'Link' | 'LinkAdd' | 'LinkDismiss' | 'LinkEdit' | 'LinkMultiple' | 'LinkPerson' | 'LinkSettings' | 'LinkSquare' | 'LinkToolbox' | 'List' | 'ListBar' | 'ListBarTree' | 'ListBarTreeOffset' | 'ListRtl' | 'Live' | 'LiveOff' | 'LocalLanguage' | 'Location' | 'LocationAdd' | 'LocationAddLeft' | 'LocationAddRight' | 'LocationAddUp' | 'LocationArrow' | 'LocationArrowLeft' | 'LocationArrowRight' | 'LocationArrowUp' | 'LocationDismiss' | 'LocationLive' | 'LocationOff' | 'LocationTargetSquare' | 'LockClosed' | 'LockClosedKey' | 'LockMultiple' | 'LockOpen' | 'LockShield' | 'Lottery' | 'Luggage' | 'Mail' | 'MailAdd' | 'MailAlert' | 'MailAllRead' | 'MailAllUnread' | 'MailArrowDoubleBack' | 'MailArrowDown' | 'MailArrowForward' | 'MailArrowUp' | 'MailAttach' | 'MailCheckmark' | 'MailClock' | 'MailCopy' | 'MailDismiss' | 'MailEdit' | 'MailError' | 'MailInbox' | 'MailInboxAdd' | 'MailInboxAll' | 'MailInboxArrowDown' | 'MailInboxArrowRight' | 'MailInboxArrowUp' | 'MailInboxCheckmark' | 'MailInboxDismiss' | 'MailLink' | 'MailList' | 'MailMultiple' | 'MailOff' | 'MailOpenPerson' | 'MailPause' | 'MailProhibited' | 'MailRead' | 'MailReadMultiple' | 'MailRewind' | 'MailSettings' | 'MailShield' | 'MailTemplate' | 'MailUnread' | 'MailWarning' | 'Mailbox' | 'Map' | 'MapDrive' | 'Markdown' | 'MatchAppLayout' | 'MathFormatLinear' | 'MathFormatProfessional' | 'MathFormula' | 'MathSymbols' | 'Maximize' | 'MeetNow' | 'Megaphone' | 'MegaphoneCircle' | 'MegaphoneLoud' | 'MegaphoneOff' | 'Memory' | 'Mention' | 'MentionArrowDown' | 'MentionBrackets' | 'Merge' | 'Mic' | 'MicOff' | 'MicProhibited' | 'MicPulse' | 'MicPulseOff' | 'MicRecord' | 'MicSettings' | 'MicSparkle' | 'MicSync' | 'Microscope' | 'Midi' | 'MobileOptimized' | 'Mold' | 'Molecule' | 'Money' | 'MoneyCalculator' | 'MoneyDismiss' | 'MoneyHand' | 'MoneyOff' | 'MoneySettings' | 'MoreCircle' | 'MoreHorizontal' | 'MoreVertical' | 'MountainLocationBottom' | 'MountainLocationTop' | 'MountainTrail' | 'MoviesAndTv' | 'Multiplier12X' | 'Multiplier15X' | 'Multiplier18X' | 'Multiplier1X' | 'Multiplier2X' | 'Multiplier5X' | 'MultiselectLtr' | 'MultiselectRtl' | 'MusicNote1' | 'MusicNote2' | 'MusicNote2Play' | 'MusicNoteOff1' | 'MusicNoteOff2' | 'MyLocation' | 'Navigation' | 'NavigationLocationTarget' | 'NavigationPlay' | 'NavigationUnread' | 'NetworkAdapter' | 'NetworkCheck' | 'New' | 'News' | 'Next' | 'NextFrame' | 'Note' | 'NoteAdd' | 'NoteEdit' | 'NotePin' | 'Notebook' | 'NotebookAdd' | 'NotebookArrowCurveDown' | 'NotebookError' | 'NotebookEye' | 'NotebookLightning' | 'NotebookQuestionMark' | 'NotebookSection' | 'NotebookSectionArrowRight' | 'NotebookSubsection' | 'NotebookSync' | 'Notepad' | 'NotepadEdit' | 'NotepadPerson' | 'NumberCircle0' | 'NumberCircle1' | 'NumberCircle2' | 'NumberCircle3' | 'NumberCircle4' | 'NumberCircle5' | 'NumberCircle6' | 'NumberCircle7' | 'NumberCircle8' | 'NumberCircle9' | 'NumberRow' | 'NumberSymbol' | 'NumberSymbolDismiss' | 'NumberSymbolSquare' | 'Open' | 'OpenFolder' | 'OpenOff' | 'Options' | 'Organization' | 'OrganizationHorizontal' | 'Orientation' | 'Oval' | 'Oven' | 'PaddingDown' | 'PaddingLeft' | 'PaddingRight' | 'PaddingTop' | 'PageFit' | 'PaintBrush' | 'PaintBrushArrowDown' | 'PaintBrushArrowUp' | 'PaintBucket' | 'Pair' | 'PanelBottom' | 'PanelBottomContract' | 'PanelBottomExpand' | 'PanelLeft' | 'PanelLeftAdd' | 'PanelLeftContract' | 'PanelLeftExpand' | 'PanelLeftFocusRight' | 'PanelLeftHeader' | 'PanelLeftHeaderAdd' | 'PanelLeftHeaderKey' | 'PanelLeftKey' | 'PanelLeftText' | 'PanelLeftTextAdd' | 'PanelLeftTextDismiss' | 'PanelRight' | 'PanelRightAdd' | 'PanelRightContract' | 'PanelRightCursor' | 'PanelRightExpand' | 'PanelRightGallery' | 'PanelSeparateWindow' | 'PanelTopContract' | 'PanelTopExpand' | 'PanelTopGallery' | 'Password' | 'Patch' | 'Patient' | 'Pause' | 'PauseCircle' | 'PauseOff' | 'PauseSettings' | 'Payment' | 'Pen' | 'PenDismiss' | 'PenOff' | 'PenProhibited' | 'PenSparkle' | 'Pentagon' | 'People' | 'PeopleAdd' | 'PeopleAudience' | 'PeopleCall' | 'PeopleChat' | 'PeopleCheckmark' | 'PeopleCommunity' | 'PeopleCommunityAdd' | 'PeopleEdit' | 'PeopleError' | 'PeopleList' | 'PeopleLock' | 'PeopleMoney' | 'PeopleProhibited' | 'PeopleQueue' | 'PeopleSearch' | 'PeopleSettings' | 'PeopleStar' | 'PeopleSwap' | 'PeopleSync' | 'PeopleTeam' | 'PeopleTeamAdd' | 'PeopleTeamDelete' | 'PeopleTeamToolbox' | 'PeopleToolbox' | 'Person' | 'Person5' | 'Person6' | 'PersonAccounts' | 'PersonAdd' | 'PersonAlert' | 'PersonArrowBack' | 'PersonArrowLeft' | 'PersonArrowRight' | 'PersonAvailable' | 'PersonBoard' | 'PersonCall' | 'PersonChat' | 'PersonCircle' | 'PersonClock' | 'PersonDelete' | 'PersonDesktop' | 'PersonEdit' | 'PersonFeedback' | 'PersonHeart' | 'PersonInfo' | 'PersonKey' | 'PersonLightbulb' | 'PersonLightning' | 'PersonLink' | 'PersonLock' | 'PersonMail' | 'PersonMoney' | 'PersonNote' | 'PersonPhone' | 'PersonPill' | 'PersonProhibited' | 'PersonQuestionMark' | 'PersonRibbon' | 'PersonRunning' | 'PersonSearch' | 'PersonSettings' | 'PersonSquare' | 'PersonSquareCheckmark' | 'PersonStanding' | 'PersonStar' | 'PersonStarburst' | 'PersonSubtract' | 'PersonSupport' | 'PersonSwap' | 'PersonSync' | 'PersonTag' | 'PersonVoice' | 'PersonWalking' | 'PersonWarning' | 'PersonWrench' | 'Phone' | 'PhoneAdd' | 'PhoneArrowRight' | 'PhoneBriefcase' | 'PhoneChat' | 'PhoneCheckmark' | 'PhoneDesktop' | 'PhoneDesktopAdd' | 'PhoneDismiss' | 'PhoneEdit' | 'PhoneEraser' | 'PhoneFooterArrowDown' | 'PhoneHeaderArrowUp' | 'PhoneKey' | 'PhoneLaptop' | 'PhoneLinkSetup' | 'PhoneLock' | 'PhoneMultiple' | 'PhoneMultipleSettings' | 'PhonePageHeader' | 'PhonePagination' | 'PhonePerson' | 'PhoneScreenTime' | 'PhoneShake' | 'PhoneSpanIn' | 'PhoneSpanOut' | 'PhoneSpeaker' | 'PhoneStatusBar' | 'PhoneSubtract' | 'PhoneTablet' | 'PhoneUpdate' | 'PhoneUpdateCheckmark' | 'PhoneVerticalScroll' | 'PhoneVibrate' | 'PhotoFilter' | 'Pi' | 'PictureInPicture' | 'PictureInPictureEnter' | 'PictureInPictureExit' | 'Pill' | 'Pin' | 'PinOff' | 'Pipeline' | 'PipelineAdd' | 'PipelineArrowCurveDown' | 'PipelinePlay' | 'Pivot' | 'PlantGrass' | 'PlantRagweed' | 'Play' | 'PlayCircle' | 'PlayCircleHint' | 'PlayMultiple' | 'PlaySettings' | 'PlayingCards' | 'PlugConnected' | 'PlugConnectedAdd' | 'PlugConnectedCheckmark' | 'PlugConnectedSettings' | 'PlugDisconnected' | 'PointScan' | 'Poll' | 'PollHorizontal' | 'PollOff' | 'PortHdmi' | 'PortMicroUsb' | 'PortUsbA' | 'PortUsbC' | 'PositionBackward' | 'PositionForward' | 'PositionToBack' | 'PositionToFront' | 'Power' | 'Predictions' | 'Premium' | 'PremiumPerson' | 'PresenceAvailable' | 'PresenceAway' | 'PresenceBlocked' | 'PresenceBusy' | 'PresenceDnd' | 'PresenceOffline' | 'PresenceOof' | 'PresenceUnknown' | 'Presenter' | 'PresenterOff' | 'PreviewLink' | 'Previous' | 'PreviousFrame' | 'Print' | 'PrintAdd' | 'Production' | 'ProductionCheckmark' | 'Prohibited' | 'ProhibitedMultiple' | 'ProhibitedNote' | 'ProjectionScreen' | 'ProjectionScreenDismiss' | 'ProjectionScreenText' | 'ProtocolHandler' | 'Pulse' | 'PulseSquare' | 'PuzzleCube' | 'PuzzleCubePiece' | 'PuzzlePiece' | 'PuzzlePieceShield' | 'QrCode' | 'Question' | 'QuestionCircle' | 'QuizNew' | 'Radar' | 'RadarCheckmark' | 'RadarRectangleMultiple' | 'RadioButton' | 'RadioButtonOff' | 'Ram' | 'RatingMature' | 'RatioOneToOne' | 'ReOrder' | 'ReOrderDotsHorizontal' | 'ReOrderDotsVertical' | 'ReadAloud' | 'ReadingList' | 'ReadingListAdd' | 'ReadingModeMobile' | 'RealEstate' | 'Receipt' | 'ReceiptAdd' | 'ReceiptBag' | 'ReceiptCube' | 'ReceiptMoney' | 'ReceiptPlay' | 'ReceiptSearch' | 'ReceiptSparkles' | 'Record' | 'RecordStop' | 'RectangleLandscape' | 'RectangleLandscapeHintCopy' | 'RectangleLandscapeSparkle' | 'RectangleLandscapeSync' | 'RectangleLandscapeSyncOff' | 'RectanglePortraitLocationTarget' | 'Recycle' | 'RemixAdd' | 'Remote' | 'Rename' | 'Reorder' | 'Replay' | 'Resize' | 'ResizeImage' | 'ResizeLarge' | 'ResizeSmall' | 'ResizeTable' | 'ResizeVideo' | 'Reward' | 'Rewind' | 'Rhombus' | 'Ribbon' | 'RibbonAdd' | 'RibbonOff' | 'RibbonStar' | 'RoadCone' | 'Rocket' | 'RotateLeft' | 'RotateRight' | 'Router' | 'RowTriple' | 'Rss' | 'Ruler' | 'Run' | 'Sanitize' | 'Save' | 'SaveArrowRight' | 'SaveCopy' | 'SaveEdit' | 'SaveImage' | 'SaveMultiple' | 'SaveSearch' | 'SaveSync' | 'Savings' | 'ScaleFill' | 'ScaleFit' | 'Scales' | 'Scan' | 'ScanCamera' | 'ScanDash' | 'ScanObject' | 'ScanPerson' | 'ScanQrCode' | 'ScanTable' | 'ScanText' | 'ScanThumbUp' | 'ScanThumbUpOff' | 'ScanType' | 'ScanTypeCheckmark' | 'ScanTypeOff' | 'Scratchpad' | 'ScreenCut' | 'ScreenPerson' | 'ScreenSearch' | 'Screenshot' | 'ScreenshotRecord' | 'Script' | 'Search' | 'SearchInfo' | 'SearchSettings' | 'SearchShield' | 'SearchSquare' | 'SearchVisual' | 'Seat' | 'SeatAdd' | 'SelectAllOff' | 'SelectAllOn' | 'SelectObject' | 'SelectObjectSkew' | 'SelectObjectSkewDismiss' | 'SelectObjectSkewEdit' | 'Send' | 'SendBeaker' | 'SendClock' | 'SendCopy' | 'SerialPort' | 'Server' | 'ServerLink' | 'ServerMultiple' | 'ServerPlay' | 'ServerSurface' | 'ServerSurfaceMultiple' | 'ServiceBell' | 'Settings' | 'SettingsChat' | 'SettingsCogMultiple' | 'ShapeExclude' | 'ShapeIntersect' | 'ShapeOrganic' | 'ShapeSubtract' | 'ShapeUnion' | 'Shapes' | 'Share' | 'ShareAndroid' | 'ShareCloseTray' | 'ShareIos' | 'ShareScreenPerson' | 'ShareScreenPersonOverlay' | 'ShareScreenPersonOverlayInside' | 'ShareScreenPersonP' | 'ShareScreenStart' | 'ShareScreenStop' | 'Shield' | 'ShieldAdd' | 'ShieldBadge' | 'ShieldCheckmark' | 'ShieldDismiss' | 'ShieldDismissShield' | 'ShieldError' | 'ShieldGlobe' | 'ShieldKeyhole' | 'ShieldLock' | 'ShieldPerson' | 'ShieldPersonAdd' | 'ShieldProhibited' | 'ShieldQuestion' | 'ShieldTask' | 'Shifts' | 'Shifts30Minutes' | 'ShiftsActivity' | 'ShiftsAdd' | 'ShiftsAvailability' | 'ShiftsCheckmark' | 'ShiftsDay' | 'ShiftsOpen' | 'ShiftsProhibited' | 'ShiftsQuestionMark' | 'ShiftsTeam' | 'ShoppingBag' | 'ShoppingBagAdd' | 'ShoppingBagArrowLeft' | 'ShoppingBagDismiss' | 'ShoppingBagPause' | 'ShoppingBagPercent' | 'ShoppingBagPlay' | 'ShoppingBagTag' | 'Shortpick' | 'Showerhead' | 'SidebarSearchLtr' | 'SidebarSearchRtl' | 'SignOut' | 'Signature' | 'Sim' | 'SkipBack10' | 'SkipForward10' | 'SkipForward30' | 'SkipForwardTab' | 'SlashForward' | 'Sleep' | 'SlideAdd' | 'SlideArrowRight' | 'SlideContent' | 'SlideEraser' | 'SlideGrid' | 'SlideHide' | 'SlideLayout' | 'SlideLink' | 'SlideMicrophone' | 'SlideMultiple' | 'SlideMultipleArrowRight' | 'SlideMultipleSearch' | 'SlideRecord' | 'SlideSearch' | 'SlideSettings' | 'SlideSize' | 'SlideText' | 'SlideTextEdit' | 'SlideTextMultiple' | 'SlideTextPerson' | 'SlideTextSparkle' | 'SlideTransition' | 'Smartwatch' | 'SmartwatchDot' | 'Snooze' | 'SoundSource' | 'SoundWaveCircle' | 'Space3D' | 'Spacebar' | 'Sparkle' | 'SparkleCircle' | 'Speaker0' | 'Speaker1' | 'Speaker2' | 'SpeakerBluetooth' | 'SpeakerBox' | 'SpeakerEdit' | 'SpeakerMute' | 'SpeakerOff' | 'SpeakerSettings' | 'SpeakerUsb' | 'SpinnerIos' | 'SplitHint' | 'SplitHorizontal' | 'SplitVertical' | 'Sport' | 'SportAmericanFootball' | 'SportBaseball' | 'SportBasketball' | 'SportHockey' | 'SportSoccer' | 'SprayCan' | 'Square' | 'SquareAdd' | 'SquareArrowForward' | 'SquareDismiss' | 'SquareEraser' | 'SquareHint' | 'SquareHintApps' | 'SquareHintArrowBack' | 'SquareHintHexagon' | 'SquareHintSparkles' | 'SquareMultiple' | 'SquareShadow' | 'SquaresNested' | 'Stack' | 'StackAdd' | 'StackArrowForward' | 'StackStar' | 'StackVertical' | 'Star' | 'StarAdd' | 'StarArrowBack' | 'StarArrowRightEnd' | 'StarArrowRightStart' | 'StarCheckmark' | 'StarDismiss' | 'StarEdit' | 'StarEmphasis' | 'StarHalf' | 'StarLineHorizontal3' | 'StarOff' | 'StarOneQuarter' | 'StarProhibited' | 'StarSettings' | 'StarThreeQuarter' | 'Status' | 'Step' | 'Steps' | 'Stethoscope' | 'Sticker' | 'StickerAdd' | 'Stop' | 'Storage' | 'StoreMicrosoft' | 'Stream' | 'StreamInput' | 'StreamInputOutput' | 'StreamOutput' | 'StreetSign' | 'StyleGuide' | 'SubGrid' | 'Subtitles' | 'Subtract' | 'SubtractCircle' | 'SubtractCircleArrowBack' | 'SubtractCircleArrowForward' | 'SubtractParentheses' | 'SubtractSquare' | 'SubtractSquareMultiple' | 'SurfaceEarbuds' | 'SurfaceHub' | 'SwimmingPool' | 'SwipeDown' | 'SwipeRight' | 'SwipeUp' | 'Symbols' | 'SyncOff' | 'Syringe' | 'System' | 'Tab' | 'TabAdd' | 'TabArrowLeft' | 'TabDesktop' | 'TabDesktopArrowClockwise' | 'TabDesktopArrowLeft' | 'TabDesktopBottom' | 'TabDesktopClock' | 'TabDesktopCopy' | 'TabDesktopImage' | 'TabDesktopLink' | 'TabDesktopMultiple' | 'TabDesktopMultipleAdd' | 'TabDesktopMultipleBottom' | 'TabDesktopNewPage' | 'TabInPrivate' | 'TabInprivateAccount' | 'TabProhibited' | 'TabShieldDismiss' | 'Table' | 'TableAdd' | 'TableArrowUp' | 'TableBottomRow' | 'TableCalculator' | 'TableCellEdit' | 'TableCellsMerge' | 'TableCellsSplit' | 'TableChecker' | 'TableColumnTopBottom' | 'TableCopy' | 'TableDefault' | 'TableDeleteColumn' | 'TableDeleteRow' | 'TableDismiss' | 'TableEdit' | 'TableFreezeColumn' | 'TableFreezeColumnAndRow' | 'TableFreezeRow' | 'TableImage' | 'TableInsertColumn' | 'TableInsertRow' | 'TableLightning' | 'TableLink' | 'TableLock' | 'TableMoveAbove' | 'TableMoveBelow' | 'TableMoveLeft' | 'TableMoveRight' | 'TableMultiple' | 'TableOffset' | 'TableOffsetAdd' | 'TableOffsetLessThanOrEqualTo' | 'TableOffsetSettings' | 'TableResizeColumn' | 'TableResizeRow' | 'TableSearch' | 'TableSettings' | 'TableSimple' | 'TableSimpleCheckmark' | 'TableSimpleExclude' | 'TableSimpleInclude' | 'TableSimpleMultiple' | 'TableSplit' | 'TableStackAbove' | 'TableStackBelow' | 'TableStackLeft' | 'TableStackRight' | 'TableSwitch' | 'Tablet' | 'TabletLaptop' | 'TabletSpeaker' | 'Tabs' | 'Tag' | 'TagCircle' | 'TagDismiss' | 'TagError' | 'TagLock' | 'TagLockAccent' | 'TagMultiple' | 'TagOff' | 'TagQuestionMark' | 'TagReset' | 'TagSearch' | 'TapDouble' | 'TapSingle' | 'Target' | 'TargetAdd' | 'TargetArrow' | 'TargetDismiss' | 'TargetEdit' | 'TaskListAdd' | 'TaskListLtr' | 'TaskListRtl' | 'TaskListSquareAdd' | 'TaskListSquareDatabase' | 'TaskListSquareLtr' | 'TaskListSquarePerson' | 'TaskListSquareRtl' | 'TaskListSquareSettings' | 'TasksApp' | 'TeardropBottomRight' | 'Teddy' | 'Temperature' | 'Tent' | 'TetrisApp' | 'Text' | 'TextAbcUnderlineDouble' | 'TextAdd' | 'TextAddSpaceAfter' | 'TextAddSpaceBefore' | 'TextAddT' | 'TextAlignCenter' | 'TextAlignCenterRotate270' | 'TextAlignCenterRotate90' | 'TextAlignDistributed' | 'TextAlignDistributedEvenly' | 'TextAlignDistributedVertical' | 'TextAlignJustify' | 'TextAlignJustifyLow' | 'TextAlignJustifyLow90' | 'TextAlignJustifyLowRotate270' | 'TextAlignJustifyLowRotate90' | 'TextAlignJustifyRotate270' | 'TextAlignJustifyRotate90' | 'TextAlignLeft' | 'TextAlignLeftRotate270' | 'TextAlignLeftRotate90' | 'TextAlignRight' | 'TextAlignRightRotate270' | 'TextAlignRightRotate90' | 'TextArrowDownRightColumn' | 'TextAsterisk' | 'TextBaseline' | 'TextBold' | 'TextBoxSettings' | 'TextBulletList' | 'TextBulletList270' | 'TextBulletList90' | 'TextBulletListAdd' | 'TextBulletListCheckmark' | 'TextBulletListDismiss' | 'TextBulletListLtr' | 'TextBulletListLtr90' | 'TextBulletListLtrRotate270' | 'TextBulletListRtl' | 'TextBulletListRtl90' | 'TextBulletListSquare' | 'TextBulletListSquareClock' | 'TextBulletListSquareEdit' | 'TextBulletListSquarePerson' | 'TextBulletListSquareSearch' | 'TextBulletListSquareSettings' | 'TextBulletListSquareShield' | 'TextBulletListSquareSparkle' | 'TextBulletListSquareToolbox' | 'TextBulletListSquareWarning' | 'TextBulletListTree' | 'TextCaseLowercase' | 'TextCaseTitle' | 'TextCaseUppercase' | 'TextChangeCase' | 'TextClearFormatting' | 'TextCollapse' | 'TextColor' | 'TextColorAccent' | 'TextColumnOne' | 'TextColumnOneNarrow' | 'TextColumnOneSemiNarrow' | 'TextColumnOneWide' | 'TextColumnOneWideLightning' | 'TextColumnThree' | 'TextColumnTwo' | 'TextColumnTwoLeft' | 'TextColumnTwoRight' | 'TextColumnWide' | 'TextContinuous' | 'TextDensity' | 'TextDescription' | 'TextDescriptionLtr' | 'TextDescriptionRtl' | 'TextDirectionHorizontalLeft' | 'TextDirectionHorizontalLtr' | 'TextDirectionHorizontalRight' | 'TextDirectionHorizontalRtl' | 'TextDirectionRotate270Right' | 'TextDirectionRotate315Right' | 'TextDirectionRotate45Right' | 'TextDirectionRotate90Left' | 'TextDirectionRotate90Ltr' | 'TextDirectionRotate90Right' | 'TextDirectionRotate90Rtl' | 'TextDirectionVertical' | 'TextEditStyle' | 'TextEditStyleCharacterA' | 'TextEditStyleCharacterGa' | 'TextEffects' | 'TextEffectsSparkle' | 'TextExpand' | 'TextField' | 'TextFirstLine' | 'TextFont' | 'TextFontInfo' | 'TextFontSize' | 'TextFootnote' | 'TextGrammarArrowLeft' | 'TextGrammarArrowRight' | 'TextGrammarCheckmark' | 'TextGrammarDismiss' | 'TextGrammarError' | 'TextGrammarLightning' | 'TextGrammarSettings' | 'TextGrammarWand' | 'TextHanging' | 'TextHeader1' | 'TextHeader1Lines' | 'TextHeader1LinesCaret' | 'TextHeader2' | 'TextHeader2Lines' | 'TextHeader2LinesCaret' | 'TextHeader3' | 'TextHeader3Lines' | 'TextHeader3LinesCaret' | 'TextIndentDecrease' | 'TextIndentDecreaseLtr' | 'TextIndentDecreaseLtr90' | 'TextIndentDecreaseLtrRotate270' | 'TextIndentDecreaseRotate270' | 'TextIndentDecreaseRotate90' | 'TextIndentDecreaseRtl' | 'TextIndentDecreaseRtl90' | 'TextIndentDecreaseRtlRotate270' | 'TextIndentIncrease' | 'TextIndentIncreaseLtr' | 'TextIndentIncreaseLtr90' | 'TextIndentIncreaseLtrRotate270' | 'TextIndentIncreaseRotate270' | 'TextIndentIncreaseRotate90' | 'TextIndentIncreaseRtl' | 'TextIndentIncreaseRtl90' | 'TextIndentIncreaseRtlRotate270' | 'TextItalic' | 'TextLineSpacing' | 'TextMore' | 'TextNumberFormat' | 'TextNumberListLtr' | 'TextNumberListLtr90' | 'TextNumberListLtrRotate270' | 'TextNumberListRotate270' | 'TextNumberListRotate90' | 'TextNumberListRtl' | 'TextNumberListRtl90' | 'TextNumberListRtlRotate270' | 'TextParagraph' | 'TextParagraphDirection' | 'TextParagraphDirectionLeft' | 'TextParagraphDirectionRight' | 'TextPeriodAsterisk' | 'TextPositionBehind' | 'TextPositionFront' | 'TextPositionLine' | 'TextPositionSquare' | 'TextPositionSquareLeft' | 'TextPositionSquareRight' | 'TextPositionThrough' | 'TextPositionTight' | 'TextPositionTopBottom' | 'TextProofingTools' | 'TextQuote' | 'TextSortAscending' | 'TextSortDescending' | 'TextStrikethrough' | 'TextSubscript' | 'TextSuperscript' | 'TextT' | 'TextTTag' | 'TextUnderline' | 'TextUnderlineCharacterU' | 'TextUnderlineDouble' | 'TextWholeWord' | 'TextWordCount' | 'TextWrap' | 'TextWrapOff' | 'Textbox' | 'TextboxAlignBottom' | 'TextboxAlignBottomCenter' | 'TextboxAlignBottomLeft' | 'TextboxAlignBottomRight' | 'TextboxAlignBottomRotate90' | 'TextboxAlignCenter' | 'TextboxAlignMiddle' | 'TextboxAlignMiddleLeft' | 'TextboxAlignMiddleRight' | 'TextboxAlignMiddleRotate90' | 'TextboxAlignTop' | 'TextboxAlignTopCenter' | 'TextboxAlignTopLeft' | 'TextboxAlignTopRight' | 'TextboxAlignTopRotate90' | 'TextboxMore' | 'TextboxRotate90' | 'TextboxSettings' | 'Thinking' | 'ThumbDislike' | 'ThumbLike' | 'ThumbLikeDislike' | 'TicketDiagonal' | 'TicketHorizontal' | 'TimeAndWeather' | 'TimePicker' | 'Timeline' | 'Timer10' | 'Timer' | 'Timer2' | 'Timer3' | 'TimerOff' | 'ToggleLeft' | 'ToggleMultiple' | 'ToggleRight' | 'Toolbox' | 'TooltipQuote' | 'TopSpeed' | 'Translate' | 'TranslateAuto' | 'TranslateOff' | 'Transmission' | 'TrayItemAdd' | 'TrayItemRemove' | 'TreeDeciduous' | 'TreeEvergreen' | 'Triangle' | 'TriangleDown' | 'TriangleLeft' | 'TriangleRight' | 'TriangleUp' | 'Trophy' | 'TrophyLock' | 'TrophyOff' | 'Tv' | 'TvArrowRight' | 'TvUsb' | 'Umbrella' | 'UninstallApp' | 'UsbPlug' | 'UsbStick' | 'Vault' | 'VehicleBicycle' | 'VehicleBus' | 'VehicleCab' | 'VehicleCableCar' | 'VehicleCar' | 'VehicleCarCollision' | 'VehicleCarParking' | 'VehicleCarProfile' | 'VehicleCarProfileLtr' | 'VehicleCarProfileLtrClock' | 'VehicleCarProfileRtl' | 'VehicleShip' | 'VehicleSubway' | 'VehicleSubwayClock' | 'VehicleTruck' | 'VehicleTruckBag' | 'VehicleTruckCube' | 'VehicleTruckProfile' | 'Video' | 'Video360' | 'Video360Off' | 'VideoAdd' | 'VideoBackgroundEffect' | 'VideoBackgroundEffectHorizontal' | 'VideoChat' | 'VideoClip' | 'VideoClipMultiple' | 'VideoClipOff' | 'VideoClipOptimize' | 'VideoLink' | 'VideoOff' | 'VideoPeople' | 'VideoPerson' | 'VideoPersonCall' | 'VideoPersonClock' | 'VideoPersonOff' | 'VideoPersonPulse' | 'VideoPersonSparkle' | 'VideoPersonSparkleOff' | 'VideoPersonStar' | 'VideoPersonStarOff' | 'VideoPlayPause' | 'VideoProhibited' | 'VideoRecording' | 'VideoSecurity' | 'VideoSwitch' | 'VideoSync' | 'ViewDesktop' | 'ViewDesktopMobile' | 'VirtualNetwork' | 'VirtualNetworkToolbox' | 'Voicemail' | 'VoicemailArrowBack' | 'VoicemailArrowForward' | 'VoicemailArrowSubtract' | 'VoicemailShield' | 'VoicemailSubtract' | 'Vote' | 'WalkieTalkie' | 'Wallet' | 'WalletCreditCard' | 'Wallpaper' | 'Wand' | 'Warning' | 'WarningShield' | 'Washer' | 'Water' | 'WeatherBlowingSnow' | 'WeatherCloudy' | 'WeatherDrizzle' | 'WeatherDuststorm' | 'WeatherFog' | 'WeatherHailDay' | 'WeatherHailNight' | 'WeatherHaze' | 'WeatherMoon' | 'WeatherMoonOff' | 'WeatherPartlyCloudyDay' | 'WeatherPartlyCloudyNight' | 'WeatherRain' | 'WeatherRainShowersDay' | 'WeatherRainShowersNight' | 'WeatherRainSnow' | 'WeatherSnow' | 'WeatherSnowShowerDay' | 'WeatherSnowShowerNight' | 'WeatherSnowflake' | 'WeatherSqualls' | 'WeatherSunny' | 'WeatherSunnyHigh' | 'WeatherSunnyLow' | 'WeatherThunderstorm' | 'WebAsset' | 'Whiteboard' | 'WhiteboardOff' | 'Wifi1' | 'Wifi2' | 'Wifi3' | 'Wifi4' | 'WifiLock' | 'WifiOff' | 'WifiSettings' | 'WifiWarning' | 'Window' | 'WindowAd' | 'WindowAdOff' | 'WindowAdPerson' | 'WindowApps' | 'WindowArrowUp' | 'WindowBulletList' | 'WindowBulletListAdd' | 'WindowConsole' | 'WindowDatabase' | 'WindowDevEdit' | 'WindowDevTools' | 'WindowEdit' | 'WindowHeaderHorizontal' | 'WindowHeaderHorizontalOff' | 'WindowHeaderVertical' | 'WindowInprivate' | 'WindowInprivateAccount' | 'WindowLocationTarget' | 'WindowMultiple' | 'WindowMultipleSwap' | 'WindowNew' | 'WindowPlay' | 'WindowSettings' | 'WindowShield' | 'WindowText' | 'WindowWrench' | 'Wrench' | 'WrenchScrewdriver' | 'WrenchSettings' | 'XboxConsole' | 'XboxController' | 'XboxControllerError' | 'Xray' | 'ZoomFit' | 'ZoomIn' | 'ZoomOut'; export type ActionStyle = 'default' | 'positive' | 'destructive'; export type ActionMode = 'primary' | 'secondary'; -export type FallbackAction = - | ISubmitAction - | IOpenUrlAction - | IExecuteAction - | IToggleVisibilityAction - | IShowCardAction - | IResetInputsAction - | 'drop'; +export type MenuActionArray = (IExecuteAction | IInsertImageAction | IOpenUrlAction | IOpenUrlDialogAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction)[]; -export type ContainerStyle = 'default' | 'emphasis' | 'accent' | 'good' | 'attention' | 'warning'; +export type ThemeName = 'Light' | 'Dark'; -export type TargetWidth = - | 'VeryNarrow' - | 'Narrow' - | 'Standard' - | 'Wide' - | 'atLeast:VeryNarrow' - | 'atMost:VeryNarrow' - | 'atLeast:Narrow' - | 'atMost:Narrow' - | 'atLeast:Standard' - | 'atMost:Standard' - | 'atLeast:Wide' - | 'atMost:Wide'; +export type ElementHeight = 'auto' | 'stretch'; export type HorizontalAlignment = 'Left' | 'Center' | 'Right'; -export type VerticalAlignment = 'Top' | 'Center' | 'Bottom'; +export type Spacing = 'None' | 'ExtraSmall' | 'Small' | 'Default' | 'Medium' | 'Large' | 'ExtraLarge' | 'Padding'; -export type FlowLayoutItemFit = 'Fit' | 'Fill'; +export type TargetWidth = 'VeryNarrow' | 'Narrow' | 'Standard' | 'Wide' | 'atLeast:VeryNarrow' | 'atMost:VeryNarrow' | 'atLeast:Narrow' | 'atMost:Narrow' | 'atLeast:Standard' | 'atMost:Standard' | 'atLeast:Wide' | 'atMost:Wide'; -export type Spacing = - | 'None' - | 'ExtraSmall' - | 'Small' - | 'Default' - | 'Medium' - | 'Large' - | 'ExtraLarge' - | 'Padding'; +export type ContainerStyle = 'default' | 'emphasis' | 'accent' | 'good' | 'attention' | 'warning'; -export type FillMode = 'Cover' | 'RepeatHorizontally' | 'RepeatVertically' | 'Repeat'; +export type VerticalAlignment = 'Top' | 'Center' | 'Bottom'; -export type MentionType = 'Person' | 'Tag'; +export type FlowLayoutItemFit = 'Fit' | 'Fill'; -export type ElementHeight = 'auto' | 'stretch'; +export type FillMode = 'Cover' | 'RepeatHorizontally' | 'RepeatVertically' | 'Repeat'; export type TextSize = 'Small' | 'Default' | 'Medium' | 'Large' | 'ExtraLarge'; @@ -2671,27 +41,27 @@ export type TextColor = 'Default' | 'Dark' | 'Light' | 'Accent' | 'Good' | 'Warn export type FontType = 'Default' | 'Monospace'; +export type TextBlockStyle = 'default' | 'columnHeader' | 'heading'; + export type ImageStyle = 'Default' | 'Person' | 'RoundedCorners'; export type Size = 'Auto' | 'Stretch' | 'Small' | 'Medium' | 'Large'; +export type ImageFitMode = 'Cover' | 'Contain' | 'Fill'; + export type InputTextStyle = 'Text' | 'Tel' | 'Url' | 'Email' | 'Password'; +export type AssociatedInputs = 'auto' | 'none'; + +export type ChoiceSetInputStyle = 'compact' | 'expanded' | 'filtered'; + export type RatingSize = 'Medium' | 'Large'; export type RatingColor = 'Neutral' | 'Marigold'; export type RatingStyle = 'Default' | 'Compact'; -export type IconSize = - | 'xxSmall' - | 'xSmall' - | 'Small' - | 'Standard' - | 'Medium' - | 'Large' - | 'xLarge' - | 'xxLarge'; +export type IconSize = 'xxSmall' | 'xSmall' | 'Small' | 'Standard' | 'Medium' | 'Large' | 'xLarge' | 'xxLarge'; export type IconStyle = 'Regular' | 'Filled'; @@ -2705,131 +75,33 @@ export type BadgeSize = 'Medium' | 'Large' | 'ExtraLarge'; export type BadgeShape = 'Square' | 'Rounded' | 'Circular'; -export type BadgeStyle = - | 'Default' - | 'Subtle' - | 'Informative' - | 'Accent' - | 'Good' - | 'Attention' - | 'Warning'; - -export type ChartColorSet = 'categorical' | 'sequential' | 'diverging'; - -export type ChartColor = - | 'good' - | 'warning' - | 'attention' - | 'neutral' - | 'categoricalRed' - | 'categoricalPurple' - | 'categoricalLavender' - | 'categoricalBlue' - | 'categoricalLightBlue' - | 'categoricalTeal' - | 'categoricalGreen' - | 'categoricalLime' - | 'categoricalMarigold' - | 'sequential1' - | 'sequential2' - | 'sequential3' - | 'sequential4' - | 'sequential5' - | 'sequential6' - | 'sequential7' - | 'sequential8' - | 'divergingBlue' - | 'divergingLightBlue' - | 'divergingCyan' - | 'divergingTeal' - | 'divergingYellow' - | 'divergingPeach' - | 'divergingLightRed' - | 'divergingRed' - | 'divergingMaroon' - | 'divergingGray'; +export type BadgeStyle = 'Default' | 'Subtle' | 'Informative' | 'Accent' | 'Good' | 'Attention' | 'Warning'; + +export type ProgressRingLabelPosition = 'Before' | 'After' | 'Above' | 'Below'; + +export type ProgressRingSize = 'Tiny' | 'Small' | 'Medium' | 'Large'; + +export type ProgressBarColor = 'Accent' | 'Good' | 'Warning' | 'Attention'; + +export type ChartColorSet = 'categorical' | 'sequential' | 'sequentialred' | 'sequentialgreen' | 'sequentialyellow' | 'diverging'; + +export type ChartColor = 'good' | 'warning' | 'attention' | 'neutral' | 'categoricalRed' | 'categoricalPurple' | 'categoricalLavender' | 'categoricalBlue' | 'categoricalLightBlue' | 'categoricalTeal' | 'categoricalGreen' | 'categoricalLime' | 'categoricalMarigold' | 'sequential1' | 'sequential2' | 'sequential3' | 'sequential4' | 'sequential5' | 'sequential6' | 'sequential7' | 'sequential8' | 'divergingBlue' | 'divergingLightBlue' | 'divergingCyan' | 'divergingTeal' | 'divergingYellow' | 'divergingPeach' | 'divergingLightRed' | 'divergingRed' | 'divergingMaroon' | 'divergingGray' | 'sequentialRed1' | 'sequentialRed2' | 'sequentialRed3' | 'sequentialRed4' | 'sequentialRed5' | 'sequentialRed6' | 'sequentialRed7' | 'sequentialRed8' | 'sequentialGreen1' | 'sequentialGreen2' | 'sequentialGreen3' | 'sequentialGreen4' | 'sequentialGreen5' | 'sequentialGreen6' | 'sequentialGreen7' | 'sequentialGreen8' | 'sequentialYellow1' | 'sequentialYellow2' | 'sequentialYellow3' | 'sequentialYellow4' | 'sequentialYellow5' | 'sequentialYellow6' | 'sequentialYellow7' | 'sequentialYellow8'; + +export type DonutThickness = 'Thin' | 'Thick'; export type HorizontalBarChartDisplayMode = 'AbsoluteWithAxis' | 'AbsoluteNoAxis' | 'PartToWhole'; export type GaugeChartValueFormat = 'Percentage' | 'Fraction'; -export type FallbackElement = - | IContainer - | IActionSet - | IColumnSet - | IMedia - | IRichTextBlock - | ITable - | ITextBlock - | IFactSet - | IImageSet - | IImage - | ITextInput - | IDateInput - | ITimeInput - | INumberInput - | IToggleInput - | IChoiceSetInput - | IRatingInput - | IRating - | ICompoundButton - | IIcon - | ICarousel - | IBadge - | IDonutChart - | IPieChart - | IGroupedVerticalBarChart - | IVerticalBarChart - | IHorizontalBarChart - | IStackedHorizontalBarChart - | ILineChart - | IGaugeChart - | ICodeBlock - | IComUserMicrosoftGraphComponent - | IComUsersMicrosoftGraphComponent - | IComResourceMicrosoftGraphComponent - | IComFileMicrosoftGraphComponent - | IComEventMicrosoftGraphComponent - | 'drop'; - -export type CardElementArray = ( - | IActionSet - | IBadge - | ICarousel - | IDonutChart - | IGaugeChart - | IHorizontalBarChart - | IStackedHorizontalBarChart - | ILineChart - | IPieChart - | IVerticalBarChart - | IGroupedVerticalBarChart - | ICodeBlock - | IColumnSet - | IComEventMicrosoftGraphComponent - | IComFileMicrosoftGraphComponent - | IComResourceMicrosoftGraphComponent - | IComUserMicrosoftGraphComponent - | IComUsersMicrosoftGraphComponent - | ICompoundButton - | IContainer - | IFactSet - | IIcon - | IImage - | IImageSet - | IChoiceSetInput - | IDateInput - | INumberInput - | IRatingInput - | ITextInput - | ITimeInput - | IToggleInput - | IMedia - | IRating - | IRichTextBlock - | ITable - | ITextBlock -)[]; +export type CodeLanguage = 'Bash' | 'C' | 'Cpp' | 'CSharp' | 'Css' | 'Dos' | 'Go' | 'Graphql' | 'Html' | 'Java' | 'JavaScript' | 'Json' | 'ObjectiveC' | 'Perl' | 'Php' | 'PlainText' | 'PowerShell' | 'Python' | 'Sql' | 'TypeScript' | 'VbNet' | 'Verilog' | 'Vhdl' | 'Xml'; + +export type PersonaIconStyle = 'profilePicture' | 'contactCard' | 'none'; + +export type PersonaDisplayStyle = 'iconAndName' | 'iconOnly' | 'nameOnly'; + +export type FallbackElement = IContainer | IActionSet | IColumnSet | IMedia | IRichTextBlock | ITable | ITextBlock | IFactSet | IImageSet | IImage | ITextInput | IDateInput | ITimeInput | INumberInput | IToggleInput | IChoiceSetInput | IRatingInput | IRating | ICompoundButton | IIcon | ICarousel | IBadge | IProgressRing | IProgressBar | IDonutChart | IPieChart | IGroupedVerticalBarChart | IVerticalBarChart | IHorizontalBarChart | IStackedHorizontalBarChart | ILineChart | IGaugeChart | ICodeBlock | IComUserMicrosoftGraphComponent | IComUsersMicrosoftGraphComponent | IComResourceMicrosoftGraphComponent | IComFileMicrosoftGraphComponent | IComEventMicrosoftGraphComponent | 'drop'; + +export type CardElementArray = (IActionSet | IBadge | ICarousel | IDonutChart | IGaugeChart | IHorizontalBarChart | IStackedHorizontalBarChart | ILineChart | IPieChart | IVerticalBarChart | IGroupedVerticalBarChart | ICodeBlock | IColumnSet | IComEventMicrosoftGraphComponent | IComFileMicrosoftGraphComponent | IComResourceMicrosoftGraphComponent | IComUserMicrosoftGraphComponent | IComUsersMicrosoftGraphComponent | ICompoundButton | IContainer | IFactSet | IIcon | IImage | IImageSet | IChoiceSetInput | IDateInput | INumberInput | IRatingInput | ITextInput | ITimeInput | IToggleInput | IMedia | IProgressBar | IProgressRing | IRating | IRichTextBlock | ITable | ITextBlock)[]; export type ImageSize = 'Small' | 'Medium' | 'Large'; @@ -2837,23 +109,32 @@ export type TableCellArray = ITableCell[]; export type TableRowArray = ITableRow[]; -export type RichTextBlockInlineArray = (ITextRun | string)[]; +export type RichTextBlockInlineArray = (ITextRun | IIconRun | IImageRun | string)[]; export type ColumnArray = IColumn[]; -export type ActionArray = ( - | IExecuteAction - | IOpenUrlAction - | IResetInputsAction - | IShowCardAction - | ISubmitAction - | IToggleVisibilityAction -)[]; +export type ActionArray = (IExecuteAction | IInsertImageAction | IOpenUrlAction | IOpenUrlDialogAction | IPopoverAction | IResetInputsAction | IShowCardAction | ISubmitAction | IToggleVisibilityAction)[]; + +export type PopoverPosition = 'Above' | 'Below' | 'Before' | 'After'; + +export type FallbackAction = ISubmitAction | IOpenUrlAction | IExecuteAction | IToggleVisibilityAction | IShowCardAction | IResetInputsAction | IPopoverAction | IOpenUrlDialogAction | IInsertImageAction | 'drop'; + +export type ImageInsertPosition = 'Selection' | 'Top' | 'Bottom'; + +export type Version = '1.0' | '1.1' | '1.2' | '1.3' | '1.4' | '1.5' | '1.6'; + +export type TeamsCardWidth = 'full'; + +export type MentionType = 'Person' | 'Tag'; /** * An Adaptive Card, containing a free-form body of card elements, and an optional set of actions. */ export interface IAdaptiveCard { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; /** * Must be **AdaptiveCard**. */ @@ -2870,10 +151,6 @@ export interface IAdaptiveCard { * The locale associated with the element. */ lang?: string; - /** - * Controls the visibility of the element. - */ - isVisible?: boolean; /** * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. */ @@ -2881,12 +158,7 @@ export interface IAdaptiveCard { /** * An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. */ - selectAction?: - | IExecuteAction - | IOpenUrlAction - | IResetInputsAction - | ISubmitAction - | IToggleVisibilityAction; + selectAction?: IExecuteAction | IInsertImageAction | IOpenUrlAction | IOpenUrlDialogAction | IPopoverAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction; /** * The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. */ @@ -2918,7 +190,7 @@ export interface IAdaptiveCard { /** * The Adaptive Card schema version the card is authored against. */ - version?: '1.0' | '1.1' | '1.2' | '1.3' | '1.4' | '1.5' | '1.6'; + version?: Version; /** * The text that should be displayed if the client is not able to render the card. */ @@ -2938,11 +210,15 @@ export interface IAdaptiveCard { /** * Teams-specific metadata associated with the card. */ - msTeams?: ITeamsCardProperties; + msteams?: ITeamsCardProperties; /** * Metadata associated with the card. */ metadata?: ICardMetadata; + /** + * Resources card elements can reference. + */ + resources?: IResources; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -2975,12 +251,16 @@ export function isAdaptiveCard(value: unknown): value is IAdaptiveCard { return typeof obj === 'object' && obj.type === 'AdaptiveCard'; } -export type AdaptiveCardOptions = Omit; +export type AdaptiveCardOptions = Partial>; /** * An Adaptive Card, containing a free-form body of card elements, and an optional set of actions. */ export class AdaptiveCard implements IAdaptiveCard { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; /** * Must be **AdaptiveCard**. */ @@ -2992,28 +272,19 @@ export class AdaptiveCard implements IAdaptiveCard { /** * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - requires?: IHostCapabilities; + requires?: IHostCapabilities = {}; /** * The locale associated with the element. */ lang?: string; - /** - * Controls the visibility of the element. - */ - isVisible?: boolean; /** * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. */ - isSortKey?: boolean; + isSortKey?: boolean = false; /** * An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. */ - selectAction?: - | IExecuteAction - | IOpenUrlAction - | IResetInputsAction - | ISubmitAction - | IToggleVisibilityAction; + selectAction?: IExecuteAction | IInsertImageAction | IOpenUrlAction | IOpenUrlDialogAction | IPopoverAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction; /** * The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. */ @@ -3045,7 +316,7 @@ export class AdaptiveCard implements IAdaptiveCard { /** * The Adaptive Card schema version the card is authored against. */ - version?: '1.0' | '1.1' | '1.2' | '1.3' | '1.4' | '1.5' | '1.6'; + version?: Version = '1.5'; /** * The text that should be displayed if the client is not able to render the card. */ @@ -3065,11 +336,15 @@ export class AdaptiveCard implements IAdaptiveCard { /** * Teams-specific metadata associated with the card. */ - msTeams?: ITeamsCardProperties; + msteams?: ITeamsCardProperties; /** * Metadata associated with the card. */ metadata?: ICardMetadata; + /** + * Resources card elements can reference. + */ + resources?: IResources; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -3096,6 +371,11 @@ export class AdaptiveCard implements IAdaptiveCard { return this; } + withKey(key: string): this { + this.key = key; + return this; + } + withId(id: string): this { this.id = id; return this; @@ -3111,24 +391,12 @@ export class AdaptiveCard implements IAdaptiveCard { return this; } - withIsVisible(isVisible = false): this { - this.isVisible = isVisible; - return this; - } - withIsSortKey(isSortKey = true): this { this.isSortKey = isSortKey; return this; } - withSelectAction( - selectAction: - | IExecuteAction - | IOpenUrlAction - | IResetInputsAction - | ISubmitAction - | IToggleVisibilityAction - ): this { + withSelectAction(selectAction: IExecuteAction | IInsertImageAction | IOpenUrlAction | IOpenUrlDialogAction | IPopoverAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction): this { this.selectAction = selectAction; return this; } @@ -3168,7 +436,7 @@ export class AdaptiveCard implements IAdaptiveCard { return this; } - withVersion(version: '1.0' | '1.1' | '1.2' | '1.3' | '1.4' | '1.5' | '1.6'): this { + withVersion(version: Version): this { this.version = version; return this; } @@ -3193,8 +461,8 @@ export class AdaptiveCard implements IAdaptiveCard { return this; } - withMsTeams(msTeams: ITeamsCardProperties): this { - this.msTeams = msTeams; + withMsteams(msteams: ITeamsCardProperties): this { + this.msteams = msteams; return this; } @@ -3203,6 +471,11 @@ export class AdaptiveCard implements IAdaptiveCard { return this; } + withResources(resources: IResources): this { + this.resources = resources; + return this; + } + withFallback(fallback: FallbackElement): this { this.fallback = fallback; return this; @@ -3222,17 +495,41 @@ export class AdaptiveCard implements IAdaptiveCard { /** * Represents a list of versioned capabilities a host application must support. */ -export interface IHostCapabilities {} +export interface IHostCapabilities extends Record { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ +} + + +export type HostCapabilitiesOptions = Partial; /** * Represents a list of versioned capabilities a host application must support. */ -export class HostCapabilities implements IHostCapabilities {} +export class HostCapabilities implements IHostCapabilities { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + + constructor(options: HostCapabilitiesOptions = {}) { + Object.assign(this, options); + } + + static from(options: IHostCapabilities): HostCapabilities { + return new HostCapabilities(options); + } + [key: string]: string; +} /** * Gathers input values, merges them with the data property if specified, and sends them to the Bot via an Invoke activity. The Bot can respond synchronously and return an updated Adaptive Card to be displayed by the client. Action.Execute works in all Adaptive Card hosts. */ export interface IExecuteAction { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; /** * Must be **Action.Execute**. */ @@ -3251,8 +548,8 @@ export interface IExecuteAction { title?: string; /** * A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. - -`iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. + * + * `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. */ iconUrl?: string; /** @@ -3272,13 +569,21 @@ export interface IExecuteAction { */ isEnabled?: boolean; /** - * The data to send to the Bot when the action is executed. The data specified in the card payload will be sent back to the Bot as is, alongside the values of the inputs expressed as key/value pairs where the key is the Id of the input. + * The actions to display in the overflow menu of a Split action button. + */ + menuActions?: MenuActionArray; + /** + * A set of theme-specific icon URLs. + */ + themedIconUrls?: IThemedUrl[]; + /** + * The data to send to the Bot when the action is executed. When expressed as an object, `data` is sent back to the Bot when the action is executed, adorned with the values of the inputs expressed as key/value pairs, where the key is the Id of the input. If `data` is expressed as a string, input values are not sent to the Bot. */ - data?: any; + data?: string | ISubmitActionData; /** * The Ids of the inputs associated with the Action.Submit. When the action is executed, the values of the associated inputs are sent to the Bot. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. */ - associatedInputs?: 'auto' | 'none'; + associatedInputs?: AssociatedInputs; /** * Controls if the action is enabled only if at least one required input has been filled by the user. */ @@ -3307,12 +612,16 @@ export function isExecuteAction(value: unknown): value is IExecuteAction { return typeof obj === 'object' && obj.type === 'Action.Execute'; } -export type ExecuteActionOptions = Omit; +export type ExecuteActionOptions = Partial>; /** * Gathers input values, merges them with the data property if specified, and sends them to the Bot via an Invoke activity. The Bot can respond synchronously and return an updated Adaptive Card to be displayed by the client. Action.Execute works in all Adaptive Card hosts. */ export class ExecuteAction implements IExecuteAction { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; /** * Must be **Action.Execute**. */ @@ -3324,25 +633,25 @@ export class ExecuteAction implements IExecuteAction { /** * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - requires?: IHostCapabilities; + requires?: IHostCapabilities = {}; /** * The title of the action, as it appears on buttons. */ title?: string; /** * A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. - -`iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. + * + * `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. */ iconUrl?: string; /** * Control the style of the action, affecting its visual and spoken representations. */ - style?: ActionStyle; + style?: ActionStyle = 'default'; /** * Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. */ - mode?: ActionMode; + mode?: ActionMode = 'primary'; /** * The tooltip text to display when the action is hovered over. */ @@ -3350,19 +659,27 @@ export class ExecuteAction implements IExecuteAction { /** * Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. */ - isEnabled?: boolean; + isEnabled?: boolean = true; + /** + * The actions to display in the overflow menu of a Split action button. + */ + menuActions?: MenuActionArray; + /** + * A set of theme-specific icon URLs. + */ + themedIconUrls?: IThemedUrl[]; /** - * The data to send to the Bot when the action is executed. The data specified in the card payload will be sent back to the Bot as is, alongside the values of the inputs expressed as key/value pairs where the key is the Id of the input. + * The data to send to the Bot when the action is executed. When expressed as an object, `data` is sent back to the Bot when the action is executed, adorned with the values of the inputs expressed as key/value pairs, where the key is the Id of the input. If `data` is expressed as a string, input values are not sent to the Bot. */ - data?: any; + data?: string | ISubmitActionData; /** * The Ids of the inputs associated with the Action.Submit. When the action is executed, the values of the associated inputs are sent to the Bot. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. */ - associatedInputs?: 'auto' | 'none'; + associatedInputs?: AssociatedInputs; /** * Controls if the action is enabled only if at least one required input has been filled by the user. */ - conditionallyEnabled?: boolean; + conditionallyEnabled?: boolean = false; /** * The verb of the action. */ @@ -3380,6 +697,11 @@ export class ExecuteAction implements IExecuteAction { return new ExecuteAction(options); } + withKey(key: string): this { + this.key = key; + return this; + } + withId(id: string): this { this.id = id; return this; @@ -3420,12 +742,22 @@ export class ExecuteAction implements IExecuteAction { return this; } - withData(data: any): this { + withMenuActions(...menuActions: MenuActionArray): this { + this.menuActions = menuActions; + return this; + } + + withThemedIconUrls(...themedIconUrls: IThemedUrl[]): this { + this.themedIconUrls = themedIconUrls; + return this; + } + + withData(data: string | ISubmitActionData): this { this.data = data; return this; } - withAssociatedInputs(associatedInputs: 'auto' | 'none'): this { + withAssociatedInputs(associatedInputs: AssociatedInputs): this { this.associatedInputs = associatedInputs; return this; } @@ -3447,13 +779,17 @@ export class ExecuteAction implements IExecuteAction { } /** - * Gathers input values, merges them with the data property if specified, and sends them to the Bot via an Invoke activity. The Bot can only acknowledge is has received the request. Action.Submit only works in Teams. + * Inserts an image into the host application's canvas. */ -export interface ISubmitAction { +export interface IInsertImageAction { /** - * Must be **Action.Submit**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type: 'Action.Submit'; + key?: string; + /** + * Must be **Action.InsertImage**. + */ + readonly type: 'Action.InsertImage'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -3468,8 +804,8 @@ export interface ISubmitAction { title?: string; /** * A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. - -`iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. + * + * `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. */ iconUrl?: string; /** @@ -3489,21 +825,25 @@ export interface ISubmitAction { */ isEnabled?: boolean; /** - * The data to send to the Bot when the action is executed. The data specified in the card payload will be sent back to the Bot as is, alongside the values of the inputs expressed as key/value pairs where the key is the Id of the input. + * The actions to display in the overflow menu of a Split action button. */ - data?: any; + menuActions?: MenuActionArray; /** - * The Ids of the inputs associated with the Action.Submit. When the action is executed, the values of the associated inputs are sent to the Bot. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. + * A set of theme-specific icon URLs. */ - associatedInputs?: 'auto' | 'none'; + themedIconUrls?: IThemedUrl[]; /** - * Controls if the action is enabled only if at least one required input has been filled by the user. + * The URL of the image to insert. */ - conditionallyEnabled?: boolean; + url?: string; /** - * Teams-specific metadata associated with the action. + * The alternate text for the image. + */ + altText?: string; + /** + * The position at which to insert the image. */ - msTeams?: ITeamsSubmitActionProperties; + insertPosition?: ImageInsertPosition; /** * An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. */ @@ -3514,26 +854,30 @@ export interface ISubmitAction { * @hidden * @internal * - * Type guard to check if a value is of type ISubmitAction. + * Type guard to check if a value is of type IInsertImageAction. * * @param value The value to check. - * @returns True if the value is an instance of SubmitAction, false otherwise. + * @returns True if the value is an instance of InsertImageAction, false otherwise. */ -export function isSubmitAction(value: unknown): value is ISubmitAction { - const obj = value as ISubmitAction; - return typeof obj === 'object' && obj.type === 'Action.Submit'; +export function isInsertImageAction(value: unknown): value is IInsertImageAction { + const obj = value as IInsertImageAction; + return typeof obj === 'object' && obj.type === 'Action.InsertImage'; } -export type SubmitActionOptions = Omit; +export type InsertImageActionOptions = Partial>; /** - * Gathers input values, merges them with the data property if specified, and sends them to the Bot via an Invoke activity. The Bot can only acknowledge is has received the request. Action.Submit only works in Teams. + * Inserts an image into the host application's canvas. */ -export class SubmitAction implements ISubmitAction { +export class InsertImageAction implements IInsertImageAction { /** - * Must be **Action.Submit**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type = 'Action.Submit'; + key?: string; + /** + * Must be **Action.InsertImage**. + */ + readonly type = 'Action.InsertImage'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -3541,25 +885,25 @@ export class SubmitAction implements ISubmitAction { /** * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - requires?: IHostCapabilities; + requires?: IHostCapabilities = {}; /** * The title of the action, as it appears on buttons. */ title?: string; /** * A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. - -`iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. + * + * `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. */ iconUrl?: string; /** * Control the style of the action, affecting its visual and spoken representations. */ - style?: ActionStyle; + style?: ActionStyle = 'default'; /** * Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. */ - mode?: ActionMode; + mode?: ActionMode = 'primary'; /** * The tooltip text to display when the action is hovered over. */ @@ -3567,34 +911,43 @@ export class SubmitAction implements ISubmitAction { /** * Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. */ - isEnabled?: boolean; + isEnabled?: boolean = true; /** - * The data to send to the Bot when the action is executed. The data specified in the card payload will be sent back to the Bot as is, alongside the values of the inputs expressed as key/value pairs where the key is the Id of the input. + * The actions to display in the overflow menu of a Split action button. */ - data?: any; + menuActions?: MenuActionArray; /** - * The Ids of the inputs associated with the Action.Submit. When the action is executed, the values of the associated inputs are sent to the Bot. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. + * A set of theme-specific icon URLs. */ - associatedInputs?: 'auto' | 'none'; + themedIconUrls?: IThemedUrl[]; /** - * Controls if the action is enabled only if at least one required input has been filled by the user. + * The URL of the image to insert. */ - conditionallyEnabled?: boolean; + url?: string; /** - * Teams-specific metadata associated with the action. + * The alternate text for the image. */ - msTeams?: ITeamsSubmitActionProperties; + altText?: string; + /** + * The position at which to insert the image. + */ + insertPosition?: ImageInsertPosition = 'Selection'; /** * An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. */ fallback?: FallbackAction; - constructor(options: SubmitActionOptions = {}) { + constructor(options: InsertImageActionOptions = {}) { Object.assign(this, options); } - static from(options: Omit): SubmitAction { - return new SubmitAction(options); + static from(options: Omit): InsertImageAction { + return new InsertImageAction(options); + } + + withKey(key: string): this { + this.key = key; + return this; } withId(id: string): this { @@ -3637,98 +990,33 @@ export class SubmitAction implements ISubmitAction { return this; } - withData(data: any): this { - this.data = data; - return this; - } - - withAssociatedInputs(associatedInputs: 'auto' | 'none'): this { - this.associatedInputs = associatedInputs; + withMenuActions(...menuActions: MenuActionArray): this { + this.menuActions = menuActions; return this; } - withConditionallyEnabled(conditionallyEnabled = true): this { - this.conditionallyEnabled = conditionallyEnabled; + withThemedIconUrls(...themedIconUrls: IThemedUrl[]): this { + this.themedIconUrls = themedIconUrls; return this; } - withMsTeams(msTeams: ITeamsSubmitActionProperties): this { - this.msTeams = msTeams; + withUrl(url: string): this { + this.url = url; return this; } - withFallback(fallback: FallbackAction): this { - this.fallback = fallback; + withAltText(altText: string): this { + this.altText = altText; return this; } -} - -/** - * Teams-specific properties associated with the action. - */ -export interface ITeamsSubmitActionProperties { - /** - * Defines how feedback is provided to the end-user when the action is executed. - */ - feedback?: ITeamsSubmitActionFeedback; -} - -export type TeamsSubmitActionPropertiesOptions = ITeamsSubmitActionProperties; - -/** - * Teams-specific properties associated with the action. - */ -export class TeamsSubmitActionProperties implements ITeamsSubmitActionProperties { - /** - * Defines how feedback is provided to the end-user when the action is executed. - */ - feedback?: ITeamsSubmitActionFeedback; - - constructor(options: TeamsSubmitActionPropertiesOptions = {}) { - Object.assign(this, options); - } - - static from(options: ITeamsSubmitActionProperties): TeamsSubmitActionProperties { - return new TeamsSubmitActionProperties(options); - } - withFeedback(feedback: ITeamsSubmitActionFeedback): this { - this.feedback = feedback; + withInsertPosition(insertPosition: ImageInsertPosition): this { + this.insertPosition = insertPosition; return this; } -} - -/** - * Represents feedback options for an [Action.Submit](https://adaptivecards.microsoft.com/?topic=Action.Submit). - */ -export interface ITeamsSubmitActionFeedback { - /** - * Defines if a feedback message should be displayed after the action is executed. - */ - hide?: boolean; -} - -export type TeamsSubmitActionFeedbackOptions = ITeamsSubmitActionFeedback; - -/** - * Represents feedback options for an [Action.Submit](https://adaptivecards.microsoft.com/?topic=Action.Submit). - */ -export class TeamsSubmitActionFeedback implements ITeamsSubmitActionFeedback { - /** - * Defines if a feedback message should be displayed after the action is executed. - */ - hide?: boolean; - - constructor(options: TeamsSubmitActionFeedbackOptions = {}) { - Object.assign(this, options); - } - - static from(options: ITeamsSubmitActionFeedback): TeamsSubmitActionFeedback { - return new TeamsSubmitActionFeedback(options); - } - withHide(hide: boolean): this { - this.hide = hide; + withFallback(fallback: FallbackAction): this { + this.fallback = fallback; return this; } } @@ -3737,6 +1025,10 @@ export class TeamsSubmitActionFeedback implements ITeamsSubmitActionFeedback { * Opens the provided URL in either a separate browser tab or within the host application. */ export interface IOpenUrlAction { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; /** * Must be **Action.OpenUrl**. */ @@ -3755,8 +1047,8 @@ export interface IOpenUrlAction { title?: string; /** * A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. - -`iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. + * + * `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. */ iconUrl?: string; /** @@ -3775,6 +1067,14 @@ export interface IOpenUrlAction { * Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. */ isEnabled?: boolean; + /** + * The actions to display in the overflow menu of a Split action button. + */ + menuActions?: MenuActionArray; + /** + * A set of theme-specific icon URLs. + */ + themedIconUrls?: IThemedUrl[]; /** * The URL to open. */ @@ -3799,12 +1099,16 @@ export function isOpenUrlAction(value: unknown): value is IOpenUrlAction { return typeof obj === 'object' && obj.type === 'Action.OpenUrl'; } -export type OpenUrlActionOptions = Omit; +export type OpenUrlActionOptions = Partial>; /** * Opens the provided URL in either a separate browser tab or within the host application. */ export class OpenUrlAction implements IOpenUrlAction { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; /** * Must be **Action.OpenUrl**. */ @@ -3816,25 +1120,25 @@ export class OpenUrlAction implements IOpenUrlAction { /** * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - requires?: IHostCapabilities; + requires?: IHostCapabilities = {}; /** * The title of the action, as it appears on buttons. */ title?: string; /** * A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. - -`iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. + * + * `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. */ iconUrl?: string; /** * Control the style of the action, affecting its visual and spoken representations. */ - style?: ActionStyle; + style?: ActionStyle = 'default'; /** * Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. */ - mode?: ActionMode; + mode?: ActionMode = 'primary'; /** * The tooltip text to display when the action is hovered over. */ @@ -3842,7 +1146,15 @@ export class OpenUrlAction implements IOpenUrlAction { /** * Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. */ - isEnabled?: boolean; + isEnabled?: boolean = true; + /** + * The actions to display in the overflow menu of a Split action button. + */ + menuActions?: MenuActionArray; + /** + * A set of theme-specific icon URLs. + */ + themedIconUrls?: IThemedUrl[]; /** * The URL to open. */ @@ -3861,6 +1173,11 @@ export class OpenUrlAction implements IOpenUrlAction { return new OpenUrlAction(options.url, options); } + withKey(key: string): this { + this.key = key; + return this; + } + withId(id: string): this { this.id = id; return this; @@ -3901,6 +1218,16 @@ export class OpenUrlAction implements IOpenUrlAction { return this; } + withMenuActions(...menuActions: MenuActionArray): this { + this.menuActions = menuActions; + return this; + } + + withThemedIconUrls(...themedIconUrls: IThemedUrl[]): this { + this.themedIconUrls = themedIconUrls; + return this; + } + withUrl(url: string): this { this.url = url; return this; @@ -3913,13 +1240,17 @@ export class OpenUrlAction implements IOpenUrlAction { } /** - * Toggles the visibility of a set of elements. Action.ToggleVisibility is useful for creating "Show more" type UI patterns. + * Opens a task module in a modal dialog hosting the content at a provided URL. */ -export interface IToggleVisibilityAction { +export interface IOpenUrlDialogAction { /** - * Must be **Action.ToggleVisibility**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type: 'Action.ToggleVisibility'; + key?: string; + /** + * Must be **Action.OpenUrlDialog**. + */ + readonly type: 'Action.OpenUrlDialog'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -3934,8 +1265,8 @@ export interface IToggleVisibilityAction { title?: string; /** * A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. - -`iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. + * + * `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. */ iconUrl?: string; /** @@ -3955,9 +1286,29 @@ export interface IToggleVisibilityAction { */ isEnabled?: boolean; /** - * The Ids of the elements to toggle the visibility of. + * The actions to display in the overflow menu of a Split action button. */ - targetElements?: (string | ITargetElement)[]; + menuActions?: MenuActionArray; + /** + * A set of theme-specific icon URLs. + */ + themedIconUrls?: IThemedUrl[]; + /** + * The title of the dialog to be displayed in the dialog header. + */ + dialogTitle?: string; + /** + * The height of the dialog. To define height as a number of pixels, use the px format. + */ + dialogHeight?: 'small' | 'medium' | 'large' | string; + /** + * The width of the dialog. To define width as a number of pixels, use the px format. + */ + dialogWidth?: 'small' | 'medium' | 'large' | string; + /** + * The URL to open. + */ + url?: string; /** * An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. */ @@ -3968,26 +1319,30 @@ export interface IToggleVisibilityAction { * @hidden * @internal * - * Type guard to check if a value is of type IToggleVisibilityAction. + * Type guard to check if a value is of type IOpenUrlDialogAction. * * @param value The value to check. - * @returns True if the value is an instance of ToggleVisibilityAction, false otherwise. + * @returns True if the value is an instance of OpenUrlDialogAction, false otherwise. */ -export function isToggleVisibilityAction(value: unknown): value is IToggleVisibilityAction { - const obj = value as IToggleVisibilityAction; - return typeof obj === 'object' && obj.type === 'Action.ToggleVisibility'; +export function isOpenUrlDialogAction(value: unknown): value is IOpenUrlDialogAction { + const obj = value as IOpenUrlDialogAction; + return typeof obj === 'object' && obj.type === 'Action.OpenUrlDialog'; } -export type ToggleVisibilityActionOptions = Omit; +export type OpenUrlDialogActionOptions = Partial>; /** - * Toggles the visibility of a set of elements. Action.ToggleVisibility is useful for creating "Show more" type UI patterns. + * Opens a task module in a modal dialog hosting the content at a provided URL. */ -export class ToggleVisibilityAction implements IToggleVisibilityAction { +export class OpenUrlDialogAction implements IOpenUrlDialogAction { /** - * Must be **Action.ToggleVisibility**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type = 'Action.ToggleVisibility'; + key?: string; + /** + * Must be **Action.OpenUrlDialog**. + */ + readonly type = 'Action.OpenUrlDialog'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -3995,25 +1350,25 @@ export class ToggleVisibilityAction implements IToggleVisibilityAction { /** * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - requires?: IHostCapabilities; + requires?: IHostCapabilities = {}; /** * The title of the action, as it appears on buttons. */ title?: string; /** * A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. - -`iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. + * + * `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. */ iconUrl?: string; /** * Control the style of the action, affecting its visual and spoken representations. */ - style?: ActionStyle; + style?: ActionStyle = 'default'; /** * Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. */ - mode?: ActionMode; + mode?: ActionMode = 'primary'; /** * The tooltip text to display when the action is hovered over. */ @@ -4021,22 +1376,47 @@ export class ToggleVisibilityAction implements IToggleVisibilityAction { /** * Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. */ - isEnabled?: boolean; + isEnabled?: boolean = true; /** - * The Ids of the elements to toggle the visibility of. + * The actions to display in the overflow menu of a Split action button. */ - targetElements?: (string | ITargetElement)[]; + menuActions?: MenuActionArray; + /** + * A set of theme-specific icon URLs. + */ + themedIconUrls?: IThemedUrl[]; + /** + * The title of the dialog to be displayed in the dialog header. + */ + dialogTitle?: string; + /** + * The height of the dialog. To define height as a number of pixels, use the px format. + */ + dialogHeight?: 'small' | 'medium' | 'large' | string; + /** + * The width of the dialog. To define width as a number of pixels, use the px format. + */ + dialogWidth?: 'small' | 'medium' | 'large' | string; + /** + * The URL to open. + */ + url?: string; /** * An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. */ fallback?: FallbackAction; - constructor(options: ToggleVisibilityActionOptions = {}) { + constructor(options: OpenUrlDialogActionOptions = {}) { Object.assign(this, options); } - static from(options: Omit): ToggleVisibilityAction { - return new ToggleVisibilityAction(options); + static from(options: Omit): OpenUrlDialogAction { + return new OpenUrlDialogAction(options); + } + + withKey(key: string): this { + this.key = key; + return this; } withId(id: string): this { @@ -4079,73 +1459,54 @@ export class ToggleVisibilityAction implements IToggleVisibilityAction { return this; } - withTargetElements(...targetElements: (string | ITargetElement)[]): this { - this.targetElements = targetElements; + withMenuActions(...menuActions: MenuActionArray): this { + this.menuActions = menuActions; return this; } - withFallback(fallback: FallbackAction): this { - this.fallback = fallback; + withThemedIconUrls(...themedIconUrls: IThemedUrl[]): this { + this.themedIconUrls = themedIconUrls; return this; } -} - -/** - * Defines a target element in an Action.ToggleVisibility. - */ -export interface ITargetElement { - /** - * The Id of the element to change the visibility of. - */ - elementId?: string; - /** - * The new visibility state of the element. - */ - isVisible?: boolean; -} - -export type TargetElementOptions = ITargetElement; -/** - * Defines a target element in an Action.ToggleVisibility. - */ -export class TargetElement implements ITargetElement { - /** - * The Id of the element to change the visibility of. - */ - elementId?: string; - /** - * The new visibility state of the element. - */ - isVisible?: boolean; + withDialogTitle(dialogTitle: string): this { + this.dialogTitle = dialogTitle; + return this; + } - constructor(options: TargetElementOptions = {}) { - Object.assign(this, options); + withDialogHeight(dialogHeight: 'small' | 'medium' | 'large' | string): this { + this.dialogHeight = dialogHeight; + return this; } - static from(options: ITargetElement): TargetElement { - return new TargetElement(options); + withDialogWidth(dialogWidth: 'small' | 'medium' | 'large' | string): this { + this.dialogWidth = dialogWidth; + return this; } - withElementId(elementId: string): this { - this.elementId = elementId; + withUrl(url: string): this { + this.url = url; return this; } - withIsVisible(isVisible: boolean): this { - this.isVisible = isVisible; + withFallback(fallback: FallbackAction): this { + this.fallback = fallback; return this; } } /** - * Expands or collapses an embedded card within the main card. + * Resets the values of the inputs in the card. */ -export interface IShowCardAction { +export interface IResetInputsAction { /** - * Must be **Action.ShowCard**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type: 'Action.ShowCard'; + key?: string; + /** + * Must be **Action.ResetInputs**. + */ + readonly type: 'Action.ResetInputs'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -4160,8 +1521,8 @@ export interface IShowCardAction { title?: string; /** * A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. - -`iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. + * + * `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. */ iconUrl?: string; /** @@ -4181,39 +1542,51 @@ export interface IShowCardAction { */ isEnabled?: boolean; /** - * An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + * The actions to display in the overflow menu of a Split action button. */ - fallback?: FallbackAction; + menuActions?: MenuActionArray; /** - * The card that should be displayed when the action is executed. + * A set of theme-specific icon URLs. */ - card?: IAdaptiveCard; + themedIconUrls?: IThemedUrl[]; + /** + * The Ids of the inputs that should be reset. + */ + targetInputIds?: string[]; + /** + * An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + */ + fallback?: FallbackAction; } /** * @hidden * @internal * - * Type guard to check if a value is of type IShowCardAction. + * Type guard to check if a value is of type IResetInputsAction. * * @param value The value to check. - * @returns True if the value is an instance of ShowCardAction, false otherwise. + * @returns True if the value is an instance of ResetInputsAction, false otherwise. */ -export function isShowCardAction(value: unknown): value is IShowCardAction { - const obj = value as IShowCardAction; - return typeof obj === 'object' && obj.type === 'Action.ShowCard'; +export function isResetInputsAction(value: unknown): value is IResetInputsAction { + const obj = value as IResetInputsAction; + return typeof obj === 'object' && obj.type === 'Action.ResetInputs'; } -export type ShowCardActionOptions = Omit; +export type ResetInputsActionOptions = Partial>; /** - * Expands or collapses an embedded card within the main card. + * Resets the values of the inputs in the card. */ -export class ShowCardAction implements IShowCardAction { +export class ResetInputsAction implements IResetInputsAction { /** - * Must be **Action.ShowCard**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type = 'Action.ShowCard'; + key?: string; + /** + * Must be **Action.ResetInputs**. + */ + readonly type = 'Action.ResetInputs'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -4221,25 +1594,25 @@ export class ShowCardAction implements IShowCardAction { /** * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - requires?: IHostCapabilities; + requires?: IHostCapabilities = {}; /** * The title of the action, as it appears on buttons. */ title?: string; /** * A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. - -`iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. + * + * `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. */ iconUrl?: string; /** * Control the style of the action, affecting its visual and spoken representations. */ - style?: ActionStyle; + style?: ActionStyle = 'default'; /** * Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. */ - mode?: ActionMode; + mode?: ActionMode = 'primary'; /** * The tooltip text to display when the action is hovered over. */ @@ -4247,22 +1620,35 @@ export class ShowCardAction implements IShowCardAction { /** * Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. */ - isEnabled?: boolean; + isEnabled?: boolean = true; /** - * An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + * The actions to display in the overflow menu of a Split action button. */ - fallback?: FallbackAction; + menuActions?: MenuActionArray; /** - * The card that should be displayed when the action is executed. + * A set of theme-specific icon URLs. */ - card?: IAdaptiveCard; + themedIconUrls?: IThemedUrl[]; + /** + * The Ids of the inputs that should be reset. + */ + targetInputIds?: string[]; + /** + * An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + */ + fallback?: FallbackAction; - constructor(options: ShowCardActionOptions = {}) { + constructor(options: ResetInputsActionOptions = {}) { Object.assign(this, options); } - static from(options: Omit): ShowCardAction { - return new ShowCardAction(options); + static from(options: Omit): ResetInputsAction { + return new ResetInputsAction(options); + } + + withKey(key: string): this { + this.key = key; + return this; } withId(id: string): this { @@ -4305,25 +1691,39 @@ export class ShowCardAction implements IShowCardAction { return this; } - withFallback(fallback: FallbackAction): this { - this.fallback = fallback; + withMenuActions(...menuActions: MenuActionArray): this { + this.menuActions = menuActions; return this; } - withCard(card: IAdaptiveCard): this { - this.card = card; + withThemedIconUrls(...themedIconUrls: IThemedUrl[]): this { + this.themedIconUrls = themedIconUrls; + return this; + } + + withTargetInputIds(...targetInputIds: string[]): this { + this.targetInputIds = targetInputIds; + return this; + } + + withFallback(fallback: FallbackAction): this { + this.fallback = fallback; return this; } } /** - * Resets the values of the inputs in the card. + * Gathers input values, merges them with the data property if specified, and sends them to the Bot via an Invoke activity. The Bot can only acknowledge is has received the request. */ -export interface IResetInputsAction { +export interface ISubmitAction { /** - * Must be **Action.ResetInputs**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type: 'Action.ResetInputs'; + key?: string; + /** + * Must be **Action.Submit**. + */ + readonly type: 'Action.Submit'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -4338,8 +1738,8 @@ export interface IResetInputsAction { title?: string; /** * A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. - -`iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. + * + * `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. */ iconUrl?: string; /** @@ -4359,9 +1759,29 @@ export interface IResetInputsAction { */ isEnabled?: boolean; /** - * The Ids of the inputs that should be reset. + * The actions to display in the overflow menu of a Split action button. */ - targetInputIds?: string[]; + menuActions?: MenuActionArray; + /** + * A set of theme-specific icon URLs. + */ + themedIconUrls?: IThemedUrl[]; + /** + * The data to send to the Bot when the action is executed. When expressed as an object, `data` is sent back to the Bot when the action is executed, adorned with the values of the inputs expressed as key/value pairs, where the key is the Id of the input. If `data` is expressed as a string, input values are not sent to the Bot. + */ + data?: string | ISubmitActionData; + /** + * The Ids of the inputs associated with the Action.Submit. When the action is executed, the values of the associated inputs are sent to the Bot. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. + */ + associatedInputs?: AssociatedInputs; + /** + * Controls if the action is enabled only if at least one required input has been filled by the user. + */ + conditionallyEnabled?: boolean; + /** + * Teams-specific metadata associated with the action. + */ + msteams?: ITeamsSubmitActionProperties; /** * An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. */ @@ -4372,26 +1792,30 @@ export interface IResetInputsAction { * @hidden * @internal * - * Type guard to check if a value is of type IResetInputsAction. + * Type guard to check if a value is of type ISubmitAction. * * @param value The value to check. - * @returns True if the value is an instance of ResetInputsAction, false otherwise. + * @returns True if the value is an instance of SubmitAction, false otherwise. */ -export function isResetInputsAction(value: unknown): value is IResetInputsAction { - const obj = value as IResetInputsAction; - return typeof obj === 'object' && obj.type === 'Action.ResetInputs'; +export function isSubmitAction(value: unknown): value is ISubmitAction { + const obj = value as ISubmitAction; + return typeof obj === 'object' && obj.type === 'Action.Submit'; } -export type ResetInputsActionOptions = Omit; +export type SubmitActionOptions = Partial>; /** - * Resets the values of the inputs in the card. + * Gathers input values, merges them with the data property if specified, and sends them to the Bot via an Invoke activity. The Bot can only acknowledge is has received the request. */ -export class ResetInputsAction implements IResetInputsAction { +export class SubmitAction implements ISubmitAction { /** - * Must be **Action.ResetInputs**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type = 'Action.ResetInputs'; + key?: string; + /** + * Must be **Action.Submit**. + */ + readonly type = 'Action.Submit'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -4399,25 +1823,25 @@ export class ResetInputsAction implements IResetInputsAction { /** * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - requires?: IHostCapabilities; + requires?: IHostCapabilities = {}; /** * The title of the action, as it appears on buttons. */ title?: string; /** * A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. - -`iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. + * + * `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. */ iconUrl?: string; /** * Control the style of the action, affecting its visual and spoken representations. */ - style?: ActionStyle; + style?: ActionStyle = 'default'; /** * Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. */ - mode?: ActionMode; + mode?: ActionMode = 'primary'; /** * The tooltip text to display when the action is hovered over. */ @@ -4425,22 +1849,47 @@ export class ResetInputsAction implements IResetInputsAction { /** * Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. */ - isEnabled?: boolean; + isEnabled?: boolean = true; /** - * The Ids of the inputs that should be reset. + * The actions to display in the overflow menu of a Split action button. */ - targetInputIds?: string[]; + menuActions?: MenuActionArray; + /** + * A set of theme-specific icon URLs. + */ + themedIconUrls?: IThemedUrl[]; + /** + * The data to send to the Bot when the action is executed. When expressed as an object, `data` is sent back to the Bot when the action is executed, adorned with the values of the inputs expressed as key/value pairs, where the key is the Id of the input. If `data` is expressed as a string, input values are not sent to the Bot. + */ + data?: string | ISubmitActionData; + /** + * The Ids of the inputs associated with the Action.Submit. When the action is executed, the values of the associated inputs are sent to the Bot. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. + */ + associatedInputs?: AssociatedInputs; + /** + * Controls if the action is enabled only if at least one required input has been filled by the user. + */ + conditionallyEnabled?: boolean = false; + /** + * Teams-specific metadata associated with the action. + */ + msteams?: ITeamsSubmitActionProperties; /** * An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. */ fallback?: FallbackAction; - constructor(options: ResetInputsActionOptions = {}) { + constructor(options: SubmitActionOptions = {}) { Object.assign(this, options); } - static from(options: Omit): ResetInputsAction { - return new ResetInputsAction(options); + static from(options: Omit): SubmitAction { + return new SubmitAction(options); + } + + withKey(key: string): this { + this.key = key; + return this; } withId(id: string): this { @@ -4483,8 +1932,33 @@ export class ResetInputsAction implements IResetInputsAction { return this; } - withTargetInputIds(...targetInputIds: string[]): this { - this.targetInputIds = targetInputIds; + withMenuActions(...menuActions: MenuActionArray): this { + this.menuActions = menuActions; + return this; + } + + withThemedIconUrls(...themedIconUrls: IThemedUrl[]): this { + this.themedIconUrls = themedIconUrls; + return this; + } + + withData(data: string | ISubmitActionData): this { + this.data = data; + return this; + } + + withAssociatedInputs(associatedInputs: AssociatedInputs): this { + this.associatedInputs = associatedInputs; + return this; + } + + withConditionallyEnabled(conditionallyEnabled = true): this { + this.conditionallyEnabled = conditionallyEnabled; + return this; + } + + withMsteams(msteams: ITeamsSubmitActionProperties): this { + this.msteams = msteams; return this; } @@ -4495,670 +1969,729 @@ export class ResetInputsAction implements IResetInputsAction { } /** - * A layout that stacks elements on top of each other. Layout.Stack is the default layout used by AdaptiveCard and all containers. + * Toggles the visibility of a set of elements. Action.ToggleVisibility is useful for creating "Show more" type UI patterns. */ -export interface IStackLayout { +export interface IToggleVisibilityAction { /** - * Must be **Layout.Stack**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type: 'Layout.Stack'; + key?: string; /** - * Controls for which card width the layout should be used. + * Must be **Action.ToggleVisibility**. */ - targetWidth?: TargetWidth; -} - -/** - * @hidden - * @internal - * - * Type guard to check if a value is of type IStackLayout. - * - * @param value The value to check. - * @returns True if the value is an instance of StackLayout, false otherwise. - */ -export function isStackLayout(value: unknown): value is IStackLayout { - const obj = value as IStackLayout; - return typeof obj === 'object' && obj.type === 'Layout.Stack'; -} - -export type StackLayoutOptions = Omit; - -/** - * A layout that stacks elements on top of each other. Layout.Stack is the default layout used by AdaptiveCard and all containers. - */ -export class StackLayout implements IStackLayout { + readonly type: 'Action.ToggleVisibility'; /** - * Must be **Layout.Stack**. + * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ - readonly type = 'Layout.Stack'; + id?: string; /** - * Controls for which card width the layout should be used. + * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - targetWidth?: TargetWidth; - - constructor(options: StackLayoutOptions = {}) { - Object.assign(this, options); - } - - static from(options: Omit): StackLayout { - return new StackLayout(options); - } - - withTargetWidth(targetWidth: TargetWidth): this { - this.targetWidth = targetWidth; - return this; - } -} - -/** - * A layout that spreads elements horizontally and wraps them across multiple rows, as needed. - */ -export interface IFlowLayout { + requires?: IHostCapabilities; /** - * Must be **Layout.Flow**. + * The title of the action, as it appears on buttons. */ - readonly type: 'Layout.Flow'; + title?: string; /** - * Controls for which card width the layout should be used. + * A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. + * + * `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. */ - targetWidth?: TargetWidth; + iconUrl?: string; /** - * Controls how the content of the container should be horizontally aligned. + * Control the style of the action, affecting its visual and spoken representations. */ - horizontalItemsAlignment?: HorizontalAlignment; + style?: ActionStyle; /** - * Controls how the content of the container should be vertically aligned. + * Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. */ - verticalItemsAlignment?: VerticalAlignment; + mode?: ActionMode; /** - * Controls how item should fit inside the container. + * The tooltip text to display when the action is hovered over. */ - itemFit?: FlowLayoutItemFit; + tooltip?: string; /** - * The minimum width, in pixels, of each item, in the `px` format. Should not be used if itemWidth is set. + * Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. */ - minItemWidth?: string; + isEnabled?: boolean; /** - * The maximum width, in pixels, of each item, in the `px` format. Should not be used if itemWidth is set. + * The actions to display in the overflow menu of a Split action button. */ - maxItemWidth?: string; + menuActions?: MenuActionArray; /** - * The width, in pixels, of each item, in the `px` format. Should not be used if maxItemWidth and/or minItemWidth are set. + * A set of theme-specific icon URLs. */ - itemWidth?: string; + themedIconUrls?: IThemedUrl[]; /** - * The space between items. + * The Ids of the elements to toggle the visibility of. */ - columnSpacing?: Spacing; + targetElements?: (string | ITargetElement)[]; /** - * The space between rows of items. + * An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. */ - rowSpacing?: Spacing; + fallback?: FallbackAction; } /** * @hidden * @internal * - * Type guard to check if a value is of type IFlowLayout. + * Type guard to check if a value is of type IToggleVisibilityAction. * * @param value The value to check. - * @returns True if the value is an instance of FlowLayout, false otherwise. + * @returns True if the value is an instance of ToggleVisibilityAction, false otherwise. */ -export function isFlowLayout(value: unknown): value is IFlowLayout { - const obj = value as IFlowLayout; - return typeof obj === 'object' && obj.type === 'Layout.Flow'; +export function isToggleVisibilityAction(value: unknown): value is IToggleVisibilityAction { + const obj = value as IToggleVisibilityAction; + return typeof obj === 'object' && obj.type === 'Action.ToggleVisibility'; } -export type FlowLayoutOptions = Omit; +export type ToggleVisibilityActionOptions = Partial>; /** - * A layout that spreads elements horizontally and wraps them across multiple rows, as needed. + * Toggles the visibility of a set of elements. Action.ToggleVisibility is useful for creating "Show more" type UI patterns. */ -export class FlowLayout implements IFlowLayout { +export class ToggleVisibilityAction implements IToggleVisibilityAction { /** - * Must be **Layout.Flow**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type = 'Layout.Flow'; + key?: string; /** - * Controls for which card width the layout should be used. + * Must be **Action.ToggleVisibility**. */ - targetWidth?: TargetWidth; + readonly type = 'Action.ToggleVisibility'; /** - * Controls how the content of the container should be horizontally aligned. + * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ - horizontalItemsAlignment?: HorizontalAlignment; + id?: string; /** - * Controls how the content of the container should be vertically aligned. + * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - verticalItemsAlignment?: VerticalAlignment; + requires?: IHostCapabilities = {}; /** - * Controls how item should fit inside the container. + * The title of the action, as it appears on buttons. */ - itemFit?: FlowLayoutItemFit; + title?: string; /** - * The minimum width, in pixels, of each item, in the `px` format. Should not be used if itemWidth is set. + * A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. + * + * `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. */ - minItemWidth?: string; + iconUrl?: string; /** - * The maximum width, in pixels, of each item, in the `px` format. Should not be used if itemWidth is set. + * Control the style of the action, affecting its visual and spoken representations. */ - maxItemWidth?: string; + style?: ActionStyle = 'default'; /** - * The width, in pixels, of each item, in the `px` format. Should not be used if maxItemWidth and/or minItemWidth are set. + * Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. */ - itemWidth?: string; + mode?: ActionMode = 'primary'; /** - * The space between items. + * The tooltip text to display when the action is hovered over. */ - columnSpacing?: Spacing; + tooltip?: string; /** - * The space between rows of items. + * Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. */ - rowSpacing?: Spacing; + isEnabled?: boolean = true; + /** + * The actions to display in the overflow menu of a Split action button. + */ + menuActions?: MenuActionArray; + /** + * A set of theme-specific icon URLs. + */ + themedIconUrls?: IThemedUrl[]; + /** + * The Ids of the elements to toggle the visibility of. + */ + targetElements?: (string | ITargetElement)[]; + /** + * An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + */ + fallback?: FallbackAction; - constructor(options: FlowLayoutOptions = {}) { + constructor(options: ToggleVisibilityActionOptions = {}) { Object.assign(this, options); } - static from(options: Omit): FlowLayout { - return new FlowLayout(options); + static from(options: Omit): ToggleVisibilityAction { + return new ToggleVisibilityAction(options); } - withTargetWidth(targetWidth: TargetWidth): this { - this.targetWidth = targetWidth; + withKey(key: string): this { + this.key = key; return this; } - withHorizontalItemsAlignment(horizontalItemsAlignment: HorizontalAlignment): this { - this.horizontalItemsAlignment = horizontalItemsAlignment; + withId(id: string): this { + this.id = id; return this; } - withVerticalItemsAlignment(verticalItemsAlignment: VerticalAlignment): this { - this.verticalItemsAlignment = verticalItemsAlignment; + withRequires(requires: IHostCapabilities): this { + this.requires = requires; return this; } - withItemFit(itemFit: FlowLayoutItemFit): this { - this.itemFit = itemFit; + withTitle(title: string): this { + this.title = title; return this; } - withMinItemWidth(minItemWidth: string): this { - this.minItemWidth = minItemWidth; + withIconUrl(iconUrl: string): this { + this.iconUrl = iconUrl; return this; } - withMaxItemWidth(maxItemWidth: string): this { - this.maxItemWidth = maxItemWidth; + withStyle(style: ActionStyle): this { + this.style = style; return this; } - withItemWidth(itemWidth: string): this { - this.itemWidth = itemWidth; + withMode(mode: ActionMode): this { + this.mode = mode; return this; } - withColumnSpacing(columnSpacing: Spacing): this { - this.columnSpacing = columnSpacing; + withTooltip(tooltip: string): this { + this.tooltip = tooltip; return this; } - withRowSpacing(rowSpacing: Spacing): this { - this.rowSpacing = rowSpacing; + withIsEnabled(isEnabled = false): this { + this.isEnabled = isEnabled; + return this; + } + + withMenuActions(...menuActions: MenuActionArray): this { + this.menuActions = menuActions; + return this; + } + + withThemedIconUrls(...themedIconUrls: IThemedUrl[]): this { + this.themedIconUrls = themedIconUrls; + return this; + } + + withTargetElements(...targetElements: (string | ITargetElement)[]): this { + this.targetElements = targetElements; + return this; + } + + withFallback(fallback: FallbackAction): this { + this.fallback = fallback; return this; } } /** - * A layout that divides a container into named areas into which elements can be placed. + * Defines a theme-specific URL. */ -export interface IAreaGridLayout { +export interface IThemedUrl { /** - * Must be **Layout.AreaGrid**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type: 'Layout.AreaGrid'; + key?: string; /** - * Controls for which card width the layout should be used. + * The theme this URL applies to. */ - targetWidth?: TargetWidth; + theme?: ThemeName; /** - * The columns in the grid layout, defined as a percentage of the available width or in pixels using the `px` format. + * The URL to use for the associated theme. */ - columns?: (number | string)[]; + url?: string; +} + + +export type ThemedUrlOptions = Partial; + +/** + * Defines a theme-specific URL. + */ +export class ThemedUrl implements IThemedUrl { /** - * The areas in the grid layout. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - areas?: IGridArea[]; + key?: string; /** - * The space between columns. + * The theme this URL applies to. */ - columnSpacing?: Spacing; + theme?: ThemeName = 'Light'; /** - * The space between rows. + * The URL to use for the associated theme. */ - rowSpacing?: Spacing; -} + url?: string; -/** - * @hidden - * @internal - * - * Type guard to check if a value is of type IAreaGridLayout. - * - * @param value The value to check. - * @returns True if the value is an instance of AreaGridLayout, false otherwise. - */ -export function isAreaGridLayout(value: unknown): value is IAreaGridLayout { - const obj = value as IAreaGridLayout; - return typeof obj === 'object' && obj.type === 'Layout.AreaGrid'; -} + constructor(options: ThemedUrlOptions = {}) { + Object.assign(this, options); + } -export type AreaGridLayoutOptions = Omit; + static from(options: IThemedUrl): ThemedUrl { + return new ThemedUrl(options); + } + + withKey(key: string): this { + this.key = key; + return this; + } + + withTheme(theme: ThemeName): this { + this.theme = theme; + return this; + } + + withUrl(url: string): this { + this.url = url; + return this; + } +} /** - * A layout that divides a container into named areas into which elements can be placed. + * Defines a target element in an Action.ToggleVisibility. */ -export class AreaGridLayout implements IAreaGridLayout { - /** - * Must be **Layout.AreaGrid**. - */ - readonly type = 'Layout.AreaGrid'; - /** - * Controls for which card width the layout should be used. - */ - targetWidth?: TargetWidth; +export interface ITargetElement { /** - * The columns in the grid layout, defined as a percentage of the available width or in pixels using the `px` format. + * The Id of the element to change the visibility of. */ - columns?: (number | string)[]; + elementId?: string; /** - * The areas in the grid layout. + * The new visibility state of the element. */ - areas?: IGridArea[]; + isVisible?: boolean; +} + + +export type TargetElementOptions = Partial; + +/** + * Defines a target element in an Action.ToggleVisibility. + */ +export class TargetElement implements ITargetElement { /** - * The space between columns. + * The Id of the element to change the visibility of. */ - columnSpacing?: Spacing; + elementId?: string; /** - * The space between rows. + * The new visibility state of the element. */ - rowSpacing?: Spacing; + isVisible?: boolean; - constructor(options: AreaGridLayoutOptions = {}) { + constructor(options: TargetElementOptions = {}) { Object.assign(this, options); } - static from(options: Omit): AreaGridLayout { - return new AreaGridLayout(options); - } - - withTargetWidth(targetWidth: TargetWidth): this { - this.targetWidth = targetWidth; - return this; - } - - withColumns(...columns: (number | string)[]): this { - this.columns = columns; - return this; - } - - withAreas(...areas: IGridArea[]): this { - this.areas = areas; - return this; + static from(options: ITargetElement): TargetElement { + return new TargetElement(options); } - withColumnSpacing(columnSpacing: Spacing): this { - this.columnSpacing = columnSpacing; + withElementId(elementId: string): this { + this.elementId = elementId; return this; } - withRowSpacing(rowSpacing: Spacing): this { - this.rowSpacing = rowSpacing; + withIsVisible(isVisible: boolean): this { + this.isVisible = isVisible; return this; } } /** - * Defines an area in a Layout.AreaGrid layout. + * Expands or collapses an embedded card within the main card. */ -export interface IGridArea { +export interface IShowCardAction { /** - * The name of the area. To place an element in this area, set its `grid.area` property to match the name of the area. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - name?: string; + key?: string; /** - * The start column index of the area. Column indices start at 1. + * Must be **Action.ShowCard**. */ - column?: number; + readonly type: 'Action.ShowCard'; /** - * Defines how many columns the area should span. + * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ - columnSpan?: number; + id?: string; /** - * The start row index of the area. Row indices start at 1. + * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - row?: number; + requires?: IHostCapabilities; /** - * Defines how many rows the area should span. + * The title of the action, as it appears on buttons. */ - rowSpan?: number; + title?: string; + /** + * A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. + * + * `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. + */ + iconUrl?: string; + /** + * Control the style of the action, affecting its visual and spoken representations. + */ + style?: ActionStyle; + /** + * Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. + */ + mode?: ActionMode; + /** + * The tooltip text to display when the action is hovered over. + */ + tooltip?: string; + /** + * Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. + */ + isEnabled?: boolean; + /** + * The actions to display in the overflow menu of a Split action button. + */ + menuActions?: MenuActionArray; + /** + * A set of theme-specific icon URLs. + */ + themedIconUrls?: IThemedUrl[]; + /** + * An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + */ + fallback?: FallbackAction; + /** + * The card that should be displayed when the action is executed. + */ + card?: IAdaptiveCard; +} + +/** + * @hidden + * @internal + * + * Type guard to check if a value is of type IShowCardAction. + * + * @param value The value to check. + * @returns True if the value is an instance of ShowCardAction, false otherwise. + */ +export function isShowCardAction(value: unknown): value is IShowCardAction { + const obj = value as IShowCardAction; + return typeof obj === 'object' && obj.type === 'Action.ShowCard'; } -export type GridAreaOptions = IGridArea; +export type ShowCardActionOptions = Partial>; /** - * Defines an area in a Layout.AreaGrid layout. + * Expands or collapses an embedded card within the main card. */ -export class GridArea implements IGridArea { +export class ShowCardAction implements IShowCardAction { /** - * The name of the area. To place an element in this area, set its `grid.area` property to match the name of the area. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - name?: string; + key?: string; /** - * The start column index of the area. Column indices start at 1. + * Must be **Action.ShowCard**. */ - column?: number; + readonly type = 'Action.ShowCard'; /** - * Defines how many columns the area should span. + * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ - columnSpan?: number; + id?: string; /** - * The start row index of the area. Row indices start at 1. + * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - row?: number; + requires?: IHostCapabilities = {}; /** - * Defines how many rows the area should span. + * The title of the action, as it appears on buttons. */ - rowSpan?: number; + title?: string; + /** + * A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. + * + * `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. + */ + iconUrl?: string; + /** + * Control the style of the action, affecting its visual and spoken representations. + */ + style?: ActionStyle = 'default'; + /** + * Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. + */ + mode?: ActionMode = 'primary'; + /** + * The tooltip text to display when the action is hovered over. + */ + tooltip?: string; + /** + * Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. + */ + isEnabled?: boolean = true; + /** + * The actions to display in the overflow menu of a Split action button. + */ + menuActions?: MenuActionArray; + /** + * A set of theme-specific icon URLs. + */ + themedIconUrls?: IThemedUrl[]; + /** + * An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + */ + fallback?: FallbackAction; + /** + * The card that should be displayed when the action is executed. + */ + card?: IAdaptiveCard; - constructor(options: GridAreaOptions = {}) { + constructor(options: ShowCardActionOptions = {}) { Object.assign(this, options); } - static from(options: IGridArea): GridArea { - return new GridArea(options); + static from(options: Omit): ShowCardAction { + return new ShowCardAction(options); } - withName(name: string): this { - this.name = name; + withKey(key: string): this { + this.key = key; return this; } - withColumn(column: number): this { - this.column = column; + withId(id: string): this { + this.id = id; return this; } - withColumnSpan(columnSpan: number): this { - this.columnSpan = columnSpan; + withRequires(requires: IHostCapabilities): this { + this.requires = requires; return this; } - withRow(row: number): this { - this.row = row; + withTitle(title: string): this { + this.title = title; return this; } - withRowSpan(rowSpan: number): this { - this.rowSpan = rowSpan; + withIconUrl(iconUrl: string): this { + this.iconUrl = iconUrl; return this; } -} -/** - * Defines a container's background image and the way it should be rendered. - */ -export interface IBackgroundImage { - /** - * The URL (or Base64-encoded Data URI) of the image. Acceptable formats are PNG, JPEG, GIF and SVG. - */ - url?: string; - /** - * Controls how the image should fill the area. - */ - fillMode?: FillMode; - /** - * Controls how the image should be aligned if it must be cropped or if using repeat fill mode. - */ - horizontalAlignment?: HorizontalAlignment; - /** - * Controls how the image should be aligned if it must be cropped or if using repeat fill mode. - */ - verticalAlignment?: VerticalAlignment; -} - -export type BackgroundImageOptions = IBackgroundImage; + withStyle(style: ActionStyle): this { + this.style = style; + return this; + } -/** - * Defines a container's background image and the way it should be rendered. - */ -export class BackgroundImage implements IBackgroundImage { - /** - * The URL (or Base64-encoded Data URI) of the image. Acceptable formats are PNG, JPEG, GIF and SVG. - */ - url?: string; - /** - * Controls how the image should fill the area. - */ - fillMode?: FillMode; - /** - * Controls how the image should be aligned if it must be cropped or if using repeat fill mode. - */ - horizontalAlignment?: HorizontalAlignment; - /** - * Controls how the image should be aligned if it must be cropped or if using repeat fill mode. - */ - verticalAlignment?: VerticalAlignment; + withMode(mode: ActionMode): this { + this.mode = mode; + return this; + } - constructor(options: BackgroundImageOptions = {}) { - Object.assign(this, options); + withTooltip(tooltip: string): this { + this.tooltip = tooltip; + return this; } - static from(options: IBackgroundImage): BackgroundImage { - return new BackgroundImage(options); + withIsEnabled(isEnabled = false): this { + this.isEnabled = isEnabled; + return this; } - withUrl(url: string): this { - this.url = url; + withMenuActions(...menuActions: MenuActionArray): this { + this.menuActions = menuActions; return this; } - withFillMode(fillMode: FillMode): this { - this.fillMode = fillMode; + withThemedIconUrls(...themedIconUrls: IThemedUrl[]): this { + this.themedIconUrls = themedIconUrls; return this; } - withHorizontalAlignment(horizontalAlignment: HorizontalAlignment): this { - this.horizontalAlignment = horizontalAlignment; + withFallback(fallback: FallbackAction): this { + this.fallback = fallback; return this; } - withVerticalAlignment(verticalAlignment: VerticalAlignment): this { - this.verticalAlignment = verticalAlignment; + withCard(card: IAdaptiveCard): this { + this.card = card; return this; } } /** - * Defines how a card can be refreshed by making a request to the target Bot. + * Shows a popover to display more information to the user. */ -export interface IRefreshDefinition { +export interface IPopoverAction { /** - * The Action.Execute action to invoke to refresh the card. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - action?: IExecuteAction; + key?: string; /** - * The list of user Ids for which the card will be automatically refreshed. In Teams, in chats or channels with more than 60 users, the card will automatically refresh only for users specified in the userIds list. Other users will have to manually click on a "refresh" button. In contexts with fewer than 60 users, the card will automatically refresh for all users. + * Must be **Action.Popover**. */ - userIds?: string[]; -} - -export type RefreshDefinitionOptions = IRefreshDefinition; - -/** - * Defines how a card can be refreshed by making a request to the target Bot. - */ -export class RefreshDefinition implements IRefreshDefinition { + readonly type: 'Action.Popover'; /** - * The Action.Execute action to invoke to refresh the card. + * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ - action?: IExecuteAction; + id?: string; /** - * The list of user Ids for which the card will be automatically refreshed. In Teams, in chats or channels with more than 60 users, the card will automatically refresh only for users specified in the userIds list. Other users will have to manually click on a "refresh" button. In contexts with fewer than 60 users, the card will automatically refresh for all users. + * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - userIds?: string[]; - - constructor(options: RefreshDefinitionOptions = {}) { - Object.assign(this, options); - } - - static from(options: IRefreshDefinition): RefreshDefinition { - return new RefreshDefinition(options); - } - - withAction(action: IExecuteAction): this { - this.action = action; - return this; - } - - withUserIds(...userIds: string[]): this { - this.userIds = userIds; - return this; - } -} - -/** - * Defines authentication information associated with a card. For more information, refer to the [Bot Framework OAuthCard type](https://docs.microsoft.com/dotnet/api/microsoft.bot.schema.oauthcard) - */ -export interface IAuthentication { + requires?: IHostCapabilities; /** - * The text that can be displayed to the end user when prompting them to authenticate. + * The title of the action, as it appears on buttons. */ - text?: string; + title?: string; /** - * The identifier for registered OAuth connection setting information. + * A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. + * + * `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. */ - connectionName?: string; + iconUrl?: string; /** - * The buttons that should be displayed to the user when prompting for authentication. The array MUST contain one button of type “signin”. Other button types are not currently supported. + * Control the style of the action, affecting its visual and spoken representations. */ - buttons?: IAuthCardButton[]; + style?: ActionStyle; /** - * Provides information required to enable on-behalf-of single sign-on user authentication. + * Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. */ - tokenExchangeResource?: ITokenExchangeResource; -} - -export type AuthenticationOptions = IAuthentication; - -/** - * Defines authentication information associated with a card. For more information, refer to the [Bot Framework OAuthCard type](https://docs.microsoft.com/dotnet/api/microsoft.bot.schema.oauthcard) - */ -export class Authentication implements IAuthentication { + mode?: ActionMode; /** - * The text that can be displayed to the end user when prompting them to authenticate. + * The tooltip text to display when the action is hovered over. */ - text?: string; + tooltip?: string; /** - * The identifier for registered OAuth connection setting information. + * Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. */ - connectionName?: string; + isEnabled?: boolean; /** - * The buttons that should be displayed to the user when prompting for authentication. The array MUST contain one button of type “signin”. Other button types are not currently supported. + * A set of theme-specific icon URLs. */ - buttons?: IAuthCardButton[]; + themedIconUrls?: IThemedUrl[]; /** - * Provides information required to enable on-behalf-of single sign-on user authentication. + * The content of the popover, which can be any element. */ - tokenExchangeResource?: ITokenExchangeResource; - - constructor(options: AuthenticationOptions = {}) { - Object.assign(this, options); - } - - static from(options: IAuthentication): Authentication { - return new Authentication(options); - } - - withText(text: string): this { - this.text = text; - return this; - } - - withConnectionName(connectionName: string): this { - this.connectionName = connectionName; - return this; - } - - withButtons(...buttons: IAuthCardButton[]): this { - this.buttons = buttons; - return this; - } - - withTokenExchangeResource(tokenExchangeResource: ITokenExchangeResource): this { - this.tokenExchangeResource = tokenExchangeResource; - return this; - } -} - -/** - * Defines a button as displayed when prompting a user to authenticate. For more information, refer to the [Bot Framework CardAction type](https://docs.microsoft.com/dotnet/api/microsoft.bot.schema.cardaction). - */ -export interface IAuthCardButton { + content?: IActionSet | IBadge | ICarousel | IDonutChart | IGaugeChart | IHorizontalBarChart | IStackedHorizontalBarChart | ILineChart | IPieChart | IVerticalBarChart | IGroupedVerticalBarChart | ICodeBlock | IColumnSet | IComEventMicrosoftGraphComponent | IComFileMicrosoftGraphComponent | IComResourceMicrosoftGraphComponent | IComUserMicrosoftGraphComponent | IComUsersMicrosoftGraphComponent | ICompoundButton | IContainer | IFactSet | IIcon | IIconRun | IImage | IImageRun | IImageSet | IChoiceSetInput | IDateInput | INumberInput | IRatingInput | ITextInput | ITimeInput | IToggleInput | IMedia | IProgressBar | IProgressRing | IRating | IRichTextBlock | ITable | ITextBlock | ITextRun; /** - * Must be **signin**. + * Controls if an arrow should be displayed towards the element that triggered the popover. */ - type?: string; + displayArrow?: boolean; /** - * The caption of the button. + * Controls where the popover should be displayed with regards to the element that triggered it. */ - title?: string; + position?: PopoverPosition; /** - * A URL to an image to display alongside the button’s caption. + * The maximum width of the popover in pixels, in the `px` format */ - image?: string; + maxPopoverWidth?: string; /** - * The value associated with the button. The meaning of value depends on the button’s type. + * An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. */ - value?: string; + fallback?: FallbackAction; +} + +/** + * @hidden + * @internal + * + * Type guard to check if a value is of type IPopoverAction. + * + * @param value The value to check. + * @returns True if the value is an instance of PopoverAction, false otherwise. + */ +export function isPopoverAction(value: unknown): value is IPopoverAction { + const obj = value as IPopoverAction; + return typeof obj === 'object' && obj.type === 'Action.Popover'; } -export type AuthCardButtonOptions = IAuthCardButton; +export type PopoverActionOptions = Partial>; /** - * Defines a button as displayed when prompting a user to authenticate. For more information, refer to the [Bot Framework CardAction type](https://docs.microsoft.com/dotnet/api/microsoft.bot.schema.cardaction). + * Shows a popover to display more information to the user. */ -export class AuthCardButton implements IAuthCardButton { +export class PopoverAction implements IPopoverAction { /** - * Must be **signin**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - type?: string; + key?: string; /** - * The caption of the button. + * Must be **Action.Popover**. + */ + readonly type = 'Action.Popover'; + /** + * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + */ + id?: string; + /** + * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + */ + requires?: IHostCapabilities = {}; + /** + * The title of the action, as it appears on buttons. */ title?: string; /** - * A URL to an image to display alongside the button’s caption. + * A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title. + * + * `iconUrl` also accepts the `[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image. */ - image?: string; + iconUrl?: string; /** - * The value associated with the button. The meaning of value depends on the button’s type. + * Control the style of the action, affecting its visual and spoken representations. */ - value?: string; + style?: ActionStyle = 'default'; + /** + * Controls if the action is primary or secondary. Secondary actions appear in an overflow menu. + */ + mode?: ActionMode = 'primary'; + /** + * The tooltip text to display when the action is hovered over. + */ + tooltip?: string; + /** + * Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state. + */ + isEnabled?: boolean = true; + /** + * A set of theme-specific icon URLs. + */ + themedIconUrls?: IThemedUrl[]; + /** + * The content of the popover, which can be any element. + */ + content?: IActionSet | IBadge | ICarousel | IDonutChart | IGaugeChart | IHorizontalBarChart | IStackedHorizontalBarChart | ILineChart | IPieChart | IVerticalBarChart | IGroupedVerticalBarChart | ICodeBlock | IColumnSet | IComEventMicrosoftGraphComponent | IComFileMicrosoftGraphComponent | IComResourceMicrosoftGraphComponent | IComUserMicrosoftGraphComponent | IComUsersMicrosoftGraphComponent | ICompoundButton | IContainer | IFactSet | IIcon | IIconRun | IImage | IImageRun | IImageSet | IChoiceSetInput | IDateInput | INumberInput | IRatingInput | ITextInput | ITimeInput | IToggleInput | IMedia | IProgressBar | IProgressRing | IRating | IRichTextBlock | ITable | ITextBlock | ITextRun; + /** + * Controls if an arrow should be displayed towards the element that triggered the popover. + */ + displayArrow?: boolean = true; + /** + * Controls where the popover should be displayed with regards to the element that triggered it. + */ + position?: PopoverPosition = 'Above'; + /** + * The maximum width of the popover in pixels, in the `px` format + */ + maxPopoverWidth?: string; + /** + * An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + */ + fallback?: FallbackAction; - constructor(options: AuthCardButtonOptions = {}) { + constructor(options: PopoverActionOptions = {}) { Object.assign(this, options); } - static from(options: IAuthCardButton): AuthCardButton { - return new AuthCardButton(options); + static from(options: Omit): PopoverAction { + return new PopoverAction(options); } - withType(type: string): this { - this.type = type; + withKey(key: string): this { + this.key = key; + return this; + } + + withId(id: string): this { + this.id = id; + return this; + } + + withRequires(requires: IHostCapabilities): this { + this.requires = requires; return this; } @@ -5167,304 +2700,74 @@ export class AuthCardButton implements IAuthCardButton { return this; } - withImage(image: string): this { - this.image = image; + withIconUrl(iconUrl: string): this { + this.iconUrl = iconUrl; return this; } - withValue(value: string): this { - this.value = value; + withStyle(style: ActionStyle): this { + this.style = style; return this; } -} -/** - * Defines information required to enable on-behalf-of single sign-on user authentication. For more information, refer to the [Bot Framework TokenExchangeResource type](https://docs.microsoft.com/dotnet/api/microsoft.bot.schema.tokenexchangeresource) - */ -export interface ITokenExchangeResource { - /** - * The unique identified of this token exchange instance. - */ - id?: string; - /** - * An application ID or resource identifier with which to exchange a token on behalf of. This property is identity provider- and application-specific. - */ - uri?: string; - /** - * An identifier for the identity provider with which to attempt a token exchange. - */ - providerId?: string; -} - -export type TokenExchangeResourceOptions = ITokenExchangeResource; - -/** - * Defines information required to enable on-behalf-of single sign-on user authentication. For more information, refer to the [Bot Framework TokenExchangeResource type](https://docs.microsoft.com/dotnet/api/microsoft.bot.schema.tokenexchangeresource) - */ -export class TokenExchangeResource implements ITokenExchangeResource { - /** - * The unique identified of this token exchange instance. - */ - id?: string; - /** - * An application ID or resource identifier with which to exchange a token on behalf of. This property is identity provider- and application-specific. - */ - uri?: string; - /** - * An identifier for the identity provider with which to attempt a token exchange. - */ - providerId?: string; - - constructor(options: TokenExchangeResourceOptions = {}) { - Object.assign(this, options); - } - - static from(options: ITokenExchangeResource): TokenExchangeResource { - return new TokenExchangeResource(options); - } - - withId(id: string): this { - this.id = id; - return this; - } - - withUri(uri: string): this { - this.uri = uri; + withMode(mode: ActionMode): this { + this.mode = mode; return this; } - withProviderId(providerId: string): this { - this.providerId = providerId; + withTooltip(tooltip: string): this { + this.tooltip = tooltip; return this; } -} - -/** - * Represents a set of Teams-specific properties on a card. - */ -export interface ITeamsCardProperties { - /** - * Controls the width of the card in a Teams chat. - -Note that setting `width` to "full" will not actually stretch the card to the "full width" of the chat pane. It will only make the card wider than when the `width` property isn't set. - */ - width?: 'full'; - /** - * The Teams-specific entities associated with the card. - */ - entities?: IMention[]; -} - -export type TeamsCardPropertiesOptions = ITeamsCardProperties; - -/** - * Represents a set of Teams-specific properties on a card. - */ -export class TeamsCardProperties implements ITeamsCardProperties { - /** - * Controls the width of the card in a Teams chat. - -Note that setting `width` to "full" will not actually stretch the card to the "full width" of the chat pane. It will only make the card wider than when the `width` property isn't set. - */ - width?: 'full'; - /** - * The Teams-specific entities associated with the card. - */ - entities?: IMention[]; - - constructor(options: TeamsCardPropertiesOptions = {}) { - Object.assign(this, options); - } - - static from(options: ITeamsCardProperties): TeamsCardProperties { - return new TeamsCardProperties(options); - } - withWidth(width: 'full'): this { - this.width = width; + withIsEnabled(isEnabled = false): this { + this.isEnabled = isEnabled; return this; } - withEntities(...entities: IMention[]): this { - this.entities = entities; + withThemedIconUrls(...themedIconUrls: IThemedUrl[]): this { + this.themedIconUrls = themedIconUrls; return this; } -} - -/** - * Represents a mention to a person. - */ -export interface IMention { - /** - * Must be **mention**. - */ - readonly type: 'mention'; - /** - * The text that will be substituted with the mention. - */ - text?: string; - /** - * Defines the entity being mentioned. - */ - mentioned?: IMentionedEntity; -} - -/** - * @hidden - * @internal - * - * Type guard to check if a value is of type IMention. - * - * @param value The value to check. - * @returns True if the value is an instance of Mention, false otherwise. - */ -export function isMention(value: unknown): value is IMention { - const obj = value as IMention; - return typeof obj === 'object' && obj.type === 'mention'; -} - -export type MentionOptions = Omit; - -/** - * Represents a mention to a person. - */ -export class Mention implements IMention { - /** - * Must be **mention**. - */ - readonly type = 'mention'; - /** - * The text that will be substituted with the mention. - */ - text?: string; - /** - * Defines the entity being mentioned. - */ - mentioned?: IMentionedEntity; - - constructor(options: MentionOptions = {}) { - Object.assign(this, options); - } - - static from(options: Omit): Mention { - return new Mention(options); - } - withText(text: string): this { - this.text = text; + withContent(content: IActionSet | IBadge | ICarousel | IDonutChart | IGaugeChart | IHorizontalBarChart | IStackedHorizontalBarChart | ILineChart | IPieChart | IVerticalBarChart | IGroupedVerticalBarChart | ICodeBlock | IColumnSet | IComEventMicrosoftGraphComponent | IComFileMicrosoftGraphComponent | IComResourceMicrosoftGraphComponent | IComUserMicrosoftGraphComponent | IComUsersMicrosoftGraphComponent | ICompoundButton | IContainer | IFactSet | IIcon | IIconRun | IImage | IImageRun | IImageSet | IChoiceSetInput | IDateInput | INumberInput | IRatingInput | ITextInput | ITimeInput | IToggleInput | IMedia | IProgressBar | IProgressRing | IRating | IRichTextBlock | ITable | ITextBlock | ITextRun): this { + this.content = content; return this; } - withMentioned(mentioned: IMentionedEntity): this { - this.mentioned = mentioned; + withDisplayArrow(displayArrow = false): this { + this.displayArrow = displayArrow; return this; } -} - -/** - * Represents a mentioned person or tag. - */ -export interface IMentionedEntity { - /** - * The Id of a person (typically a Microsoft Entra user Id) or tag. - */ - id?: string; - /** - * The name of the mentioned entity. - */ - name?: string; - /** - * The type of the mentioned entity. - */ - mentionType?: MentionType; -} - -export type MentionedEntityOptions = IMentionedEntity; - -/** - * Represents a mentioned person or tag. - */ -export class MentionedEntity implements IMentionedEntity { - /** - * The Id of a person (typically a Microsoft Entra user Id) or tag. - */ - id?: string; - /** - * The name of the mentioned entity. - */ - name?: string; - /** - * The type of the mentioned entity. - */ - mentionType?: MentionType; - - constructor(options: MentionedEntityOptions = {}) { - Object.assign(this, options); - } - - static from(options: IMentionedEntity): MentionedEntity { - return new MentionedEntity(options); - } - withId(id: string): this { - this.id = id; + withPosition(position: PopoverPosition): this { + this.position = position; return this; } - withName(name: string): this { - this.name = name; + withMaxPopoverWidth(maxPopoverWidth: string): this { + this.maxPopoverWidth = maxPopoverWidth; return this; } - withMentionType(mentionType: MentionType): this { - this.mentionType = mentionType; + withFallback(fallback: FallbackAction): this { + this.fallback = fallback; return this; } } /** - * Card-level metadata. - */ -export interface ICardMetadata { - /** - * The URL the card originates from. When `webUrl` is set, the card is dubbed an **Adaptive Card-based Loop Component** and, when pasted in Teams or other Loop Component-capable host applications, the URL will unfurl to the same exact card. - */ - webUrl?: string; -} - -export type CardMetadataOptions = ICardMetadata; - -/** - * Card-level metadata. + * Displays a set of action, which can be placed anywhere in the card. */ -export class CardMetadata implements ICardMetadata { +export interface IActionSet { /** - * The URL the card originates from. When `webUrl` is set, the card is dubbed an **Adaptive Card-based Loop Component** and, when pasted in Teams or other Loop Component-capable host applications, the URL will unfurl to the same exact card. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - webUrl?: string; - - constructor(options: CardMetadataOptions = {}) { - Object.assign(this, options); - } - - static from(options: ICardMetadata): CardMetadata { - return new CardMetadata(options); - } - - withWebUrl(webUrl: string): this { - this.webUrl = webUrl; - return this; - } -} - -/** - * A container for other elements. Use containers for styling purposes and/or to logically group a set of elements together, which can be especially useful when used with Action.ToggleVisibility. - */ -export interface IContainer { + key?: string; /** - * Must be **Container**. + * Must be **ActionSet**. */ - readonly type: 'Container'; + readonly type: 'ActionSet'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -5506,14 +2809,231 @@ export interface IContainer { */ isSortKey?: boolean; /** - * An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. + * The area of a Layout.AreaGrid layout in which an element should be displayed. + */ + 'grid.area'?: string; + /** + * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + */ + fallback?: FallbackElement; + /** + * The actions in the set. + */ + actions: ActionArray; +} + +/** + * @hidden + * @internal + * + * Type guard to check if a value is of type IActionSet. + * + * @param value The value to check. + * @returns True if the value is an instance of ActionSet, false otherwise. + */ +export function isActionSet(value: unknown): value is IActionSet { + const obj = value as IActionSet; + return typeof obj === 'object' && obj.type === 'ActionSet'; +} + +export type ActionSetOptions = Partial>; + +/** + * Displays a set of action, which can be placed anywhere in the card. + */ +export class ActionSet implements IActionSet { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * Must be **ActionSet**. + */ + readonly type = 'ActionSet'; + /** + * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + */ + id?: string; + /** + * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + */ + requires?: IHostCapabilities = {}; + /** + * The locale associated with the element. + */ + lang?: string; + /** + * Controls the visibility of the element. + */ + isVisible?: boolean = true; + /** + * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + */ + separator?: boolean = false; + /** + * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + */ + height?: ElementHeight = 'auto'; + /** + * Controls how the element should be horizontally aligned. + */ + horizontalAlignment?: HorizontalAlignment; + /** + * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + */ + spacing?: Spacing = 'Default'; + /** + * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + */ + targetWidth?: TargetWidth; + /** + * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + */ + isSortKey?: boolean = false; + /** + * The area of a Layout.AreaGrid layout in which an element should be displayed. + */ + 'grid.area'?: string; + /** + * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + */ + fallback?: FallbackElement; + /** + * The actions in the set. + */ + actions: ActionArray; + + constructor(...actions: ActionArray) { + this.actions = actions; + } + + withOptions(value: ActionSetOptions): this { + Object.assign(this, value); + return this; + } + + withKey(key: string): this { + this.key = key; + return this; + } + + withId(id: string): this { + this.id = id; + return this; + } + + withRequires(requires: IHostCapabilities): this { + this.requires = requires; + return this; + } + + withLang(lang: string): this { + this.lang = lang; + return this; + } + + withIsVisible(isVisible = false): this { + this.isVisible = isVisible; + return this; + } + + withSeparator(separator = true): this { + this.separator = separator; + return this; + } + + withHeight(height: ElementHeight): this { + this.height = height; + return this; + } + + withHorizontalAlignment(horizontalAlignment: HorizontalAlignment): this { + this.horizontalAlignment = horizontalAlignment; + return this; + } + + withSpacing(spacing: Spacing): this { + this.spacing = spacing; + return this; + } + + withTargetWidth(targetWidth: TargetWidth): this { + this.targetWidth = targetWidth; + return this; + } + + withIsSortKey(isSortKey = true): this { + this.isSortKey = isSortKey; + return this; + } + + withFallback(fallback: FallbackElement): this { + this.fallback = fallback; + return this; + } + + withActions(...actions: ActionArray): this { + this.actions = actions; + return this; + } +} + +/** + * A container for other elements. Use containers for styling purposes and/or to logically group a set of elements together, which can be especially useful when used with Action.ToggleVisibility. + */ +export interface IContainer { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * Must be **Container**. + */ + readonly type: 'Container'; + /** + * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + */ + id?: string; + /** + * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + */ + requires?: IHostCapabilities; + /** + * The locale associated with the element. + */ + lang?: string; + /** + * Controls the visibility of the element. + */ + isVisible?: boolean; + /** + * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + */ + separator?: boolean; + /** + * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + */ + height?: ElementHeight; + /** + * Controls how the element should be horizontally aligned. + */ + horizontalAlignment?: HorizontalAlignment; + /** + * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + */ + spacing?: Spacing; + /** + * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + */ + targetWidth?: TargetWidth; + /** + * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + */ + isSortKey?: boolean; + /** + * An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. */ - selectAction?: - | IExecuteAction - | IOpenUrlAction - | IResetInputsAction - | ISubmitAction - | IToggleVisibilityAction; + selectAction?: IExecuteAction | IInsertImageAction | IOpenUrlAction | IOpenUrlDialogAction | IPopoverAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction; /** * The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. */ @@ -5582,12 +3102,16 @@ export function isContainer(value: unknown): value is IContainer { return typeof obj === 'object' && obj.type === 'Container'; } -export type ContainerOptions = Omit; +export type ContainerOptions = Partial>; /** * A container for other elements. Use containers for styling purposes and/or to logically group a set of elements together, which can be especially useful when used with Action.ToggleVisibility. */ export class Container implements IContainer { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; /** * Must be **Container**. */ @@ -5599,7 +3123,7 @@ export class Container implements IContainer { /** * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - requires?: IHostCapabilities; + requires?: IHostCapabilities = {}; /** * The locale associated with the element. */ @@ -5607,15 +3131,15 @@ export class Container implements IContainer { /** * Controls the visibility of the element. */ - isVisible?: boolean; + isVisible?: boolean = true; /** * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. */ - separator?: boolean; + separator?: boolean = false; /** * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. */ - height?: ElementHeight; + height?: ElementHeight = 'auto'; /** * Controls how the element should be horizontally aligned. */ @@ -5623,7 +3147,7 @@ export class Container implements IContainer { /** * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ - spacing?: Spacing; + spacing?: Spacing = 'Default'; /** * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). */ @@ -5631,16 +3155,11 @@ export class Container implements IContainer { /** * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. */ - isSortKey?: boolean; + isSortKey?: boolean = false; /** * An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. */ - selectAction?: - | IExecuteAction - | IOpenUrlAction - | IResetInputsAction - | ISubmitAction - | IToggleVisibilityAction; + selectAction?: IExecuteAction | IInsertImageAction | IOpenUrlAction | IOpenUrlDialogAction | IPopoverAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction; /** * The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. */ @@ -5648,11 +3167,11 @@ export class Container implements IContainer { /** * Controls if a border should be displayed around the container. */ - showBorder?: boolean; + showBorder?: boolean = false; /** * Controls if the container should have rounded corners. */ - roundedCorners?: boolean; + roundedCorners?: boolean = false; /** * The layouts associated with the container. The container can dynamically switch from one layout to another as the card's width changes. See [Container layouts](https://adaptivecards.microsoft.com/?topic=container-layouts) for more details. */ @@ -5660,7 +3179,7 @@ export class Container implements IContainer { /** * Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. */ - bleed?: boolean; + bleed?: boolean = false; /** * The minimum height, in pixels, of the container, in the `px` format. */ @@ -5703,6 +3222,11 @@ export class Container implements IContainer { return this; } + withKey(key: string): this { + this.key = key; + return this; + } + withId(id: string): this { this.id = id; return this; @@ -5753,14 +3277,7 @@ export class Container implements IContainer { return this; } - withSelectAction( - selectAction: - | IExecuteAction - | IOpenUrlAction - | IResetInputsAction - | ISubmitAction - | IToggleVisibilityAction - ): this { + withSelectAction(selectAction: IExecuteAction | IInsertImageAction | IOpenUrlAction | IOpenUrlDialogAction | IPopoverAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction): this { this.selectAction = selectAction; return this; } @@ -5827,525 +3344,585 @@ export class Container implements IContainer { } /** - * Displays a set of action, which can be placed anywhere in the card. + * A layout that stacks elements on top of each other. Layout.Stack is the default layout used by AdaptiveCard and all containers. */ -export interface IActionSet { - /** - * Must be **ActionSet**. - */ - readonly type: 'ActionSet'; - /** - * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - */ - id?: string; - /** - * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - */ - requires?: IHostCapabilities; - /** - * The locale associated with the element. - */ - lang?: string; - /** - * Controls the visibility of the element. - */ - isVisible?: boolean; +export interface IStackLayout { /** - * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - separator?: boolean; + key?: string; /** - * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + * Must be **Layout.Stack**. */ - height?: ElementHeight; + readonly type: 'Layout.Stack'; /** - * Controls how the element should be horizontally aligned. + * Controls for which card width the layout should be used. */ - horizontalAlignment?: HorizontalAlignment; + targetWidth?: TargetWidth; +} + +/** + * @hidden + * @internal + * + * Type guard to check if a value is of type IStackLayout. + * + * @param value The value to check. + * @returns True if the value is an instance of StackLayout, false otherwise. + */ +export function isStackLayout(value: unknown): value is IStackLayout { + const obj = value as IStackLayout; + return typeof obj === 'object' && obj.type === 'Layout.Stack'; +} + +export type StackLayoutOptions = Partial>; + +/** + * A layout that stacks elements on top of each other. Layout.Stack is the default layout used by AdaptiveCard and all containers. + */ +export class StackLayout implements IStackLayout { /** - * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - spacing?: Spacing; + key?: string; /** - * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + * Must be **Layout.Stack**. + */ + readonly type = 'Layout.Stack'; + /** + * Controls for which card width the layout should be used. */ targetWidth?: TargetWidth; + + constructor(options: StackLayoutOptions = {}) { + Object.assign(this, options); + } + + static from(options: Omit): StackLayout { + return new StackLayout(options); + } + + withKey(key: string): this { + this.key = key; + return this; + } + + withTargetWidth(targetWidth: TargetWidth): this { + this.targetWidth = targetWidth; + return this; + } +} + +/** + * A layout that spreads elements horizontally and wraps them across multiple rows, as needed. + */ +export interface IFlowLayout { /** - * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - isSortKey?: boolean; + key?: string; /** - * The area of a Layout.AreaGrid layout in which an element should be displayed. + * Must be **Layout.Flow**. */ - 'grid.area'?: string; + readonly type: 'Layout.Flow'; /** - * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + * Controls for which card width the layout should be used. */ - fallback?: FallbackElement; + targetWidth?: TargetWidth; /** - * The actions in the set. + * Controls how the content of the container should be horizontally aligned. */ - actions: ActionArray; + horizontalItemsAlignment?: HorizontalAlignment; + /** + * Controls how the content of the container should be vertically aligned. + */ + verticalItemsAlignment?: VerticalAlignment; + /** + * Controls how item should fit inside the container. + */ + itemFit?: FlowLayoutItemFit; + /** + * The minimum width, in pixels, of each item, in the `px` format. Should not be used if itemWidth is set. + */ + minItemWidth?: string; + /** + * The maximum width, in pixels, of each item, in the `px` format. Should not be used if itemWidth is set. + */ + maxItemWidth?: string; + /** + * The width, in pixels, of each item, in the `px` format. Should not be used if maxItemWidth and/or minItemWidth are set. + */ + itemWidth?: string; + /** + * The space between items. + */ + columnSpacing?: Spacing; + /** + * The space between rows of items. + */ + rowSpacing?: Spacing; } /** * @hidden * @internal * - * Type guard to check if a value is of type IActionSet. + * Type guard to check if a value is of type IFlowLayout. * * @param value The value to check. - * @returns True if the value is an instance of ActionSet, false otherwise. + * @returns True if the value is an instance of FlowLayout, false otherwise. */ -export function isActionSet(value: unknown): value is IActionSet { - const obj = value as IActionSet; - return typeof obj === 'object' && obj.type === 'ActionSet'; +export function isFlowLayout(value: unknown): value is IFlowLayout { + const obj = value as IFlowLayout; + return typeof obj === 'object' && obj.type === 'Layout.Flow'; } -export type ActionSetOptions = Omit; +export type FlowLayoutOptions = Partial>; /** - * Displays a set of action, which can be placed anywhere in the card. + * A layout that spreads elements horizontally and wraps them across multiple rows, as needed. */ -export class ActionSet implements IActionSet { - /** - * Must be **ActionSet**. - */ - readonly type = 'ActionSet'; - /** - * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - */ - id?: string; - /** - * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - */ - requires?: IHostCapabilities; +export class FlowLayout implements IFlowLayout { /** - * The locale associated with the element. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - lang?: string; + key?: string; /** - * Controls the visibility of the element. + * Must be **Layout.Flow**. */ - isVisible?: boolean; + readonly type = 'Layout.Flow'; /** - * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + * Controls for which card width the layout should be used. */ - separator?: boolean; + targetWidth?: TargetWidth; /** - * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + * Controls how the content of the container should be horizontally aligned. */ - height?: ElementHeight; + horizontalItemsAlignment?: HorizontalAlignment = 'Center'; /** - * Controls how the element should be horizontally aligned. + * Controls how the content of the container should be vertically aligned. */ - horizontalAlignment?: HorizontalAlignment; + verticalItemsAlignment?: VerticalAlignment = 'Top'; /** - * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + * Controls how item should fit inside the container. */ - spacing?: Spacing; + itemFit?: FlowLayoutItemFit = 'Fit'; /** - * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + * The minimum width, in pixels, of each item, in the `px` format. Should not be used if itemWidth is set. */ - targetWidth?: TargetWidth; + minItemWidth?: string; /** - * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + * The maximum width, in pixels, of each item, in the `px` format. Should not be used if itemWidth is set. */ - isSortKey?: boolean; + maxItemWidth?: string; /** - * The area of a Layout.AreaGrid layout in which an element should be displayed. + * The width, in pixels, of each item, in the `px` format. Should not be used if maxItemWidth and/or minItemWidth are set. */ - 'grid.area'?: string; + itemWidth?: string; /** - * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + * The space between items. */ - fallback?: FallbackElement; + columnSpacing?: Spacing = 'Default'; /** - * The actions in the set. + * The space between rows of items. */ - actions: ActionArray; - - constructor(...actions: ActionArray) { - this.actions = actions; - } - - withOptions(value: ActionSetOptions): this { - Object.assign(this, value); - return this; - } + rowSpacing?: Spacing = 'Default'; - withId(id: string): this { - this.id = id; - return this; + constructor(options: FlowLayoutOptions = {}) { + Object.assign(this, options); } - withRequires(requires: IHostCapabilities): this { - this.requires = requires; - return this; + static from(options: Omit): FlowLayout { + return new FlowLayout(options); } - withLang(lang: string): this { - this.lang = lang; + withKey(key: string): this { + this.key = key; return this; } - withIsVisible(isVisible = false): this { - this.isVisible = isVisible; + withTargetWidth(targetWidth: TargetWidth): this { + this.targetWidth = targetWidth; return this; } - withSeparator(separator = true): this { - this.separator = separator; + withHorizontalItemsAlignment(horizontalItemsAlignment: HorizontalAlignment): this { + this.horizontalItemsAlignment = horizontalItemsAlignment; return this; } - withHeight(height: ElementHeight): this { - this.height = height; + withVerticalItemsAlignment(verticalItemsAlignment: VerticalAlignment): this { + this.verticalItemsAlignment = verticalItemsAlignment; return this; } - withHorizontalAlignment(horizontalAlignment: HorizontalAlignment): this { - this.horizontalAlignment = horizontalAlignment; + withItemFit(itemFit: FlowLayoutItemFit): this { + this.itemFit = itemFit; return this; } - withSpacing(spacing: Spacing): this { - this.spacing = spacing; + withMinItemWidth(minItemWidth: string): this { + this.minItemWidth = minItemWidth; return this; } - withTargetWidth(targetWidth: TargetWidth): this { - this.targetWidth = targetWidth; + withMaxItemWidth(maxItemWidth: string): this { + this.maxItemWidth = maxItemWidth; return this; } - withIsSortKey(isSortKey = true): this { - this.isSortKey = isSortKey; + withItemWidth(itemWidth: string): this { + this.itemWidth = itemWidth; return this; } - withFallback(fallback: FallbackElement): this { - this.fallback = fallback; + withColumnSpacing(columnSpacing: Spacing): this { + this.columnSpacing = columnSpacing; return this; } - withActions(...actions: ActionArray): this { - this.actions = actions; + withRowSpacing(rowSpacing: Spacing): this { + this.rowSpacing = rowSpacing; return this; } } /** - * Splits the available horizontal space into separate columns, so elements can be organized in a row. + * A layout that divides a container into named areas into which elements can be placed. */ -export interface IColumnSet { - /** - * Must be **ColumnSet**. - */ - readonly type: 'ColumnSet'; - /** - * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - */ - id?: string; - /** - * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - */ - requires?: IHostCapabilities; +export interface IAreaGridLayout { /** - * The locale associated with the element. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - lang?: string; + key?: string; /** - * Controls the visibility of the element. + * Must be **Layout.AreaGrid**. */ - isVisible?: boolean; + readonly type: 'Layout.AreaGrid'; /** - * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + * Controls for which card width the layout should be used. */ - separator?: boolean; + targetWidth?: TargetWidth; /** - * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + * The columns in the grid layout, defined as a percentage of the available width or in pixels using the `px` format. */ - height?: ElementHeight; + columns?: (number | string)[]; /** - * Controls how the element should be horizontally aligned. + * The areas in the grid layout. */ - horizontalAlignment?: HorizontalAlignment; + areas?: IGridArea[]; /** - * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + * The space between columns. */ - spacing?: Spacing; + columnSpacing?: Spacing; /** - * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + * The space between rows. */ - targetWidth?: TargetWidth; - /** - * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - */ - isSortKey?: boolean; - /** - * An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. - */ - selectAction?: - | IExecuteAction - | IOpenUrlAction - | IResetInputsAction - | ISubmitAction - | IToggleVisibilityAction; - /** - * The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. - */ - style?: ContainerStyle; - /** - * Controls if a border should be displayed around the container. - */ - showBorder?: boolean; - /** - * Controls if the container should have rounded corners. - */ - roundedCorners?: boolean; - /** - * Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. - */ - bleed?: boolean; - /** - * The minimum height, in pixels, of the container, in the `px` format. - */ - minHeight?: string; - /** - * The area of a Layout.AreaGrid layout in which an element should be displayed. - */ - 'grid.area'?: string; - /** - * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - */ - fallback?: FallbackElement; - /** - * The columns in the set. - */ - columns?: ColumnArray; + rowSpacing?: Spacing; } /** * @hidden * @internal * - * Type guard to check if a value is of type IColumnSet. + * Type guard to check if a value is of type IAreaGridLayout. * * @param value The value to check. - * @returns True if the value is an instance of ColumnSet, false otherwise. + * @returns True if the value is an instance of AreaGridLayout, false otherwise. */ -export function isColumnSet(value: unknown): value is IColumnSet { - const obj = value as IColumnSet; - return typeof obj === 'object' && obj.type === 'ColumnSet'; +export function isAreaGridLayout(value: unknown): value is IAreaGridLayout { + const obj = value as IAreaGridLayout; + return typeof obj === 'object' && obj.type === 'Layout.AreaGrid'; } -export type ColumnSetOptions = Omit; +export type AreaGridLayoutOptions = Partial>; /** - * Splits the available horizontal space into separate columns, so elements can be organized in a row. + * A layout that divides a container into named areas into which elements can be placed. */ -export class ColumnSet implements IColumnSet { - /** - * Must be **ColumnSet**. - */ - readonly type = 'ColumnSet'; - /** - * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - */ - id?: string; - /** - * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - */ - requires?: IHostCapabilities; - /** - * The locale associated with the element. - */ - lang?: string; - /** - * Controls the visibility of the element. - */ - isVisible?: boolean; - /** - * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - */ - separator?: boolean; - /** - * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - */ - height?: ElementHeight; +export class AreaGridLayout implements IAreaGridLayout { /** - * Controls how the element should be horizontally aligned. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - horizontalAlignment?: HorizontalAlignment; + key?: string; /** - * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + * Must be **Layout.AreaGrid**. */ - spacing?: Spacing; + readonly type = 'Layout.AreaGrid'; /** - * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + * Controls for which card width the layout should be used. */ targetWidth?: TargetWidth; /** - * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - */ - isSortKey?: boolean; - /** - * An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. - */ - selectAction?: - | IExecuteAction - | IOpenUrlAction - | IResetInputsAction - | ISubmitAction - | IToggleVisibilityAction; - /** - * The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. - */ - style?: ContainerStyle; - /** - * Controls if a border should be displayed around the container. - */ - showBorder?: boolean; - /** - * Controls if the container should have rounded corners. - */ - roundedCorners?: boolean; - /** - * Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. - */ - bleed?: boolean; - /** - * The minimum height, in pixels, of the container, in the `px` format. + * The columns in the grid layout, defined as a percentage of the available width or in pixels using the `px` format. */ - minHeight?: string; + columns?: (number | string)[]; /** - * The area of a Layout.AreaGrid layout in which an element should be displayed. + * The areas in the grid layout. */ - 'grid.area'?: string; + areas?: IGridArea[]; /** - * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + * The space between columns. */ - fallback?: FallbackElement; + columnSpacing?: Spacing = 'Default'; /** - * The columns in the set. + * The space between rows. */ - columns?: ColumnArray; + rowSpacing?: Spacing = 'Default'; - constructor(options: ColumnSetOptions = {}) { + constructor(options: AreaGridLayoutOptions = {}) { Object.assign(this, options); } - static from(options: Omit): ColumnSet { - return new ColumnSet(options); + static from(options: Omit): AreaGridLayout { + return new AreaGridLayout(options); } - withId(id: string): this { - this.id = id; + withKey(key: string): this { + this.key = key; return this; } - withRequires(requires: IHostCapabilities): this { - this.requires = requires; + withTargetWidth(targetWidth: TargetWidth): this { + this.targetWidth = targetWidth; return this; } - withLang(lang: string): this { - this.lang = lang; + withColumns(...columns: (number | string)[]): this { + this.columns = columns; return this; } - withIsVisible(isVisible = false): this { - this.isVisible = isVisible; + withAreas(...areas: IGridArea[]): this { + this.areas = areas; return this; } - withSeparator(separator = true): this { - this.separator = separator; + withColumnSpacing(columnSpacing: Spacing): this { + this.columnSpacing = columnSpacing; return this; } - withHeight(height: ElementHeight): this { - this.height = height; + withRowSpacing(rowSpacing: Spacing): this { + this.rowSpacing = rowSpacing; return this; } +} - withHorizontalAlignment(horizontalAlignment: HorizontalAlignment): this { - this.horizontalAlignment = horizontalAlignment; - return this; - } +/** + * Defines an area in a Layout.AreaGrid layout. + */ +export interface IGridArea { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * The name of the area. To place an element in this area, set its `grid.area` property to match the name of the area. + */ + name?: string; + /** + * The start column index of the area. Column indices start at 1. + */ + column?: number; + /** + * Defines how many columns the area should span. + */ + columnSpan?: number; + /** + * The start row index of the area. Row indices start at 1. + */ + row?: number; + /** + * Defines how many rows the area should span. + */ + rowSpan?: number; +} - withSpacing(spacing: Spacing): this { - this.spacing = spacing; - return this; - } - withTargetWidth(targetWidth: TargetWidth): this { - this.targetWidth = targetWidth; - return this; - } +export type GridAreaOptions = Partial; - withIsSortKey(isSortKey = true): this { - this.isSortKey = isSortKey; - return this; - } +/** + * Defines an area in a Layout.AreaGrid layout. + */ +export class GridArea implements IGridArea { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * The name of the area. To place an element in this area, set its `grid.area` property to match the name of the area. + */ + name?: string; + /** + * The start column index of the area. Column indices start at 1. + */ + column?: number = 1; + /** + * Defines how many columns the area should span. + */ + columnSpan?: number = 1; + /** + * The start row index of the area. Row indices start at 1. + */ + row?: number = 1; + /** + * Defines how many rows the area should span. + */ + rowSpan?: number = 1; - withSelectAction( - selectAction: - | IExecuteAction - | IOpenUrlAction - | IResetInputsAction - | ISubmitAction - | IToggleVisibilityAction - ): this { - this.selectAction = selectAction; - return this; + constructor(options: GridAreaOptions = {}) { + Object.assign(this, options); } - withStyle(style: ContainerStyle): this { - this.style = style; - return this; + static from(options: IGridArea): GridArea { + return new GridArea(options); } - withShowBorder(showBorder = true): this { - this.showBorder = showBorder; + withKey(key: string): this { + this.key = key; return this; } - withRoundedCorners(roundedCorners = true): this { - this.roundedCorners = roundedCorners; + withName(name: string): this { + this.name = name; return this; } - withBleed(bleed = true): this { - this.bleed = bleed; + withColumn(column: number): this { + this.column = column; return this; } - withMinHeight(minHeight: string): this { - this.minHeight = minHeight; + withColumnSpan(columnSpan: number): this { + this.columnSpan = columnSpan; return this; } - withFallback(fallback: FallbackElement): this { - this.fallback = fallback; + withRow(row: number): this { + this.row = row; return this; } - withColumns(...columns: ColumnArray): this { - this.columns = columns; + withRowSpan(rowSpan: number): this { + this.rowSpan = rowSpan; return this; } } /** - * A media element, that makes it possible to embed videos inside a card. + * Defines a container's background image and the way it should be rendered. */ -export interface IMedia { +export interface IBackgroundImage { /** - * Must be **Media**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type: 'Media'; + key?: string; + /** + * The URL (or Base64-encoded Data URI) of the image. Acceptable formats are PNG, JPEG, GIF and SVG. + */ + url?: string; + /** + * Controls how the image should fill the area. + */ + fillMode?: FillMode; + /** + * Controls how the image should be aligned if it must be cropped or if using repeat fill mode. + */ + horizontalAlignment?: HorizontalAlignment; + /** + * Controls how the image should be aligned if it must be cropped or if using repeat fill mode. + */ + verticalAlignment?: VerticalAlignment; + /** + * A set of theme-specific image URLs. + */ + themedUrls?: IThemedUrl[]; +} + + +export type BackgroundImageOptions = Partial; + +/** + * Defines a container's background image and the way it should be rendered. + */ +export class BackgroundImage implements IBackgroundImage { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * The URL (or Base64-encoded Data URI) of the image. Acceptable formats are PNG, JPEG, GIF and SVG. + */ + url?: string; + /** + * Controls how the image should fill the area. + */ + fillMode?: FillMode = 'Cover'; + /** + * Controls how the image should be aligned if it must be cropped or if using repeat fill mode. + */ + horizontalAlignment?: HorizontalAlignment = 'Left'; + /** + * Controls how the image should be aligned if it must be cropped or if using repeat fill mode. + */ + verticalAlignment?: VerticalAlignment = 'Top'; + /** + * A set of theme-specific image URLs. + */ + themedUrls?: IThemedUrl[]; + + constructor(options: BackgroundImageOptions = {}) { + Object.assign(this, options); + } + + static from(options: IBackgroundImage): BackgroundImage { + return new BackgroundImage(options); + } + + withKey(key: string): this { + this.key = key; + return this; + } + + withUrl(url: string): this { + this.url = url; + return this; + } + + withFillMode(fillMode: FillMode): this { + this.fillMode = fillMode; + return this; + } + + withHorizontalAlignment(horizontalAlignment: HorizontalAlignment): this { + this.horizontalAlignment = horizontalAlignment; + return this; + } + + withVerticalAlignment(verticalAlignment: VerticalAlignment): this { + this.verticalAlignment = verticalAlignment; + return this; + } + + withThemedUrls(...themedUrls: IThemedUrl[]): this { + this.themedUrls = themedUrls; + return this; + } +} + +/** + * Splits the available horizontal space into separate columns, so elements can be organized in a row. + */ +export interface IColumnSet { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * Must be **ColumnSet**. + */ + readonly type: 'ColumnSet'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -6370,6 +3947,10 @@ export interface IMedia { * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. */ height?: ElementHeight; + /** + * Controls how the element should be horizontally aligned. + */ + horizontalAlignment?: HorizontalAlignment; /** * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ @@ -6383,21 +3964,33 @@ export interface IMedia { */ isSortKey?: boolean; /** - * The sources for the media. For YouTube, Dailymotion and Vimeo, only one source can be specified. + * An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. */ - sources?: IMediaSource[]; + selectAction?: IExecuteAction | IInsertImageAction | IOpenUrlAction | IOpenUrlDialogAction | IPopoverAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction; /** - * The caption sources for the media. Caption sources are not used for YouTube, Dailymotion or Vimeo sources. + * The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. */ - captionSources?: ICaptionSource[]; + style?: ContainerStyle; /** - * The URL of the poster image to display. + * Controls if a border should be displayed around the container. */ - poster?: string; + showBorder?: boolean; /** - * The alternate text for the media, used for accessibility purposes. + * Controls if the container should have rounded corners. */ - altText?: string; + roundedCorners?: boolean; + /** + * Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. + */ + bleed?: boolean; + /** + * The minimum height, in pixels, of the container, in the `px` format. + */ + minHeight?: string; + /** + * The minimum width of the column set. `auto` will automatically adjust the column set's minimum width according to its content and using the `px` format will give the column set an explicit minimum width in pixels. A scrollbar will be displayed if the available width is less than the specified minimum width. + */ + minWidth?: 'auto' | string; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -6406,32 +3999,40 @@ export interface IMedia { * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. */ fallback?: FallbackElement; + /** + * The columns in the set. + */ + columns?: ColumnArray; } /** * @hidden * @internal * - * Type guard to check if a value is of type IMedia. + * Type guard to check if a value is of type IColumnSet. * * @param value The value to check. - * @returns True if the value is an instance of Media, false otherwise. + * @returns True if the value is an instance of ColumnSet, false otherwise. */ -export function isMedia(value: unknown): value is IMedia { - const obj = value as IMedia; - return typeof obj === 'object' && obj.type === 'Media'; +export function isColumnSet(value: unknown): value is IColumnSet { + const obj = value as IColumnSet; + return typeof obj === 'object' && obj.type === 'ColumnSet'; } -export type MediaOptions = Omit; +export type ColumnSetOptions = Partial>; /** - * A media element, that makes it possible to embed videos inside a card. + * Splits the available horizontal space into separate columns, so elements can be organized in a row. */ -export class Media implements IMedia { +export class ColumnSet implements IColumnSet { /** - * Must be **Media**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type = 'Media'; + key?: string; + /** + * Must be **ColumnSet**. + */ + readonly type = 'ColumnSet'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -6439,7 +4040,7 @@ export class Media implements IMedia { /** * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - requires?: IHostCapabilities; + requires?: IHostCapabilities = {}; /** * The locale associated with the element. */ @@ -6447,19 +4048,23 @@ export class Media implements IMedia { /** * Controls the visibility of the element. */ - isVisible?: boolean; + isVisible?: boolean = true; /** * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. */ - separator?: boolean; + separator?: boolean = false; /** * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. */ - height?: ElementHeight; + height?: ElementHeight = 'auto'; + /** + * Controls how the element should be horizontally aligned. + */ + horizontalAlignment?: HorizontalAlignment; /** * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ - spacing?: Spacing; + spacing?: Spacing = 'Default'; /** * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). */ @@ -6467,23 +4072,35 @@ export class Media implements IMedia { /** * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. */ - isSortKey?: boolean; + isSortKey?: boolean = false; /** - * The sources for the media. For YouTube, Dailymotion and Vimeo, only one source can be specified. + * An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. */ - sources?: IMediaSource[]; + selectAction?: IExecuteAction | IInsertImageAction | IOpenUrlAction | IOpenUrlDialogAction | IPopoverAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction; /** - * The caption sources for the media. Caption sources are not used for YouTube, Dailymotion or Vimeo sources. + * The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. */ - captionSources?: ICaptionSource[]; + style?: ContainerStyle; /** - * The URL of the poster image to display. + * Controls if a border should be displayed around the container. */ - poster?: string; + showBorder?: boolean = false; /** - * The alternate text for the media, used for accessibility purposes. + * Controls if the container should have rounded corners. */ - altText?: string; + roundedCorners?: boolean = false; + /** + * Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. + */ + bleed?: boolean = false; + /** + * The minimum height, in pixels, of the container, in the `px` format. + */ + minHeight?: string; + /** + * The minimum width of the column set. `auto` will automatically adjust the column set's minimum width according to its content and using the `px` format will give the column set an explicit minimum width in pixels. A scrollbar will be displayed if the available width is less than the specified minimum width. + */ + minWidth?: 'auto' | string; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -6492,13 +4109,22 @@ export class Media implements IMedia { * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. */ fallback?: FallbackElement; + /** + * The columns in the set. + */ + columns?: ColumnArray; - constructor(options: MediaOptions = {}) { + constructor(options: ColumnSetOptions = {}) { Object.assign(this, options); } - static from(options: Omit): Media { - return new Media(options); + static from(options: Omit): ColumnSet { + return new ColumnSet(options); + } + + withKey(key: string): this { + this.key = key; + return this; } withId(id: string): this { @@ -6531,6 +4157,11 @@ export class Media implements IMedia { return this; } + withHorizontalAlignment(horizontalAlignment: HorizontalAlignment): this { + this.horizontalAlignment = horizontalAlignment; + return this; + } + withSpacing(spacing: Spacing): this { this.spacing = spacing; return this; @@ -6546,23 +4177,38 @@ export class Media implements IMedia { return this; } - withSources(...sources: IMediaSource[]): this { - this.sources = sources; + withSelectAction(selectAction: IExecuteAction | IInsertImageAction | IOpenUrlAction | IOpenUrlDialogAction | IPopoverAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction): this { + this.selectAction = selectAction; return this; } - withCaptionSources(...captionSources: ICaptionSource[]): this { - this.captionSources = captionSources; + withStyle(style: ContainerStyle): this { + this.style = style; return this; } - withPoster(poster: string): this { - this.poster = poster; + withShowBorder(showBorder = true): this { + this.showBorder = showBorder; return this; } - withAltText(altText: string): this { - this.altText = altText; + withRoundedCorners(roundedCorners = true): this { + this.roundedCorners = roundedCorners; + return this; + } + + withBleed(bleed = true): this { + this.bleed = bleed; + return this; + } + + withMinHeight(minHeight: string): this { + this.minHeight = minHeight; + return this; + } + + withMinWidth(minWidth: 'auto' | string): this { + this.minWidth = minWidth; return this; } @@ -6570,131 +4216,31 @@ export class Media implements IMedia { this.fallback = fallback; return this; } + + withColumns(...columns: ColumnArray): this { + this.columns = columns; + return this; + } } /** - * Defines the source URL of a media stream. YouTube, Dailymotion, Vimeo and Microsoft Stream URLs are supported. + * A media element, that makes it possible to embed videos inside a card. */ -export interface IMediaSource { +export interface IMedia { /** - * The MIME type of the source. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - mimeType?: string; + key?: string; /** - * The URL of the source. + * Must be **Media**. */ - url?: string; -} - -export type MediaSourceOptions = IMediaSource; - -/** - * Defines the source URL of a media stream. YouTube, Dailymotion, Vimeo and Microsoft Stream URLs are supported. - */ -export class MediaSource implements IMediaSource { + readonly type: 'Media'; /** - * The MIME type of the source. + * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ - mimeType?: string; + id?: string; /** - * The URL of the source. - */ - url?: string; - - constructor(options: MediaSourceOptions = {}) { - Object.assign(this, options); - } - - static from(options: IMediaSource): MediaSource { - return new MediaSource(options); - } - - withMimeType(mimeType: string): this { - this.mimeType = mimeType; - return this; - } - - withUrl(url: string): this { - this.url = url; - return this; - } -} - -/** - * Defines a source URL for a video captions. - */ -export interface ICaptionSource { - /** - * The MIME type of the source. - */ - mimeType?: string; - /** - * The URL of the source. - */ - url?: string; - /** - * The label of this caption source. - */ - label?: string; -} - -export type CaptionSourceOptions = ICaptionSource; - -/** - * Defines a source URL for a video captions. - */ -export class CaptionSource implements ICaptionSource { - /** - * The MIME type of the source. - */ - mimeType?: string; - /** - * The URL of the source. - */ - url?: string; - /** - * The label of this caption source. - */ - label?: string; - - constructor(options: CaptionSourceOptions = {}) { - Object.assign(this, options); - } - - static from(options: ICaptionSource): CaptionSource { - return new CaptionSource(options); - } - - withMimeType(mimeType: string): this { - this.mimeType = mimeType; - return this; - } - - withUrl(url: string): this { - this.url = url; - return this; - } - - withLabel(label: string): this { - this.label = label; - return this; - } -} - -/** - * A rich text block that displays formatted text. - */ -export interface IRichTextBlock { - /** - * Must be **RichTextBlock**. - */ - readonly type: 'RichTextBlock'; - /** - * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - */ - id?: string; - /** - * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ requires?: IHostCapabilities; /** @@ -6713,10 +4259,6 @@ export interface IRichTextBlock { * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. */ height?: ElementHeight; - /** - * Controls how the element should be horizontally aligned. - */ - horizontalAlignment?: HorizontalAlignment; /** * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ @@ -6729,6 +4271,22 @@ export interface IRichTextBlock { * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. */ isSortKey?: boolean; + /** + * The sources for the media. For YouTube, Dailymotion and Vimeo, only one source can be specified. + */ + sources?: IMediaSource[]; + /** + * The caption sources for the media. Caption sources are not used for YouTube, Dailymotion or Vimeo sources. + */ + captionSources?: ICaptionSource[]; + /** + * The URL of the poster image to display. + */ + poster?: string; + /** + * The alternate text for the media, used for accessibility purposes. + */ + altText?: string; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -6737,36 +4295,36 @@ export interface IRichTextBlock { * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. */ fallback?: FallbackElement; - /** - * The inlines making up the rich text block. - */ - inlines?: RichTextBlockInlineArray; } /** * @hidden * @internal * - * Type guard to check if a value is of type IRichTextBlock. + * Type guard to check if a value is of type IMedia. * * @param value The value to check. - * @returns True if the value is an instance of RichTextBlock, false otherwise. + * @returns True if the value is an instance of Media, false otherwise. */ -export function isRichTextBlock(value: unknown): value is IRichTextBlock { - const obj = value as IRichTextBlock; - return typeof obj === 'object' && obj.type === 'RichTextBlock'; +export function isMedia(value: unknown): value is IMedia { + const obj = value as IMedia; + return typeof obj === 'object' && obj.type === 'Media'; } -export type RichTextBlockOptions = Omit; +export type MediaOptions = Partial>; /** - * A rich text block that displays formatted text. + * A media element, that makes it possible to embed videos inside a card. */ -export class RichTextBlock implements IRichTextBlock { +export class Media implements IMedia { /** - * Must be **RichTextBlock**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type = 'RichTextBlock'; + key?: string; + /** + * Must be **Media**. + */ + readonly type = 'Media'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -6774,7 +4332,7 @@ export class RichTextBlock implements IRichTextBlock { /** * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - requires?: IHostCapabilities; + requires?: IHostCapabilities = {}; /** * The locale associated with the element. */ @@ -6782,23 +4340,19 @@ export class RichTextBlock implements IRichTextBlock { /** * Controls the visibility of the element. */ - isVisible?: boolean; + isVisible?: boolean = true; /** * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. */ - separator?: boolean; + separator?: boolean = false; /** * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. */ - height?: ElementHeight; - /** - * Controls how the element should be horizontally aligned. - */ - horizontalAlignment?: HorizontalAlignment; + height?: ElementHeight = 'auto'; /** * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ - spacing?: Spacing; + spacing?: Spacing = 'Default'; /** * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). */ @@ -6806,7 +4360,23 @@ export class RichTextBlock implements IRichTextBlock { /** * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. */ - isSortKey?: boolean; + isSortKey?: boolean = false; + /** + * The sources for the media. For YouTube, Dailymotion and Vimeo, only one source can be specified. + */ + sources?: IMediaSource[]; + /** + * The caption sources for the media. Caption sources are not used for YouTube, Dailymotion or Vimeo sources. + */ + captionSources?: ICaptionSource[]; + /** + * The URL of the poster image to display. + */ + poster?: string; + /** + * The alternate text for the media, used for accessibility purposes. + */ + altText?: string; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -6815,17 +4385,18 @@ export class RichTextBlock implements IRichTextBlock { * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. */ fallback?: FallbackElement; - /** - * The inlines making up the rich text block. - */ - inlines?: RichTextBlockInlineArray; - constructor(options: RichTextBlockOptions = {}) { + constructor(options: MediaOptions = {}) { Object.assign(this, options); } - static from(options: Omit): RichTextBlock { - return new RichTextBlock(options); + static from(options: Omit): Media { + return new Media(options); + } + + withKey(key: string): this { + this.key = key; + return this; } withId(id: string): this { @@ -6858,11 +4429,6 @@ export class RichTextBlock implements IRichTextBlock { return this; } - withHorizontalAlignment(horizontalAlignment: HorizontalAlignment): this { - this.horizontalAlignment = horizontalAlignment; - return this; - } - withSpacing(spacing: Spacing): this { this.spacing = spacing; return this; @@ -6878,139 +4444,181 @@ export class RichTextBlock implements IRichTextBlock { return this; } - withFallback(fallback: FallbackElement): this { - this.fallback = fallback; + withSources(...sources: IMediaSource[]): this { + this.sources = sources; return this; } - withInlines(...inlines: RichTextBlockInlineArray): this { - this.inlines = inlines; + withCaptionSources(...captionSources: ICaptionSource[]): this { + this.captionSources = captionSources; + return this; + } + + withPoster(poster: string): this { + this.poster = poster; + return this; + } + + withAltText(altText: string): this { + this.altText = altText; + return this; + } + + withFallback(fallback: FallbackElement): this { + this.fallback = fallback; return this; } } /** - * Use tables to display data in a tabular way, with rows, columns and cells. + * Defines the source URL of a media stream. YouTube, Dailymotion, Vimeo and Microsoft Stream URLs are supported. */ -export interface ITable { - /** - * Must be **Table**. - */ - readonly type: 'Table'; - /** - * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - */ - id?: string; - /** - * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - */ - requires?: IHostCapabilities; - /** - * The locale associated with the element. - */ - lang?: string; - /** - * Controls the visibility of the element. - */ - isVisible?: boolean; - /** - * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - */ - separator?: boolean; +export interface IMediaSource { /** - * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - height?: ElementHeight; + key?: string; /** - * Controls how the element should be horizontally aligned. + * The MIME type of the source. */ - horizontalAlignment?: HorizontalAlignment; + mimeType?: string; /** - * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + * The URL of the source. */ - spacing?: Spacing; + url?: string; +} + + +export type MediaSourceOptions = Partial; + +/** + * Defines the source URL of a media stream. YouTube, Dailymotion, Vimeo and Microsoft Stream URLs are supported. + */ +export class MediaSource implements IMediaSource { /** - * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - targetWidth?: TargetWidth; + key?: string; /** - * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + * The MIME type of the source. */ - isSortKey?: boolean; + mimeType?: string; /** - * The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. + * The URL of the source. */ - style?: ContainerStyle; - /** - * Controls if a border should be displayed around the container. - */ - showBorder?: boolean; - /** - * Controls if the container should have rounded corners. - */ - roundedCorners?: boolean; - /** - * The columns in the table. - */ - columns?: IColumnDefinition[]; + url?: string; + + constructor(options: MediaSourceOptions = {}) { + Object.assign(this, options); + } + + static from(options: IMediaSource): MediaSource { + return new MediaSource(options); + } + + withKey(key: string): this { + this.key = key; + return this; + } + + withMimeType(mimeType: string): this { + this.mimeType = mimeType; + return this; + } + + withUrl(url: string): this { + this.url = url; + return this; + } +} + +/** + * Defines a source URL for a video captions. + */ +export interface ICaptionSource { /** - * Controls whether the first row of the table should be treated as a header. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - firstRowAsHeaders?: boolean; + key?: string; /** - * Controls if grid lines should be displayed. + * The MIME type of the source. */ - showGridLines?: boolean; + mimeType?: string; /** - * The style of the grid lines between cells. + * The URL of the source. */ - gridStyle?: ContainerStyle; + url?: string; /** - * Controls how the content of every cell in the table should be horizontally aligned by default. + * The label of this caption source. */ - horizontalCellContentAlignment?: HorizontalAlignment; + label?: string; +} + + +export type CaptionSourceOptions = Partial; + +/** + * Defines a source URL for a video captions. + */ +export class CaptionSource implements ICaptionSource { /** - * Controls how the content of every cell in the table should be vertically aligned by default. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - verticalCellContentAlignment?: VerticalAlignment; + key?: string; /** - * The area of a Layout.AreaGrid layout in which an element should be displayed. + * The MIME type of the source. */ - 'grid.area'?: string; + mimeType?: string; /** - * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + * The URL of the source. */ - fallback?: FallbackElement; + url?: string; /** - * The rows of the table. + * The label of this caption source. */ - rows?: TableRowArray; -} + label?: string; -/** - * @hidden - * @internal - * - * Type guard to check if a value is of type ITable. - * - * @param value The value to check. - * @returns True if the value is an instance of Table, false otherwise. - */ -export function isTable(value: unknown): value is ITable { - const obj = value as ITable; - return typeof obj === 'object' && obj.type === 'Table'; -} + constructor(options: CaptionSourceOptions = {}) { + Object.assign(this, options); + } + + static from(options: ICaptionSource): CaptionSource { + return new CaptionSource(options); + } + + withKey(key: string): this { + this.key = key; + return this; + } + + withMimeType(mimeType: string): this { + this.mimeType = mimeType; + return this; + } + + withUrl(url: string): this { + this.url = url; + return this; + } -export type TableOptions = Omit; + withLabel(label: string): this { + this.label = label; + return this; + } +} /** - * Use tables to display data in a tabular way, with rows, columns and cells. + * A rich text block that displays formatted text. */ -export class Table implements ITable { +export interface IRichTextBlock { /** - * Must be **Table**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type = 'Table'; + key?: string; + /** + * Must be **RichTextBlock**. + */ + readonly type: 'RichTextBlock'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -7052,41 +4660,95 @@ export class Table implements ITable { */ isSortKey?: boolean; /** - * The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. + * The Id of the input the RichTextBlock should act as the label of. */ - style?: ContainerStyle; + labelFor?: string; /** - * Controls if a border should be displayed around the container. + * The area of a Layout.AreaGrid layout in which an element should be displayed. */ - showBorder?: boolean; + 'grid.area'?: string; /** - * Controls if the container should have rounded corners. + * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. */ - roundedCorners?: boolean; + fallback?: FallbackElement; /** - * The columns in the table. + * The inlines making up the rich text block. */ - columns?: IColumnDefinition[]; + inlines?: RichTextBlockInlineArray; +} + +/** + * @hidden + * @internal + * + * Type guard to check if a value is of type IRichTextBlock. + * + * @param value The value to check. + * @returns True if the value is an instance of RichTextBlock, false otherwise. + */ +export function isRichTextBlock(value: unknown): value is IRichTextBlock { + const obj = value as IRichTextBlock; + return typeof obj === 'object' && obj.type === 'RichTextBlock'; +} + +export type RichTextBlockOptions = Partial>; + +/** + * A rich text block that displays formatted text. + */ +export class RichTextBlock implements IRichTextBlock { /** - * Controls whether the first row of the table should be treated as a header. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - firstRowAsHeaders?: boolean; + key?: string; /** - * Controls if grid lines should be displayed. + * Must be **RichTextBlock**. */ - showGridLines?: boolean; + readonly type = 'RichTextBlock'; /** - * The style of the grid lines between cells. + * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ - gridStyle?: ContainerStyle; + id?: string; /** - * Controls how the content of every cell in the table should be horizontally aligned by default. + * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - horizontalCellContentAlignment?: HorizontalAlignment; + requires?: IHostCapabilities = {}; /** - * Controls how the content of every cell in the table should be vertically aligned by default. + * The locale associated with the element. */ - verticalCellContentAlignment?: VerticalAlignment; + lang?: string; + /** + * Controls the visibility of the element. + */ + isVisible?: boolean = true; + /** + * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + */ + separator?: boolean = false; + /** + * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + */ + height?: ElementHeight = 'auto'; + /** + * Controls how the element should be horizontally aligned. + */ + horizontalAlignment?: HorizontalAlignment; + /** + * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + */ + spacing?: Spacing = 'Default'; + /** + * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + */ + targetWidth?: TargetWidth; + /** + * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + */ + isSortKey?: boolean = false; + /** + * The Id of the input the RichTextBlock should act as the label of. + */ + labelFor?: string; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -7096,16 +4758,21 @@ export class Table implements ITable { */ fallback?: FallbackElement; /** - * The rows of the table. + * The inlines making up the rich text block. */ - rows?: TableRowArray; + inlines?: RichTextBlockInlineArray; - constructor(options: TableOptions = {}) { + constructor(options: RichTextBlockOptions = {}) { Object.assign(this, options); } - static from(options: Omit): Table { - return new Table(options); + static from(options: Omit): RichTextBlock { + return new RichTextBlock(options); + } + + withKey(key: string): this { + this.key = key; + return this; } withId(id: string): this { @@ -7158,131 +4825,34 @@ export class Table implements ITable { return this; } - withStyle(style: ContainerStyle): this { - this.style = style; - return this; - } - - withShowBorder(showBorder = true): this { - this.showBorder = showBorder; - return this; - } - - withRoundedCorners(roundedCorners = true): this { - this.roundedCorners = roundedCorners; - return this; - } - - withColumns(...columns: IColumnDefinition[]): this { - this.columns = columns; - return this; - } - - withFirstRowAsHeaders(firstRowAsHeaders = false): this { - this.firstRowAsHeaders = firstRowAsHeaders; - return this; - } - - withShowGridLines(showGridLines = false): this { - this.showGridLines = showGridLines; - return this; - } - - withGridStyle(gridStyle: ContainerStyle): this { - this.gridStyle = gridStyle; + withLabelFor(labelFor: string): this { + this.labelFor = labelFor; return this; } - withHorizontalCellContentAlignment(horizontalCellContentAlignment: HorizontalAlignment): this { - this.horizontalCellContentAlignment = horizontalCellContentAlignment; + withFallback(fallback: FallbackElement): this { + this.fallback = fallback; return this; } - withVerticalCellContentAlignment(verticalCellContentAlignment: VerticalAlignment): this { - this.verticalCellContentAlignment = verticalCellContentAlignment; + withInlines(...inlines: RichTextBlockInlineArray): this { + this.inlines = inlines; return this; } - - withFallback(fallback: FallbackElement): this { - this.fallback = fallback; - return this; - } - - withRows(...rows: TableRowArray): this { - this.rows = rows; - return this; - } -} - -/** - * Defines a column in a Table element. - */ -export interface IColumnDefinition { - /** - * Controls how the content of every cell in the table should be horizontally aligned by default. This property overrides the horizontalCellContentAlignment property of the table. - */ - horizontalCellContentAlignment?: HorizontalAlignment; - /** - * Controls how the content of every cell in the column should be vertically aligned by default. This property overrides the verticalCellContentAlignment property of the table. - */ - verticalCellContentAlignment?: VerticalAlignment; - /** - * The width of the column in the table, expressed as either a percentage of the available width or in pixels, using the `px` format. - */ - width?: string | number; -} - -export type ColumnDefinitionOptions = IColumnDefinition; +} /** - * Defines a column in a Table element. + * Use tables to display data in a tabular way, with rows, columns and cells. */ -export class ColumnDefinition implements IColumnDefinition { - /** - * Controls how the content of every cell in the table should be horizontally aligned by default. This property overrides the horizontalCellContentAlignment property of the table. - */ - horizontalCellContentAlignment?: HorizontalAlignment; - /** - * Controls how the content of every cell in the column should be vertically aligned by default. This property overrides the verticalCellContentAlignment property of the table. - */ - verticalCellContentAlignment?: VerticalAlignment; +export interface ITable { /** - * The width of the column in the table, expressed as either a percentage of the available width or in pixels, using the `px` format. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - width?: string | number; - - constructor(options: ColumnDefinitionOptions = {}) { - Object.assign(this, options); - } - - static from(options: IColumnDefinition): ColumnDefinition { - return new ColumnDefinition(options); - } - - withHorizontalCellContentAlignment(horizontalCellContentAlignment: HorizontalAlignment): this { - this.horizontalCellContentAlignment = horizontalCellContentAlignment; - return this; - } - - withVerticalCellContentAlignment(verticalCellContentAlignment: VerticalAlignment): this { - this.verticalCellContentAlignment = verticalCellContentAlignment; - return this; - } - - withWidth(width: string | number): this { - this.width = width; - return this; - } -} - -/** - * A block of text, optionally formatted using Markdown. - */ -export interface ITextBlock { + key?: string; /** - * Must be **TextBlock**. + * Must be **Table**. */ - readonly type: 'TextBlock'; + readonly type: 'Table'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -7324,41 +4894,45 @@ export interface ITextBlock { */ isSortKey?: boolean; /** - * The text to display. A subset of markdown is supported. + * The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. */ - text: string; + style?: ContainerStyle; /** - * The size of the text. + * Controls if a border should be displayed around the container. */ - size?: TextSize; + showBorder?: boolean; /** - * The weight of the text. + * Controls if the container should have rounded corners. */ - weight?: TextWeight; + roundedCorners?: boolean; /** - * The color of the text. + * The columns in the table. */ - color?: TextColor; + columns?: IColumnDefinition[]; /** - * Controls whether the text should be renderer using a subtler variant of the select color. + * The minimum width of the table in pixels. `auto` will automatically adjust the table's minimum width according to its content and using the `px` format will give the table an explicit minimum width in pixels. A scrollbar will be displayed if the available width is less than the specified minimum width. */ - isSubtle?: boolean; + minWidth?: 'auto' | string; /** - * The type of font to use for rendering. + * Controls whether the first row of the table should be treated as a header. */ - fontType?: FontType; + firstRowAsHeaders?: boolean; /** - * Controls if the text should wrap. + * Controls if grid lines should be displayed. */ - wrap?: boolean; + showGridLines?: boolean; /** - * The maximum number of lines to display. + * The style of the grid lines between cells. */ - maxLines?: number; + gridStyle?: ContainerStyle; /** - * The style of the text. + * Controls how the content of every cell in the table should be horizontally aligned by default. */ - style?: 'default' | 'columnHeader' | 'heading'; + horizontalCellContentAlignment?: HorizontalAlignment; + /** + * Controls how the content of every cell in the table should be vertically aligned by default. + */ + verticalCellContentAlignment?: VerticalAlignment; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -7367,32 +4941,40 @@ export interface ITextBlock { * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. */ fallback?: FallbackElement; + /** + * The rows of the table. + */ + rows?: TableRowArray; } /** * @hidden * @internal * - * Type guard to check if a value is of type ITextBlock. + * Type guard to check if a value is of type ITable. * * @param value The value to check. - * @returns True if the value is an instance of TextBlock, false otherwise. + * @returns True if the value is an instance of Table, false otherwise. */ -export function isTextBlock(value: unknown): value is ITextBlock { - const obj = value as ITextBlock; - return typeof obj === 'object' && obj.type === 'TextBlock'; +export function isTable(value: unknown): value is ITable { + const obj = value as ITable; + return typeof obj === 'object' && obj.type === 'Table'; } -export type TextBlockOptions = Omit; +export type TableOptions = Partial>; /** - * A block of text, optionally formatted using Markdown. + * Use tables to display data in a tabular way, with rows, columns and cells. */ -export class TextBlock implements ITextBlock { +export class Table implements ITable { /** - * Must be **TextBlock**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type = 'TextBlock'; + key?: string; + /** + * Must be **Table**. + */ + readonly type = 'Table'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -7400,7 +4982,7 @@ export class TextBlock implements ITextBlock { /** * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - requires?: IHostCapabilities; + requires?: IHostCapabilities = {}; /** * The locale associated with the element. */ @@ -7408,15 +4990,15 @@ export class TextBlock implements ITextBlock { /** * Controls the visibility of the element. */ - isVisible?: boolean; + isVisible?: boolean = true; /** * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. */ - separator?: boolean; + separator?: boolean = false; /** * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. */ - height?: ElementHeight; + height?: ElementHeight = 'auto'; /** * Controls how the element should be horizontally aligned. */ @@ -7424,7 +5006,7 @@ export class TextBlock implements ITextBlock { /** * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ - spacing?: Spacing; + spacing?: Spacing = 'Default'; /** * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). */ @@ -7432,43 +5014,47 @@ export class TextBlock implements ITextBlock { /** * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. */ - isSortKey?: boolean; + isSortKey?: boolean = false; /** - * The text to display. A subset of markdown is supported. + * The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. */ - text: string; + style?: ContainerStyle; /** - * The size of the text. + * Controls if a border should be displayed around the container. */ - size?: TextSize; + showBorder?: boolean = false; /** - * The weight of the text. + * Controls if the container should have rounded corners. */ - weight?: TextWeight; + roundedCorners?: boolean = false; /** - * The color of the text. + * The columns in the table. */ - color?: TextColor; + columns?: IColumnDefinition[]; /** - * Controls whether the text should be renderer using a subtler variant of the select color. + * The minimum width of the table in pixels. `auto` will automatically adjust the table's minimum width according to its content and using the `px` format will give the table an explicit minimum width in pixels. A scrollbar will be displayed if the available width is less than the specified minimum width. */ - isSubtle?: boolean; + minWidth?: 'auto' | string; /** - * The type of font to use for rendering. + * Controls whether the first row of the table should be treated as a header. */ - fontType?: FontType; + firstRowAsHeaders?: boolean = true; /** - * Controls if the text should wrap. + * Controls if grid lines should be displayed. */ - wrap?: boolean; + showGridLines?: boolean = true; /** - * The maximum number of lines to display. + * The style of the grid lines between cells. */ - maxLines?: number; + gridStyle?: ContainerStyle; /** - * The style of the text. + * Controls how the content of every cell in the table should be horizontally aligned by default. + */ + horizontalCellContentAlignment?: HorizontalAlignment; + /** + * Controls how the content of every cell in the table should be vertically aligned by default. */ - style?: 'default' | 'columnHeader' | 'heading'; + verticalCellContentAlignment?: VerticalAlignment; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -7477,14 +5063,22 @@ export class TextBlock implements ITextBlock { * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. */ fallback?: FallbackElement; + /** + * The rows of the table. + */ + rows?: TableRowArray; - constructor(text: string, options: TextBlockOptions = {}) { + constructor(options: TableOptions = {}) { Object.assign(this, options); - this.text = text; } - static from(options: Omit): TextBlock { - return new TextBlock(options.text, options); + static from(options: Omit): Table { + return new Table(options); + } + + withKey(key: string): this { + this.key = key; + return this; } withId(id: string): this { @@ -7537,48 +5131,53 @@ export class TextBlock implements ITextBlock { return this; } - withText(text: string): this { - this.text = text; + withStyle(style: ContainerStyle): this { + this.style = style; return this; } - withSize(size: TextSize): this { - this.size = size; + withShowBorder(showBorder = true): this { + this.showBorder = showBorder; return this; } - withWeight(weight: TextWeight): this { - this.weight = weight; + withRoundedCorners(roundedCorners = true): this { + this.roundedCorners = roundedCorners; return this; } - withColor(color: TextColor): this { - this.color = color; + withColumns(...columns: IColumnDefinition[]): this { + this.columns = columns; return this; } - withIsSubtle(isSubtle: boolean): this { - this.isSubtle = isSubtle; + withMinWidth(minWidth: 'auto' | string): this { + this.minWidth = minWidth; return this; } - withFontType(fontType: FontType): this { - this.fontType = fontType; + withFirstRowAsHeaders(firstRowAsHeaders = false): this { + this.firstRowAsHeaders = firstRowAsHeaders; return this; } - withWrap(wrap = true): this { - this.wrap = wrap; + withShowGridLines(showGridLines = false): this { + this.showGridLines = showGridLines; return this; } - withMaxLines(maxLines: number): this { - this.maxLines = maxLines; + withGridStyle(gridStyle: ContainerStyle): this { + this.gridStyle = gridStyle; return this; } - withStyle(style: 'default' | 'columnHeader' | 'heading'): this { - this.style = style; + withHorizontalCellContentAlignment(horizontalCellContentAlignment: HorizontalAlignment): this { + this.horizontalCellContentAlignment = horizontalCellContentAlignment; + return this; + } + + withVerticalCellContentAlignment(verticalCellContentAlignment: VerticalAlignment): this { + this.verticalCellContentAlignment = verticalCellContentAlignment; return this; } @@ -7586,40 +5185,128 @@ export class TextBlock implements ITextBlock { this.fallback = fallback; return this; } + + withRows(...rows: TableRowArray): this { + this.rows = rows; + return this; + } } /** - * A set of facts, displayed as a table or a vertical list when horizontal space is constrained. + * Defines a column in a Table element. */ -export interface IFactSet { +export interface IColumnDefinition { /** - * Must be **FactSet**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type: 'FactSet'; + key?: string; /** - * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + * Controls how the content of every cell in the table should be horizontally aligned by default. This property overrides the horizontalCellContentAlignment property of the table. */ - id?: string; + horizontalCellContentAlignment?: HorizontalAlignment; /** - * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + * Controls how the content of every cell in the column should be vertically aligned by default. This property overrides the verticalCellContentAlignment property of the table. */ - requires?: IHostCapabilities; + verticalCellContentAlignment?: VerticalAlignment; /** - * The locale associated with the element. + * The width of the column in the table. If expressed as a number, represents the relative weight of the column in the table. If expressed as a string, `auto` will automatically adjust the column's width according to its content and using the `px` format will give the column an explicit width in pixels. */ - lang?: string; + width?: 'auto' | string | number; +} + + +export type ColumnDefinitionOptions = Partial; + +/** + * Defines a column in a Table element. + */ +export class ColumnDefinition implements IColumnDefinition { /** - * Controls the visibility of the element. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - isVisible?: boolean; + key?: string; /** - * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + * Controls how the content of every cell in the table should be horizontally aligned by default. This property overrides the horizontalCellContentAlignment property of the table. + */ + horizontalCellContentAlignment?: HorizontalAlignment; + /** + * Controls how the content of every cell in the column should be vertically aligned by default. This property overrides the verticalCellContentAlignment property of the table. + */ + verticalCellContentAlignment?: VerticalAlignment; + /** + * The width of the column in the table. If expressed as a number, represents the relative weight of the column in the table. If expressed as a string, `auto` will automatically adjust the column's width according to its content and using the `px` format will give the column an explicit width in pixels. + */ + width?: 'auto' | string | number; + + constructor(options: ColumnDefinitionOptions = {}) { + Object.assign(this, options); + } + + static from(options: IColumnDefinition): ColumnDefinition { + return new ColumnDefinition(options); + } + + withKey(key: string): this { + this.key = key; + return this; + } + + withHorizontalCellContentAlignment(horizontalCellContentAlignment: HorizontalAlignment): this { + this.horizontalCellContentAlignment = horizontalCellContentAlignment; + return this; + } + + withVerticalCellContentAlignment(verticalCellContentAlignment: VerticalAlignment): this { + this.verticalCellContentAlignment = verticalCellContentAlignment; + return this; + } + + withWidth(width: 'auto' | string | number): this { + this.width = width; + return this; + } +} + +/** + * A block of text, optionally formatted using Markdown. + */ +export interface ITextBlock { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * Must be **TextBlock**. + */ + readonly type: 'TextBlock'; + /** + * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + */ + id?: string; + /** + * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + */ + requires?: IHostCapabilities; + /** + * The locale associated with the element. + */ + lang?: string; + /** + * Controls the visibility of the element. + */ + isVisible?: boolean; + /** + * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. */ separator?: boolean; /** * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. */ height?: ElementHeight; + /** + * Controls how the element should be horizontally aligned. + */ + horizontalAlignment?: HorizontalAlignment; /** * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ @@ -7633,9 +5320,45 @@ export interface IFactSet { */ isSortKey?: boolean; /** - * The facts in the set. + * The text to display. A subset of markdown is supported. */ - facts: IFact[]; + text: string; + /** + * The size of the text. + */ + size?: TextSize; + /** + * The weight of the text. + */ + weight?: TextWeight; + /** + * The color of the text. + */ + color?: TextColor; + /** + * Controls whether the text should be renderer using a subtler variant of the select color. + */ + isSubtle?: boolean; + /** + * The type of font to use for rendering. + */ + fontType?: FontType; + /** + * Controls if the text should wrap. + */ + wrap?: boolean; + /** + * The maximum number of lines to display. + */ + maxLines?: number; + /** + * The style of the text. + */ + style?: TextBlockStyle; + /** + * The Id of the input the TextBlock should act as the label of. + */ + labelFor?: string; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -7650,26 +5373,30 @@ export interface IFactSet { * @hidden * @internal * - * Type guard to check if a value is of type IFactSet. + * Type guard to check if a value is of type ITextBlock. * * @param value The value to check. - * @returns True if the value is an instance of FactSet, false otherwise. + * @returns True if the value is an instance of TextBlock, false otherwise. */ -export function isFactSet(value: unknown): value is IFactSet { - const obj = value as IFactSet; - return typeof obj === 'object' && obj.type === 'FactSet'; +export function isTextBlock(value: unknown): value is ITextBlock { + const obj = value as ITextBlock; + return typeof obj === 'object' && obj.type === 'TextBlock'; } -export type FactSetOptions = Omit; +export type TextBlockOptions = Partial>; /** - * A set of facts, displayed as a table or a vertical list when horizontal space is constrained. + * A block of text, optionally formatted using Markdown. */ -export class FactSet implements IFactSet { +export class TextBlock implements ITextBlock { /** - * Must be **FactSet**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type = 'FactSet'; + key?: string; + /** + * Must be **TextBlock**. + */ + readonly type = 'TextBlock'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -7677,7 +5404,7 @@ export class FactSet implements IFactSet { /** * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - requires?: IHostCapabilities; + requires?: IHostCapabilities = {}; /** * The locale associated with the element. */ @@ -7685,19 +5412,23 @@ export class FactSet implements IFactSet { /** * Controls the visibility of the element. */ - isVisible?: boolean; + isVisible?: boolean = true; /** * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. */ - separator?: boolean; + separator?: boolean = false; /** * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. */ - height?: ElementHeight; + height?: ElementHeight = 'auto'; + /** + * Controls how the element should be horizontally aligned. + */ + horizontalAlignment?: HorizontalAlignment; /** * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ - spacing?: Spacing; + spacing?: Spacing = 'Default'; /** * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). */ @@ -7705,11 +5436,47 @@ export class FactSet implements IFactSet { /** * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. */ - isSortKey?: boolean; + isSortKey?: boolean = false; /** - * The facts in the set. + * The text to display. A subset of markdown is supported. */ - facts: IFact[]; + text: string; + /** + * The size of the text. + */ + size?: TextSize; + /** + * The weight of the text. + */ + weight?: TextWeight; + /** + * The color of the text. + */ + color?: TextColor; + /** + * Controls whether the text should be renderer using a subtler variant of the select color. + */ + isSubtle?: boolean; + /** + * The type of font to use for rendering. + */ + fontType?: FontType; + /** + * Controls if the text should wrap. + */ + wrap?: boolean = false; + /** + * The maximum number of lines to display. + */ + maxLines?: number; + /** + * The style of the text. + */ + style?: TextBlockStyle; + /** + * The Id of the input the TextBlock should act as the label of. + */ + labelFor?: string; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -7719,12 +5486,17 @@ export class FactSet implements IFactSet { */ fallback?: FallbackElement; - constructor(...facts: IFact[]) { - this.facts = facts; + constructor(text: string, options: TextBlockOptions = {}) { + Object.assign(this, options); + this.text = text; } - withOptions(value: FactSetOptions): this { - Object.assign(this, value); + static from(options: Omit): TextBlock { + return new TextBlock(options.text, options); + } + + withKey(key: string): this { + this.key = key; return this; } @@ -7758,6 +5530,11 @@ export class FactSet implements IFactSet { return this; } + withHorizontalAlignment(horizontalAlignment: HorizontalAlignment): this { + this.horizontalAlignment = horizontalAlignment; + return this; + } + withSpacing(spacing: Spacing): this { this.spacing = spacing; return this; @@ -7773,74 +5550,74 @@ export class FactSet implements IFactSet { return this; } - withFacts(...facts: IFact[]): this { - this.facts = facts; + withText(text: string): this { + this.text = text; return this; } - withFallback(fallback: FallbackElement): this { - this.fallback = fallback; + withSize(size: TextSize): this { + this.size = size; return this; } -} -/** - * A fact in a FactSet element. - */ -export interface IFact { - /** - * The fact's title. - */ - title: string; - /** - * The fact's value. - */ - value: string; -} + withWeight(weight: TextWeight): this { + this.weight = weight; + return this; + } -export type FactOptions = IFact; + withColor(color: TextColor): this { + this.color = color; + return this; + } -/** - * A fact in a FactSet element. - */ -export class Fact implements IFact { - /** - * The fact's title. - */ - title: string; - /** - * The fact's value. - */ - value: string; + withIsSubtle(isSubtle: boolean): this { + this.isSubtle = isSubtle; + return this; + } - constructor(title: string, value: string) { - this.title = title; - this.value = value; + withFontType(fontType: FontType): this { + this.fontType = fontType; + return this; } - static from(options: IFact): Fact { - return new Fact(options.title, options.value); + withWrap(wrap = true): this { + this.wrap = wrap; + return this; } - withTitle(title: string): this { - this.title = title; + withMaxLines(maxLines: number): this { + this.maxLines = maxLines; return this; } - withValue(value: string): this { - this.value = value; + withStyle(style: TextBlockStyle): this { + this.style = style; return this; } -} -/** - * A set of images, displayed side-by-side and wrapped across multiple rows as needed. - */ -export interface IImageSet { - /** - * Must be **ImageSet**. + withLabelFor(labelFor: string): this { + this.labelFor = labelFor; + return this; + } + + withFallback(fallback: FallbackElement): this { + this.fallback = fallback; + return this; + } +} + +/** + * A set of facts, displayed as a table or a vertical list when horizontal space is constrained. + */ +export interface IFactSet { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type: 'ImageSet'; + key?: string; + /** + * Must be **FactSet**. + */ + readonly type: 'FactSet'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -7865,10 +5642,6 @@ export interface IImageSet { * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. */ height?: ElementHeight; - /** - * Controls how the element should be horizontally aligned. - */ - horizontalAlignment?: HorizontalAlignment; /** * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ @@ -7882,13 +5655,9 @@ export interface IImageSet { */ isSortKey?: boolean; /** - * The images in the set. - */ - images: IImage[]; - /** - * The size to use to render all images in the set. + * The facts in the set. */ - imageSize?: ImageSize; + facts: IFact[]; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -7903,26 +5672,30 @@ export interface IImageSet { * @hidden * @internal * - * Type guard to check if a value is of type IImageSet. + * Type guard to check if a value is of type IFactSet. * * @param value The value to check. - * @returns True if the value is an instance of ImageSet, false otherwise. + * @returns True if the value is an instance of FactSet, false otherwise. */ -export function isImageSet(value: unknown): value is IImageSet { - const obj = value as IImageSet; - return typeof obj === 'object' && obj.type === 'ImageSet'; +export function isFactSet(value: unknown): value is IFactSet { + const obj = value as IFactSet; + return typeof obj === 'object' && obj.type === 'FactSet'; } -export type ImageSetOptions = Omit; +export type FactSetOptions = Partial>; /** - * A set of images, displayed side-by-side and wrapped across multiple rows as needed. + * A set of facts, displayed as a table or a vertical list when horizontal space is constrained. */ -export class ImageSet implements IImageSet { +export class FactSet implements IFactSet { /** - * Must be **ImageSet**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type = 'ImageSet'; + key?: string; + /** + * Must be **FactSet**. + */ + readonly type = 'FactSet'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -7930,7 +5703,7 @@ export class ImageSet implements IImageSet { /** * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - requires?: IHostCapabilities; + requires?: IHostCapabilities = {}; /** * The locale associated with the element. */ @@ -7938,23 +5711,19 @@ export class ImageSet implements IImageSet { /** * Controls the visibility of the element. */ - isVisible?: boolean; + isVisible?: boolean = true; /** * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. */ - separator?: boolean; + separator?: boolean = false; /** * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. */ - height?: ElementHeight; - /** - * Controls how the element should be horizontally aligned. - */ - horizontalAlignment?: HorizontalAlignment; + height?: ElementHeight = 'auto'; /** * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ - spacing?: Spacing; + spacing?: Spacing = 'Default'; /** * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). */ @@ -7962,15 +5731,11 @@ export class ImageSet implements IImageSet { /** * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. */ - isSortKey?: boolean; - /** - * The images in the set. - */ - images: IImage[]; + isSortKey?: boolean = false; /** - * The size to use to render all images in the set. + * The facts in the set. */ - imageSize?: ImageSize; + facts: IFact[]; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -7980,15 +5745,20 @@ export class ImageSet implements IImageSet { */ fallback?: FallbackElement; - constructor(...images: IImage[]) { - this.images = images; + constructor(...facts: IFact[]) { + this.facts = facts; } - withOptions(value: ImageSetOptions): this { + withOptions(value: FactSetOptions): this { Object.assign(this, value); return this; } + withKey(key: string): this { + this.key = key; + return this; + } + withId(id: string): this { this.id = id; return this; @@ -8019,11 +5789,6 @@ export class ImageSet implements IImageSet { return this; } - withHorizontalAlignment(horizontalAlignment: HorizontalAlignment): this { - this.horizontalAlignment = horizontalAlignment; - return this; - } - withSpacing(spacing: Spacing): this { this.spacing = spacing; return this; @@ -8039,30 +5804,93 @@ export class ImageSet implements IImageSet { return this; } - withImages(...images: IImage[]): this { - this.images = images; + withFacts(...facts: IFact[]): this { + this.facts = facts; return this; } - withImageSize(imageSize: ImageSize): this { - this.imageSize = imageSize; + withFallback(fallback: FallbackElement): this { + this.fallback = fallback; return this; } +} - withFallback(fallback: FallbackElement): this { - this.fallback = fallback; +/** + * A fact in a FactSet element. + */ +export interface IFact { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * The fact's title. + */ + title: string; + /** + * The fact's value. + */ + value: string; +} + + +export type FactOptions = Partial; + +/** + * A fact in a FactSet element. + */ +export class Fact implements IFact { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * The fact's title. + */ + title: string; + /** + * The fact's value. + */ + value: string; + + constructor(title: string, value: string, options: FactOptions = {}) { + Object.assign(this, options); + this.title = title; + this.value = value; + } + + static from(options: IFact): Fact { + return new Fact(options.title, options.value, options); + } + + withKey(key: string): this { + this.key = key; + return this; + } + + withTitle(title: string): this { + this.title = title; + return this; + } + + withValue(value: string): this { + this.value = value; return this; } } /** - * A standalone image element. + * A set of images, displayed side-by-side and wrapped across multiple rows as needed. */ -export interface IImage { +export interface IImageSet { /** - * Must be **Image**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type: 'Image'; + key?: string; + /** + * Must be **ImageSet**. + */ + readonly type: 'ImageSet'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -8083,6 +5911,10 @@ export interface IImage { * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. */ separator?: boolean; + /** + * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + */ + height?: ElementHeight; /** * Controls how the element should be horizontally aligned. */ @@ -8100,50 +5932,13 @@ export interface IImage { */ isSortKey?: boolean; /** - * The URL (or Base64-encoded Data URI) of the image. Acceptable formats are PNG, JPEG, GIF and SVG. - */ - url: string; - /** - * The alternate text for the image, used for accessibility purposes. - */ - altText?: string; - /** - * The background color of the image. - */ - backgroundColor?: string; - /** - * The style of the image. - */ - style?: ImageStyle; - /** - * The size of the image. - */ - size?: Size; - /** - * The width of the image. - */ - width?: 'auto' | 'stretch' | string; - /** - * An Action that will be invoked when the image is tapped or clicked. Action.ShowCard is not supported. - */ - selectAction?: - | IExecuteAction - | IOpenUrlAction - | IResetInputsAction - | ISubmitAction - | IToggleVisibilityAction; - /** - * Controls if the image can be expanded to full screen. - */ - allowExpand?: boolean; - /** - * Teams-specific metadata associated with the image. + * The images in the set. */ - msTeams?: ITeamsImageProperties; + images: IImage[]; /** - * The height of the image. + * The size to use to render all images in the set. */ - height?: 'auto' | 'stretch' | string; + imageSize?: ImageSize; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -8158,26 +5953,30 @@ export interface IImage { * @hidden * @internal * - * Type guard to check if a value is of type IImage. + * Type guard to check if a value is of type IImageSet. * * @param value The value to check. - * @returns True if the value is an instance of Image, false otherwise. + * @returns True if the value is an instance of ImageSet, false otherwise. */ -export function isImage(value: unknown): value is IImage { - const obj = value as IImage; - return typeof obj === 'object' && obj.type === 'Image'; +export function isImageSet(value: unknown): value is IImageSet { + const obj = value as IImageSet; + return typeof obj === 'object' && obj.type === 'ImageSet'; } -export type ImageOptions = Omit; +export type ImageSetOptions = Partial>; /** - * A standalone image element. + * A set of images, displayed side-by-side and wrapped across multiple rows as needed. */ -export class Image implements IImage { +export class ImageSet implements IImageSet { /** - * Must be **Image**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type = 'Image'; + key?: string; + /** + * Must be **ImageSet**. + */ + readonly type = 'ImageSet'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -8185,7 +5984,7 @@ export class Image implements IImage { /** * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - requires?: IHostCapabilities; + requires?: IHostCapabilities = {}; /** * The locale associated with the element. */ @@ -8193,11 +5992,15 @@ export class Image implements IImage { /** * Controls the visibility of the element. */ - isVisible?: boolean; + isVisible?: boolean = true; /** * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. */ - separator?: boolean; + separator?: boolean = false; + /** + * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + */ + height?: ElementHeight = 'auto'; /** * Controls how the element should be horizontally aligned. */ @@ -8205,7 +6008,7 @@ export class Image implements IImage { /** * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ - spacing?: Spacing; + spacing?: Spacing = 'Default'; /** * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). */ @@ -8213,68 +6016,36 @@ export class Image implements IImage { /** * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. */ - isSortKey?: boolean; - /** - * The URL (or Base64-encoded Data URI) of the image. Acceptable formats are PNG, JPEG, GIF and SVG. - */ - url: string; - /** - * The alternate text for the image, used for accessibility purposes. - */ - altText?: string; - /** - * The background color of the image. - */ - backgroundColor?: string; - /** - * The style of the image. - */ - style?: ImageStyle; + isSortKey?: boolean = false; /** - * The size of the image. + * The images in the set. */ - size?: Size; + images: IImage[]; /** - * The width of the image. + * The size to use to render all images in the set. */ - width?: 'auto' | 'stretch' | string; + imageSize?: ImageSize = 'Medium'; /** - * An Action that will be invoked when the image is tapped or clicked. Action.ShowCard is not supported. + * The area of a Layout.AreaGrid layout in which an element should be displayed. */ - selectAction?: - | IExecuteAction - | IOpenUrlAction - | IResetInputsAction - | ISubmitAction - | IToggleVisibilityAction; + 'grid.area'?: string; /** - * Controls if the image can be expanded to full screen. - */ - allowExpand?: boolean; - /** - * Teams-specific metadata associated with the image. - */ - msTeams?: ITeamsImageProperties; - /** - * The height of the image. - */ - height?: 'auto' | 'stretch' | string; - /** - * The area of a Layout.AreaGrid layout in which an element should be displayed. - */ - 'grid.area'?: string; - /** - * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. */ fallback?: FallbackElement; - constructor(url: string, options: ImageOptions = {}) { - Object.assign(this, options); - this.url = url; + constructor(...images: IImage[]) { + this.images = images; } - static from(options: Omit): Image { - return new Image(options.url, options); + withOptions(value: ImageSetOptions): this { + Object.assign(this, value); + return this; + } + + withKey(key: string): this { + this.key = key; + return this; } withId(id: string): this { @@ -8302,6 +6073,11 @@ export class Image implements IImage { return this; } + withHeight(height: ElementHeight): this { + this.height = height; + return this; + } + withHorizontalAlignment(horizontalAlignment: HorizontalAlignment): this { this.horizontalAlignment = horizontalAlignment; return this; @@ -8322,60 +6098,13 @@ export class Image implements IImage { return this; } - withUrl(url: string): this { - this.url = url; - return this; - } - - withAltText(altText: string): this { - this.altText = altText; - return this; - } - - withBackgroundColor(backgroundColor: string): this { - this.backgroundColor = backgroundColor; - return this; - } - - withStyle(style: ImageStyle): this { - this.style = style; - return this; - } - - withSize(size: Size): this { - this.size = size; - return this; - } - - withWidth(width: 'auto' | 'stretch' | string): this { - this.width = width; - return this; - } - - withSelectAction( - selectAction: - | IExecuteAction - | IOpenUrlAction - | IResetInputsAction - | ISubmitAction - | IToggleVisibilityAction - ): this { - this.selectAction = selectAction; - return this; - } - - withAllowExpand(allowExpand = true): this { - this.allowExpand = allowExpand; - return this; - } - - withMsTeams(msTeams: ITeamsImageProperties): this { - this.msTeams = msTeams; + withImages(...images: IImage[]): this { + this.images = images; return this; } - withHeight(height: 'auto' | 'stretch' | string): this { - this.height = height; + withImageSize(imageSize: ImageSize): this { + this.imageSize = imageSize; return this; } @@ -8386,48 +6115,17 @@ export class Image implements IImage { } /** - * Represents a set of Teams-specific properties on an image. - */ -export interface ITeamsImageProperties { - /** - * Controls if the image is expandable in Teams. This property is equivalent to the Image.allowExpand property. - */ - allowExpand?: boolean; -} - -export type TeamsImagePropertiesOptions = ITeamsImageProperties; - -/** - * Represents a set of Teams-specific properties on an image. + * A standalone image element. */ -export class TeamsImageProperties implements ITeamsImageProperties { +export interface IImage { /** - * Controls if the image is expandable in Teams. This property is equivalent to the Image.allowExpand property. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - allowExpand?: boolean; - - constructor(options: TeamsImagePropertiesOptions = {}) { - Object.assign(this, options); - } - - static from(options: ITeamsImageProperties): TeamsImageProperties { - return new TeamsImageProperties(options); - } - - withAllowExpand(allowExpand: boolean): this { - this.allowExpand = allowExpand; - return this; - } -} - -/** - * An input to allow the user to enter text. - */ -export interface ITextInput { + key?: string; /** - * Must be **Input.Text**. + * Must be **Image**. */ - readonly type: 'Input.Text'; + readonly type: 'Image'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -8449,9 +6147,9 @@ export interface ITextInput { */ separator?: boolean; /** - * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + * Controls how the element should be horizontally aligned. */ - height?: ElementHeight; + horizontalAlignment?: HorizontalAlignment; /** * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ @@ -8465,56 +6163,61 @@ export interface ITextInput { */ isSortKey?: boolean; /** - * The label of the input. - -A label should **always** be provided to ensure the best user experience especially for users of assistive technology. + * The URL (or Base64-encoded Data URI) of the image. Acceptable formats are PNG, JPEG, GIF and SVG. */ - label?: string; + url: string; /** - * Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. + * The alternate text for the image, used for accessibility purposes. */ - isRequired?: boolean; + altText?: string; /** - * The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. + * The background color of the image. */ - errorMessage?: string; + backgroundColor?: string; /** - * An Action.ResetInputs action that will be executed when the value of the input changes. + * The style of the image. */ - valueChangedAction?: IResetInputsAction; + style?: ImageStyle; /** - * The default value of the input. + * The size of the image. */ - value?: string; + size?: Size; /** - * The maximum length of the text in the input. + * The width of the image. */ - maxLength?: number; + width?: 'auto' | 'stretch' | string; /** - * Controls if the input should allow multiple lines of text. + * An Action that will be invoked when the image is tapped or clicked. Action.ShowCard is not supported. */ - isMultiline?: boolean; + selectAction?: IExecuteAction | IInsertImageAction | IOpenUrlAction | IOpenUrlDialogAction | IPopoverAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction; /** - * The text to display as a placeholder when the user hasn't entered a value. + * Controls if the image can be expanded to full screen. */ - placeholder?: string; + allowExpand?: boolean; /** - * The style of the input. + * Teams-specific metadata associated with the image. */ - style?: InputTextStyle; + msteams?: ITeamsImageProperties; /** - * The action that should be displayed as a button alongside the input. Action.ShowCard is not supported. + * A set of theme-specific image URLs. */ - inlineAction?: - | IExecuteAction - | IOpenUrlAction - | IResetInputsAction - | ISubmitAction - | IToggleVisibilityAction; + themedUrls?: IThemedUrl[]; /** - * The regular expression to validate the input. + * Controls how the image should be fitted inside its bounding box. imageFit is only meaningful when both the width and height properties are set. When fitMode is set to contain, the default style is always used. */ - regex?: string; + fitMode?: ImageFitMode; + /** + * Controls the horizontal position of the image within its bounding box. horizontalContentAlignment is only meaningful when both the width and height properties are set and fitMode is set to either cover or contain. + */ + horizontalContentAlignment?: HorizontalAlignment; + /** + * Controls the vertical position of the image within its bounding box. verticalContentAlignment is only meaningful when both the width and height properties are set and fitMode is set to either cover or contain. + */ + verticalContentAlignment?: VerticalAlignment; + /** + * The height of the image. + */ + height?: 'auto' | 'stretch' | string; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -8529,26 +6232,30 @@ A label should **always** be provided to ensure the best user experience especia * @hidden * @internal * - * Type guard to check if a value is of type ITextInput. + * Type guard to check if a value is of type IImage. * * @param value The value to check. - * @returns True if the value is an instance of TextInput, false otherwise. + * @returns True if the value is an instance of Image, false otherwise. */ -export function isTextInput(value: unknown): value is ITextInput { - const obj = value as ITextInput; - return typeof obj === 'object' && obj.type === 'Input.Text'; +export function isImage(value: unknown): value is IImage { + const obj = value as IImage; + return typeof obj === 'object' && obj.type === 'Image'; } -export type TextInputOptions = Omit; +export type ImageOptions = Partial>; /** - * An input to allow the user to enter text. + * A standalone image element. */ -export class TextInput implements ITextInput { +export class Image implements IImage { /** - * Must be **Input.Text**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type = 'Input.Text'; + key?: string; + /** + * Must be **Image**. + */ + readonly type = 'Image'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -8556,7 +6263,7 @@ export class TextInput implements ITextInput { /** * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - requires?: IHostCapabilities; + requires?: IHostCapabilities = {}; /** * The locale associated with the element. */ @@ -8564,19 +6271,19 @@ export class TextInput implements ITextInput { /** * Controls the visibility of the element. */ - isVisible?: boolean; + isVisible?: boolean = true; /** * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. */ - separator?: boolean; + separator?: boolean = false; /** - * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + * Controls how the element should be horizontally aligned. */ - height?: ElementHeight; + horizontalAlignment?: HorizontalAlignment; /** * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ - spacing?: Spacing; + spacing?: Spacing = 'Default'; /** * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). */ @@ -8584,58 +6291,63 @@ export class TextInput implements ITextInput { /** * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. */ - isSortKey?: boolean; + isSortKey?: boolean = false; /** - * The label of the input. - -A label should **always** be provided to ensure the best user experience especially for users of assistive technology. + * The URL (or Base64-encoded Data URI) of the image. Acceptable formats are PNG, JPEG, GIF and SVG. */ - label?: string; + url: string; /** - * Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. + * The alternate text for the image, used for accessibility purposes. */ - isRequired?: boolean; + altText?: string; /** - * The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. + * The background color of the image. */ - errorMessage?: string; + backgroundColor?: string; /** - * An Action.ResetInputs action that will be executed when the value of the input changes. + * The style of the image. */ - valueChangedAction?: IResetInputsAction; + style?: ImageStyle = 'Default'; /** - * The default value of the input. + * The size of the image. */ - value?: string; + size?: Size = 'Auto'; /** - * The maximum length of the text in the input. + * The width of the image. */ - maxLength?: number; + width?: 'auto' | 'stretch' | string = 'auto'; /** - * Controls if the input should allow multiple lines of text. + * An Action that will be invoked when the image is tapped or clicked. Action.ShowCard is not supported. */ - isMultiline?: boolean; + selectAction?: IExecuteAction | IInsertImageAction | IOpenUrlAction | IOpenUrlDialogAction | IPopoverAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction; /** - * The text to display as a placeholder when the user hasn't entered a value. + * Controls if the image can be expanded to full screen. */ - placeholder?: string; + allowExpand?: boolean = false; /** - * The style of the input. + * Teams-specific metadata associated with the image. */ - style?: InputTextStyle; + msteams?: ITeamsImageProperties; /** - * The action that should be displayed as a button alongside the input. Action.ShowCard is not supported. + * A set of theme-specific image URLs. */ - inlineAction?: - | IExecuteAction - | IOpenUrlAction - | IResetInputsAction - | ISubmitAction - | IToggleVisibilityAction; + themedUrls?: IThemedUrl[]; /** - * The regular expression to validate the input. + * Controls how the image should be fitted inside its bounding box. imageFit is only meaningful when both the width and height properties are set. When fitMode is set to contain, the default style is always used. */ - regex?: string; + fitMode?: ImageFitMode = 'Fill'; + /** + * Controls the horizontal position of the image within its bounding box. horizontalContentAlignment is only meaningful when both the width and height properties are set and fitMode is set to either cover or contain. + */ + horizontalContentAlignment?: HorizontalAlignment = 'Left'; + /** + * Controls the vertical position of the image within its bounding box. verticalContentAlignment is only meaningful when both the width and height properties are set and fitMode is set to either cover or contain. + */ + verticalContentAlignment?: VerticalAlignment = 'Top'; + /** + * The height of the image. + */ + height?: 'auto' | 'stretch' | string = 'auto'; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -8645,12 +6357,18 @@ A label should **always** be provided to ensure the best user experience especia */ fallback?: FallbackElement; - constructor(options: TextInputOptions = {}) { + constructor(url: string, options: ImageOptions = {}) { Object.assign(this, options); + this.url = url; } - static from(options: Omit): TextInput { - return new TextInput(options); + static from(options: Omit): Image { + return new Image(options.url, options); + } + + withKey(key: string): this { + this.key = key; + return this; } withId(id: string): this { @@ -8678,8 +6396,8 @@ A label should **always** be provided to ensure the best user experience especia return this; } - withHeight(height: ElementHeight): this { - this.height = height; + withHorizontalAlignment(horizontalAlignment: HorizontalAlignment): this { + this.horizontalAlignment = horizontalAlignment; return this; } @@ -8698,65 +6416,73 @@ A label should **always** be provided to ensure the best user experience especia return this; } - withLabel(label: string): this { - this.label = label; + withUrl(url: string): this { + this.url = url; return this; } - withIsRequired(isRequired = true): this { - this.isRequired = isRequired; + withAltText(altText: string): this { + this.altText = altText; return this; } - withErrorMessage(errorMessage: string): this { - this.errorMessage = errorMessage; + withBackgroundColor(backgroundColor: string): this { + this.backgroundColor = backgroundColor; return this; } - withValueChangedAction(valueChangedAction: IResetInputsAction): this { - this.valueChangedAction = valueChangedAction; + withStyle(style: ImageStyle): this { + this.style = style; return this; } - withValue(value: string): this { - this.value = value; + withSize(size: Size): this { + this.size = size; return this; } - withMaxLength(maxLength: number): this { - this.maxLength = maxLength; + withWidth(width: 'auto' | 'stretch' | string): this { + this.width = width; return this; } - withIsMultiline(isMultiline = true): this { - this.isMultiline = isMultiline; + withSelectAction(selectAction: IExecuteAction | IInsertImageAction | IOpenUrlAction | IOpenUrlDialogAction | IPopoverAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction): this { + this.selectAction = selectAction; return this; } - withPlaceholder(placeholder: string): this { - this.placeholder = placeholder; + withAllowExpand(allowExpand = true): this { + this.allowExpand = allowExpand; return this; } - withStyle(style: InputTextStyle): this { - this.style = style; + withMsteams(msteams: ITeamsImageProperties): this { + this.msteams = msteams; return this; } - withInlineAction( - inlineAction: - | IExecuteAction - | IOpenUrlAction - | IResetInputsAction - | ISubmitAction - | IToggleVisibilityAction - ): this { - this.inlineAction = inlineAction; + withThemedUrls(...themedUrls: IThemedUrl[]): this { + this.themedUrls = themedUrls; return this; } - withRegex(regex: string): this { - this.regex = regex; + withFitMode(fitMode: ImageFitMode): this { + this.fitMode = fitMode; + return this; + } + + withHorizontalContentAlignment(horizontalContentAlignment: HorizontalAlignment): this { + this.horizontalContentAlignment = horizontalContentAlignment; + return this; + } + + withVerticalContentAlignment(verticalContentAlignment: VerticalAlignment): this { + this.verticalContentAlignment = verticalContentAlignment; + return this; + } + + withHeight(height: 'auto' | 'stretch' | string): this { + this.height = height; return this; } @@ -8767,13 +6493,66 @@ A label should **always** be provided to ensure the best user experience especia } /** - * An input to allow the user to select a date. + * Represents a set of Teams-specific properties on an image. */ -export interface IDateInput { +export interface ITeamsImageProperties { /** - * Must be **Input.Date**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type: 'Input.Date'; + key?: string; + /** + * Controls if the image is expandable in Teams. This property is equivalent to the Image.allowExpand property. + */ + allowExpand?: boolean; +} + + +export type TeamsImagePropertiesOptions = Partial; + +/** + * Represents a set of Teams-specific properties on an image. + */ +export class TeamsImageProperties implements ITeamsImageProperties { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * Controls if the image is expandable in Teams. This property is equivalent to the Image.allowExpand property. + */ + allowExpand?: boolean; + + constructor(options: TeamsImagePropertiesOptions = {}) { + Object.assign(this, options); + } + + static from(options: ITeamsImageProperties): TeamsImageProperties { + return new TeamsImageProperties(options); + } + + withKey(key: string): this { + this.key = key; + return this; + } + + withAllowExpand(allowExpand: boolean): this { + this.allowExpand = allowExpand; + return this; + } +} + +/** + * An input to allow the user to enter text. + */ +export interface ITextInput { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * Must be **Input.Text**. + */ + readonly type: 'Input.Text'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -8812,8 +6591,8 @@ export interface IDateInput { isSortKey?: boolean; /** * The label of the input. - -A label should **always** be provided to ensure the best user experience especially for users of assistive technology. + * + * A label should **always** be provided to ensure the best user experience especially for users of assistive technology. */ label?: string; /** @@ -8827,23 +6606,35 @@ A label should **always** be provided to ensure the best user experience especia /** * An Action.ResetInputs action that will be executed when the value of the input changes. */ - valueChangedAction?: IResetInputsAction; + valueChangedAction?: IOpenUrlDialogAction | IPopoverAction | IResetInputsAction; /** - * The default value of the input, in the `YYYY-MM-DD` format. + * The default value of the input. */ value?: string; /** - * The text to display as a placeholder when the user has not selected a date. + * The maximum length of the text in the input. + */ + maxLength?: number; + /** + * Controls if the input should allow multiple lines of text. + */ + isMultiline?: boolean; + /** + * The text to display as a placeholder when the user hasn't entered a value. */ placeholder?: string; /** - * The minimum date that can be selected. + * The style of the input. */ - min?: string; + style?: InputTextStyle; /** - * The maximum date that can be selected. + * The action that should be displayed as a button alongside the input. Action.ShowCard is not supported. */ - max?: string; + inlineAction?: IExecuteAction | IInsertImageAction | IOpenUrlAction | IOpenUrlDialogAction | IPopoverAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction; + /** + * The regular expression to validate the input. + */ + regex?: string; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -8858,26 +6649,30 @@ A label should **always** be provided to ensure the best user experience especia * @hidden * @internal * - * Type guard to check if a value is of type IDateInput. + * Type guard to check if a value is of type ITextInput. * * @param value The value to check. - * @returns True if the value is an instance of DateInput, false otherwise. + * @returns True if the value is an instance of TextInput, false otherwise. */ -export function isDateInput(value: unknown): value is IDateInput { - const obj = value as IDateInput; - return typeof obj === 'object' && obj.type === 'Input.Date'; +export function isTextInput(value: unknown): value is ITextInput { + const obj = value as ITextInput; + return typeof obj === 'object' && obj.type === 'Input.Text'; } -export type DateInputOptions = Omit; +export type TextInputOptions = Partial>; /** - * An input to allow the user to select a date. + * An input to allow the user to enter text. */ -export class DateInput implements IDateInput { +export class TextInput implements ITextInput { /** - * Must be **Input.Date**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type = 'Input.Date'; + key?: string; + /** + * Must be **Input.Text**. + */ + readonly type = 'Input.Text'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -8885,7 +6680,7 @@ export class DateInput implements IDateInput { /** * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - requires?: IHostCapabilities; + requires?: IHostCapabilities = {}; /** * The locale associated with the element. */ @@ -8893,19 +6688,19 @@ export class DateInput implements IDateInput { /** * Controls the visibility of the element. */ - isVisible?: boolean; + isVisible?: boolean = true; /** * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. */ - separator?: boolean; + separator?: boolean = false; /** * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. */ - height?: ElementHeight; + height?: ElementHeight = 'auto'; /** * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ - spacing?: Spacing; + spacing?: Spacing = 'Default'; /** * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). */ @@ -8913,17 +6708,17 @@ export class DateInput implements IDateInput { /** * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. */ - isSortKey?: boolean; + isSortKey?: boolean = false; /** * The label of the input. - -A label should **always** be provided to ensure the best user experience especially for users of assistive technology. + * + * A label should **always** be provided to ensure the best user experience especially for users of assistive technology. */ label?: string; /** * Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. */ - isRequired?: boolean; + isRequired?: boolean = false; /** * The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. */ @@ -8931,23 +6726,35 @@ A label should **always** be provided to ensure the best user experience especia /** * An Action.ResetInputs action that will be executed when the value of the input changes. */ - valueChangedAction?: IResetInputsAction; + valueChangedAction?: IOpenUrlDialogAction | IPopoverAction | IResetInputsAction; /** - * The default value of the input, in the `YYYY-MM-DD` format. + * The default value of the input. */ value?: string; /** - * The text to display as a placeholder when the user has not selected a date. + * The maximum length of the text in the input. + */ + maxLength?: number; + /** + * Controls if the input should allow multiple lines of text. + */ + isMultiline?: boolean = false; + /** + * The text to display as a placeholder when the user hasn't entered a value. */ placeholder?: string; /** - * The minimum date that can be selected. + * The style of the input. */ - min?: string; + style?: InputTextStyle = 'Text'; /** - * The maximum date that can be selected. + * The action that should be displayed as a button alongside the input. Action.ShowCard is not supported. */ - max?: string; + inlineAction?: IExecuteAction | IInsertImageAction | IOpenUrlAction | IOpenUrlDialogAction | IPopoverAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction; + /** + * The regular expression to validate the input. + */ + regex?: string; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -8957,12 +6764,17 @@ A label should **always** be provided to ensure the best user experience especia */ fallback?: FallbackElement; - constructor(options: DateInputOptions = {}) { + constructor(options: TextInputOptions = {}) { Object.assign(this, options); } - static from(options: Omit): DateInput { - return new DateInput(options); + static from(options: Omit): TextInput { + return new TextInput(options); + } + + withKey(key: string): this { + this.key = key; + return this; } withId(id: string): this { @@ -9025,7 +6837,7 @@ A label should **always** be provided to ensure the best user experience especia return this; } - withValueChangedAction(valueChangedAction: IResetInputsAction): this { + withValueChangedAction(valueChangedAction: IOpenUrlDialogAction | IPopoverAction | IResetInputsAction): this { this.valueChangedAction = valueChangedAction; return this; } @@ -9035,18 +6847,33 @@ A label should **always** be provided to ensure the best user experience especia return this; } + withMaxLength(maxLength: number): this { + this.maxLength = maxLength; + return this; + } + + withIsMultiline(isMultiline = true): this { + this.isMultiline = isMultiline; + return this; + } + withPlaceholder(placeholder: string): this { this.placeholder = placeholder; return this; } - withMin(min: string): this { - this.min = min; + withStyle(style: InputTextStyle): this { + this.style = style; return this; } - withMax(max: string): this { - this.max = max; + withInlineAction(inlineAction: IExecuteAction | IInsertImageAction | IOpenUrlAction | IOpenUrlDialogAction | IPopoverAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction): this { + this.inlineAction = inlineAction; + return this; + } + + withRegex(regex: string): this { + this.regex = regex; return this; } @@ -9057,13 +6884,17 @@ A label should **always** be provided to ensure the best user experience especia } /** - * An input to allow the user to select a time. + * An input to allow the user to select a date. */ -export interface ITimeInput { +export interface IDateInput { /** - * Must be **Input.Time**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type: 'Input.Time'; + key?: string; + /** + * Must be **Input.Date**. + */ + readonly type: 'Input.Date'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -9102,8 +6933,8 @@ export interface ITimeInput { isSortKey?: boolean; /** * The label of the input. - -A label should **always** be provided to ensure the best user experience especially for users of assistive technology. + * + * A label should **always** be provided to ensure the best user experience especially for users of assistive technology. */ label?: string; /** @@ -9117,21 +6948,21 @@ A label should **always** be provided to ensure the best user experience especia /** * An Action.ResetInputs action that will be executed when the value of the input changes. */ - valueChangedAction?: IResetInputsAction; + valueChangedAction?: IOpenUrlDialogAction | IPopoverAction | IResetInputsAction; /** - * The default value of the input, in the `HH:MM` format. + * The default value of the input, in the `YYYY-MM-DD` format. */ value?: string; /** - * The text to display as a placeholder when the user hasn't entered a value. + * The text to display as a placeholder when the user has not selected a date. */ placeholder?: string; /** - * The minimum time that can be selected, in the `HH:MM` format. + * The minimum date that can be selected. */ min?: string; /** - * The maximum time that can be selected, in the `HH:MM` format. + * The maximum date that can be selected. */ max?: string; /** @@ -9148,26 +6979,30 @@ A label should **always** be provided to ensure the best user experience especia * @hidden * @internal * - * Type guard to check if a value is of type ITimeInput. + * Type guard to check if a value is of type IDateInput. * * @param value The value to check. - * @returns True if the value is an instance of TimeInput, false otherwise. + * @returns True if the value is an instance of DateInput, false otherwise. */ -export function isTimeInput(value: unknown): value is ITimeInput { - const obj = value as ITimeInput; - return typeof obj === 'object' && obj.type === 'Input.Time'; +export function isDateInput(value: unknown): value is IDateInput { + const obj = value as IDateInput; + return typeof obj === 'object' && obj.type === 'Input.Date'; } -export type TimeInputOptions = Omit; +export type DateInputOptions = Partial>; /** - * An input to allow the user to select a time. + * An input to allow the user to select a date. */ -export class TimeInput implements ITimeInput { +export class DateInput implements IDateInput { /** - * Must be **Input.Time**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type = 'Input.Time'; + key?: string; + /** + * Must be **Input.Date**. + */ + readonly type = 'Input.Date'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -9175,7 +7010,7 @@ export class TimeInput implements ITimeInput { /** * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - requires?: IHostCapabilities; + requires?: IHostCapabilities = {}; /** * The locale associated with the element. */ @@ -9183,19 +7018,19 @@ export class TimeInput implements ITimeInput { /** * Controls the visibility of the element. */ - isVisible?: boolean; + isVisible?: boolean = true; /** * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. */ - separator?: boolean; + separator?: boolean = false; /** * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. */ - height?: ElementHeight; + height?: ElementHeight = 'auto'; /** * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ - spacing?: Spacing; + spacing?: Spacing = 'Default'; /** * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). */ @@ -9203,17 +7038,17 @@ export class TimeInput implements ITimeInput { /** * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. */ - isSortKey?: boolean; + isSortKey?: boolean = false; /** * The label of the input. - -A label should **always** be provided to ensure the best user experience especially for users of assistive technology. + * + * A label should **always** be provided to ensure the best user experience especially for users of assistive technology. */ label?: string; /** * Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. */ - isRequired?: boolean; + isRequired?: boolean = false; /** * The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. */ @@ -9221,21 +7056,21 @@ A label should **always** be provided to ensure the best user experience especia /** * An Action.ResetInputs action that will be executed when the value of the input changes. */ - valueChangedAction?: IResetInputsAction; + valueChangedAction?: IOpenUrlDialogAction | IPopoverAction | IResetInputsAction; /** - * The default value of the input, in the `HH:MM` format. + * The default value of the input, in the `YYYY-MM-DD` format. */ value?: string; /** - * The text to display as a placeholder when the user hasn't entered a value. + * The text to display as a placeholder when the user has not selected a date. */ placeholder?: string; /** - * The minimum time that can be selected, in the `HH:MM` format. + * The minimum date that can be selected. */ min?: string; /** - * The maximum time that can be selected, in the `HH:MM` format. + * The maximum date that can be selected. */ max?: string; /** @@ -9247,13 +7082,18 @@ A label should **always** be provided to ensure the best user experience especia */ fallback?: FallbackElement; - constructor(options: TimeInputOptions = {}) { + constructor(options: DateInputOptions = {}) { Object.assign(this, options); } - static from(options: Omit): TimeInput { - return new TimeInput(options); - } + static from(options: Omit): DateInput { + return new DateInput(options); + } + + withKey(key: string): this { + this.key = key; + return this; + } withId(id: string): this { this.id = id; @@ -9315,7 +7155,7 @@ A label should **always** be provided to ensure the best user experience especia return this; } - withValueChangedAction(valueChangedAction: IResetInputsAction): this { + withValueChangedAction(valueChangedAction: IOpenUrlDialogAction | IPopoverAction | IResetInputsAction): this { this.valueChangedAction = valueChangedAction; return this; } @@ -9347,13 +7187,17 @@ A label should **always** be provided to ensure the best user experience especia } /** - * An input to allow the user to enter a number. + * An input to allow the user to select a time. */ -export interface INumberInput { +export interface ITimeInput { /** - * Must be **Input.Number**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type: 'Input.Number'; + key?: string; + /** + * Must be **Input.Time**. + */ + readonly type: 'Input.Time'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -9392,8 +7236,8 @@ export interface INumberInput { isSortKey?: boolean; /** * The label of the input. - -A label should **always** be provided to ensure the best user experience especially for users of assistive technology. + * + * A label should **always** be provided to ensure the best user experience especially for users of assistive technology. */ label?: string; /** @@ -9407,23 +7251,23 @@ A label should **always** be provided to ensure the best user experience especia /** * An Action.ResetInputs action that will be executed when the value of the input changes. */ - valueChangedAction?: IResetInputsAction; + valueChangedAction?: IOpenUrlDialogAction | IPopoverAction | IResetInputsAction; /** - * The default value of the input. + * The default value of the input, in the `HH:MM` format. */ - value?: number; + value?: string; /** * The text to display as a placeholder when the user hasn't entered a value. */ placeholder?: string; /** - * The minimum value that can be entered. + * The minimum time that can be selected, in the `HH:MM` format. */ - min?: number; + min?: string; /** - * The maximum value that can be entered. + * The maximum time that can be selected, in the `HH:MM` format. */ - max?: number; + max?: string; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -9438,26 +7282,30 @@ A label should **always** be provided to ensure the best user experience especia * @hidden * @internal * - * Type guard to check if a value is of type INumberInput. + * Type guard to check if a value is of type ITimeInput. * * @param value The value to check. - * @returns True if the value is an instance of NumberInput, false otherwise. + * @returns True if the value is an instance of TimeInput, false otherwise. */ -export function isNumberInput(value: unknown): value is INumberInput { - const obj = value as INumberInput; - return typeof obj === 'object' && obj.type === 'Input.Number'; +export function isTimeInput(value: unknown): value is ITimeInput { + const obj = value as ITimeInput; + return typeof obj === 'object' && obj.type === 'Input.Time'; } -export type NumberInputOptions = Omit; +export type TimeInputOptions = Partial>; /** - * An input to allow the user to enter a number. + * An input to allow the user to select a time. */ -export class NumberInput implements INumberInput { +export class TimeInput implements ITimeInput { /** - * Must be **Input.Number**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type = 'Input.Number'; + key?: string; + /** + * Must be **Input.Time**. + */ + readonly type = 'Input.Time'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -9465,7 +7313,7 @@ export class NumberInput implements INumberInput { /** * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - requires?: IHostCapabilities; + requires?: IHostCapabilities = {}; /** * The locale associated with the element. */ @@ -9473,19 +7321,19 @@ export class NumberInput implements INumberInput { /** * Controls the visibility of the element. */ - isVisible?: boolean; + isVisible?: boolean = true; /** * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. */ - separator?: boolean; + separator?: boolean = false; /** * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. */ - height?: ElementHeight; + height?: ElementHeight = 'auto'; /** * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ - spacing?: Spacing; + spacing?: Spacing = 'Default'; /** * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). */ @@ -9493,17 +7341,17 @@ export class NumberInput implements INumberInput { /** * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. */ - isSortKey?: boolean; + isSortKey?: boolean = false; /** * The label of the input. - -A label should **always** be provided to ensure the best user experience especially for users of assistive technology. + * + * A label should **always** be provided to ensure the best user experience especially for users of assistive technology. */ label?: string; /** * Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. */ - isRequired?: boolean; + isRequired?: boolean = false; /** * The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. */ @@ -9511,23 +7359,23 @@ A label should **always** be provided to ensure the best user experience especia /** * An Action.ResetInputs action that will be executed when the value of the input changes. */ - valueChangedAction?: IResetInputsAction; + valueChangedAction?: IOpenUrlDialogAction | IPopoverAction | IResetInputsAction; /** - * The default value of the input. + * The default value of the input, in the `HH:MM` format. */ - value?: number; + value?: string; /** * The text to display as a placeholder when the user hasn't entered a value. */ placeholder?: string; /** - * The minimum value that can be entered. + * The minimum time that can be selected, in the `HH:MM` format. */ - min?: number; + min?: string; /** - * The maximum value that can be entered. + * The maximum time that can be selected, in the `HH:MM` format. */ - max?: number; + max?: string; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -9537,12 +7385,17 @@ A label should **always** be provided to ensure the best user experience especia */ fallback?: FallbackElement; - constructor(options: NumberInputOptions = {}) { + constructor(options: TimeInputOptions = {}) { Object.assign(this, options); } - static from(options: Omit): NumberInput { - return new NumberInput(options); + static from(options: Omit): TimeInput { + return new TimeInput(options); + } + + withKey(key: string): this { + this.key = key; + return this; } withId(id: string): this { @@ -9605,12 +7458,12 @@ A label should **always** be provided to ensure the best user experience especia return this; } - withValueChangedAction(valueChangedAction: IResetInputsAction): this { + withValueChangedAction(valueChangedAction: IOpenUrlDialogAction | IPopoverAction | IResetInputsAction): this { this.valueChangedAction = valueChangedAction; return this; } - withValue(value: number): this { + withValue(value: string): this { this.value = value; return this; } @@ -9620,12 +7473,12 @@ A label should **always** be provided to ensure the best user experience especia return this; } - withMin(min: number): this { + withMin(min: string): this { this.min = min; return this; } - withMax(max: number): this { + withMax(max: string): this { this.max = max; return this; } @@ -9637,13 +7490,17 @@ A label should **always** be provided to ensure the best user experience especia } /** - * An input to allow the user to select between on/off states. + * An input to allow the user to enter a number. */ -export interface IToggleInput { +export interface INumberInput { /** - * Must be **Input.Toggle**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type: 'Input.Toggle'; + key?: string; + /** + * Must be **Input.Number**. + */ + readonly type: 'Input.Number'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -9682,8 +7539,8 @@ export interface IToggleInput { isSortKey?: boolean; /** * The label of the input. - -A label should **always** be provided to ensure the best user experience especially for users of assistive technology. + * + * A label should **always** be provided to ensure the best user experience especially for users of assistive technology. */ label?: string; /** @@ -9697,27 +7554,23 @@ A label should **always** be provided to ensure the best user experience especia /** * An Action.ResetInputs action that will be executed when the value of the input changes. */ - valueChangedAction?: IResetInputsAction; + valueChangedAction?: IOpenUrlDialogAction | IPopoverAction | IResetInputsAction; /** * The default value of the input. */ - value?: string; - /** - * The title (caption) to display next to the toggle. - */ - title: string; + value?: number; /** - * The value to send to the Bot when the toggle is on. + * The text to display as a placeholder when the user hasn't entered a value. */ - valueOn?: string; + placeholder?: string; /** - * The value to send to the Bot when the toggle is off. + * The minimum value that can be entered. */ - valueOff?: string; + min?: number; /** - * Controls if the title should wrap. + * The maximum value that can be entered. */ - wrap?: boolean; + max?: number; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -9732,26 +7585,30 @@ A label should **always** be provided to ensure the best user experience especia * @hidden * @internal * - * Type guard to check if a value is of type IToggleInput. + * Type guard to check if a value is of type INumberInput. * * @param value The value to check. - * @returns True if the value is an instance of ToggleInput, false otherwise. + * @returns True if the value is an instance of NumberInput, false otherwise. */ -export function isToggleInput(value: unknown): value is IToggleInput { - const obj = value as IToggleInput; - return typeof obj === 'object' && obj.type === 'Input.Toggle'; +export function isNumberInput(value: unknown): value is INumberInput { + const obj = value as INumberInput; + return typeof obj === 'object' && obj.type === 'Input.Number'; } -export type ToggleInputOptions = Omit; +export type NumberInputOptions = Partial>; /** - * An input to allow the user to select between on/off states. + * An input to allow the user to enter a number. */ -export class ToggleInput implements IToggleInput { +export class NumberInput implements INumberInput { /** - * Must be **Input.Toggle**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type = 'Input.Toggle'; + key?: string; + /** + * Must be **Input.Number**. + */ + readonly type = 'Input.Number'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -9759,7 +7616,7 @@ export class ToggleInput implements IToggleInput { /** * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - requires?: IHostCapabilities; + requires?: IHostCapabilities = {}; /** * The locale associated with the element. */ @@ -9767,19 +7624,19 @@ export class ToggleInput implements IToggleInput { /** * Controls the visibility of the element. */ - isVisible?: boolean; + isVisible?: boolean = true; /** * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. */ - separator?: boolean; + separator?: boolean = false; /** * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. */ - height?: ElementHeight; + height?: ElementHeight = 'auto'; /** * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ - spacing?: Spacing; + spacing?: Spacing = 'Default'; /** * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). */ @@ -9787,17 +7644,17 @@ export class ToggleInput implements IToggleInput { /** * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. */ - isSortKey?: boolean; + isSortKey?: boolean = false; /** * The label of the input. - -A label should **always** be provided to ensure the best user experience especially for users of assistive technology. + * + * A label should **always** be provided to ensure the best user experience especially for users of assistive technology. */ label?: string; /** * Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. */ - isRequired?: boolean; + isRequired?: boolean = false; /** * The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. */ @@ -9805,27 +7662,23 @@ A label should **always** be provided to ensure the best user experience especia /** * An Action.ResetInputs action that will be executed when the value of the input changes. */ - valueChangedAction?: IResetInputsAction; + valueChangedAction?: IOpenUrlDialogAction | IPopoverAction | IResetInputsAction; /** * The default value of the input. */ - value?: string; - /** - * The title (caption) to display next to the toggle. - */ - title: string; + value?: number; /** - * The value to send to the Bot when the toggle is on. + * The text to display as a placeholder when the user hasn't entered a value. */ - valueOn?: string; + placeholder?: string; /** - * The value to send to the Bot when the toggle is off. + * The minimum value that can be entered. */ - valueOff?: string; + min?: number; /** - * Controls if the title should wrap. + * The maximum value that can be entered. */ - wrap?: boolean; + max?: number; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -9835,13 +7688,17 @@ A label should **always** be provided to ensure the best user experience especia */ fallback?: FallbackElement; - constructor(title: string, options: ToggleInputOptions = {}) { + constructor(options: NumberInputOptions = {}) { Object.assign(this, options); - this.title = title; } - static from(options: Omit): ToggleInput { - return new ToggleInput(options.title, options); + static from(options: Omit): NumberInput { + return new NumberInput(options); + } + + withKey(key: string): this { + this.key = key; + return this; } withId(id: string): this { @@ -9904,33 +7761,28 @@ A label should **always** be provided to ensure the best user experience especia return this; } - withValueChangedAction(valueChangedAction: IResetInputsAction): this { + withValueChangedAction(valueChangedAction: IOpenUrlDialogAction | IPopoverAction | IResetInputsAction): this { this.valueChangedAction = valueChangedAction; return this; } - withValue(value: string): this { + withValue(value: number): this { this.value = value; return this; } - withTitle(title: string): this { - this.title = title; - return this; - } - - withValueOn(valueOn: string): this { - this.valueOn = valueOn; + withPlaceholder(placeholder: string): this { + this.placeholder = placeholder; return this; } - withValueOff(valueOff: string): this { - this.valueOff = valueOff; + withMin(min: number): this { + this.min = min; return this; } - withWrap(wrap = false): this { - this.wrap = wrap; + withMax(max: number): this { + this.max = max; return this; } @@ -9941,13 +7793,17 @@ A label should **always** be provided to ensure the best user experience especia } /** - * An input to allow the user to select one or more values. + * An input to allow the user to select between on/off states. */ -export interface IChoiceSetInput { +export interface IToggleInput { /** - * Must be **Input.ChoiceSet**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type: 'Input.ChoiceSet'; + key?: string; + /** + * Must be **Input.Toggle**. + */ + readonly type: 'Input.Toggle'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -9986,8 +7842,8 @@ export interface IChoiceSetInput { isSortKey?: boolean; /** * The label of the input. - -A label should **always** be provided to ensure the best user experience especially for users of assistive technology. + * + * A label should **always** be provided to ensure the best user experience especially for users of assistive technology. */ label?: string; /** @@ -10001,35 +7857,31 @@ A label should **always** be provided to ensure the best user experience especia /** * An Action.ResetInputs action that will be executed when the value of the input changes. */ - valueChangedAction?: IResetInputsAction; + valueChangedAction?: IOpenUrlDialogAction | IPopoverAction | IResetInputsAction; /** * The default value of the input. */ value?: string; /** - * The choices associated with the input. - */ - choices: IChoice[]; - /** - * A Data.Query object that defines the dataset from which to dynamically fetch the choices for the input. + * The title (caption) to display next to the toggle. */ - 'choices.data'?: IQueryData; + title: string; /** - * Controls whether the input should be displayed as a dropdown (compact) or a list of radio buttons or checkboxes (expanded). + * The value to send to the Bot when the toggle is on. */ - style?: 'compact' | 'expanded' | 'filtered'; + valueOn?: string; /** - * Controls whether multiple choices can be selected. + * The value to send to the Bot when the toggle is off. */ - isMultiSelect?: boolean; + valueOff?: string; /** - * The text to display as a placeholder when the user has not entered any value. + * Controls if the title should wrap. */ - placeholder?: string; + wrap?: boolean; /** - * Controls if choice titles should wrap. + * Controls whether the title is visually displayed. When set to false, the title is hidden from view but remains accessible to screen readers for accessibility purposes. */ - wrap?: boolean; + showTitle?: boolean; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -10044,26 +7896,30 @@ A label should **always** be provided to ensure the best user experience especia * @hidden * @internal * - * Type guard to check if a value is of type IChoiceSetInput. + * Type guard to check if a value is of type IToggleInput. * * @param value The value to check. - * @returns True if the value is an instance of ChoiceSetInput, false otherwise. + * @returns True if the value is an instance of ToggleInput, false otherwise. */ -export function isChoiceSetInput(value: unknown): value is IChoiceSetInput { - const obj = value as IChoiceSetInput; - return typeof obj === 'object' && obj.type === 'Input.ChoiceSet'; +export function isToggleInput(value: unknown): value is IToggleInput { + const obj = value as IToggleInput; + return typeof obj === 'object' && obj.type === 'Input.Toggle'; } -export type ChoiceSetInputOptions = Omit; +export type ToggleInputOptions = Partial>; /** - * An input to allow the user to select one or more values. + * An input to allow the user to select between on/off states. */ -export class ChoiceSetInput implements IChoiceSetInput { +export class ToggleInput implements IToggleInput { /** - * Must be **Input.ChoiceSet**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type = 'Input.ChoiceSet'; + key?: string; + /** + * Must be **Input.Toggle**. + */ + readonly type = 'Input.Toggle'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -10071,7 +7927,7 @@ export class ChoiceSetInput implements IChoiceSetInput { /** * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - requires?: IHostCapabilities; + requires?: IHostCapabilities = {}; /** * The locale associated with the element. */ @@ -10079,19 +7935,19 @@ export class ChoiceSetInput implements IChoiceSetInput { /** * Controls the visibility of the element. */ - isVisible?: boolean; + isVisible?: boolean = true; /** * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. */ - separator?: boolean; + separator?: boolean = false; /** * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. */ - height?: ElementHeight; + height?: ElementHeight = 'auto'; /** * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ - spacing?: Spacing; + spacing?: Spacing = 'Default'; /** * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). */ @@ -10099,17 +7955,17 @@ export class ChoiceSetInput implements IChoiceSetInput { /** * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. */ - isSortKey?: boolean; + isSortKey?: boolean = false; /** * The label of the input. - -A label should **always** be provided to ensure the best user experience especially for users of assistive technology. + * + * A label should **always** be provided to ensure the best user experience especially for users of assistive technology. */ label?: string; /** * Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. */ - isRequired?: boolean; + isRequired?: boolean = false; /** * The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. */ @@ -10117,35 +7973,31 @@ A label should **always** be provided to ensure the best user experience especia /** * An Action.ResetInputs action that will be executed when the value of the input changes. */ - valueChangedAction?: IResetInputsAction; + valueChangedAction?: IOpenUrlDialogAction | IPopoverAction | IResetInputsAction; /** * The default value of the input. */ - value?: string; + value?: string = 'false'; /** - * The choices associated with the input. + * The title (caption) to display next to the toggle. */ - choices: IChoice[]; + title: string; /** - * A Data.Query object that defines the dataset from which to dynamically fetch the choices for the input. + * The value to send to the Bot when the toggle is on. */ - 'choices.data'?: IQueryData; + valueOn?: string = 'true'; /** - * Controls whether the input should be displayed as a dropdown (compact) or a list of radio buttons or checkboxes (expanded). - */ - style?: 'compact' | 'expanded' | 'filtered'; - /** - * Controls whether multiple choices can be selected. + * The value to send to the Bot when the toggle is off. */ - isMultiSelect?: boolean; + valueOff?: string = 'false'; /** - * The text to display as a placeholder when the user has not entered any value. + * Controls if the title should wrap. */ - placeholder?: string; + wrap?: boolean = true; /** - * Controls if choice titles should wrap. + * Controls whether the title is visually displayed. When set to false, the title is hidden from view but remains accessible to screen readers for accessibility purposes. */ - wrap?: boolean; + showTitle?: boolean = true; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -10155,12 +8007,17 @@ A label should **always** be provided to ensure the best user experience especia */ fallback?: FallbackElement; - constructor(...choices: IChoice[]) { - this.choices = choices; + constructor(title: string, options: ToggleInputOptions = {}) { + Object.assign(this, options); + this.title = title; } - withOptions(value: ChoiceSetInputOptions): this { - Object.assign(this, value); + static from(options: Omit): ToggleInput { + return new ToggleInput(options.title, options); + } + + withKey(key: string): this { + this.key = key; return this; } @@ -10224,7 +8081,7 @@ A label should **always** be provided to ensure the best user experience especia return this; } - withValueChangedAction(valueChangedAction: IResetInputsAction): this { + withValueChangedAction(valueChangedAction: IOpenUrlDialogAction | IPopoverAction | IResetInputsAction): this { this.valueChangedAction = valueChangedAction; return this; } @@ -10234,23 +8091,18 @@ A label should **always** be provided to ensure the best user experience especia return this; } - withChoices(...choices: IChoice[]): this { - this.choices = choices; - return this; - } - - withStyle(style: 'compact' | 'expanded' | 'filtered'): this { - this.style = style; + withTitle(title: string): this { + this.title = title; return this; } - withIsMultiSelect(isMultiSelect = true): this { - this.isMultiSelect = isMultiSelect; + withValueOn(valueOn: string): this { + this.valueOn = valueOn; return this; } - withPlaceholder(placeholder: string): this { - this.placeholder = placeholder; + withValueOff(valueOff: string): this { + this.valueOff = valueOff; return this; } @@ -10259,164 +8111,29 @@ A label should **always** be provided to ensure the best user experience especia return this; } - withFallback(fallback: FallbackElement): this { - this.fallback = fallback; - return this; - } -} - -/** - * A choice as used by the Input.ChoiceSet input. - */ -export interface IChoice { - /** - * The text to display for the choice. - */ - title?: string; - /** - * The value associated with the choice, as sent to the Bot when an Action.Submit or Action.Execute is invoked - */ - value?: string; -} - -export type ChoiceOptions = IChoice; - -/** - * A choice as used by the Input.ChoiceSet input. - */ -export class Choice implements IChoice { - /** - * The text to display for the choice. - */ - title?: string; - /** - * The value associated with the choice, as sent to the Bot when an Action.Submit or Action.Execute is invoked - */ - value?: string; - - constructor(options: ChoiceOptions = {}) { - Object.assign(this, options); - } - - static from(options: IChoice): Choice { - return new Choice(options); - } - - withTitle(title: string): this { - this.title = title; + withShowTitle(showTitle = false): this { + this.showTitle = showTitle; return this; } - withValue(value: string): this { - this.value = value; + withFallback(fallback: FallbackElement): this { + this.fallback = fallback; return this; } } /** - * Defines a query to dynamically fetch data from a Bot. - */ -export interface IQueryData { - /** - * Must be **Data.Query**. - */ - readonly type: 'Data.Query'; - /** - * The dataset from which to fetch the data. - */ - dataset?: string; - /** - * Controls which inputs are associated with the Data.Query. When a Data.Query is executed, the values of the associated inputs are sent to the Bot, allowing it to perform filtering operations based on the user's input. - */ - associatedInputs?: 'auto' | 'none'; - /** - * The maximum number of data items that should be returned by the query. Card authors should not specify this property in their card payload. It is determined by the client and sent to the Bot to enable pagination. - */ - count?: number; - /** - * The number of data items to be skipped by the query. Card authors should not specify this property in their card payload. It is determined by the client and sent to the Bot to enable pagination. - */ - skip?: number; -} - -/** - * @hidden - * @internal - * - * Type guard to check if a value is of type IQueryData. - * - * @param value The value to check. - * @returns True if the value is an instance of QueryData, false otherwise. - */ -export function isQueryData(value: unknown): value is IQueryData { - const obj = value as IQueryData; - return typeof obj === 'object' && obj.type === 'Data.Query'; -} - -export type QueryDataOptions = Omit; - -/** - * Defines a query to dynamically fetch data from a Bot. + * An input to allow the user to select one or more values. */ -export class QueryData implements IQueryData { - /** - * Must be **Data.Query**. - */ - readonly type = 'Data.Query'; - /** - * The dataset from which to fetch the data. - */ - dataset?: string; - /** - * Controls which inputs are associated with the Data.Query. When a Data.Query is executed, the values of the associated inputs are sent to the Bot, allowing it to perform filtering operations based on the user's input. - */ - associatedInputs?: 'auto' | 'none'; - /** - * The maximum number of data items that should be returned by the query. Card authors should not specify this property in their card payload. It is determined by the client and sent to the Bot to enable pagination. - */ - count?: number; +export interface IChoiceSetInput { /** - * The number of data items to be skipped by the query. Card authors should not specify this property in their card payload. It is determined by the client and sent to the Bot to enable pagination. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - skip?: number; - - constructor(options: QueryDataOptions = {}) { - Object.assign(this, options); - } - - static from(options: Omit): QueryData { - return new QueryData(options); - } - - withDataset(dataset: string): this { - this.dataset = dataset; - return this; - } - - withAssociatedInputs(associatedInputs: 'auto' | 'none'): this { - this.associatedInputs = associatedInputs; - return this; - } - - withCount(count: number): this { - this.count = count; - return this; - } - - withSkip(skip: number): this { - this.skip = skip; - return this; - } -} - -/** - * An input to allow the user to rate something using stars. - */ -export interface IRatingInput { + key?: string; /** - * Must be **Input.Rating**. + * Must be **Input.ChoiceSet**. */ - readonly type: 'Input.Rating'; + readonly type: 'Input.ChoiceSet'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -10455,8 +8172,8 @@ export interface IRatingInput { isSortKey?: boolean; /** * The label of the input. - -A label should **always** be provided to ensure the best user experience especially for users of assistive technology. + * + * A label should **always** be provided to ensure the best user experience especially for users of assistive technology. */ label?: string; /** @@ -10470,27 +8187,43 @@ A label should **always** be provided to ensure the best user experience especia /** * An Action.ResetInputs action that will be executed when the value of the input changes. */ - valueChangedAction?: IResetInputsAction; + valueChangedAction?: IOpenUrlDialogAction | IPopoverAction | IResetInputsAction; /** * The default value of the input. */ - value?: number; + value?: string; /** - * The number of stars to display. + * The choices associated with the input. */ - max?: number; + choices: IChoice[]; /** - * Controls if the user can select half stars. + * A Data.Query object that defines the dataset from which to dynamically fetch the choices for the input. */ - allowHalfSteps?: boolean; + 'choices.data'?: IQueryData; /** - * The size of the stars. + * Controls whether the input should be displayed as a dropdown (compact) or a list of radio buttons or checkboxes (expanded). */ - size?: RatingSize; + style?: ChoiceSetInputStyle; /** - * The color of the stars. + * Controls whether multiple choices can be selected. */ - color?: RatingColor; + isMultiSelect?: boolean; + /** + * The text to display as a placeholder when the user has not entered any value. + */ + placeholder?: string; + /** + * Controls if choice titles should wrap. + */ + wrap?: boolean; + /** + * Controls whether choice items are arranged in multiple columns in expanded mode, or in a single column. Default is false. + */ + useMultipleColumns?: boolean; + /** + * The minimum width, in pixels, for each column when using a multi-column layout. This ensures that choice items remain readable even when horizontal space is limited. Default is 100 pixels. + */ + minColumnWidth?: string; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -10505,26 +8238,30 @@ A label should **always** be provided to ensure the best user experience especia * @hidden * @internal * - * Type guard to check if a value is of type IRatingInput. + * Type guard to check if a value is of type IChoiceSetInput. * * @param value The value to check. - * @returns True if the value is an instance of RatingInput, false otherwise. + * @returns True if the value is an instance of ChoiceSetInput, false otherwise. */ -export function isRatingInput(value: unknown): value is IRatingInput { - const obj = value as IRatingInput; - return typeof obj === 'object' && obj.type === 'Input.Rating'; +export function isChoiceSetInput(value: unknown): value is IChoiceSetInput { + const obj = value as IChoiceSetInput; + return typeof obj === 'object' && obj.type === 'Input.ChoiceSet'; } -export type RatingInputOptions = Omit; +export type ChoiceSetInputOptions = Partial>; /** - * An input to allow the user to rate something using stars. + * An input to allow the user to select one or more values. */ -export class RatingInput implements IRatingInput { +export class ChoiceSetInput implements IChoiceSetInput { /** - * Must be **Input.Rating**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type = 'Input.Rating'; + key?: string; + /** + * Must be **Input.ChoiceSet**. + */ + readonly type = 'Input.ChoiceSet'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -10532,7 +8269,7 @@ export class RatingInput implements IRatingInput { /** * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - requires?: IHostCapabilities; + requires?: IHostCapabilities = {}; /** * The locale associated with the element. */ @@ -10540,19 +8277,19 @@ export class RatingInput implements IRatingInput { /** * Controls the visibility of the element. */ - isVisible?: boolean; + isVisible?: boolean = true; /** * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. */ - separator?: boolean; + separator?: boolean = false; /** * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. */ - height?: ElementHeight; + height?: ElementHeight = 'auto'; /** * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ - spacing?: Spacing; + spacing?: Spacing = 'Default'; /** * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). */ @@ -10560,17 +8297,17 @@ export class RatingInput implements IRatingInput { /** * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. */ - isSortKey?: boolean; + isSortKey?: boolean = false; /** * The label of the input. - -A label should **always** be provided to ensure the best user experience especially for users of assistive technology. + * + * A label should **always** be provided to ensure the best user experience especially for users of assistive technology. */ label?: string; /** * Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. */ - isRequired?: boolean; + isRequired?: boolean = false; /** * The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. */ @@ -10578,27 +8315,43 @@ A label should **always** be provided to ensure the best user experience especia /** * An Action.ResetInputs action that will be executed when the value of the input changes. */ - valueChangedAction?: IResetInputsAction; + valueChangedAction?: IOpenUrlDialogAction | IPopoverAction | IResetInputsAction; /** * The default value of the input. */ - value?: number; + value?: string; /** - * The number of stars to display. + * The choices associated with the input. */ - max?: number; + choices: IChoice[]; /** - * Controls if the user can select half stars. + * A Data.Query object that defines the dataset from which to dynamically fetch the choices for the input. */ - allowHalfSteps?: boolean; + 'choices.data'?: IQueryData; /** - * The size of the stars. + * Controls whether the input should be displayed as a dropdown (compact) or a list of radio buttons or checkboxes (expanded). */ - size?: RatingSize; + style?: ChoiceSetInputStyle = 'compact'; /** - * The color of the stars. + * Controls whether multiple choices can be selected. */ - color?: RatingColor; + isMultiSelect?: boolean = false; + /** + * The text to display as a placeholder when the user has not entered any value. + */ + placeholder?: string; + /** + * Controls if choice titles should wrap. + */ + wrap?: boolean = true; + /** + * Controls whether choice items are arranged in multiple columns in expanded mode, or in a single column. Default is false. + */ + useMultipleColumns?: boolean = false; + /** + * The minimum width, in pixels, for each column when using a multi-column layout. This ensures that choice items remain readable even when horizontal space is limited. Default is 100 pixels. + */ + minColumnWidth?: string; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -10608,12 +8361,18 @@ A label should **always** be provided to ensure the best user experience especia */ fallback?: FallbackElement; - constructor(options: RatingInputOptions = {}) { - Object.assign(this, options); + constructor(...choices: IChoice[]) { + this.choices = choices; } - static from(options: Omit): RatingInput { - return new RatingInput(options); + withOptions(value: ChoiceSetInputOptions): this { + Object.assign(this, value); + return this; + } + + withKey(key: string): this { + this.key = key; + return this; } withId(id: string): this { @@ -10676,33 +8435,48 @@ A label should **always** be provided to ensure the best user experience especia return this; } - withValueChangedAction(valueChangedAction: IResetInputsAction): this { + withValueChangedAction(valueChangedAction: IOpenUrlDialogAction | IPopoverAction | IResetInputsAction): this { this.valueChangedAction = valueChangedAction; return this; } - withValue(value: number): this { + withValue(value: string): this { this.value = value; return this; } - withMax(max: number): this { - this.max = max; + withChoices(...choices: IChoice[]): this { + this.choices = choices; return this; } - withAllowHalfSteps(allowHalfSteps = true): this { - this.allowHalfSteps = allowHalfSteps; + withStyle(style: ChoiceSetInputStyle): this { + this.style = style; return this; } - withSize(size: RatingSize): this { - this.size = size; + withIsMultiSelect(isMultiSelect = true): this { + this.isMultiSelect = isMultiSelect; return this; } - withColor(color: RatingColor): this { - this.color = color; + withPlaceholder(placeholder: string): this { + this.placeholder = placeholder; + return this; + } + + withWrap(wrap = false): this { + this.wrap = wrap; + return this; + } + + withUseMultipleColumns(useMultipleColumns = true): this { + this.useMultipleColumns = useMultipleColumns; + return this; + } + + withMinColumnWidth(minColumnWidth: string): this { + this.minColumnWidth = minColumnWidth; return this; } @@ -10713,111 +8487,188 @@ A label should **always** be provided to ensure the best user experience especia } /** - * A read-only star rating element, to display the rating of something. + * A choice as used by the Input.ChoiceSet input. */ -export interface IRating { - /** - * Must be **Rating**. - */ - readonly type: 'Rating'; +export interface IChoice { /** - * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - id?: string; + key?: string; /** - * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + * The text to display for the choice. */ - requires?: IHostCapabilities; + title?: string; /** - * The locale associated with the element. + * The value associated with the choice, as sent to the Bot when an Action.Submit or Action.Execute is invoked */ - lang?: string; + value?: string; +} + + +export type ChoiceOptions = Partial; + +/** + * A choice as used by the Input.ChoiceSet input. + */ +export class Choice implements IChoice { /** - * Controls the visibility of the element. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - isVisible?: boolean; + key?: string; /** - * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + * The text to display for the choice. */ - separator?: boolean; + title?: string; /** - * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + * The value associated with the choice, as sent to the Bot when an Action.Submit or Action.Execute is invoked */ - height?: ElementHeight; + value?: string; + + constructor(options: ChoiceOptions = {}) { + Object.assign(this, options); + } + + static from(options: IChoice): Choice { + return new Choice(options); + } + + withKey(key: string): this { + this.key = key; + return this; + } + + withTitle(title: string): this { + this.title = title; + return this; + } + + withValue(value: string): this { + this.value = value; + return this; + } +} + +/** + * Defines a query to dynamically fetch data from a Bot. + */ +export interface IQueryData { /** - * Controls how the element should be horizontally aligned. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - horizontalAlignment?: HorizontalAlignment; + key?: string; /** - * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + * Must be **Data.Query**. */ - spacing?: Spacing; + readonly type: 'Data.Query'; /** - * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + * The dataset from which to fetch the data. */ - targetWidth?: TargetWidth; + dataset?: string; /** - * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + * Controls which inputs are associated with the Data.Query. When a Data.Query is executed, the values of the associated inputs are sent to the Bot, allowing it to perform filtering operations based on the user's input. */ - isSortKey?: boolean; + associatedInputs?: AssociatedInputs; /** - * The value of the rating. Must be between 0 and max. + * The maximum number of data items that should be returned by the query. Card authors should not specify this property in their card payload. It is determined by the client and sent to the Bot to enable pagination. */ - value?: number; + count?: number; /** - * The number of "votes" associated with the rating. + * The number of data items to be skipped by the query. Card authors should not specify this property in their card payload. It is determined by the client and sent to the Bot to enable pagination. */ - count?: number; + skip?: number; +} + +/** + * @hidden + * @internal + * + * Type guard to check if a value is of type IQueryData. + * + * @param value The value to check. + * @returns True if the value is an instance of QueryData, false otherwise. + */ +export function isQueryData(value: unknown): value is IQueryData { + const obj = value as IQueryData; + return typeof obj === 'object' && obj.type === 'Data.Query'; +} + +export type QueryDataOptions = Partial>; + +/** + * Defines a query to dynamically fetch data from a Bot. + */ +export class QueryData implements IQueryData { /** - * The number of stars to display. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - max?: number; + key?: string; /** - * The size of the stars. + * Must be **Data.Query**. */ - size?: RatingSize; + readonly type = 'Data.Query'; /** - * The color of the stars. + * The dataset from which to fetch the data. */ - color?: RatingColor; + dataset?: string; /** - * The style of the stars. + * Controls which inputs are associated with the Data.Query. When a Data.Query is executed, the values of the associated inputs are sent to the Bot, allowing it to perform filtering operations based on the user's input. */ - style?: RatingStyle; + associatedInputs?: AssociatedInputs; /** - * The area of a Layout.AreaGrid layout in which an element should be displayed. + * The maximum number of data items that should be returned by the query. Card authors should not specify this property in their card payload. It is determined by the client and sent to the Bot to enable pagination. */ - 'grid.area'?: string; + count?: number; /** - * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + * The number of data items to be skipped by the query. Card authors should not specify this property in their card payload. It is determined by the client and sent to the Bot to enable pagination. */ - fallback?: FallbackElement; -} + skip?: number; -/** - * @hidden - * @internal - * - * Type guard to check if a value is of type IRating. - * - * @param value The value to check. - * @returns True if the value is an instance of Rating, false otherwise. - */ -export function isRating(value: unknown): value is IRating { - const obj = value as IRating; - return typeof obj === 'object' && obj.type === 'Rating'; -} + constructor(options: QueryDataOptions = {}) { + Object.assign(this, options); + } + + static from(options: Omit): QueryData { + return new QueryData(options); + } + + withKey(key: string): this { + this.key = key; + return this; + } + + withDataset(dataset: string): this { + this.dataset = dataset; + return this; + } -export type RatingOptions = Omit; + withAssociatedInputs(associatedInputs: AssociatedInputs): this { + this.associatedInputs = associatedInputs; + return this; + } + + withCount(count: number): this { + this.count = count; + return this; + } + + withSkip(skip: number): this { + this.skip = skip; + return this; + } +} /** - * A read-only star rating element, to display the rating of something. + * An input to allow the user to rate something using stars. */ -export class Rating implements IRating { +export interface IRatingInput { /** - * Must be **Rating**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type = 'Rating'; + key?: string; + /** + * Must be **Input.Rating**. + */ + readonly type: 'Input.Rating'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -10842,10 +8693,6 @@ export class Rating implements IRating { * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. */ height?: ElementHeight; - /** - * Controls how the element should be horizontally aligned. - */ - horizontalAlignment?: HorizontalAlignment; /** * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ @@ -10859,29 +8706,43 @@ export class Rating implements IRating { */ isSortKey?: boolean; /** - * The value of the rating. Must be between 0 and max. + * The label of the input. + * + * A label should **always** be provided to ensure the best user experience especially for users of assistive technology. */ - value?: number; + label?: string; /** - * The number of "votes" associated with the rating. + * Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. */ - count?: number; + isRequired?: boolean; /** - * The number of stars to display. + * The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. */ - max?: number; + errorMessage?: string; /** - * The size of the stars. + * An Action.ResetInputs action that will be executed when the value of the input changes. */ - size?: RatingSize; + valueChangedAction?: IOpenUrlDialogAction | IPopoverAction | IResetInputsAction; /** - * The color of the stars. + * The default value of the input. */ - color?: RatingColor; + value?: number; /** - * The style of the stars. + * The number of stars to display. */ - style?: RatingStyle; + max?: number; + /** + * Controls if the user can select half stars. + */ + allowHalfSteps?: boolean; + /** + * The size of the stars. + */ + size?: RatingSize; + /** + * The color of the stars. + */ + color?: RatingColor; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -10890,13 +8751,130 @@ export class Rating implements IRating { * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. */ fallback?: FallbackElement; +} - constructor(options: RatingOptions = {}) { +/** + * @hidden + * @internal + * + * Type guard to check if a value is of type IRatingInput. + * + * @param value The value to check. + * @returns True if the value is an instance of RatingInput, false otherwise. + */ +export function isRatingInput(value: unknown): value is IRatingInput { + const obj = value as IRatingInput; + return typeof obj === 'object' && obj.type === 'Input.Rating'; +} + +export type RatingInputOptions = Partial>; + +/** + * An input to allow the user to rate something using stars. + */ +export class RatingInput implements IRatingInput { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * Must be **Input.Rating**. + */ + readonly type = 'Input.Rating'; + /** + * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + */ + id?: string; + /** + * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + */ + requires?: IHostCapabilities = {}; + /** + * The locale associated with the element. + */ + lang?: string; + /** + * Controls the visibility of the element. + */ + isVisible?: boolean = true; + /** + * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + */ + separator?: boolean = false; + /** + * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + */ + height?: ElementHeight = 'auto'; + /** + * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + */ + spacing?: Spacing = 'Default'; + /** + * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + */ + targetWidth?: TargetWidth; + /** + * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + */ + isSortKey?: boolean = false; + /** + * The label of the input. + * + * A label should **always** be provided to ensure the best user experience especially for users of assistive technology. + */ + label?: string; + /** + * Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. + */ + isRequired?: boolean = false; + /** + * The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details. + */ + errorMessage?: string; + /** + * An Action.ResetInputs action that will be executed when the value of the input changes. + */ + valueChangedAction?: IOpenUrlDialogAction | IPopoverAction | IResetInputsAction; + /** + * The default value of the input. + */ + value?: number; + /** + * The number of stars to display. + */ + max?: number = 5; + /** + * Controls if the user can select half stars. + */ + allowHalfSteps?: boolean = false; + /** + * The size of the stars. + */ + size?: RatingSize = 'Large'; + /** + * The color of the stars. + */ + color?: RatingColor = 'Neutral'; + /** + * The area of a Layout.AreaGrid layout in which an element should be displayed. + */ + 'grid.area'?: string; + /** + * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + */ + fallback?: FallbackElement; + + constructor(options: RatingInputOptions = {}) { Object.assign(this, options); } - static from(options: Omit): Rating { - return new Rating(options); + static from(options: Omit): RatingInput { + return new RatingInput(options); + } + + withKey(key: string): this { + this.key = key; + return this; } withId(id: string): this { @@ -10929,11 +8907,6 @@ export class Rating implements IRating { return this; } - withHorizontalAlignment(horizontalAlignment: HorizontalAlignment): this { - this.horizontalAlignment = horizontalAlignment; - return this; - } - withSpacing(spacing: Spacing): this { this.spacing = spacing; return this; @@ -10949,13 +8922,28 @@ export class Rating implements IRating { return this; } - withValue(value: number): this { - this.value = value; + withLabel(label: string): this { + this.label = label; return this; } - withCount(count: number): this { - this.count = count; + withIsRequired(isRequired = true): this { + this.isRequired = isRequired; + return this; + } + + withErrorMessage(errorMessage: string): this { + this.errorMessage = errorMessage; + return this; + } + + withValueChangedAction(valueChangedAction: IOpenUrlDialogAction | IPopoverAction | IResetInputsAction): this { + this.valueChangedAction = valueChangedAction; + return this; + } + + withValue(value: number): this { + this.value = value; return this; } @@ -10964,6 +8952,11 @@ export class Rating implements IRating { return this; } + withAllowHalfSteps(allowHalfSteps = true): this { + this.allowHalfSteps = allowHalfSteps; + return this; + } + withSize(size: RatingSize): this { this.size = size; return this; @@ -10974,11 +8967,6 @@ export class Rating implements IRating { return this; } - withStyle(style: RatingStyle): this { - this.style = style; - return this; - } - withFallback(fallback: FallbackElement): this { this.fallback = fallback; return this; @@ -10986,13 +8974,17 @@ export class Rating implements IRating { } /** - * A special type of button with an icon, title and description. + * A read-only star rating element, to display the rating of something. */ -export interface ICompoundButton { +export interface IRating { /** - * Must be **CompoundButton**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type: 'CompoundButton'; + key?: string; + /** + * Must be **Rating**. + */ + readonly type: 'Rating'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -11034,30 +9026,29 @@ export interface ICompoundButton { */ isSortKey?: boolean; /** - * The icon to show on the button. + * The value of the rating. Must be between 0 and max. */ - icon?: IIconInfo; + value?: number; /** - * The badge to show on the button. + * The number of "votes" associated with the rating. */ - badge?: string; + count?: number; /** - * The title of the button. + * The number of stars to display. */ - title?: string; + max?: number; /** - * The description text of the button. + * The size of the stars. */ - description?: string; + size?: RatingSize; /** - * An Action that will be invoked when the button is tapped or clicked. Action.ShowCard is not supported. + * The color of the stars. */ - selectAction?: - | IExecuteAction - | IOpenUrlAction - | IResetInputsAction - | ISubmitAction - | IToggleVisibilityAction; + color?: RatingColor; + /** + * The style of the stars. + */ + style?: RatingStyle; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -11072,26 +9063,30 @@ export interface ICompoundButton { * @hidden * @internal * - * Type guard to check if a value is of type ICompoundButton. + * Type guard to check if a value is of type IRating. * * @param value The value to check. - * @returns True if the value is an instance of CompoundButton, false otherwise. + * @returns True if the value is an instance of Rating, false otherwise. */ -export function isCompoundButton(value: unknown): value is ICompoundButton { - const obj = value as ICompoundButton; - return typeof obj === 'object' && obj.type === 'CompoundButton'; +export function isRating(value: unknown): value is IRating { + const obj = value as IRating; + return typeof obj === 'object' && obj.type === 'Rating'; } -export type CompoundButtonOptions = Omit; +export type RatingOptions = Partial>; /** - * A special type of button with an icon, title and description. + * A read-only star rating element, to display the rating of something. */ -export class CompoundButton implements ICompoundButton { +export class Rating implements IRating { /** - * Must be **CompoundButton**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type = 'CompoundButton'; + key?: string; + /** + * Must be **Rating**. + */ + readonly type = 'Rating'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -11099,7 +9094,7 @@ export class CompoundButton implements ICompoundButton { /** * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - requires?: IHostCapabilities; + requires?: IHostCapabilities = {}; /** * The locale associated with the element. */ @@ -11107,15 +9102,15 @@ export class CompoundButton implements ICompoundButton { /** * Controls the visibility of the element. */ - isVisible?: boolean; + isVisible?: boolean = true; /** * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. */ - separator?: boolean; + separator?: boolean = false; /** * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. */ - height?: ElementHeight; + height?: ElementHeight = 'auto'; /** * Controls how the element should be horizontally aligned. */ @@ -11123,7 +9118,7 @@ export class CompoundButton implements ICompoundButton { /** * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ - spacing?: Spacing; + spacing?: Spacing = 'Default'; /** * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). */ @@ -11131,32 +9126,31 @@ export class CompoundButton implements ICompoundButton { /** * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. */ - isSortKey?: boolean; + isSortKey?: boolean = false; /** - * The icon to show on the button. + * The value of the rating. Must be between 0 and max. */ - icon?: IIconInfo; + value?: number; /** - * The badge to show on the button. + * The number of "votes" associated with the rating. */ - badge?: string; + count?: number; /** - * The title of the button. + * The number of stars to display. */ - title?: string; + max?: number = 5; /** - * The description text of the button. + * The size of the stars. */ - description?: string; + size?: RatingSize = 'Large'; /** - * An Action that will be invoked when the button is tapped or clicked. Action.ShowCard is not supported. + * The color of the stars. + */ + color?: RatingColor = 'Neutral'; + /** + * The style of the stars. */ - selectAction?: - | IExecuteAction - | IOpenUrlAction - | IResetInputsAction - | ISubmitAction - | IToggleVisibilityAction; + style?: RatingStyle = 'Default'; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -11166,12 +9160,17 @@ export class CompoundButton implements ICompoundButton { */ fallback?: FallbackElement; - constructor(options: CompoundButtonOptions = {}) { + constructor(options: RatingOptions = {}) { Object.assign(this, options); } - static from(options: Omit): CompoundButton { - return new CompoundButton(options); + static from(options: Omit): Rating { + return new Rating(options); + } + + withKey(key: string): this { + this.key = key; + return this; } withId(id: string): this { @@ -11224,126 +9223,54 @@ export class CompoundButton implements ICompoundButton { return this; } - withIcon(icon: IIconInfo): this { - this.icon = icon; + withValue(value: number): this { + this.value = value; return this; } - withBadge(badge: string): this { - this.badge = badge; + withCount(count: number): this { + this.count = count; return this; } - withTitle(title: string): this { - this.title = title; + withMax(max: number): this { + this.max = max; return this; } - withDescription(description: string): this { - this.description = description; - return this; - } - - withSelectAction( - selectAction: - | IExecuteAction - | IOpenUrlAction - | IResetInputsAction - | ISubmitAction - | IToggleVisibilityAction - ): this { - this.selectAction = selectAction; - return this; - } - - withFallback(fallback: FallbackElement): this { - this.fallback = fallback; - return this; - } -} - -/** - * Defines information about a Fluent icon and how it should be rendered. - */ -export interface IIconInfo { - /** - * The name of the icon to display. - */ - name?: string; - /** - * The size of the icon. - */ - size?: IconSize; - /** - * The style of the icon. - */ - style?: IconStyle; - /** - * The color of the icon. - */ - color?: TextColor; -} - -export type IconInfoOptions = IIconInfo; - -/** - * Defines information about a Fluent icon and how it should be rendered. - */ -export class IconInfo implements IIconInfo { - /** - * The name of the icon to display. - */ - name?: string; - /** - * The size of the icon. - */ - size?: IconSize; - /** - * The style of the icon. - */ - style?: IconStyle; - /** - * The color of the icon. - */ - color?: TextColor; - - constructor(options: IconInfoOptions = {}) { - Object.assign(this, options); - } - - static from(options: IIconInfo): IconInfo { - return new IconInfo(options); - } - - withName(name: string): this { - this.name = name; + withSize(size: RatingSize): this { + this.size = size; return this; } - withSize(size: IconSize): this { - this.size = size; + withColor(color: RatingColor): this { + this.color = color; return this; } - withStyle(style: IconStyle): this { + withStyle(style: RatingStyle): this { this.style = style; return this; } - withColor(color: TextColor): this { - this.color = color; + withFallback(fallback: FallbackElement): this { + this.fallback = fallback; return this; } } /** - * A standalone icon element. Icons can be picked from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog). + * A special type of button with an icon, title and description. */ -export interface IIcon { +export interface ICompoundButton { /** - * Must be **Icon**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type: 'Icon'; + key?: string; + /** + * Must be **CompoundButton**. + */ + readonly type: 'CompoundButton'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -11364,6 +9291,10 @@ export interface IIcon { * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. */ separator?: boolean; + /** + * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + */ + height?: ElementHeight; /** * Controls how the element should be horizontally aligned. */ @@ -11381,30 +9312,25 @@ export interface IIcon { */ isSortKey?: boolean; /** - * The name of the icon to display. + * The icon to show on the button. */ - name: string; + icon?: IIconInfo; /** - * The size of the icon. + * The badge to show on the button. */ - size?: IconSize; + badge?: string; /** - * The style of the icon. + * The title of the button. */ - style?: IconStyle; + title?: string; /** - * The color of the icon. + * The description text of the button. */ - color?: TextColor; + description?: string; /** - * An Action that will be invoked when the icon is tapped or clicked. Action.ShowCard is not supported. + * An Action that will be invoked when the button is tapped or clicked. Action.ShowCard is not supported. */ - selectAction?: - | IExecuteAction - | IOpenUrlAction - | IResetInputsAction - | ISubmitAction - | IToggleVisibilityAction; + selectAction?: IExecuteAction | IInsertImageAction | IOpenUrlAction | IOpenUrlDialogAction | IPopoverAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -11419,26 +9345,30 @@ export interface IIcon { * @hidden * @internal * - * Type guard to check if a value is of type IIcon. + * Type guard to check if a value is of type ICompoundButton. * * @param value The value to check. - * @returns True if the value is an instance of Icon, false otherwise. + * @returns True if the value is an instance of CompoundButton, false otherwise. */ -export function isIcon(value: unknown): value is IIcon { - const obj = value as IIcon; - return typeof obj === 'object' && obj.type === 'Icon'; +export function isCompoundButton(value: unknown): value is ICompoundButton { + const obj = value as ICompoundButton; + return typeof obj === 'object' && obj.type === 'CompoundButton'; } -export type IconOptions = Omit; +export type CompoundButtonOptions = Partial>; /** - * A standalone icon element. Icons can be picked from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog). + * A special type of button with an icon, title and description. */ -export class Icon implements IIcon { +export class CompoundButton implements ICompoundButton { /** - * Must be **Icon**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type = 'Icon'; + key?: string; + /** + * Must be **CompoundButton**. + */ + readonly type = 'CompoundButton'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -11446,7 +9376,7 @@ export class Icon implements IIcon { /** * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - requires?: IHostCapabilities; + requires?: IHostCapabilities = {}; /** * The locale associated with the element. */ @@ -11454,11 +9384,15 @@ export class Icon implements IIcon { /** * Controls the visibility of the element. */ - isVisible?: boolean; + isVisible?: boolean = true; /** * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. */ - separator?: boolean; + separator?: boolean = false; + /** + * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + */ + height?: ElementHeight = 'auto'; /** * Controls how the element should be horizontally aligned. */ @@ -11466,7 +9400,7 @@ export class Icon implements IIcon { /** * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ - spacing?: Spacing; + spacing?: Spacing = 'Default'; /** * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). */ @@ -11474,32 +9408,27 @@ export class Icon implements IIcon { /** * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. */ - isSortKey?: boolean; + isSortKey?: boolean = false; /** - * The name of the icon to display. + * The icon to show on the button. */ - name: string; + icon?: IIconInfo; /** - * The size of the icon. + * The badge to show on the button. */ - size?: IconSize; + badge?: string; /** - * The style of the icon. + * The title of the button. */ - style?: IconStyle; + title?: string; /** - * The color of the icon. + * The description text of the button. */ - color?: TextColor; + description?: string; /** - * An Action that will be invoked when the icon is tapped or clicked. Action.ShowCard is not supported. + * An Action that will be invoked when the button is tapped or clicked. Action.ShowCard is not supported. */ - selectAction?: - | IExecuteAction - | IOpenUrlAction - | IResetInputsAction - | ISubmitAction - | IToggleVisibilityAction; + selectAction?: IExecuteAction | IInsertImageAction | IOpenUrlAction | IOpenUrlDialogAction | IPopoverAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -11509,13 +9438,17 @@ export class Icon implements IIcon { */ fallback?: FallbackElement; - constructor(name: string, options: IconOptions = {}) { + constructor(options: CompoundButtonOptions = {}) { Object.assign(this, options); - this.name = name; } - static from(options: Omit): Icon { - return new Icon(options.name, options); + static from(options: Omit): CompoundButton { + return new CompoundButton(options); + } + + withKey(key: string): this { + this.key = key; + return this; } withId(id: string): this { @@ -11543,6 +9476,11 @@ export class Icon implements IIcon { return this; } + withHeight(height: ElementHeight): this { + this.height = height; + return this; + } + withHorizontalAlignment(horizontalAlignment: HorizontalAlignment): this { this.horizontalAlignment = horizontalAlignment; return this; @@ -11563,34 +9501,27 @@ export class Icon implements IIcon { return this; } - withName(name: string): this { - this.name = name; + withIcon(icon: IIconInfo): this { + this.icon = icon; return this; } - withSize(size: IconSize): this { - this.size = size; + withBadge(badge: string): this { + this.badge = badge; return this; } - withStyle(style: IconStyle): this { - this.style = style; + withTitle(title: string): this { + this.title = title; return this; } - withColor(color: TextColor): this { - this.color = color; + withDescription(description: string): this { + this.description = description; return this; } - withSelectAction( - selectAction: - | IExecuteAction - | IOpenUrlAction - | IResetInputsAction - | ISubmitAction - | IToggleVisibilityAction - ): this { + withSelectAction(selectAction: IExecuteAction | IInsertImageAction | IOpenUrlAction | IOpenUrlDialogAction | IPopoverAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction): this { this.selectAction = selectAction; return this; } @@ -11602,99 +9533,199 @@ export class Icon implements IIcon { } /** - * A carousel with sliding pages. + * Defines information about a Fluent icon and how it should be rendered. */ -export interface ICarousel { - /** - * Must be **Carousel**. - */ - readonly type: 'Carousel'; - /** - * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - */ - id?: string; - /** - * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - */ - requires?: IHostCapabilities; - /** - * The locale associated with the element. - */ - lang?: string; - /** - * Controls the visibility of the element. - */ - isVisible?: boolean; +export interface IIconInfo { /** - * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - separator?: boolean; + key?: string; /** - * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + * The name of the icon to display. */ - height?: ElementHeight; + name?: string; /** - * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + * The size of the icon. */ - spacing?: Spacing; + size?: IconSize; /** - * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + * The style of the icon. */ - targetWidth?: TargetWidth; + style?: IconStyle; /** - * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + * The color of the icon. */ - isSortKey?: boolean; + color?: TextColor; +} + + +export type IconInfoOptions = Partial; + +/** + * Defines information about a Fluent icon and how it should be rendered. + */ +export class IconInfo implements IIconInfo { /** - * Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - bleed?: boolean; + key?: string; /** - * The minimum height, in pixels, of the container, in the `px` format. + * The name of the icon to display. */ - minHeight?: string; + name?: string; /** - * Controls the type of animation to use to navigate between pages. + * The size of the icon. */ - pageAnimation?: CarouselPageAnimation; + size?: IconSize = 'xSmall'; /** - * The area of a Layout.AreaGrid layout in which an element should be displayed. + * The style of the icon. */ - 'grid.area'?: string; + style?: IconStyle = 'Regular'; /** - * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + * The color of the icon. */ - fallback?: FallbackElement; - /** - * The pages in the carousel. + color?: TextColor = 'Default'; + + constructor(options: IconInfoOptions = {}) { + Object.assign(this, options); + } + + static from(options: IIconInfo): IconInfo { + return new IconInfo(options); + } + + withKey(key: string): this { + this.key = key; + return this; + } + + withName(name: string): this { + this.name = name; + return this; + } + + withSize(size: IconSize): this { + this.size = size; + return this; + } + + withStyle(style: IconStyle): this { + this.style = style; + return this; + } + + withColor(color: TextColor): this { + this.color = color; + return this; + } +} + +/** + * A standalone icon element. Icons can be picked from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog). + */ +export interface IIcon { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - pages?: ICarouselPage[]; + key?: string; + /** + * Must be **Icon**. + */ + readonly type: 'Icon'; + /** + * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + */ + id?: string; + /** + * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + */ + requires?: IHostCapabilities; + /** + * The locale associated with the element. + */ + lang?: string; + /** + * Controls the visibility of the element. + */ + isVisible?: boolean; + /** + * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + */ + separator?: boolean; + /** + * Controls how the element should be horizontally aligned. + */ + horizontalAlignment?: HorizontalAlignment; + /** + * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + */ + spacing?: Spacing; + /** + * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + */ + targetWidth?: TargetWidth; + /** + * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + */ + isSortKey?: boolean; + /** + * The name of the icon to display. + */ + name: string; + /** + * The size of the icon. + */ + size?: IconSize; + /** + * The style of the icon. + */ + style?: IconStyle; + /** + * The color of the icon. + */ + color?: TextColor; + /** + * An Action that will be invoked when the icon is tapped or clicked. Action.ShowCard is not supported. + */ + selectAction?: IExecuteAction | IInsertImageAction | IOpenUrlAction | IOpenUrlDialogAction | IPopoverAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction; + /** + * The area of a Layout.AreaGrid layout in which an element should be displayed. + */ + 'grid.area'?: string; + /** + * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + */ + fallback?: FallbackElement; } /** * @hidden * @internal * - * Type guard to check if a value is of type ICarousel. + * Type guard to check if a value is of type IIcon. * * @param value The value to check. - * @returns True if the value is an instance of Carousel, false otherwise. + * @returns True if the value is an instance of Icon, false otherwise. */ -export function isCarousel(value: unknown): value is ICarousel { - const obj = value as ICarousel; - return typeof obj === 'object' && obj.type === 'Carousel'; +export function isIcon(value: unknown): value is IIcon { + const obj = value as IIcon; + return typeof obj === 'object' && obj.type === 'Icon'; } -export type CarouselOptions = Omit; +export type IconOptions = Partial>; /** - * A carousel with sliding pages. + * A standalone icon element. Icons can be picked from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog). */ -export class Carousel implements ICarousel { +export class Icon implements IIcon { /** - * Must be **Carousel**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type = 'Carousel'; + key?: string; + /** + * Must be **Icon**. + */ + readonly type = 'Icon'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -11702,7 +9733,7 @@ export class Carousel implements ICarousel { /** * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - requires?: IHostCapabilities; + requires?: IHostCapabilities = {}; /** * The locale associated with the element. */ @@ -11710,19 +9741,19 @@ export class Carousel implements ICarousel { /** * Controls the visibility of the element. */ - isVisible?: boolean; + isVisible?: boolean = true; /** * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. */ - separator?: boolean; + separator?: boolean = false; /** - * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + * Controls how the element should be horizontally aligned. */ - height?: ElementHeight; + horizontalAlignment?: HorizontalAlignment; /** * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ - spacing?: Spacing; + spacing?: Spacing = 'Default'; /** * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). */ @@ -11730,19 +9761,27 @@ export class Carousel implements ICarousel { /** * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. */ - isSortKey?: boolean; + isSortKey?: boolean = false; /** - * Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. + * The name of the icon to display. */ - bleed?: boolean; + name: string; /** - * The minimum height, in pixels, of the container, in the `px` format. + * The size of the icon. */ - minHeight?: string; + size?: IconSize = 'Standard'; /** - * Controls the type of animation to use to navigate between pages. + * The style of the icon. */ - pageAnimation?: CarouselPageAnimation; + style?: IconStyle = 'Regular'; + /** + * The color of the icon. + */ + color?: TextColor = 'Default'; + /** + * An Action that will be invoked when the icon is tapped or clicked. Action.ShowCard is not supported. + */ + selectAction?: IExecuteAction | IInsertImageAction | IOpenUrlAction | IOpenUrlDialogAction | IPopoverAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -11751,17 +9790,19 @@ export class Carousel implements ICarousel { * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. */ fallback?: FallbackElement; - /** - * The pages in the carousel. - */ - pages?: ICarouselPage[]; - constructor(options: CarouselOptions = {}) { + constructor(name: string, options: IconOptions = {}) { Object.assign(this, options); + this.name = name; } - static from(options: Omit): Carousel { - return new Carousel(options); + static from(options: Omit): Icon { + return new Icon(options.name, options); + } + + withKey(key: string): this { + this.key = key; + return this; } withId(id: string): this { @@ -11789,8 +9830,8 @@ export class Carousel implements ICarousel { return this; } - withHeight(height: ElementHeight): this { - this.height = height; + withHorizontalAlignment(horizontalAlignment: HorizontalAlignment): this { + this.horizontalAlignment = horizontalAlignment; return this; } @@ -11809,40 +9850,49 @@ export class Carousel implements ICarousel { return this; } - withBleed(bleed = true): this { - this.bleed = bleed; + withName(name: string): this { + this.name = name; return this; } - withMinHeight(minHeight: string): this { - this.minHeight = minHeight; + withSize(size: IconSize): this { + this.size = size; return this; } - withPageAnimation(pageAnimation: CarouselPageAnimation): this { - this.pageAnimation = pageAnimation; + withStyle(style: IconStyle): this { + this.style = style; return this; } - withFallback(fallback: FallbackElement): this { - this.fallback = fallback; + withColor(color: TextColor): this { + this.color = color; return this; } - withPages(...pages: ICarouselPage[]): this { - this.pages = pages; + withSelectAction(selectAction: IExecuteAction | IInsertImageAction | IOpenUrlAction | IOpenUrlDialogAction | IPopoverAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction): this { + this.selectAction = selectAction; + return this; + } + + withFallback(fallback: FallbackElement): this { + this.fallback = fallback; return this; } } /** - * A badge element to show an icon and/or text in a compact form over a colored background. + * A carousel with sliding pages. */ -export interface IBadge { +export interface ICarousel { /** - * Must be **Badge**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type: 'Badge'; + key?: string; + /** + * Must be **Carousel**. + */ + readonly type: 'Carousel'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -11867,10 +9917,6 @@ export interface IBadge { * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. */ height?: ElementHeight; - /** - * Controls how the element should be horizontally aligned. - */ - horizontalAlignment?: HorizontalAlignment; /** * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ @@ -11884,37 +9930,17 @@ export interface IBadge { */ isSortKey?: boolean; /** - * The text to display. - */ - text?: string; - /** - * The name of an icon from the [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) to display, in the `[,regular|filled]` format. If the style is not specified, the regular style is used. - */ - icon?: string; - /** - * Controls the position of the icon. - */ - iconPosition?: BadgeIconPosition; - /** - * Controls the strength of the background color. - */ - appearance?: BadgeAppearance; - /** - * The size of the badge. - */ - size?: BadgeSize; - /** - * Controls the shape of the badge. + * Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. */ - shape?: BadgeShape; + bleed?: boolean; /** - * The style of the badge. + * The minimum height, in pixels, of the container, in the `px` format. */ - style?: BadgeStyle; + minHeight?: string; /** - * Controls the tooltip text to display when the badge is hovered over. + * Controls the type of animation to use to navigate between pages. */ - tooltip?: string; + pageAnimation?: CarouselPageAnimation; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -11923,32 +9949,40 @@ export interface IBadge { * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. */ fallback?: FallbackElement; + /** + * The pages in the carousel. + */ + pages?: ICarouselPage[]; } /** * @hidden * @internal * - * Type guard to check if a value is of type IBadge. + * Type guard to check if a value is of type ICarousel. * * @param value The value to check. - * @returns True if the value is an instance of Badge, false otherwise. + * @returns True if the value is an instance of Carousel, false otherwise. */ -export function isBadge(value: unknown): value is IBadge { - const obj = value as IBadge; - return typeof obj === 'object' && obj.type === 'Badge'; +export function isCarousel(value: unknown): value is ICarousel { + const obj = value as ICarousel; + return typeof obj === 'object' && obj.type === 'Carousel'; } -export type BadgeOptions = Omit; +export type CarouselOptions = Partial>; /** - * A badge element to show an icon and/or text in a compact form over a colored background. + * A carousel with sliding pages. */ -export class Badge implements IBadge { +export class Carousel implements ICarousel { /** - * Must be **Badge**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type = 'Badge'; + key?: string; + /** + * Must be **Carousel**. + */ + readonly type = 'Carousel'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -11956,7 +9990,7 @@ export class Badge implements IBadge { /** * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - requires?: IHostCapabilities; + requires?: IHostCapabilities = {}; /** * The locale associated with the element. */ @@ -11964,23 +9998,19 @@ export class Badge implements IBadge { /** * Controls the visibility of the element. */ - isVisible?: boolean; + isVisible?: boolean = true; /** * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. */ - separator?: boolean; + separator?: boolean = false; /** * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. */ - height?: ElementHeight; - /** - * Controls how the element should be horizontally aligned. - */ - horizontalAlignment?: HorizontalAlignment; + height?: ElementHeight = 'auto'; /** * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ - spacing?: Spacing; + spacing?: Spacing = 'Default'; /** * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). */ @@ -11988,39 +10018,19 @@ export class Badge implements IBadge { /** * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. */ - isSortKey?: boolean; - /** - * The text to display. - */ - text?: string; - /** - * The name of an icon from the [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) to display, in the `[,regular|filled]` format. If the style is not specified, the regular style is used. - */ - icon?: string; - /** - * Controls the position of the icon. - */ - iconPosition?: BadgeIconPosition; - /** - * Controls the strength of the background color. - */ - appearance?: BadgeAppearance; - /** - * The size of the badge. - */ - size?: BadgeSize; + isSortKey?: boolean = false; /** - * Controls the shape of the badge. + * Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. */ - shape?: BadgeShape; + bleed?: boolean = false; /** - * The style of the badge. + * The minimum height, in pixels, of the container, in the `px` format. */ - style?: BadgeStyle; + minHeight?: string; /** - * Controls the tooltip text to display when the badge is hovered over. + * Controls the type of animation to use to navigate between pages. */ - tooltip?: string; + pageAnimation?: CarouselPageAnimation = 'Slide'; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -12029,13 +10039,22 @@ export class Badge implements IBadge { * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. */ fallback?: FallbackElement; + /** + * The pages in the carousel. + */ + pages?: ICarouselPage[]; - constructor(options: BadgeOptions = {}) { + constructor(options: CarouselOptions = {}) { Object.assign(this, options); } - static from(options: Omit): Badge { - return new Badge(options); + static from(options: Omit): Carousel { + return new Carousel(options); + } + + withKey(key: string): this { + this.key = key; + return this; } withId(id: string): this { @@ -12068,11 +10087,6 @@ export class Badge implements IBadge { return this; } - withHorizontalAlignment(horizontalAlignment: HorizontalAlignment): this { - this.horizontalAlignment = horizontalAlignment; - return this; - } - withSpacing(spacing: Spacing): this { this.spacing = spacing; return this; @@ -12088,60 +10102,44 @@ export class Badge implements IBadge { return this; } - withText(text: string): this { - this.text = text; - return this; - } - - withIcon(icon: string): this { - this.icon = icon; - return this; - } - - withIconPosition(iconPosition: BadgeIconPosition): this { - this.iconPosition = iconPosition; - return this; - } - - withAppearance(appearance: BadgeAppearance): this { - this.appearance = appearance; - return this; - } - - withSize(size: BadgeSize): this { - this.size = size; + withBleed(bleed = true): this { + this.bleed = bleed; return this; } - withShape(shape: BadgeShape): this { - this.shape = shape; + withMinHeight(minHeight: string): this { + this.minHeight = minHeight; return this; } - withStyle(style: BadgeStyle): this { - this.style = style; + withPageAnimation(pageAnimation: CarouselPageAnimation): this { + this.pageAnimation = pageAnimation; return this; } - withTooltip(tooltip: string): this { - this.tooltip = tooltip; + withFallback(fallback: FallbackElement): this { + this.fallback = fallback; return this; } - withFallback(fallback: FallbackElement): this { - this.fallback = fallback; + withPages(...pages: ICarouselPage[]): this { + this.pages = pages; return this; } } /** - * A donut chart. + * A badge element to show an icon and/or text in a compact form over a colored background. */ -export interface IDonutChart { +export interface IBadge { /** - * Must be **Chart.Donut**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type: 'Chart.Donut'; + key?: string; + /** + * Must be **Badge**. + */ + readonly type: 'Badge'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -12183,17 +10181,37 @@ export interface IDonutChart { */ isSortKey?: boolean; /** - * The title of the chart. + * The text to display. */ - title?: string; + text?: string; /** - * The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + * The name of an icon from the [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) to display, in the `[,regular|filled]` format. If the style is not specified, the regular style is used. */ - colorSet?: ChartColorSet; + icon?: string; /** - * The data to display in the chart. + * Controls the position of the icon. */ - data?: IDonutChartData[]; + iconPosition?: BadgeIconPosition; + /** + * Controls the strength of the background color. + */ + appearance?: BadgeAppearance; + /** + * The size of the badge. + */ + size?: BadgeSize; + /** + * Controls the shape of the badge. + */ + shape?: BadgeShape; + /** + * The style of the badge. + */ + style?: BadgeStyle; + /** + * Controls the tooltip text to display when the badge is hovered over. + */ + tooltip?: string; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -12208,26 +10226,30 @@ export interface IDonutChart { * @hidden * @internal * - * Type guard to check if a value is of type IDonutChart. + * Type guard to check if a value is of type IBadge. * * @param value The value to check. - * @returns True if the value is an instance of DonutChart, false otherwise. + * @returns True if the value is an instance of Badge, false otherwise. */ -export function isDonutChart(value: unknown): value is IDonutChart { - const obj = value as IDonutChart; - return typeof obj === 'object' && obj.type === 'Chart.Donut'; +export function isBadge(value: unknown): value is IBadge { + const obj = value as IBadge; + return typeof obj === 'object' && obj.type === 'Badge'; } -export type DonutChartOptions = Omit; +export type BadgeOptions = Partial>; /** - * A donut chart. + * A badge element to show an icon and/or text in a compact form over a colored background. */ -export class DonutChart implements IDonutChart { +export class Badge implements IBadge { /** - * Must be **Chart.Donut**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type = 'Chart.Donut'; + key?: string; + /** + * Must be **Badge**. + */ + readonly type = 'Badge'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -12235,7 +10257,7 @@ export class DonutChart implements IDonutChart { /** * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - requires?: IHostCapabilities; + requires?: IHostCapabilities = {}; /** * The locale associated with the element. */ @@ -12243,15 +10265,15 @@ export class DonutChart implements IDonutChart { /** * Controls the visibility of the element. */ - isVisible?: boolean; + isVisible?: boolean = true; /** * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. */ - separator?: boolean; + separator?: boolean = false; /** * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. */ - height?: ElementHeight; + height?: ElementHeight = 'auto'; /** * Controls how the element should be horizontally aligned. */ @@ -12259,7 +10281,7 @@ export class DonutChart implements IDonutChart { /** * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ - spacing?: Spacing; + spacing?: Spacing = 'Default'; /** * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). */ @@ -12267,19 +10289,39 @@ export class DonutChart implements IDonutChart { /** * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. */ - isSortKey?: boolean; + isSortKey?: boolean = false; /** - * The title of the chart. + * The text to display. */ - title?: string; + text?: string; /** - * The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + * The name of an icon from the [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) to display, in the `[,regular|filled]` format. If the style is not specified, the regular style is used. */ - colorSet?: ChartColorSet; + icon?: string; /** - * The data to display in the chart. + * Controls the position of the icon. */ - data?: IDonutChartData[]; + iconPosition?: BadgeIconPosition = 'Before'; + /** + * Controls the strength of the background color. + */ + appearance?: BadgeAppearance = 'Filled'; + /** + * The size of the badge. + */ + size?: BadgeSize = 'Medium'; + /** + * Controls the shape of the badge. + */ + shape?: BadgeShape = 'Circular'; + /** + * The style of the badge. + */ + style?: BadgeStyle = 'Default'; + /** + * Controls the tooltip text to display when the badge is hovered over. + */ + tooltip?: string; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -12289,12 +10331,17 @@ export class DonutChart implements IDonutChart { */ fallback?: FallbackElement; - constructor(options: DonutChartOptions = {}) { + constructor(options: BadgeOptions = {}) { Object.assign(this, options); } - static from(options: Omit): DonutChart { - return new DonutChart(options); + static from(options: Omit): Badge { + return new Badge(options); + } + + withKey(key: string): this { + this.key = key; + return this; } withId(id: string): this { @@ -12347,18 +10394,43 @@ export class DonutChart implements IDonutChart { return this; } - withTitle(title: string): this { - this.title = title; + withText(text: string): this { + this.text = text; return this; } - withColorSet(colorSet: ChartColorSet): this { - this.colorSet = colorSet; + withIcon(icon: string): this { + this.icon = icon; return this; } - withData(...data: IDonutChartData[]): this { - this.data = data; + withIconPosition(iconPosition: BadgeIconPosition): this { + this.iconPosition = iconPosition; + return this; + } + + withAppearance(appearance: BadgeAppearance): this { + this.appearance = appearance; + return this; + } + + withSize(size: BadgeSize): this { + this.size = size; + return this; + } + + withShape(shape: BadgeShape): this { + this.shape = shape; + return this; + } + + withStyle(style: BadgeStyle): this { + this.style = style; + return this; + } + + withTooltip(tooltip: string): this { + this.tooltip = tooltip; return this; } @@ -12369,76 +10441,19 @@ export class DonutChart implements IDonutChart { } /** - * A data point in a Donut chart. + * A spinning ring element, to indicate progress. */ -export interface IDonutChartData { +export interface IProgressRing { /** - * The legend of the chart. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - legend?: string; + key?: string; /** - * The value associated with the data point. + * Must be **ProgressRing**. */ - value?: number; + readonly type: 'ProgressRing'; /** - * The color to use for the data point. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - */ - color?: ChartColor; -} - -export type DonutChartDataOptions = IDonutChartData; - -/** - * A data point in a Donut chart. - */ -export class DonutChartData implements IDonutChartData { - /** - * The legend of the chart. - */ - legend?: string; - /** - * The value associated with the data point. - */ - value?: number; - /** - * The color to use for the data point. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - */ - color?: ChartColor; - - constructor(options: DonutChartDataOptions = {}) { - Object.assign(this, options); - } - - static from(options: IDonutChartData): DonutChartData { - return new DonutChartData(options); - } - - withLegend(legend: string): this { - this.legend = legend; - return this; - } - - withValue(value: number): this { - this.value = value; - return this; - } - - withColor(color: ChartColor): this { - this.color = color; - return this; - } -} - -/** - * A pie chart. - */ -export interface IPieChart { - /** - * Must be **Chart.Pie**. - */ - readonly type: 'Chart.Pie'; - /** - * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ id?: string; /** @@ -12478,17 +10493,17 @@ export interface IPieChart { */ isSortKey?: boolean; /** - * The title of the chart. + * The label of the progress ring. */ - title?: string; + label?: string; /** - * The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + * Controls the relative position of the label to the progress ring. */ - colorSet?: ChartColorSet; + labelPosition?: ProgressRingLabelPosition; /** - * The data to display in the chart. + * The size of the progress ring. */ - data?: IDonutChartData[]; + size?: ProgressRingSize; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -12503,26 +10518,30 @@ export interface IPieChart { * @hidden * @internal * - * Type guard to check if a value is of type IPieChart. + * Type guard to check if a value is of type IProgressRing. * * @param value The value to check. - * @returns True if the value is an instance of PieChart, false otherwise. + * @returns True if the value is an instance of ProgressRing, false otherwise. */ -export function isPieChart(value: unknown): value is IPieChart { - const obj = value as IPieChart; - return typeof obj === 'object' && obj.type === 'Chart.Pie'; +export function isProgressRing(value: unknown): value is IProgressRing { + const obj = value as IProgressRing; + return typeof obj === 'object' && obj.type === 'ProgressRing'; } -export type PieChartOptions = Omit; +export type ProgressRingOptions = Partial>; /** - * A pie chart. + * A spinning ring element, to indicate progress. */ -export class PieChart implements IPieChart { +export class ProgressRing implements IProgressRing { /** - * Must be **Chart.Pie**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type = 'Chart.Pie'; + key?: string; + /** + * Must be **ProgressRing**. + */ + readonly type = 'ProgressRing'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -12530,7 +10549,7 @@ export class PieChart implements IPieChart { /** * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - requires?: IHostCapabilities; + requires?: IHostCapabilities = {}; /** * The locale associated with the element. */ @@ -12538,15 +10557,15 @@ export class PieChart implements IPieChart { /** * Controls the visibility of the element. */ - isVisible?: boolean; + isVisible?: boolean = true; /** * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. */ - separator?: boolean; + separator?: boolean = false; /** * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. */ - height?: ElementHeight; + height?: ElementHeight = 'auto'; /** * Controls how the element should be horizontally aligned. */ @@ -12554,7 +10573,7 @@ export class PieChart implements IPieChart { /** * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ - spacing?: Spacing; + spacing?: Spacing = 'Default'; /** * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). */ @@ -12562,19 +10581,19 @@ export class PieChart implements IPieChart { /** * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. */ - isSortKey?: boolean; + isSortKey?: boolean = false; /** - * The title of the chart. + * The label of the progress ring. */ - title?: string; + label?: string; /** - * The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + * Controls the relative position of the label to the progress ring. */ - colorSet?: ChartColorSet; + labelPosition?: ProgressRingLabelPosition = 'Below'; /** - * The data to display in the chart. + * The size of the progress ring. */ - data?: IDonutChartData[]; + size?: ProgressRingSize = 'Medium'; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -12584,12 +10603,17 @@ export class PieChart implements IPieChart { */ fallback?: FallbackElement; - constructor(options: PieChartOptions = {}) { + constructor(options: ProgressRingOptions = {}) { Object.assign(this, options); } - static from(options: Omit): PieChart { - return new PieChart(options); + static from(options: Omit): ProgressRing { + return new ProgressRing(options); + } + + withKey(key: string): this { + this.key = key; + return this; } withId(id: string): this { @@ -12642,18 +10666,18 @@ export class PieChart implements IPieChart { return this; } - withTitle(title: string): this { - this.title = title; + withLabel(label: string): this { + this.label = label; return this; } - withColorSet(colorSet: ChartColorSet): this { - this.colorSet = colorSet; + withLabelPosition(labelPosition: ProgressRingLabelPosition): this { + this.labelPosition = labelPosition; return this; } - withData(...data: IDonutChartData[]): this { - this.data = data; + withSize(size: ProgressRingSize): this { + this.size = size; return this; } @@ -12664,13 +10688,17 @@ export class PieChart implements IPieChart { } /** - * A grouped vertical bar chart. + * A progress bar element, to represent a value within a range. */ -export interface IGroupedVerticalBarChart { +export interface IProgressBar { /** - * Must be **Chart.VerticalBar.Grouped**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type: 'Chart.VerticalBar.Grouped'; + key?: string; + /** + * Must be **ProgressBar**. + */ + readonly type: 'ProgressBar'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -12712,37 +10740,17 @@ export interface IGroupedVerticalBarChart { */ isSortKey?: boolean; /** - * The title of the chart. - */ - title?: string; - /** - * The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - */ - colorSet?: ChartColorSet; - /** - * The title of the x axis. - */ - xAxisTitle?: string; - /** - * The title of the y axis. - */ - yAxisTitle?: string; - /** - * The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - */ - color?: ChartColor; - /** - * Controls if bars in the chart should be displayed as stacked instead of grouped. + * The value of the progress bar. Must be between 0 and max. */ - stacked?: boolean; + value?: number; /** - * The data points in a series. + * The maximum value of the progress bar. */ - data?: IGroupedVerticalBarChartData[]; + max?: number; /** - * Controls if values should be displayed on each bar. + * The color of the progress bar. `color` has no effect when the `ProgressBar` is in indeterminate mode, in which case the "accent" color is always used. */ - showBarValues?: boolean; + color?: ProgressBarColor; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -12757,26 +10765,30 @@ export interface IGroupedVerticalBarChart { * @hidden * @internal * - * Type guard to check if a value is of type IGroupedVerticalBarChart. + * Type guard to check if a value is of type IProgressBar. * * @param value The value to check. - * @returns True if the value is an instance of GroupedVerticalBarChart, false otherwise. + * @returns True if the value is an instance of ProgressBar, false otherwise. */ -export function isGroupedVerticalBarChart(value: unknown): value is IGroupedVerticalBarChart { - const obj = value as IGroupedVerticalBarChart; - return typeof obj === 'object' && obj.type === 'Chart.VerticalBar.Grouped'; +export function isProgressBar(value: unknown): value is IProgressBar { + const obj = value as IProgressBar; + return typeof obj === 'object' && obj.type === 'ProgressBar'; } -export type GroupedVerticalBarChartOptions = Omit; +export type ProgressBarOptions = Partial>; /** - * A grouped vertical bar chart. + * A progress bar element, to represent a value within a range. */ -export class GroupedVerticalBarChart implements IGroupedVerticalBarChart { +export class ProgressBar implements IProgressBar { /** - * Must be **Chart.VerticalBar.Grouped**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type = 'Chart.VerticalBar.Grouped'; + key?: string; + /** + * Must be **ProgressBar**. + */ + readonly type = 'ProgressBar'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -12784,7 +10796,7 @@ export class GroupedVerticalBarChart implements IGroupedVerticalBarChart { /** * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - requires?: IHostCapabilities; + requires?: IHostCapabilities = {}; /** * The locale associated with the element. */ @@ -12792,15 +10804,15 @@ export class GroupedVerticalBarChart implements IGroupedVerticalBarChart { /** * Controls the visibility of the element. */ - isVisible?: boolean; + isVisible?: boolean = true; /** * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. */ - separator?: boolean; + separator?: boolean = false; /** * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. */ - height?: ElementHeight; + height?: ElementHeight = 'auto'; /** * Controls how the element should be horizontally aligned. */ @@ -12808,7 +10820,7 @@ export class GroupedVerticalBarChart implements IGroupedVerticalBarChart { /** * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ - spacing?: Spacing; + spacing?: Spacing = 'Default'; /** * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). */ @@ -12816,39 +10828,19 @@ export class GroupedVerticalBarChart implements IGroupedVerticalBarChart { /** * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. */ - isSortKey?: boolean; - /** - * The title of the chart. - */ - title?: string; - /** - * The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - */ - colorSet?: ChartColorSet; - /** - * The title of the x axis. - */ - xAxisTitle?: string; - /** - * The title of the y axis. - */ - yAxisTitle?: string; - /** - * The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - */ - color?: ChartColor; + isSortKey?: boolean = false; /** - * Controls if bars in the chart should be displayed as stacked instead of grouped. + * The value of the progress bar. Must be between 0 and max. */ - stacked?: boolean; + value?: number; /** - * The data points in a series. + * The maximum value of the progress bar. */ - data?: IGroupedVerticalBarChartData[]; + max?: number = 100; /** - * Controls if values should be displayed on each bar. + * The color of the progress bar. `color` has no effect when the `ProgressBar` is in indeterminate mode, in which case the "accent" color is always used. */ - showBarValues?: boolean; + color?: ProgressBarColor = 'Accent'; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -12858,12 +10850,17 @@ export class GroupedVerticalBarChart implements IGroupedVerticalBarChart { */ fallback?: FallbackElement; - constructor(options: GroupedVerticalBarChartOptions = {}) { + constructor(options: ProgressBarOptions = {}) { Object.assign(this, options); } - static from(options: Omit): GroupedVerticalBarChart { - return new GroupedVerticalBarChart(options); + static from(options: Omit): ProgressBar { + return new ProgressBar(options); + } + + withKey(key: string): this { + this.key = key; + return this; } withId(id: string): this { @@ -12916,46 +10913,21 @@ export class GroupedVerticalBarChart implements IGroupedVerticalBarChart { return this; } - withTitle(title: string): this { - this.title = title; - return this; - } - - withColorSet(colorSet: ChartColorSet): this { - this.colorSet = colorSet; - return this; - } - - withXAxisTitle(xAxisTitle: string): this { - this.xAxisTitle = xAxisTitle; + withValue(value: number): this { + this.value = value; return this; } - withYAxisTitle(yAxisTitle: string): this { - this.yAxisTitle = yAxisTitle; + withMax(max: number): this { + this.max = max; return this; } - withColor(color: ChartColor): this { + withColor(color: ProgressBarColor): this { this.color = color; return this; } - withStacked(stacked = true): this { - this.stacked = stacked; - return this; - } - - withData(...data: IGroupedVerticalBarChartData[]): this { - this.data = data; - return this; - } - - withShowBarValues(showBarValues = true): this { - this.showBarValues = showBarValues; - return this; - } - withFallback(fallback: FallbackElement): this { this.fallback = fallback; return this; @@ -12963,136 +10935,31 @@ export class GroupedVerticalBarChart implements IGroupedVerticalBarChart { } /** - * Represents a series of data points. + * A donut chart. */ -export interface IGroupedVerticalBarChartData { +export interface IDonutChart { /** - * The legend of the chart. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - legend?: string; + key?: string; /** - * The data points in the series. + * Must be **Chart.Donut**. */ - values?: IBarChartDataValue[]; + readonly type: 'Chart.Donut'; /** - * The color to use for all data points in the series. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ - color?: ChartColor; -} - -export type GroupedVerticalBarChartDataOptions = IGroupedVerticalBarChartData; - -/** - * Represents a series of data points. - */ -export class GroupedVerticalBarChartData implements IGroupedVerticalBarChartData { + id?: string; /** - * The legend of the chart. + * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - legend?: string; + requires?: IHostCapabilities; /** - * The data points in the series. + * The locale associated with the element. */ - values?: IBarChartDataValue[]; + lang?: string; /** - * The color to use for all data points in the series. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - */ - color?: ChartColor; - - constructor(options: GroupedVerticalBarChartDataOptions = {}) { - Object.assign(this, options); - } - - static from(options: IGroupedVerticalBarChartData): GroupedVerticalBarChartData { - return new GroupedVerticalBarChartData(options); - } - - withLegend(legend: string): this { - this.legend = legend; - return this; - } - - withValues(...values: IBarChartDataValue[]): this { - this.values = values; - return this; - } - - withColor(color: ChartColor): this { - this.color = color; - return this; - } -} - -/** - * A single data point in a bar chart. - */ -export interface IBarChartDataValue { - /** - * The x axis value of the data point. - */ - x?: string; - /** - * The y axis value of the data point. - */ - y?: number; -} - -export type BarChartDataValueOptions = IBarChartDataValue; - -/** - * A single data point in a bar chart. - */ -export class BarChartDataValue implements IBarChartDataValue { - /** - * The x axis value of the data point. - */ - x?: string; - /** - * The y axis value of the data point. - */ - y?: number; - - constructor(options: BarChartDataValueOptions = {}) { - Object.assign(this, options); - } - - static from(options: IBarChartDataValue): BarChartDataValue { - return new BarChartDataValue(options); - } - - withX(x: string): this { - this.x = x; - return this; - } - - withY(y: number): this { - this.y = y; - return this; - } -} - -/** - * A vertical bar chart. - */ -export interface IVerticalBarChart { - /** - * Must be **Chart.VerticalBar**. - */ - readonly type: 'Chart.VerticalBar'; - /** - * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - */ - id?: string; - /** - * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - */ - requires?: IHostCapabilities; - /** - * The locale associated with the element. - */ - lang?: string; - /** - * Controls the visibility of the element. + * Controls the visibility of the element. */ isVisible?: boolean; /** @@ -13123,30 +10990,42 @@ export interface IVerticalBarChart { * The title of the chart. */ title?: string; + /** + * Controls whether the chart's title should be displayed. Defaults to `false`. + */ + showTitle?: boolean; /** * The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). */ colorSet?: ChartColorSet; /** - * The title of the x axis. + * The maximum width, in pixels, of the chart, in the `px` format. */ - xAxisTitle?: string; + maxWidth?: string; /** - * The title of the y axis. + * Controls whether the chart's legend should be displayed. */ - yAxisTitle?: string; + showLegend?: boolean; /** * The data to display in the chart. */ - data?: IVerticalBarChartDataValue[]; + data?: IDonutChartData[]; /** - * The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + * The value that should be displayed in the center of a Donut chart. `value` is ignored for Pie charts. */ - color?: ChartColor; + value?: string; /** - * Controls if the bar values should be displayed. + * Controls the color of the value displayed in the center of a Donut chart. */ - showBarValues?: boolean; + valueColor?: ChartColor; + /** + * Controls the thickness of the donut segments. Default is **Thick**. + */ + thickness?: DonutThickness; + /** + * Controls whether the outlines of the donut segments are displayed. + */ + showOutlines?: boolean; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -13161,26 +11040,30 @@ export interface IVerticalBarChart { * @hidden * @internal * - * Type guard to check if a value is of type IVerticalBarChart. + * Type guard to check if a value is of type IDonutChart. * * @param value The value to check. - * @returns True if the value is an instance of VerticalBarChart, false otherwise. + * @returns True if the value is an instance of DonutChart, false otherwise. */ -export function isVerticalBarChart(value: unknown): value is IVerticalBarChart { - const obj = value as IVerticalBarChart; - return typeof obj === 'object' && obj.type === 'Chart.VerticalBar'; +export function isDonutChart(value: unknown): value is IDonutChart { + const obj = value as IDonutChart; + return typeof obj === 'object' && obj.type === 'Chart.Donut'; } -export type VerticalBarChartOptions = Omit; +export type DonutChartOptions = Partial>; /** - * A vertical bar chart. + * A donut chart. */ -export class VerticalBarChart implements IVerticalBarChart { +export class DonutChart implements IDonutChart { /** - * Must be **Chart.VerticalBar**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type = 'Chart.VerticalBar'; + key?: string; + /** + * Must be **Chart.Donut**. + */ + readonly type = 'Chart.Donut'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -13188,7 +11071,7 @@ export class VerticalBarChart implements IVerticalBarChart { /** * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - requires?: IHostCapabilities; + requires?: IHostCapabilities = {}; /** * The locale associated with the element. */ @@ -13196,15 +11079,15 @@ export class VerticalBarChart implements IVerticalBarChart { /** * Controls the visibility of the element. */ - isVisible?: boolean; + isVisible?: boolean = true; /** * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. */ - separator?: boolean; + separator?: boolean = false; /** * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. */ - height?: ElementHeight; + height?: ElementHeight = 'auto'; /** * Controls how the element should be horizontally aligned. */ @@ -13212,7 +11095,7 @@ export class VerticalBarChart implements IVerticalBarChart { /** * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ - spacing?: Spacing; + spacing?: Spacing = 'Default'; /** * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). */ @@ -13220,35 +11103,47 @@ export class VerticalBarChart implements IVerticalBarChart { /** * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. */ - isSortKey?: boolean; + isSortKey?: boolean = false; /** * The title of the chart. */ title?: string; + /** + * Controls whether the chart's title should be displayed. Defaults to `false`. + */ + showTitle?: boolean = false; /** * The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). */ colorSet?: ChartColorSet; /** - * The title of the x axis. + * The maximum width, in pixels, of the chart, in the `px` format. */ - xAxisTitle?: string; + maxWidth?: string; /** - * The title of the y axis. + * Controls whether the chart's legend should be displayed. */ - yAxisTitle?: string; + showLegend?: boolean = true; /** * The data to display in the chart. */ - data?: IVerticalBarChartDataValue[]; + data?: IDonutChartData[]; /** - * The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + * The value that should be displayed in the center of a Donut chart. `value` is ignored for Pie charts. */ - color?: ChartColor; + value?: string; /** - * Controls if the bar values should be displayed. + * Controls the color of the value displayed in the center of a Donut chart. */ - showBarValues?: boolean; + valueColor?: ChartColor; + /** + * Controls the thickness of the donut segments. Default is **Thick**. + */ + thickness?: DonutThickness; + /** + * Controls whether the outlines of the donut segments are displayed. + */ + showOutlines?: boolean = true; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -13258,12 +11153,17 @@ export class VerticalBarChart implements IVerticalBarChart { */ fallback?: FallbackElement; - constructor(options: VerticalBarChartOptions = {}) { + constructor(options: DonutChartOptions = {}) { Object.assign(this, options); } - static from(options: Omit): VerticalBarChart { - return new VerticalBarChart(options); + static from(options: Omit): DonutChart { + return new DonutChart(options); + } + + withKey(key: string): this { + this.key = key; + return this; } withId(id: string): this { @@ -13321,33 +11221,48 @@ export class VerticalBarChart implements IVerticalBarChart { return this; } + withShowTitle(showTitle = true): this { + this.showTitle = showTitle; + return this; + } + withColorSet(colorSet: ChartColorSet): this { this.colorSet = colorSet; return this; } - withXAxisTitle(xAxisTitle: string): this { - this.xAxisTitle = xAxisTitle; + withMaxWidth(maxWidth: string): this { + this.maxWidth = maxWidth; return this; } - withYAxisTitle(yAxisTitle: string): this { - this.yAxisTitle = yAxisTitle; + withShowLegend(showLegend = false): this { + this.showLegend = showLegend; return this; } - withData(...data: IVerticalBarChartDataValue[]): this { + withData(...data: IDonutChartData[]): this { this.data = data; return this; } - withColor(color: ChartColor): this { - this.color = color; + withValue(value: string): this { + this.value = value; return this; } - withShowBarValues(showBarValues = true): this { - this.showBarValues = showBarValues; + withValueColor(valueColor: ChartColor): this { + this.valueColor = valueColor; + return this; + } + + withThickness(thickness: DonutThickness): this { + this.thickness = thickness; + return this; + } + + withShowOutlines(showOutlines = false): this { + this.showOutlines = showOutlines; return this; } @@ -13358,57 +11273,71 @@ export class VerticalBarChart implements IVerticalBarChart { } /** - * Represents a data point in a vertical bar chart. + * A data point in a Donut chart. */ -export interface IVerticalBarChartDataValue { +export interface IDonutChartData { /** - * The x axis value of the data point. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - x?: string | number; + key?: string; /** - * The y axis value of the data point. + * The legend of the chart. */ - y?: number; + legend?: string; /** - * The color to use for the bar associated with the data point. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + * The value associated with the data point. + */ + value?: number; + /** + * The color to use for the data point. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). */ color?: ChartColor; } -export type VerticalBarChartDataValueOptions = IVerticalBarChartDataValue; + +export type DonutChartDataOptions = Partial; /** - * Represents a data point in a vertical bar chart. + * A data point in a Donut chart. */ -export class VerticalBarChartDataValue implements IVerticalBarChartDataValue { +export class DonutChartData implements IDonutChartData { /** - * The x axis value of the data point. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - x?: string | number; + key?: string; /** - * The y axis value of the data point. + * The legend of the chart. */ - y?: number; + legend?: string; /** - * The color to use for the bar associated with the data point. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + * The value associated with the data point. + */ + value?: number = 0; + /** + * The color to use for the data point. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). */ color?: ChartColor; - constructor(options: VerticalBarChartDataValueOptions = {}) { + constructor(options: DonutChartDataOptions = {}) { Object.assign(this, options); } - static from(options: IVerticalBarChartDataValue): VerticalBarChartDataValue { - return new VerticalBarChartDataValue(options); + static from(options: IDonutChartData): DonutChartData { + return new DonutChartData(options); } - withX(x: string | number): this { - this.x = x; + withKey(key: string): this { + this.key = key; return this; } - withY(y: number): this { - this.y = y; + withLegend(legend: string): this { + this.legend = legend; + return this; + } + + withValue(value: number): this { + this.value = value; return this; } @@ -13419,13 +11348,17 @@ export class VerticalBarChartDataValue implements IVerticalBarChartDataValue { } /** - * A horizontal bar chart. + * A pie chart. */ -export interface IHorizontalBarChart { +export interface IPieChart { /** - * Must be **Chart.HorizontalBar**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type: 'Chart.HorizontalBar'; + key?: string; + /** + * Must be **Chart.Pie**. + */ + readonly type: 'Chart.Pie'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -13470,32 +11403,44 @@ export interface IHorizontalBarChart { * The title of the chart. */ title?: string; + /** + * Controls whether the chart's title should be displayed. Defaults to `false`. + */ + showTitle?: boolean; /** * The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). */ colorSet?: ChartColorSet; /** - * The title of the x axis. + * The maximum width, in pixels, of the chart, in the `px` format. */ - xAxisTitle?: string; + maxWidth?: string; /** - * The title of the y axis. + * Controls whether the chart's legend should be displayed. */ - yAxisTitle?: string; + showLegend?: boolean; /** - * The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + * The data to display in the chart. */ - color?: ChartColor; + data?: IDonutChartData[]; /** - * The data points in the chart. + * The value that should be displayed in the center of a Donut chart. `value` is ignored for Pie charts. */ - data?: IHorizontalBarChartDataValue[]; + value?: string; /** - * Controls how the chart should be visually laid out. + * Controls the color of the value displayed in the center of a Donut chart. */ - displayMode?: HorizontalBarChartDisplayMode; + valueColor?: ChartColor; /** - * The area of a Layout.AreaGrid layout in which an element should be displayed. + * Controls the thickness of the donut segments. Default is **Thick**. + */ + thickness?: DonutThickness; + /** + * Controls whether the outlines of the donut segments are displayed. + */ + showOutlines?: boolean; + /** + * The area of a Layout.AreaGrid layout in which an element should be displayed. */ 'grid.area'?: string; /** @@ -13508,26 +11453,30 @@ export interface IHorizontalBarChart { * @hidden * @internal * - * Type guard to check if a value is of type IHorizontalBarChart. + * Type guard to check if a value is of type IPieChart. * * @param value The value to check. - * @returns True if the value is an instance of HorizontalBarChart, false otherwise. + * @returns True if the value is an instance of PieChart, false otherwise. */ -export function isHorizontalBarChart(value: unknown): value is IHorizontalBarChart { - const obj = value as IHorizontalBarChart; - return typeof obj === 'object' && obj.type === 'Chart.HorizontalBar'; +export function isPieChart(value: unknown): value is IPieChart { + const obj = value as IPieChart; + return typeof obj === 'object' && obj.type === 'Chart.Pie'; } -export type HorizontalBarChartOptions = Omit; +export type PieChartOptions = Partial>; /** - * A horizontal bar chart. + * A pie chart. */ -export class HorizontalBarChart implements IHorizontalBarChart { +export class PieChart implements IPieChart { /** - * Must be **Chart.HorizontalBar**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type = 'Chart.HorizontalBar'; + key?: string; + /** + * Must be **Chart.Pie**. + */ + readonly type = 'Chart.Pie'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -13535,7 +11484,7 @@ export class HorizontalBarChart implements IHorizontalBarChart { /** * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - requires?: IHostCapabilities; + requires?: IHostCapabilities = {}; /** * The locale associated with the element. */ @@ -13543,15 +11492,15 @@ export class HorizontalBarChart implements IHorizontalBarChart { /** * Controls the visibility of the element. */ - isVisible?: boolean; + isVisible?: boolean = true; /** * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. */ - separator?: boolean; + separator?: boolean = false; /** * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. */ - height?: ElementHeight; + height?: ElementHeight = 'auto'; /** * Controls how the element should be horizontally aligned. */ @@ -13559,7 +11508,7 @@ export class HorizontalBarChart implements IHorizontalBarChart { /** * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ - spacing?: Spacing; + spacing?: Spacing = 'Default'; /** * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). */ @@ -13567,35 +11516,47 @@ export class HorizontalBarChart implements IHorizontalBarChart { /** * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. */ - isSortKey?: boolean; + isSortKey?: boolean = false; /** * The title of the chart. */ title?: string; + /** + * Controls whether the chart's title should be displayed. Defaults to `false`. + */ + showTitle?: boolean = false; /** * The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). */ colorSet?: ChartColorSet; /** - * The title of the x axis. + * The maximum width, in pixels, of the chart, in the `px` format. */ - xAxisTitle?: string; + maxWidth?: string; /** - * The title of the y axis. + * Controls whether the chart's legend should be displayed. */ - yAxisTitle?: string; + showLegend?: boolean = true; /** - * The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + * The data to display in the chart. */ - color?: ChartColor; + data?: IDonutChartData[]; /** - * The data points in the chart. + * The value that should be displayed in the center of a Donut chart. `value` is ignored for Pie charts. */ - data?: IHorizontalBarChartDataValue[]; + value?: string; /** - * Controls how the chart should be visually laid out. + * Controls the color of the value displayed in the center of a Donut chart. */ - displayMode?: HorizontalBarChartDisplayMode; + valueColor?: ChartColor; + /** + * Controls the thickness of the donut segments. Default is **Thick**. + */ + thickness?: DonutThickness; + /** + * Controls whether the outlines of the donut segments are displayed. + */ + showOutlines?: boolean = true; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -13605,12 +11566,17 @@ export class HorizontalBarChart implements IHorizontalBarChart { */ fallback?: FallbackElement; - constructor(options: HorizontalBarChartOptions = {}) { + constructor(options: PieChartOptions = {}) { Object.assign(this, options); } - static from(options: Omit): HorizontalBarChart { - return new HorizontalBarChart(options); + static from(options: Omit): PieChart { + return new PieChart(options); + } + + withKey(key: string): this { + this.key = key; + return this; } withId(id: string): this { @@ -13668,111 +11634,69 @@ export class HorizontalBarChart implements IHorizontalBarChart { return this; } - withColorSet(colorSet: ChartColorSet): this { - this.colorSet = colorSet; + withShowTitle(showTitle = true): this { + this.showTitle = showTitle; return this; } - withXAxisTitle(xAxisTitle: string): this { - this.xAxisTitle = xAxisTitle; + withColorSet(colorSet: ChartColorSet): this { + this.colorSet = colorSet; return this; } - withYAxisTitle(yAxisTitle: string): this { - this.yAxisTitle = yAxisTitle; + withMaxWidth(maxWidth: string): this { + this.maxWidth = maxWidth; return this; } - withColor(color: ChartColor): this { - this.color = color; + withShowLegend(showLegend = false): this { + this.showLegend = showLegend; return this; } - withData(...data: IHorizontalBarChartDataValue[]): this { + withData(...data: IDonutChartData[]): this { this.data = data; return this; } - withDisplayMode(displayMode: HorizontalBarChartDisplayMode): this { - this.displayMode = displayMode; + withValue(value: string): this { + this.value = value; return this; } - withFallback(fallback: FallbackElement): this { - this.fallback = fallback; + withValueColor(valueColor: ChartColor): this { + this.valueColor = valueColor; return this; } -} - -/** - * Represents a single data point in a horizontal bar chart. - */ -export interface IHorizontalBarChartDataValue { - /** - * The x axis value of the data point. - */ - x?: string; - /** - * The y axis value of the data point. - */ - y?: number; - /** - * The color of the bar associated with the data point. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - */ - color?: ChartColor; -} - -export type HorizontalBarChartDataValueOptions = IHorizontalBarChartDataValue; - -/** - * Represents a single data point in a horizontal bar chart. - */ -export class HorizontalBarChartDataValue implements IHorizontalBarChartDataValue { - /** - * The x axis value of the data point. - */ - x?: string; - /** - * The y axis value of the data point. - */ - y?: number; - /** - * The color of the bar associated with the data point. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). - */ - color?: ChartColor; - - constructor(options: HorizontalBarChartDataValueOptions = {}) { - Object.assign(this, options); - } - static from(options: IHorizontalBarChartDataValue): HorizontalBarChartDataValue { - return new HorizontalBarChartDataValue(options); - } - - withX(x: string): this { - this.x = x; + withThickness(thickness: DonutThickness): this { + this.thickness = thickness; return this; } - withY(y: number): this { - this.y = y; + withShowOutlines(showOutlines = false): this { + this.showOutlines = showOutlines; return this; } - withColor(color: ChartColor): this { - this.color = color; + withFallback(fallback: FallbackElement): this { + this.fallback = fallback; return this; } } /** - * A stacked horizontal bar chart. + * A grouped vertical bar chart. */ -export interface IStackedHorizontalBarChart { +export interface IGroupedVerticalBarChart { /** - * Must be **Chart.HorizontalBar.Stacked**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type: 'Chart.HorizontalBar.Stacked'; + key?: string; + /** + * Must be **Chart.VerticalBar.Grouped**. + */ + readonly type: 'Chart.VerticalBar.Grouped'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -13817,10 +11741,22 @@ export interface IStackedHorizontalBarChart { * The title of the chart. */ title?: string; + /** + * Controls whether the chart's title should be displayed. Defaults to `false`. + */ + showTitle?: boolean; /** * The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). */ colorSet?: ChartColorSet; + /** + * The maximum width, in pixels, of the chart, in the `px` format. + */ + maxWidth?: string; + /** + * Controls whether the chart's legend should be displayed. + */ + showLegend?: boolean; /** * The title of the x axis. */ @@ -13834,9 +11770,31 @@ export interface IStackedHorizontalBarChart { */ color?: ChartColor; /** - * The data to display in the chart. + * Controls if bars in the chart should be displayed as stacks instead of groups. + * + * **Note:** stacked vertical bar charts do not support custom Y ranges nor negative Y values. */ - data?: IStackedHorizontalBarChartData[]; + stacked?: boolean; + /** + * The data points in a series. + */ + data?: IGroupedVerticalBarChartData[]; + /** + * Controls if values should be displayed on each bar. + */ + showBarValues?: boolean; + /** + * The requested minimum for the Y axis range. The value used at runtime may be different to optimize visual presentation. + * + * `yMin` is ignored if `stacked` is set to `true`. + */ + yMin?: number; + /** + * The requested maximum for the Y axis range. The value used at runtime may be different to optimize visual presentation. + * + * `yMax` is ignored if `stacked` is set to `true`. + */ + yMax?: number; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -13851,26 +11809,30 @@ export interface IStackedHorizontalBarChart { * @hidden * @internal * - * Type guard to check if a value is of type IStackedHorizontalBarChart. + * Type guard to check if a value is of type IGroupedVerticalBarChart. * * @param value The value to check. - * @returns True if the value is an instance of StackedHorizontalBarChart, false otherwise. + * @returns True if the value is an instance of GroupedVerticalBarChart, false otherwise. */ -export function isStackedHorizontalBarChart(value: unknown): value is IStackedHorizontalBarChart { - const obj = value as IStackedHorizontalBarChart; - return typeof obj === 'object' && obj.type === 'Chart.HorizontalBar.Stacked'; +export function isGroupedVerticalBarChart(value: unknown): value is IGroupedVerticalBarChart { + const obj = value as IGroupedVerticalBarChart; + return typeof obj === 'object' && obj.type === 'Chart.VerticalBar.Grouped'; } -export type StackedHorizontalBarChartOptions = Omit; +export type GroupedVerticalBarChartOptions = Partial>; /** - * A stacked horizontal bar chart. + * A grouped vertical bar chart. */ -export class StackedHorizontalBarChart implements IStackedHorizontalBarChart { +export class GroupedVerticalBarChart implements IGroupedVerticalBarChart { /** - * Must be **Chart.HorizontalBar.Stacked**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type = 'Chart.HorizontalBar.Stacked'; + key?: string; + /** + * Must be **Chart.VerticalBar.Grouped**. + */ + readonly type = 'Chart.VerticalBar.Grouped'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -13878,7 +11840,7 @@ export class StackedHorizontalBarChart implements IStackedHorizontalBarChart { /** * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - requires?: IHostCapabilities; + requires?: IHostCapabilities = {}; /** * The locale associated with the element. */ @@ -13886,15 +11848,15 @@ export class StackedHorizontalBarChart implements IStackedHorizontalBarChart { /** * Controls the visibility of the element. */ - isVisible?: boolean; + isVisible?: boolean = true; /** * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. */ - separator?: boolean; + separator?: boolean = false; /** * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. */ - height?: ElementHeight; + height?: ElementHeight = 'auto'; /** * Controls how the element should be horizontally aligned. */ @@ -13902,7 +11864,7 @@ export class StackedHorizontalBarChart implements IStackedHorizontalBarChart { /** * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ - spacing?: Spacing; + spacing?: Spacing = 'Default'; /** * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). */ @@ -13910,15 +11872,27 @@ export class StackedHorizontalBarChart implements IStackedHorizontalBarChart { /** * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. */ - isSortKey?: boolean; + isSortKey?: boolean = false; /** * The title of the chart. */ title?: string; + /** + * Controls whether the chart's title should be displayed. Defaults to `false`. + */ + showTitle?: boolean = false; /** * The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). */ colorSet?: ChartColorSet; + /** + * The maximum width, in pixels, of the chart, in the `px` format. + */ + maxWidth?: string; + /** + * Controls whether the chart's legend should be displayed. + */ + showLegend?: boolean = true; /** * The title of the x axis. */ @@ -13932,9 +11906,31 @@ export class StackedHorizontalBarChart implements IStackedHorizontalBarChart { */ color?: ChartColor; /** - * The data to display in the chart. + * Controls if bars in the chart should be displayed as stacks instead of groups. + * + * **Note:** stacked vertical bar charts do not support custom Y ranges nor negative Y values. */ - data?: IStackedHorizontalBarChartData[]; + stacked?: boolean = false; + /** + * The data points in a series. + */ + data?: IGroupedVerticalBarChartData[]; + /** + * Controls if values should be displayed on each bar. + */ + showBarValues?: boolean = false; + /** + * The requested minimum for the Y axis range. The value used at runtime may be different to optimize visual presentation. + * + * `yMin` is ignored if `stacked` is set to `true`. + */ + yMin?: number; + /** + * The requested maximum for the Y axis range. The value used at runtime may be different to optimize visual presentation. + * + * `yMax` is ignored if `stacked` is set to `true`. + */ + yMax?: number; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -13944,12 +11940,17 @@ export class StackedHorizontalBarChart implements IStackedHorizontalBarChart { */ fallback?: FallbackElement; - constructor(options: StackedHorizontalBarChartOptions = {}) { + constructor(options: GroupedVerticalBarChartOptions = {}) { Object.assign(this, options); } - static from(options: Omit): StackedHorizontalBarChart { - return new StackedHorizontalBarChart(options); + static from(options: Omit): GroupedVerticalBarChart { + return new GroupedVerticalBarChart(options); + } + + withKey(key: string): this { + this.key = key; + return this; } withId(id: string): this { @@ -14007,11 +12008,26 @@ export class StackedHorizontalBarChart implements IStackedHorizontalBarChart { return this; } + withShowTitle(showTitle = true): this { + this.showTitle = showTitle; + return this; + } + withColorSet(colorSet: ChartColorSet): this { this.colorSet = colorSet; return this; } + withMaxWidth(maxWidth: string): this { + this.maxWidth = maxWidth; + return this; + } + + withShowLegend(showLegend = false): this { + this.showLegend = showLegend; + return this; + } + withXAxisTitle(xAxisTitle: string): this { this.xAxisTitle = xAxisTitle; return this; @@ -14027,11 +12043,31 @@ export class StackedHorizontalBarChart implements IStackedHorizontalBarChart { return this; } - withData(...data: IStackedHorizontalBarChartData[]): this { + withStacked(stacked = true): this { + this.stacked = stacked; + return this; + } + + withData(...data: IGroupedVerticalBarChartData[]): this { this.data = data; return this; } + withShowBarValues(showBarValues = true): this { + this.showBarValues = showBarValues; + return this; + } + + withYMin(yMin: number): this { + this.yMin = yMin; + return this; + } + + withYMax(yMax: number): this { + this.yMax = yMax; + return this; + } + withFallback(fallback: FallbackElement): this { this.fallback = fallback; return this; @@ -14039,122 +12075,154 @@ export class StackedHorizontalBarChart implements IStackedHorizontalBarChart { } /** - * Defines the collection of data series to display in as a stacked horizontal bar chart. + * Represents a series of data points. */ -export interface IStackedHorizontalBarChartData { +export interface IGroupedVerticalBarChartData { /** - * The title of the series. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - title?: string; + key?: string; /** - * The data points in the series. + * The legend of the chart. */ - data?: IStackedHorizontalBarChartDataPoint[]; + legend?: string; + /** + * The data points in the series. + */ + values?: IBarChartDataValue[]; + /** + * The color to use for all data points in the series. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + */ + color?: ChartColor; } -export type StackedHorizontalBarChartDataOptions = IStackedHorizontalBarChartData; + +export type GroupedVerticalBarChartDataOptions = Partial; /** - * Defines the collection of data series to display in as a stacked horizontal bar chart. + * Represents a series of data points. */ -export class StackedHorizontalBarChartData implements IStackedHorizontalBarChartData { +export class GroupedVerticalBarChartData implements IGroupedVerticalBarChartData { /** - * The title of the series. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - title?: string; + key?: string; + /** + * The legend of the chart. + */ + legend?: string; /** * The data points in the series. */ - data?: IStackedHorizontalBarChartDataPoint[]; + values?: IBarChartDataValue[]; + /** + * The color to use for all data points in the series. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + */ + color?: ChartColor; - constructor(options: StackedHorizontalBarChartDataOptions = {}) { + constructor(options: GroupedVerticalBarChartDataOptions = {}) { Object.assign(this, options); } - static from(options: IStackedHorizontalBarChartData): StackedHorizontalBarChartData { - return new StackedHorizontalBarChartData(options); + static from(options: IGroupedVerticalBarChartData): GroupedVerticalBarChartData { + return new GroupedVerticalBarChartData(options); } - withTitle(title: string): this { - this.title = title; + withKey(key: string): this { + this.key = key; return this; } - withData(...data: IStackedHorizontalBarChartDataPoint[]): this { - this.data = data; + withLegend(legend: string): this { + this.legend = legend; + return this; + } + + withValues(...values: IBarChartDataValue[]): this { + this.values = values; + return this; + } + + withColor(color: ChartColor): this { + this.color = color; return this; } } /** - * A data point in a series. + * A single data point in a bar chart. */ -export interface IStackedHorizontalBarChartDataPoint { +export interface IBarChartDataValue { /** - * The legend associated with the data point. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - legend?: string; + key?: string; /** - * The value of the data point. + * The x axis value of the data point. */ - value?: number; + x?: string; /** - * The color to use to render the bar associated with the data point. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + * The y axis value of the data point. */ - color?: ChartColor; + y?: number; } -export type StackedHorizontalBarChartDataPointOptions = IStackedHorizontalBarChartDataPoint; + +export type BarChartDataValueOptions = Partial; /** - * A data point in a series. + * A single data point in a bar chart. */ -export class StackedHorizontalBarChartDataPoint implements IStackedHorizontalBarChartDataPoint { +export class BarChartDataValue implements IBarChartDataValue { /** - * The legend associated with the data point. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - legend?: string; + key?: string; /** - * The value of the data point. + * The x axis value of the data point. */ - value?: number; + x?: string; /** - * The color to use to render the bar associated with the data point. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + * The y axis value of the data point. */ - color?: ChartColor; + y?: number = 0; - constructor(options: StackedHorizontalBarChartDataPointOptions = {}) { + constructor(options: BarChartDataValueOptions = {}) { Object.assign(this, options); } - static from(options: IStackedHorizontalBarChartDataPoint): StackedHorizontalBarChartDataPoint { - return new StackedHorizontalBarChartDataPoint(options); + static from(options: IBarChartDataValue): BarChartDataValue { + return new BarChartDataValue(options); } - withLegend(legend: string): this { - this.legend = legend; + withKey(key: string): this { + this.key = key; return this; } - withValue(value: number): this { - this.value = value; + withX(x: string): this { + this.x = x; return this; } - withColor(color: ChartColor): this { - this.color = color; + withY(y: number): this { + this.y = y; return this; } } /** - * A line chart. + * A vertical bar chart. */ -export interface ILineChart { +export interface IVerticalBarChart { /** - * Must be **Chart.Line**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type: 'Chart.Line'; + key?: string; + /** + * Must be **Chart.VerticalBar**. + */ + readonly type: 'Chart.VerticalBar'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -14199,10 +12267,22 @@ export interface ILineChart { * The title of the chart. */ title?: string; + /** + * Controls whether the chart's title should be displayed. Defaults to `false`. + */ + showTitle?: boolean; /** * The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). */ colorSet?: ChartColorSet; + /** + * The maximum width, in pixels, of the chart, in the `px` format. + */ + maxWidth?: string; + /** + * Controls whether the chart's legend should be displayed. + */ + showLegend?: boolean; /** * The title of the x axis. */ @@ -14211,14 +12291,26 @@ export interface ILineChart { * The title of the y axis. */ yAxisTitle?: string; + /** + * The data to display in the chart. + */ + data?: IVerticalBarChartDataValue[]; /** * The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). */ color?: ChartColor; /** - * The data point series in the line chart. + * Controls if the bar values should be displayed. */ - data?: ILineChartData[]; + showBarValues?: boolean; + /** + * The requested minimum for the Y axis range. The value used at runtime may be different to optimize visual presentation. + */ + yMin?: number; + /** + * The requested maximum for the Y axis range. The value used at runtime may be different to optimize visual presentation. + */ + yMax?: number; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -14233,26 +12325,30 @@ export interface ILineChart { * @hidden * @internal * - * Type guard to check if a value is of type ILineChart. + * Type guard to check if a value is of type IVerticalBarChart. * * @param value The value to check. - * @returns True if the value is an instance of LineChart, false otherwise. + * @returns True if the value is an instance of VerticalBarChart, false otherwise. */ -export function isLineChart(value: unknown): value is ILineChart { - const obj = value as ILineChart; - return typeof obj === 'object' && obj.type === 'Chart.Line'; +export function isVerticalBarChart(value: unknown): value is IVerticalBarChart { + const obj = value as IVerticalBarChart; + return typeof obj === 'object' && obj.type === 'Chart.VerticalBar'; } -export type LineChartOptions = Omit; +export type VerticalBarChartOptions = Partial>; /** - * A line chart. + * A vertical bar chart. */ -export class LineChart implements ILineChart { +export class VerticalBarChart implements IVerticalBarChart { /** - * Must be **Chart.Line**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type = 'Chart.Line'; + key?: string; + /** + * Must be **Chart.VerticalBar**. + */ + readonly type = 'Chart.VerticalBar'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -14260,7 +12356,7 @@ export class LineChart implements ILineChart { /** * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - requires?: IHostCapabilities; + requires?: IHostCapabilities = {}; /** * The locale associated with the element. */ @@ -14268,15 +12364,15 @@ export class LineChart implements ILineChart { /** * Controls the visibility of the element. */ - isVisible?: boolean; + isVisible?: boolean = true; /** * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. */ - separator?: boolean; + separator?: boolean = false; /** * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. */ - height?: ElementHeight; + height?: ElementHeight = 'auto'; /** * Controls how the element should be horizontally aligned. */ @@ -14284,7 +12380,7 @@ export class LineChart implements ILineChart { /** * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ - spacing?: Spacing; + spacing?: Spacing = 'Default'; /** * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). */ @@ -14292,15 +12388,27 @@ export class LineChart implements ILineChart { /** * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. */ - isSortKey?: boolean; + isSortKey?: boolean = false; /** * The title of the chart. */ title?: string; + /** + * Controls whether the chart's title should be displayed. Defaults to `false`. + */ + showTitle?: boolean = false; /** * The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). */ colorSet?: ChartColorSet; + /** + * The maximum width, in pixels, of the chart, in the `px` format. + */ + maxWidth?: string; + /** + * Controls whether the chart's legend should be displayed. + */ + showLegend?: boolean = true; /** * The title of the x axis. */ @@ -14309,14 +12417,26 @@ export class LineChart implements ILineChart { * The title of the y axis. */ yAxisTitle?: string; + /** + * The data to display in the chart. + */ + data?: IVerticalBarChartDataValue[]; /** * The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). */ color?: ChartColor; /** - * The data point series in the line chart. + * Controls if the bar values should be displayed. */ - data?: ILineChartData[]; + showBarValues?: boolean = false; + /** + * The requested minimum for the Y axis range. The value used at runtime may be different to optimize visual presentation. + */ + yMin?: number; + /** + * The requested maximum for the Y axis range. The value used at runtime may be different to optimize visual presentation. + */ + yMax?: number; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -14326,12 +12446,17 @@ export class LineChart implements ILineChart { */ fallback?: FallbackElement; - constructor(options: LineChartOptions = {}) { + constructor(options: VerticalBarChartOptions = {}) { Object.assign(this, options); } - static from(options: Omit): LineChart { - return new LineChart(options); + static from(options: Omit): VerticalBarChart { + return new VerticalBarChart(options); + } + + withKey(key: string): this { + this.key = key; + return this; } withId(id: string): this { @@ -14389,11 +12514,26 @@ export class LineChart implements ILineChart { return this; } + withShowTitle(showTitle = true): this { + this.showTitle = showTitle; + return this; + } + withColorSet(colorSet: ChartColorSet): this { this.colorSet = colorSet; return this; } + withMaxWidth(maxWidth: string): this { + this.maxWidth = maxWidth; + return this; + } + + withShowLegend(showLegend = false): this { + this.showLegend = showLegend; + return this; + } + withXAxisTitle(xAxisTitle: string): this { this.xAxisTitle = xAxisTitle; return this; @@ -14404,13 +12544,28 @@ export class LineChart implements ILineChart { return this; } + withData(...data: IVerticalBarChartDataValue[]): this { + this.data = data; + return this; + } + withColor(color: ChartColor): this { this.color = color; return this; } - withData(...data: ILineChartData[]): this { - this.data = data; + withShowBarValues(showBarValues = true): this { + this.showBarValues = showBarValues; + return this; + } + + withYMin(yMin: number): this { + this.yMin = yMin; + return this; + } + + withYMax(yMax: number): this { + this.yMax = yMax; return this; } @@ -14421,57 +12576,71 @@ export class LineChart implements ILineChart { } /** - * Represents a collection of data points series in a line chart. + * Represents a data point in a vertical bar chart. */ -export interface ILineChartData { +export interface IVerticalBarChartDataValue { /** - * The legend of the chart. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - legend?: string; + key?: string; /** - * The data points in the series. + * The x axis value of the data point. */ - values?: ILineChartValue[]; + x?: string | number; /** - * The color all data points in the series. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + * The y axis value of the data point. + */ + y?: number; + /** + * The color to use for the bar associated with the data point. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). */ color?: ChartColor; } -export type LineChartDataOptions = ILineChartData; + +export type VerticalBarChartDataValueOptions = Partial; /** - * Represents a collection of data points series in a line chart. + * Represents a data point in a vertical bar chart. */ -export class LineChartData implements ILineChartData { +export class VerticalBarChartDataValue implements IVerticalBarChartDataValue { /** - * The legend of the chart. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - legend?: string; + key?: string; /** - * The data points in the series. + * The x axis value of the data point. */ - values?: ILineChartValue[]; + x?: string | number; /** - * The color all data points in the series. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + * The y axis value of the data point. + */ + y?: number = 0; + /** + * The color to use for the bar associated with the data point. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). */ color?: ChartColor; - constructor(options: LineChartDataOptions = {}) { + constructor(options: VerticalBarChartDataValueOptions = {}) { Object.assign(this, options); } - static from(options: ILineChartData): LineChartData { - return new LineChartData(options); + static from(options: IVerticalBarChartDataValue): VerticalBarChartDataValue { + return new VerticalBarChartDataValue(options); } - withLegend(legend: string): this { - this.legend = legend; + withKey(key: string): this { + this.key = key; return this; } - withValues(...values: ILineChartValue[]): this { - this.values = values; + withX(x: string | number): this { + this.x = x; + return this; + } + + withY(y: number): this { + this.y = y; return this; } @@ -14482,69 +12651,17 @@ export class LineChartData implements ILineChartData { } /** - * Represents a single data point in a line chart. + * A horizontal bar chart. */ -export interface ILineChartValue { +export interface IHorizontalBarChart { /** - * The x axis value of the data point. - -If all x values of the x [Chart.Line](https://adaptivecards.microsoft.com/?topic=Chart.Line) are expressed as a number, or if all x values are expressed as a date string in the `YYYY-MM-DD` format, the chart will be rendered as a time series chart, i.e. x axis values will span across the minimum x value to maximum x value range. - -Otherwise, if x values are represented as a mix of numbers and strings or if at least one x value isn't in the `YYYY-MM-DD` format, the chart will be rendered as a categorical chart, i.e. x axis values will be displayed as categories. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - x?: number | string; + key?: string; /** - * The y axis value of the data point. - */ - y?: number; -} - -export type LineChartValueOptions = ILineChartValue; - -/** - * Represents a single data point in a line chart. - */ -export class LineChartValue implements ILineChartValue { - /** - * The x axis value of the data point. - -If all x values of the x [Chart.Line](https://adaptivecards.microsoft.com/?topic=Chart.Line) are expressed as a number, or if all x values are expressed as a date string in the `YYYY-MM-DD` format, the chart will be rendered as a time series chart, i.e. x axis values will span across the minimum x value to maximum x value range. - -Otherwise, if x values are represented as a mix of numbers and strings or if at least one x value isn't in the `YYYY-MM-DD` format, the chart will be rendered as a categorical chart, i.e. x axis values will be displayed as categories. - */ - x?: number | string; - /** - * The y axis value of the data point. - */ - y?: number; - - constructor(options: LineChartValueOptions = {}) { - Object.assign(this, options); - } - - static from(options: ILineChartValue): LineChartValue { - return new LineChartValue(options); - } - - withX(x: number | string): this { - this.x = x; - return this; - } - - withY(y: number): this { - this.y = y; - return this; - } -} - -/** - * A gauge chart. - */ -export interface IGaugeChart { - /** - * Must be **Chart.Gauge**. + * Must be **Chart.HorizontalBar**. */ - readonly type: 'Chart.Gauge'; + readonly type: 'Chart.HorizontalBar'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -14590,41 +12707,41 @@ export interface IGaugeChart { */ title?: string; /** - * The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + * Controls whether the chart's title should be displayed. Defaults to `false`. */ - colorSet?: ChartColorSet; + showTitle?: boolean; /** - * The minimum value of the gauge. + * The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). */ - min?: number; + colorSet?: ChartColorSet; /** - * The maximum value of the gauge. + * The maximum width, in pixels, of the chart, in the `px` format. */ - max?: number; + maxWidth?: string; /** - * The sub-label of the gauge. + * Controls whether the chart's legend should be displayed. */ - subLabel?: string; + showLegend?: boolean; /** - * Controls if the min/max values should be displayed. + * The title of the x axis. */ - showMinMax?: boolean; + xAxisTitle?: string; /** - * Controls if the legend should be displayed. + * The title of the y axis. */ - showLegend?: boolean; + yAxisTitle?: string; /** - * The segments to display in the gauge. + * The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). */ - segments?: IGaugeChartLegend[]; + color?: ChartColor; /** - * The value of the gauge. + * The data points in the chart. */ - value?: number; + data?: IHorizontalBarChartDataValue[]; /** - * The format used to display the gauge's value. + * Controls how the chart should be visually laid out. */ - valueFormat?: GaugeChartValueFormat; + displayMode?: HorizontalBarChartDisplayMode; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -14639,26 +12756,30 @@ export interface IGaugeChart { * @hidden * @internal * - * Type guard to check if a value is of type IGaugeChart. + * Type guard to check if a value is of type IHorizontalBarChart. * * @param value The value to check. - * @returns True if the value is an instance of GaugeChart, false otherwise. + * @returns True if the value is an instance of HorizontalBarChart, false otherwise. */ -export function isGaugeChart(value: unknown): value is IGaugeChart { - const obj = value as IGaugeChart; - return typeof obj === 'object' && obj.type === 'Chart.Gauge'; +export function isHorizontalBarChart(value: unknown): value is IHorizontalBarChart { + const obj = value as IHorizontalBarChart; + return typeof obj === 'object' && obj.type === 'Chart.HorizontalBar'; } -export type GaugeChartOptions = Omit; +export type HorizontalBarChartOptions = Partial>; /** - * A gauge chart. + * A horizontal bar chart. */ -export class GaugeChart implements IGaugeChart { +export class HorizontalBarChart implements IHorizontalBarChart { /** - * Must be **Chart.Gauge**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type = 'Chart.Gauge'; + key?: string; + /** + * Must be **Chart.HorizontalBar**. + */ + readonly type = 'Chart.HorizontalBar'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -14666,7 +12787,7 @@ export class GaugeChart implements IGaugeChart { /** * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - requires?: IHostCapabilities; + requires?: IHostCapabilities = {}; /** * The locale associated with the element. */ @@ -14674,15 +12795,15 @@ export class GaugeChart implements IGaugeChart { /** * Controls the visibility of the element. */ - isVisible?: boolean; + isVisible?: boolean = true; /** * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. */ - separator?: boolean; + separator?: boolean = false; /** * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. */ - height?: ElementHeight; + height?: ElementHeight = 'auto'; /** * Controls how the element should be horizontally aligned. */ @@ -14690,7 +12811,7 @@ export class GaugeChart implements IGaugeChart { /** * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ - spacing?: Spacing; + spacing?: Spacing = 'Default'; /** * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). */ @@ -14698,47 +12819,47 @@ export class GaugeChart implements IGaugeChart { /** * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. */ - isSortKey?: boolean; + isSortKey?: boolean = false; /** * The title of the chart. */ title?: string; /** - * The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + * Controls whether the chart's title should be displayed. Defaults to `false`. */ - colorSet?: ChartColorSet; + showTitle?: boolean = false; /** - * The minimum value of the gauge. + * The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). */ - min?: number; + colorSet?: ChartColorSet; /** - * The maximum value of the gauge. + * The maximum width, in pixels, of the chart, in the `px` format. */ - max?: number; + maxWidth?: string; /** - * The sub-label of the gauge. + * Controls whether the chart's legend should be displayed. */ - subLabel?: string; + showLegend?: boolean = true; /** - * Controls if the min/max values should be displayed. + * The title of the x axis. */ - showMinMax?: boolean; + xAxisTitle?: string; /** - * Controls if the legend should be displayed. + * The title of the y axis. */ - showLegend?: boolean; + yAxisTitle?: string; /** - * The segments to display in the gauge. + * The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). */ - segments?: IGaugeChartLegend[]; + color?: ChartColor; /** - * The value of the gauge. + * The data points in the chart. */ - value?: number; + data?: IHorizontalBarChartDataValue[]; /** - * The format used to display the gauge's value. + * Controls how the chart should be visually laid out. */ - valueFormat?: GaugeChartValueFormat; + displayMode?: HorizontalBarChartDisplayMode = 'AbsoluteWithAxis'; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -14748,12 +12869,17 @@ export class GaugeChart implements IGaugeChart { */ fallback?: FallbackElement; - constructor(options: GaugeChartOptions = {}) { + constructor(options: HorizontalBarChartOptions = {}) { Object.assign(this, options); } - static from(options: Omit): GaugeChart { - return new GaugeChart(options); + static from(options: Omit): HorizontalBarChart { + return new HorizontalBarChart(options); + } + + withKey(key: string): this { + this.key = key; + return this; } withId(id: string): this { @@ -14811,48 +12937,48 @@ export class GaugeChart implements IGaugeChart { return this; } - withColorSet(colorSet: ChartColorSet): this { - this.colorSet = colorSet; + withShowTitle(showTitle = true): this { + this.showTitle = showTitle; return this; } - withMin(min: number): this { - this.min = min; + withColorSet(colorSet: ChartColorSet): this { + this.colorSet = colorSet; return this; } - withMax(max: number): this { - this.max = max; + withMaxWidth(maxWidth: string): this { + this.maxWidth = maxWidth; return this; } - withSubLabel(subLabel: string): this { - this.subLabel = subLabel; + withShowLegend(showLegend = false): this { + this.showLegend = showLegend; return this; } - withShowMinMax(showMinMax = false): this { - this.showMinMax = showMinMax; + withXAxisTitle(xAxisTitle: string): this { + this.xAxisTitle = xAxisTitle; return this; } - withShowLegend(showLegend = false): this { - this.showLegend = showLegend; + withYAxisTitle(yAxisTitle: string): this { + this.yAxisTitle = yAxisTitle; return this; } - withSegments(...segments: IGaugeChartLegend[]): this { - this.segments = segments; + withColor(color: ChartColor): this { + this.color = color; return this; } - withValue(value: number): this { - this.value = value; + withData(...data: IHorizontalBarChartDataValue[]): this { + this.data = data; return this; } - withValueFormat(valueFormat: GaugeChartValueFormat): this { - this.valueFormat = valueFormat; + withDisplayMode(displayMode: HorizontalBarChartDisplayMode): this { + this.displayMode = displayMode; return this; } @@ -14863,57 +12989,71 @@ export class GaugeChart implements IGaugeChart { } /** - * The legend of the chart. + * Represents a single data point in a horizontal bar chart. */ -export interface IGaugeChartLegend { +export interface IHorizontalBarChartDataValue { /** - * The size of the segment. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - size?: number; + key?: string; /** - * The legend text associated with the segment. + * The x axis value of the data point. */ - legend?: string; + x?: string; /** - * The color to use for the segment. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + * The y axis value of the data point. + */ + y?: number; + /** + * The color of the bar associated with the data point. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). */ color?: ChartColor; } -export type GaugeChartLegendOptions = IGaugeChartLegend; + +export type HorizontalBarChartDataValueOptions = Partial; /** - * The legend of the chart. + * Represents a single data point in a horizontal bar chart. */ -export class GaugeChartLegend implements IGaugeChartLegend { +export class HorizontalBarChartDataValue implements IHorizontalBarChartDataValue { /** - * The size of the segment. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - size?: number; + key?: string; /** - * The legend text associated with the segment. + * The x axis value of the data point. */ - legend?: string; + x?: string; /** - * The color to use for the segment. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + * The y axis value of the data point. + */ + y?: number = 0; + /** + * The color of the bar associated with the data point. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). */ color?: ChartColor; - constructor(options: GaugeChartLegendOptions = {}) { + constructor(options: HorizontalBarChartDataValueOptions = {}) { Object.assign(this, options); } - static from(options: IGaugeChartLegend): GaugeChartLegend { - return new GaugeChartLegend(options); + static from(options: IHorizontalBarChartDataValue): HorizontalBarChartDataValue { + return new HorizontalBarChartDataValue(options); } - withSize(size: number): this { - this.size = size; + withKey(key: string): this { + this.key = key; return this; } - withLegend(legend: string): this { - this.legend = legend; + withX(x: string): this { + this.x = x; + return this; + } + + withY(y: number): this { + this.y = y; return this; } @@ -14924,13 +13064,17 @@ export class GaugeChartLegend implements IGaugeChartLegend { } /** - * A formatted and syntax-colored code block. + * A stacked horizontal bar chart. */ -export interface ICodeBlock { +export interface IStackedHorizontalBarChart { /** - * Must be **CodeBlock**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type: 'CodeBlock'; + key?: string; + /** + * Must be **Chart.HorizontalBar.Stacked**. + */ + readonly type: 'Chart.HorizontalBar.Stacked'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -14972,75 +13116,79 @@ export interface ICodeBlock { */ isSortKey?: boolean; /** - * The code snippet to display. + * The title of the chart. */ - codeSnippet?: string; + title?: string; /** - * The language the code snippet is expressed in. + * Controls whether the chart's title should be displayed. Defaults to `false`. */ - language?: - | 'Bash' - | 'C' - | 'Cpp' - | 'CSharp' - | 'Css' - | 'Dos' - | 'Go' - | 'Graphql' - | 'Html' - | 'Java' - | 'JavaScript' - | 'Json' - | 'ObjectiveC' - | 'Perl' - | 'Php' - | 'PlainText' - | 'PowerShell' - | 'Python' - | 'Sql' - | 'TypeScript' - | 'VbNet' - | 'Verilog' - | 'Vhdl' - | 'Xml'; + showTitle?: boolean; /** - * A number that represents the line in the file from where the code snippet was extracted. + * The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). */ - startLineNumber?: number; + colorSet?: ChartColorSet; /** - * The area of a Layout.AreaGrid layout in which an element should be displayed. + * The maximum width, in pixels, of the chart, in the `px` format. */ - 'grid.area'?: string; + maxWidth?: string; /** - * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + * Controls whether the chart's legend should be displayed. */ - fallback?: FallbackElement; -} - -/** - * @hidden - * @internal - * - * Type guard to check if a value is of type ICodeBlock. - * - * @param value The value to check. - * @returns True if the value is an instance of CodeBlock, false otherwise. - */ -export function isCodeBlock(value: unknown): value is ICodeBlock { - const obj = value as ICodeBlock; - return typeof obj === 'object' && obj.type === 'CodeBlock'; + showLegend?: boolean; + /** + * The title of the x axis. + */ + xAxisTitle?: string; + /** + * The title of the y axis. + */ + yAxisTitle?: string; + /** + * The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + */ + color?: ChartColor; + /** + * The data to display in the chart. + */ + data?: IStackedHorizontalBarChartData[]; + /** + * The area of a Layout.AreaGrid layout in which an element should be displayed. + */ + 'grid.area'?: string; + /** + * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + */ + fallback?: FallbackElement; +} + +/** + * @hidden + * @internal + * + * Type guard to check if a value is of type IStackedHorizontalBarChart. + * + * @param value The value to check. + * @returns True if the value is an instance of StackedHorizontalBarChart, false otherwise. + */ +export function isStackedHorizontalBarChart(value: unknown): value is IStackedHorizontalBarChart { + const obj = value as IStackedHorizontalBarChart; + return typeof obj === 'object' && obj.type === 'Chart.HorizontalBar.Stacked'; } -export type CodeBlockOptions = Omit; +export type StackedHorizontalBarChartOptions = Partial>; /** - * A formatted and syntax-colored code block. + * A stacked horizontal bar chart. */ -export class CodeBlock implements ICodeBlock { +export class StackedHorizontalBarChart implements IStackedHorizontalBarChart { /** - * Must be **CodeBlock**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type = 'CodeBlock'; + key?: string; + /** + * Must be **Chart.HorizontalBar.Stacked**. + */ + readonly type = 'Chart.HorizontalBar.Stacked'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -15048,7 +13196,7 @@ export class CodeBlock implements ICodeBlock { /** * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - requires?: IHostCapabilities; + requires?: IHostCapabilities = {}; /** * The locale associated with the element. */ @@ -15056,15 +13204,15 @@ export class CodeBlock implements ICodeBlock { /** * Controls the visibility of the element. */ - isVisible?: boolean; + isVisible?: boolean = true; /** * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. */ - separator?: boolean; + separator?: boolean = false; /** * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. */ - height?: ElementHeight; + height?: ElementHeight = 'auto'; /** * Controls how the element should be horizontally aligned. */ @@ -15072,7 +13220,7 @@ export class CodeBlock implements ICodeBlock { /** * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ - spacing?: Spacing; + spacing?: Spacing = 'Default'; /** * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). */ @@ -15080,43 +13228,43 @@ export class CodeBlock implements ICodeBlock { /** * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. */ - isSortKey?: boolean; + isSortKey?: boolean = false; /** - * The code snippet to display. + * The title of the chart. */ - codeSnippet?: string; + title?: string; /** - * The language the code snippet is expressed in. + * Controls whether the chart's title should be displayed. Defaults to `false`. */ - language?: - | 'Bash' - | 'C' - | 'Cpp' - | 'CSharp' - | 'Css' - | 'Dos' - | 'Go' - | 'Graphql' - | 'Html' - | 'Java' - | 'JavaScript' - | 'Json' - | 'ObjectiveC' - | 'Perl' - | 'Php' - | 'PlainText' - | 'PowerShell' - | 'Python' - | 'Sql' - | 'TypeScript' - | 'VbNet' - | 'Verilog' - | 'Vhdl' - | 'Xml'; + showTitle?: boolean = false; /** - * A number that represents the line in the file from where the code snippet was extracted. + * The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). */ - startLineNumber?: number; + colorSet?: ChartColorSet; + /** + * The maximum width, in pixels, of the chart, in the `px` format. + */ + maxWidth?: string; + /** + * Controls whether the chart's legend should be displayed. + */ + showLegend?: boolean = true; + /** + * The title of the x axis. + */ + xAxisTitle?: string; + /** + * The title of the y axis. + */ + yAxisTitle?: string; + /** + * The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + */ + color?: ChartColor; + /** + * The data to display in the chart. + */ + data?: IStackedHorizontalBarChartData[]; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -15126,12 +13274,17 @@ export class CodeBlock implements ICodeBlock { */ fallback?: FallbackElement; - constructor(options: CodeBlockOptions = {}) { + constructor(options: StackedHorizontalBarChartOptions = {}) { Object.assign(this, options); } - static from(options: Omit): CodeBlock { - return new CodeBlock(options); + static from(options: Omit): StackedHorizontalBarChart { + return new StackedHorizontalBarChart(options); + } + + withKey(key: string): this { + this.key = key; + return this; } withId(id: string): this { @@ -15184,44 +13337,48 @@ export class CodeBlock implements ICodeBlock { return this; } - withCodeSnippet(codeSnippet: string): this { - this.codeSnippet = codeSnippet; + withTitle(title: string): this { + this.title = title; return this; } - withLanguage( - language: - | 'Bash' - | 'C' - | 'Cpp' - | 'CSharp' - | 'Css' - | 'Dos' - | 'Go' - | 'Graphql' - | 'Html' - | 'Java' - | 'JavaScript' - | 'Json' - | 'ObjectiveC' - | 'Perl' - | 'Php' - | 'PlainText' - | 'PowerShell' - | 'Python' - | 'Sql' - | 'TypeScript' - | 'VbNet' - | 'Verilog' - | 'Vhdl' - | 'Xml' - ): this { - this.language = language; + withShowTitle(showTitle = true): this { + this.showTitle = showTitle; return this; } - withStartLineNumber(startLineNumber: number): this { - this.startLineNumber = startLineNumber; + withColorSet(colorSet: ChartColorSet): this { + this.colorSet = colorSet; + return this; + } + + withMaxWidth(maxWidth: string): this { + this.maxWidth = maxWidth; + return this; + } + + withShowLegend(showLegend = false): this { + this.showLegend = showLegend; + return this; + } + + withXAxisTitle(xAxisTitle: string): this { + this.xAxisTitle = xAxisTitle; + return this; + } + + withYAxisTitle(yAxisTitle: string): this { + this.yAxisTitle = yAxisTitle; + return this; + } + + withColor(color: ChartColor): this { + this.color = color; + return this; + } + + withData(...data: IStackedHorizontalBarChartData[]): this { + this.data = data; return this; } @@ -15232,286 +13389,154 @@ export class CodeBlock implements ICodeBlock { } /** - * Displays a user's information, including their profile picture. + * Defines the collection of data series to display in as a stacked horizontal bar chart. */ -export interface IComUserMicrosoftGraphComponent { - /** - * Must be **Component**. - */ - readonly type: 'Component'; - /** - * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. - */ - id?: string; - /** - * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). - */ - requires?: IHostCapabilities; - /** - * The locale associated with the element. - */ - lang?: string; - /** - * Controls the visibility of the element. - */ - isVisible?: boolean; +export interface IStackedHorizontalBarChartData { /** - * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - separator?: boolean; + key?: string; /** - * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + * The title of the series. */ - height?: ElementHeight; + title?: string; /** - * Controls how the element should be horizontally aligned. + * The data points in the series. */ - horizontalAlignment?: HorizontalAlignment; + data?: IStackedHorizontalBarChartDataPoint[]; +} + + +export type StackedHorizontalBarChartDataOptions = Partial; + +/** + * Defines the collection of data series to display in as a stacked horizontal bar chart. + */ +export class StackedHorizontalBarChartData implements IStackedHorizontalBarChartData { /** - * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - spacing?: Spacing; + key?: string; /** - * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + * The title of the series. */ - targetWidth?: TargetWidth; + title?: string; /** - * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + * The data points in the series. */ - isSortKey?: boolean; + data?: IStackedHorizontalBarChartDataPoint[]; + + constructor(options: StackedHorizontalBarChartDataOptions = {}) { + Object.assign(this, options); + } + + static from(options: IStackedHorizontalBarChartData): StackedHorizontalBarChartData { + return new StackedHorizontalBarChartData(options); + } + + withKey(key: string): this { + this.key = key; + return this; + } + + withTitle(title: string): this { + this.title = title; + return this; + } + + withData(...data: IStackedHorizontalBarChartDataPoint[]): this { + this.data = data; + return this; + } +} + +/** + * A data point in a series. + */ +export interface IStackedHorizontalBarChartDataPoint { /** - * Must be **graph.microsoft.com/user**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly name: 'graph.microsoft.com/user'; + key?: string; /** - * The properties of the user. + * The legend associated with the data point. */ - properties?: IPersonaProperties; + legend?: string; /** - * The area of a Layout.AreaGrid layout in which an element should be displayed. + * The value of the data point. */ - 'grid.area'?: string; + value?: number; /** - * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + * The color to use to render the bar associated with the data point. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). */ - fallback?: FallbackElement; + color?: ChartColor; } -/** - * @hidden - * @internal - * - * Type guard to check if a value is of type IComUserMicrosoftGraphComponent. - * - * @param value The value to check. - * @returns True if the value is an instance of ComUserMicrosoftGraphComponent, false otherwise. - */ -export function isComUserMicrosoftGraphComponent( - value: unknown -): value is IComUserMicrosoftGraphComponent { - const obj = value as IComUserMicrosoftGraphComponent; - return ( - typeof obj === 'object' && obj.type === 'Component' && obj.name === 'graph.microsoft.com/user' - ); -} -export type ComUserMicrosoftGraphComponentOptions = Omit< - IComUserMicrosoftGraphComponent, - 'type' | 'name' ->; +export type StackedHorizontalBarChartDataPointOptions = Partial; /** - * Displays a user's information, including their profile picture. + * A data point in a series. */ -export class ComUserMicrosoftGraphComponent implements IComUserMicrosoftGraphComponent { - /** - * Must be **Component**. - */ - readonly type = 'Component'; +export class StackedHorizontalBarChartDataPoint implements IStackedHorizontalBarChartDataPoint { /** - * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - id?: string; + key?: string; /** - * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + * The legend associated with the data point. */ - requires?: IHostCapabilities; + legend?: string; /** - * The locale associated with the element. + * The value of the data point. */ - lang?: string; + value?: number = 0; /** - * Controls the visibility of the element. + * The color to use to render the bar associated with the data point. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). */ - isVisible?: boolean; - /** - * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - */ - separator?: boolean; - /** - * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - */ - height?: ElementHeight; - /** - * Controls how the element should be horizontally aligned. - */ - horizontalAlignment?: HorizontalAlignment; - /** - * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - */ - spacing?: Spacing; - /** - * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - */ - targetWidth?: TargetWidth; - /** - * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - */ - isSortKey?: boolean; - /** - * Must be **graph.microsoft.com/user**. - */ - readonly name = 'graph.microsoft.com/user'; - /** - * The properties of the user. - */ - properties?: IPersonaProperties; - /** - * The area of a Layout.AreaGrid layout in which an element should be displayed. - */ - 'grid.area'?: string; - /** - * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. - */ - fallback?: FallbackElement; + color?: ChartColor; - constructor(options: ComUserMicrosoftGraphComponentOptions = {}) { + constructor(options: StackedHorizontalBarChartDataPointOptions = {}) { Object.assign(this, options); } - static from( - options: Omit - ): ComUserMicrosoftGraphComponent { - return new ComUserMicrosoftGraphComponent(options); - } - - withId(id: string): this { - this.id = id; - return this; - } - - withRequires(requires: IHostCapabilities): this { - this.requires = requires; - return this; - } - - withLang(lang: string): this { - this.lang = lang; - return this; - } - - withIsVisible(isVisible = false): this { - this.isVisible = isVisible; - return this; - } - - withSeparator(separator = true): this { - this.separator = separator; - return this; - } - - withHeight(height: ElementHeight): this { - this.height = height; - return this; - } - - withHorizontalAlignment(horizontalAlignment: HorizontalAlignment): this { - this.horizontalAlignment = horizontalAlignment; - return this; - } - - withSpacing(spacing: Spacing): this { - this.spacing = spacing; - return this; + static from(options: IStackedHorizontalBarChartDataPoint): StackedHorizontalBarChartDataPoint { + return new StackedHorizontalBarChartDataPoint(options); } - withTargetWidth(targetWidth: TargetWidth): this { - this.targetWidth = targetWidth; + withKey(key: string): this { + this.key = key; return this; } - withIsSortKey(isSortKey = true): this { - this.isSortKey = isSortKey; + withLegend(legend: string): this { + this.legend = legend; return this; } - withProperties(properties: IPersonaProperties): this { - this.properties = properties; + withValue(value: number): this { + this.value = value; return this; } - withFallback(fallback: FallbackElement): this { - this.fallback = fallback; + withColor(color: ChartColor): this { + this.color = color; return this; } } /** - * Represents the properties of a Persona component. - */ -export interface IPersonaProperties { - /** - * The UPN of the persona. - */ - userPrincipalName?: string; - /** - * The display name of the persona. - */ - displayName?: string; -} - -export type PersonaPropertiesOptions = IPersonaProperties; - -/** - * Represents the properties of a Persona component. + * A line chart. */ -export class PersonaProperties implements IPersonaProperties { - /** - * The UPN of the persona. - */ - userPrincipalName?: string; +export interface ILineChart { /** - * The display name of the persona. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - displayName?: string; - - constructor(options: PersonaPropertiesOptions = {}) { - Object.assign(this, options); - } - - static from(options: IPersonaProperties): PersonaProperties { - return new PersonaProperties(options); - } - - withUserPrincipalName(userPrincipalName: string): this { - this.userPrincipalName = userPrincipalName; - return this; - } - - withDisplayName(displayName: string): this { - this.displayName = displayName; - return this; - } -} - -/** - * Displays multiple users' information, including their profile pictures. - */ -export interface IComUsersMicrosoftGraphComponent { + key?: string; /** - * Must be **Component**. + * Must be **Chart.Line**. */ - readonly type: 'Component'; + readonly type: 'Chart.Line'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -15553,13 +13578,49 @@ export interface IComUsersMicrosoftGraphComponent { */ isSortKey?: boolean; /** - * Must be **graph.microsoft.com/users**. + * The title of the chart. */ - readonly name: 'graph.microsoft.com/users'; + title?: string; /** - * The properties of the set. + * Controls whether the chart's title should be displayed. Defaults to `false`. */ - properties?: IPersonaSetProperties; + showTitle?: boolean; + /** + * The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + */ + colorSet?: ChartColorSet; + /** + * The maximum width, in pixels, of the chart, in the `px` format. + */ + maxWidth?: string; + /** + * Controls whether the chart's legend should be displayed. + */ + showLegend?: boolean; + /** + * The title of the x axis. + */ + xAxisTitle?: string; + /** + * The title of the y axis. + */ + yAxisTitle?: string; + /** + * The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + */ + color?: ChartColor; + /** + * The data point series in the line chart. + */ + data?: ILineChartData[]; + /** + * The maximum y range. + */ + yMin?: number; + /** + * The minimum y range. + */ + yMax?: number; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -15574,33 +13635,30 @@ export interface IComUsersMicrosoftGraphComponent { * @hidden * @internal * - * Type guard to check if a value is of type IComUsersMicrosoftGraphComponent. + * Type guard to check if a value is of type ILineChart. * * @param value The value to check. - * @returns True if the value is an instance of ComUsersMicrosoftGraphComponent, false otherwise. + * @returns True if the value is an instance of LineChart, false otherwise. */ -export function isComUsersMicrosoftGraphComponent( - value: unknown -): value is IComUsersMicrosoftGraphComponent { - const obj = value as IComUsersMicrosoftGraphComponent; - return ( - typeof obj === 'object' && obj.type === 'Component' && obj.name === 'graph.microsoft.com/users' - ); +export function isLineChart(value: unknown): value is ILineChart { + const obj = value as ILineChart; + return typeof obj === 'object' && obj.type === 'Chart.Line'; } -export type ComUsersMicrosoftGraphComponentOptions = Omit< - IComUsersMicrosoftGraphComponent, - 'type' | 'name' ->; +export type LineChartOptions = Partial>; /** - * Displays multiple users' information, including their profile pictures. + * A line chart. */ -export class ComUsersMicrosoftGraphComponent implements IComUsersMicrosoftGraphComponent { +export class LineChart implements ILineChart { /** - * Must be **Component**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type = 'Component'; + key?: string; + /** + * Must be **Chart.Line**. + */ + readonly type = 'Chart.Line'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -15608,7 +13666,7 @@ export class ComUsersMicrosoftGraphComponent implements IComUsersMicrosoftGraphC /** * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - requires?: IHostCapabilities; + requires?: IHostCapabilities = {}; /** * The locale associated with the element. */ @@ -15616,15 +13674,15 @@ export class ComUsersMicrosoftGraphComponent implements IComUsersMicrosoftGraphC /** * Controls the visibility of the element. */ - isVisible?: boolean; + isVisible?: boolean = true; /** * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. */ - separator?: boolean; + separator?: boolean = false; /** * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. */ - height?: ElementHeight; + height?: ElementHeight = 'auto'; /** * Controls how the element should be horizontally aligned. */ @@ -15632,7 +13690,7 @@ export class ComUsersMicrosoftGraphComponent implements IComUsersMicrosoftGraphC /** * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ - spacing?: Spacing; + spacing?: Spacing = 'Default'; /** * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). */ @@ -15640,15 +13698,51 @@ export class ComUsersMicrosoftGraphComponent implements IComUsersMicrosoftGraphC /** * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. */ - isSortKey?: boolean; + isSortKey?: boolean = false; /** - * Must be **graph.microsoft.com/users**. + * The title of the chart. */ - readonly name = 'graph.microsoft.com/users'; + title?: string; /** - * The properties of the set. + * Controls whether the chart's title should be displayed. Defaults to `false`. */ - properties?: IPersonaSetProperties; + showTitle?: boolean = false; + /** + * The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + */ + colorSet?: ChartColorSet; + /** + * The maximum width, in pixels, of the chart, in the `px` format. + */ + maxWidth?: string; + /** + * Controls whether the chart's legend should be displayed. + */ + showLegend?: boolean = true; + /** + * The title of the x axis. + */ + xAxisTitle?: string; + /** + * The title of the y axis. + */ + yAxisTitle?: string; + /** + * The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + */ + color?: ChartColor; + /** + * The data point series in the line chart. + */ + data?: ILineChartData[]; + /** + * The maximum y range. + */ + yMin?: number; + /** + * The minimum y range. + */ + yMax?: number; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -15658,14 +13752,17 @@ export class ComUsersMicrosoftGraphComponent implements IComUsersMicrosoftGraphC */ fallback?: FallbackElement; - constructor(options: ComUsersMicrosoftGraphComponentOptions = {}) { + constructor(options: LineChartOptions = {}) { Object.assign(this, options); } - static from( - options: Omit - ): ComUsersMicrosoftGraphComponent { - return new ComUsersMicrosoftGraphComponent(options); + static from(options: Omit): LineChart { + return new LineChart(options); + } + + withKey(key: string): this { + this.key = key; + return this; } withId(id: string): this { @@ -15718,60 +13815,224 @@ export class ComUsersMicrosoftGraphComponent implements IComUsersMicrosoftGraphC return this; } - withProperties(properties: IPersonaSetProperties): this { - this.properties = properties; + withTitle(title: string): this { + this.title = title; return this; } - withFallback(fallback: FallbackElement): this { - this.fallback = fallback; + withShowTitle(showTitle = true): this { + this.showTitle = showTitle; + return this; + } + + withColorSet(colorSet: ChartColorSet): this { + this.colorSet = colorSet; + return this; + } + + withMaxWidth(maxWidth: string): this { + this.maxWidth = maxWidth; + return this; + } + + withShowLegend(showLegend = false): this { + this.showLegend = showLegend; + return this; + } + + withXAxisTitle(xAxisTitle: string): this { + this.xAxisTitle = xAxisTitle; + return this; + } + + withYAxisTitle(yAxisTitle: string): this { + this.yAxisTitle = yAxisTitle; + return this; + } + + withColor(color: ChartColor): this { + this.color = color; + return this; + } + + withData(...data: ILineChartData[]): this { + this.data = data; + return this; + } + + withYMin(yMin: number): this { + this.yMin = yMin; + return this; + } + + withYMax(yMax: number): this { + this.yMax = yMax; + return this; + } + + withFallback(fallback: FallbackElement): this { + this.fallback = fallback; return this; } } /** - * Represents the properties of a PersonaSet component. + * Represents a collection of data points series in a line chart. */ -export interface IPersonaSetProperties { +export interface ILineChartData { /** - * The users a PersonaSet component should display. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - users?: IPersonaProperties[]; + key?: string; + /** + * The legend of the chart. + */ + legend?: string; + /** + * The data points in the series. + */ + values?: ILineChartValue[]; + /** + * The color all data points in the series. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + */ + color?: ChartColor; } -export type PersonaSetPropertiesOptions = IPersonaSetProperties; + +export type LineChartDataOptions = Partial; /** - * Represents the properties of a PersonaSet component. + * Represents a collection of data points series in a line chart. */ -export class PersonaSetProperties implements IPersonaSetProperties { +export class LineChartData implements ILineChartData { /** - * The users a PersonaSet component should display. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - users?: IPersonaProperties[]; + key?: string; + /** + * The legend of the chart. + */ + legend?: string; + /** + * The data points in the series. + */ + values?: ILineChartValue[]; + /** + * The color all data points in the series. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + */ + color?: ChartColor; - constructor(options: PersonaSetPropertiesOptions = {}) { + constructor(options: LineChartDataOptions = {}) { Object.assign(this, options); } - static from(options: IPersonaSetProperties): PersonaSetProperties { - return new PersonaSetProperties(options); + static from(options: ILineChartData): LineChartData { + return new LineChartData(options); } - withUsers(...users: IPersonaProperties[]): this { - this.users = users; + withKey(key: string): this { + this.key = key; + return this; + } + + withLegend(legend: string): this { + this.legend = legend; + return this; + } + + withValues(...values: ILineChartValue[]): this { + this.values = values; + return this; + } + + withColor(color: ChartColor): this { + this.color = color; return this; } } /** - * Displays information about a generic graph resource. + * Represents a single data point in a line chart. */ -export interface IComResourceMicrosoftGraphComponent { +export interface ILineChartValue { /** - * Must be **Component**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type: 'Component'; + key?: string; + /** + * The x axis value of the data point. + * + * If all x values of the x [Chart.Line](https://adaptivecards.microsoft.com/?topic=Chart.Line) are expressed as a number, or if all x values are expressed as a date string in the `YYYY-MM-DD` format, the chart will be rendered as a time series chart, i.e. x axis values will span across the minimum x value to maximum x value range. + * + * Otherwise, if x values are represented as a mix of numbers and strings or if at least one x value isn't in the `YYYY-MM-DD` format, the chart will be rendered as a categorical chart, i.e. x axis values will be displayed as categories. + */ + x?: number | string; + /** + * The y axis value of the data point. + */ + y?: number; +} + + +export type LineChartValueOptions = Partial; + +/** + * Represents a single data point in a line chart. + */ +export class LineChartValue implements ILineChartValue { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * The x axis value of the data point. + * + * If all x values of the x [Chart.Line](https://adaptivecards.microsoft.com/?topic=Chart.Line) are expressed as a number, or if all x values are expressed as a date string in the `YYYY-MM-DD` format, the chart will be rendered as a time series chart, i.e. x axis values will span across the minimum x value to maximum x value range. + * + * Otherwise, if x values are represented as a mix of numbers and strings or if at least one x value isn't in the `YYYY-MM-DD` format, the chart will be rendered as a categorical chart, i.e. x axis values will be displayed as categories. + */ + x?: number | string; + /** + * The y axis value of the data point. + */ + y?: number = 0; + + constructor(options: LineChartValueOptions = {}) { + Object.assign(this, options); + } + + static from(options: ILineChartValue): LineChartValue { + return new LineChartValue(options); + } + + withKey(key: string): this { + this.key = key; + return this; + } + + withX(x: number | string): this { + this.x = x; + return this; + } + + withY(y: number): this { + this.y = y; + return this; + } +} + +/** + * A gauge chart. + */ +export interface IGaugeChart { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * Must be **Chart.Gauge**. + */ + readonly type: 'Chart.Gauge'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -15813,13 +14074,61 @@ export interface IComResourceMicrosoftGraphComponent { */ isSortKey?: boolean; /** - * Must be **graph.microsoft.com/resource**. + * The title of the chart. */ - readonly name: 'graph.microsoft.com/resource'; + title?: string; /** - * The properties of the resource. + * Controls whether the chart's title should be displayed. Defaults to `false`. */ - properties?: IResourceProperties; + showTitle?: boolean; + /** + * The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + */ + colorSet?: ChartColorSet; + /** + * The maximum width, in pixels, of the chart, in the `px` format. + */ + maxWidth?: string; + /** + * Controls whether the chart's legend should be displayed. + */ + showLegend?: boolean; + /** + * The minimum value of the gauge. + */ + min?: number; + /** + * The maximum value of the gauge. + */ + max?: number; + /** + * The sub-label of the gauge. + */ + subLabel?: string; + /** + * Controls whether the min/max values should be displayed. + */ + showMinMax?: boolean; + /** + * Controls whether the gauge's needle is displayed. Default is **true**. + */ + showNeedle?: boolean; + /** + * Controls whether the outlines of the gauge segments are displayed. + */ + showOutlines?: boolean; + /** + * The segments to display in the gauge. + */ + segments?: IGaugeChartLegend[]; + /** + * The value of the gauge. + */ + value?: number; + /** + * The format used to display the gauge's value. + */ + valueFormat?: GaugeChartValueFormat; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -15834,35 +14143,30 @@ export interface IComResourceMicrosoftGraphComponent { * @hidden * @internal * - * Type guard to check if a value is of type IComResourceMicrosoftGraphComponent. + * Type guard to check if a value is of type IGaugeChart. * * @param value The value to check. - * @returns True if the value is an instance of ComResourceMicrosoftGraphComponent, false otherwise. + * @returns True if the value is an instance of GaugeChart, false otherwise. */ -export function isComResourceMicrosoftGraphComponent( - value: unknown -): value is IComResourceMicrosoftGraphComponent { - const obj = value as IComResourceMicrosoftGraphComponent; - return ( - typeof obj === 'object' && - obj.type === 'Component' && - obj.name === 'graph.microsoft.com/resource' - ); +export function isGaugeChart(value: unknown): value is IGaugeChart { + const obj = value as IGaugeChart; + return typeof obj === 'object' && obj.type === 'Chart.Gauge'; } -export type ComResourceMicrosoftGraphComponentOptions = Omit< - IComResourceMicrosoftGraphComponent, - 'type' | 'name' ->; +export type GaugeChartOptions = Partial>; /** - * Displays information about a generic graph resource. + * A gauge chart. */ -export class ComResourceMicrosoftGraphComponent implements IComResourceMicrosoftGraphComponent { +export class GaugeChart implements IGaugeChart { /** - * Must be **Component**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type = 'Component'; + key?: string; + /** + * Must be **Chart.Gauge**. + */ + readonly type = 'Chart.Gauge'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -15870,7 +14174,7 @@ export class ComResourceMicrosoftGraphComponent implements IComResourceMicrosoft /** * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - requires?: IHostCapabilities; + requires?: IHostCapabilities = {}; /** * The locale associated with the element. */ @@ -15878,15 +14182,15 @@ export class ComResourceMicrosoftGraphComponent implements IComResourceMicrosoft /** * Controls the visibility of the element. */ - isVisible?: boolean; + isVisible?: boolean = true; /** * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. */ - separator?: boolean; + separator?: boolean = false; /** * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. */ - height?: ElementHeight; + height?: ElementHeight = 'auto'; /** * Controls how the element should be horizontally aligned. */ @@ -15894,7 +14198,7 @@ export class ComResourceMicrosoftGraphComponent implements IComResourceMicrosoft /** * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ - spacing?: Spacing; + spacing?: Spacing = 'Default'; /** * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). */ @@ -15902,32 +14206,83 @@ export class ComResourceMicrosoftGraphComponent implements IComResourceMicrosoft /** * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. */ - isSortKey?: boolean; + isSortKey?: boolean = false; /** - * Must be **graph.microsoft.com/resource**. + * The title of the chart. */ - readonly name = 'graph.microsoft.com/resource'; + title?: string; /** - * The properties of the resource. + * Controls whether the chart's title should be displayed. Defaults to `false`. */ - properties?: IResourceProperties; + showTitle?: boolean = false; /** - * The area of a Layout.AreaGrid layout in which an element should be displayed. + * The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). */ - 'grid.area'?: string; + colorSet?: ChartColorSet; /** - * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + * The maximum width, in pixels, of the chart, in the `px` format. */ - fallback?: FallbackElement; - - constructor(options: ComResourceMicrosoftGraphComponentOptions = {}) { - Object.assign(this, options); - } - - static from( - options: Omit - ): ComResourceMicrosoftGraphComponent { - return new ComResourceMicrosoftGraphComponent(options); + maxWidth?: string; + /** + * Controls whether the chart's legend should be displayed. + */ + showLegend?: boolean = true; + /** + * The minimum value of the gauge. + */ + min?: number = 0; + /** + * The maximum value of the gauge. + */ + max?: number; + /** + * The sub-label of the gauge. + */ + subLabel?: string; + /** + * Controls whether the min/max values should be displayed. + */ + showMinMax?: boolean = true; + /** + * Controls whether the gauge's needle is displayed. Default is **true**. + */ + showNeedle?: boolean = true; + /** + * Controls whether the outlines of the gauge segments are displayed. + */ + showOutlines?: boolean = true; + /** + * The segments to display in the gauge. + */ + segments?: IGaugeChartLegend[]; + /** + * The value of the gauge. + */ + value?: number = 0; + /** + * The format used to display the gauge's value. + */ + valueFormat?: GaugeChartValueFormat = 'Percentage'; + /** + * The area of a Layout.AreaGrid layout in which an element should be displayed. + */ + 'grid.area'?: string; + /** + * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + */ + fallback?: FallbackElement; + + constructor(options: GaugeChartOptions = {}) { + Object.assign(this, options); + } + + static from(options: Omit): GaugeChart { + return new GaugeChart(options); + } + + withKey(key: string): this { + this.key = key; + return this; } withId(id: string): this { @@ -15980,8 +14335,73 @@ export class ComResourceMicrosoftGraphComponent implements IComResourceMicrosoft return this; } - withProperties(properties: IResourceProperties): this { - this.properties = properties; + withTitle(title: string): this { + this.title = title; + return this; + } + + withShowTitle(showTitle = true): this { + this.showTitle = showTitle; + return this; + } + + withColorSet(colorSet: ChartColorSet): this { + this.colorSet = colorSet; + return this; + } + + withMaxWidth(maxWidth: string): this { + this.maxWidth = maxWidth; + return this; + } + + withShowLegend(showLegend = false): this { + this.showLegend = showLegend; + return this; + } + + withMin(min: number): this { + this.min = min; + return this; + } + + withMax(max: number): this { + this.max = max; + return this; + } + + withSubLabel(subLabel: string): this { + this.subLabel = subLabel; + return this; + } + + withShowMinMax(showMinMax = false): this { + this.showMinMax = showMinMax; + return this; + } + + withShowNeedle(showNeedle = false): this { + this.showNeedle = showNeedle; + return this; + } + + withShowOutlines(showOutlines = false): this { + this.showOutlines = showOutlines; + return this; + } + + withSegments(...segments: IGaugeChartLegend[]): this { + this.segments = segments; + return this; + } + + withValue(value: number): this { + this.value = value; + return this; + } + + withValueFormat(valueFormat: GaugeChartValueFormat): this { + this.valueFormat = valueFormat; return this; } @@ -15992,109 +14412,92 @@ export class ComResourceMicrosoftGraphComponent implements IComResourceMicrosoft } /** - * Represents the properties of a resource component. + * The legend of the chart. */ -export interface IResourceProperties { +export interface IGaugeChartLegend { /** - * The Id of the resource. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - id?: string; + key?: string; /** - * The reference to the resource. + * The size of the segment. */ - resourceReference?: Record; + size?: number; /** - * The visualization of the resource. + * The legend text associated with the segment. */ - resourceVisualization?: IResourceVisualization; + legend?: string; + /** + * The color to use for the segment. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + */ + color?: ChartColor; } -export type ResourcePropertiesOptions = IResourceProperties; + +export type GaugeChartLegendOptions = Partial; /** - * Represents the properties of a resource component. + * The legend of the chart. */ -export class ResourceProperties implements IResourceProperties { +export class GaugeChartLegend implements IGaugeChartLegend { /** - * The Id of the resource. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - id?: string; + key?: string; /** - * The reference to the resource. + * The size of the segment. */ - resourceReference?: Record; + size?: number = 0; /** - * The visualization of the resource. + * The legend text associated with the segment. */ - resourceVisualization?: IResourceVisualization; + legend?: string; + /** + * The color to use for the segment. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference). + */ + color?: ChartColor; - constructor(options: ResourcePropertiesOptions = {}) { + constructor(options: GaugeChartLegendOptions = {}) { Object.assign(this, options); } - static from(options: IResourceProperties): ResourceProperties { - return new ResourceProperties(options); + static from(options: IGaugeChartLegend): GaugeChartLegend { + return new GaugeChartLegend(options); } - withId(id: string): this { - this.id = id; + withKey(key: string): this { + this.key = key; return this; } - withResourceReference(resourceReference: Record): this { - this.resourceReference = resourceReference; + withSize(size: number): this { + this.size = size; return this; } - withResourceVisualization(resourceVisualization: IResourceVisualization): this { - this.resourceVisualization = resourceVisualization; + withLegend(legend: string): this { + this.legend = legend; return this; } -} - -/** - * Represents a visualization of a resource. - */ -export interface IResourceVisualization { - /** - * The media associated with the resource. - */ - media?: string; -} - -export type ResourceVisualizationOptions = IResourceVisualization; - -/** - * Represents a visualization of a resource. - */ -export class ResourceVisualization implements IResourceVisualization { - /** - * The media associated with the resource. - */ - media?: string; - - constructor(options: ResourceVisualizationOptions = {}) { - Object.assign(this, options); - } - - static from(options: IResourceVisualization): ResourceVisualization { - return new ResourceVisualization(options); - } - withMedia(media: string): this { - this.media = media; + withColor(color: ChartColor): this { + this.color = color; return this; } } /** - * Displays information about a file resource. + * A formatted and syntax-colored code block. */ -export interface IComFileMicrosoftGraphComponent { +export interface ICodeBlock { /** - * Must be **Component**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type: 'Component'; + key?: string; + /** + * Must be **CodeBlock**. + */ + readonly type: 'CodeBlock'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -16136,13 +14539,17 @@ export interface IComFileMicrosoftGraphComponent { */ isSortKey?: boolean; /** - * Must be **graph.microsoft.com/file**. + * The code snippet to display. */ - readonly name: 'graph.microsoft.com/file'; + codeSnippet?: string; /** - * The properties of the file. + * The language the code snippet is expressed in. */ - properties?: IFileProperties; + language?: CodeLanguage; + /** + * A number that represents the line in the file from where the code snippet was extracted. + */ + startLineNumber?: number; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -16157,33 +14564,30 @@ export interface IComFileMicrosoftGraphComponent { * @hidden * @internal * - * Type guard to check if a value is of type IComFileMicrosoftGraphComponent. + * Type guard to check if a value is of type ICodeBlock. * * @param value The value to check. - * @returns True if the value is an instance of ComFileMicrosoftGraphComponent, false otherwise. + * @returns True if the value is an instance of CodeBlock, false otherwise. */ -export function isComFileMicrosoftGraphComponent( - value: unknown -): value is IComFileMicrosoftGraphComponent { - const obj = value as IComFileMicrosoftGraphComponent; - return ( - typeof obj === 'object' && obj.type === 'Component' && obj.name === 'graph.microsoft.com/file' - ); +export function isCodeBlock(value: unknown): value is ICodeBlock { + const obj = value as ICodeBlock; + return typeof obj === 'object' && obj.type === 'CodeBlock'; } -export type ComFileMicrosoftGraphComponentOptions = Omit< - IComFileMicrosoftGraphComponent, - 'type' | 'name' ->; +export type CodeBlockOptions = Partial>; /** - * Displays information about a file resource. + * A formatted and syntax-colored code block. */ -export class ComFileMicrosoftGraphComponent implements IComFileMicrosoftGraphComponent { +export class CodeBlock implements ICodeBlock { /** - * Must be **Component**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type = 'Component'; + key?: string; + /** + * Must be **CodeBlock**. + */ + readonly type = 'CodeBlock'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -16191,7 +14595,7 @@ export class ComFileMicrosoftGraphComponent implements IComFileMicrosoftGraphCom /** * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - requires?: IHostCapabilities; + requires?: IHostCapabilities = {}; /** * The locale associated with the element. */ @@ -16199,15 +14603,15 @@ export class ComFileMicrosoftGraphComponent implements IComFileMicrosoftGraphCom /** * Controls the visibility of the element. */ - isVisible?: boolean; + isVisible?: boolean = true; /** * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. */ - separator?: boolean; + separator?: boolean = false; /** * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. */ - height?: ElementHeight; + height?: ElementHeight = 'auto'; /** * Controls how the element should be horizontally aligned. */ @@ -16215,7 +14619,7 @@ export class ComFileMicrosoftGraphComponent implements IComFileMicrosoftGraphCom /** * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ - spacing?: Spacing; + spacing?: Spacing = 'Default'; /** * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). */ @@ -16223,15 +14627,19 @@ export class ComFileMicrosoftGraphComponent implements IComFileMicrosoftGraphCom /** * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. */ - isSortKey?: boolean; + isSortKey?: boolean = false; /** - * Must be **graph.microsoft.com/file**. + * The code snippet to display. */ - readonly name = 'graph.microsoft.com/file'; + codeSnippet?: string; /** - * The properties of the file. + * The language the code snippet is expressed in. */ - properties?: IFileProperties; + language?: CodeLanguage = 'PlainText'; + /** + * A number that represents the line in the file from where the code snippet was extracted. + */ + startLineNumber?: number = 1; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -16241,14 +14649,17 @@ export class ComFileMicrosoftGraphComponent implements IComFileMicrosoftGraphCom */ fallback?: FallbackElement; - constructor(options: ComFileMicrosoftGraphComponentOptions = {}) { + constructor(options: CodeBlockOptions = {}) { Object.assign(this, options); } - static from( - options: Omit - ): ComFileMicrosoftGraphComponent { - return new ComFileMicrosoftGraphComponent(options); + static from(options: Omit): CodeBlock { + return new CodeBlock(options); + } + + withKey(key: string): this { + this.key = key; + return this; } withId(id: string): this { @@ -16301,82 +14712,35 @@ export class ComFileMicrosoftGraphComponent implements IComFileMicrosoftGraphCom return this; } - withProperties(properties: IFileProperties): this { - this.properties = properties; - return this; - } - - withFallback(fallback: FallbackElement): this { - this.fallback = fallback; + withCodeSnippet(codeSnippet: string): this { + this.codeSnippet = codeSnippet; return this; } -} - -/** - * Represents the properties of a file component. - */ -export interface IFileProperties { - /** - * The name of the file. - */ - name?: string; - /** - * The file extension. - */ - extension?: string; - /** - * The URL of the file. - */ - url?: string; -} - -export type FilePropertiesOptions = IFileProperties; - -/** - * Represents the properties of a file component. - */ -export class FileProperties implements IFileProperties { - /** - * The name of the file. - */ - name?: string; - /** - * The file extension. - */ - extension?: string; - /** - * The URL of the file. - */ - url?: string; - - constructor(options: FilePropertiesOptions = {}) { - Object.assign(this, options); - } - - static from(options: IFileProperties): FileProperties { - return new FileProperties(options); - } - withName(name: string): this { - this.name = name; + withLanguage(language: CodeLanguage): this { + this.language = language; return this; } - withExtension(extension: string): this { - this.extension = extension; + withStartLineNumber(startLineNumber: number): this { + this.startLineNumber = startLineNumber; return this; } - withUrl(url: string): this { - this.url = url; + withFallback(fallback: FallbackElement): this { + this.fallback = fallback; return this; } } /** - * Displays information about a calendar event. + * Displays a user's information, including their profile picture. */ -export interface IComEventMicrosoftGraphComponent { +export interface IComUserMicrosoftGraphComponent { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; /** * Must be **Component**. */ @@ -16422,13 +14786,13 @@ export interface IComEventMicrosoftGraphComponent { */ isSortKey?: boolean; /** - * Must be **graph.microsoft.com/event**. + * Must be **graph.microsoft.com/user**. */ - readonly name: 'graph.microsoft.com/event'; + readonly name: 'graph.microsoft.com/user'; /** - * The properties of the event. + * The properties of the Persona component. */ - properties?: ICalendarEventProperties; + properties?: IPersonaProperties; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -16443,29 +14807,26 @@ export interface IComEventMicrosoftGraphComponent { * @hidden * @internal * - * Type guard to check if a value is of type IComEventMicrosoftGraphComponent. + * Type guard to check if a value is of type IComUserMicrosoftGraphComponent. * * @param value The value to check. - * @returns True if the value is an instance of ComEventMicrosoftGraphComponent, false otherwise. + * @returns True if the value is an instance of ComUserMicrosoftGraphComponent, false otherwise. */ -export function isComEventMicrosoftGraphComponent( - value: unknown -): value is IComEventMicrosoftGraphComponent { - const obj = value as IComEventMicrosoftGraphComponent; - return ( - typeof obj === 'object' && obj.type === 'Component' && obj.name === 'graph.microsoft.com/event' - ); +export function isComUserMicrosoftGraphComponent(value: unknown): value is IComUserMicrosoftGraphComponent { + const obj = value as IComUserMicrosoftGraphComponent; + return typeof obj === 'object' && obj.type === 'Component' && obj.name === 'graph.microsoft.com/user'; } -export type ComEventMicrosoftGraphComponentOptions = Omit< - IComEventMicrosoftGraphComponent, - 'type' | 'name' ->; +export type ComUserMicrosoftGraphComponentOptions = Partial>; /** - * Displays information about a calendar event. + * Displays a user's information, including their profile picture. */ -export class ComEventMicrosoftGraphComponent implements IComEventMicrosoftGraphComponent { +export class ComUserMicrosoftGraphComponent implements IComUserMicrosoftGraphComponent { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; /** * Must be **Component**. */ @@ -16477,7 +14838,7 @@ export class ComEventMicrosoftGraphComponent implements IComEventMicrosoftGraphC /** * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - requires?: IHostCapabilities; + requires?: IHostCapabilities = {}; /** * The locale associated with the element. */ @@ -16485,15 +14846,15 @@ export class ComEventMicrosoftGraphComponent implements IComEventMicrosoftGraphC /** * Controls the visibility of the element. */ - isVisible?: boolean; + isVisible?: boolean = true; /** * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. */ - separator?: boolean; + separator?: boolean = false; /** * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. */ - height?: ElementHeight; + height?: ElementHeight = 'auto'; /** * Controls how the element should be horizontally aligned. */ @@ -16501,7 +14862,7 @@ export class ComEventMicrosoftGraphComponent implements IComEventMicrosoftGraphC /** * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ - spacing?: Spacing; + spacing?: Spacing = 'Default'; /** * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). */ @@ -16509,15 +14870,15 @@ export class ComEventMicrosoftGraphComponent implements IComEventMicrosoftGraphC /** * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. */ - isSortKey?: boolean; + isSortKey?: boolean = false; /** - * Must be **graph.microsoft.com/event**. + * Must be **graph.microsoft.com/user**. */ - readonly name = 'graph.microsoft.com/event'; + readonly name = 'graph.microsoft.com/user'; /** - * The properties of the event. + * The properties of the Persona component. */ - properties?: ICalendarEventProperties; + properties?: IPersonaProperties; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -16527,14 +14888,17 @@ export class ComEventMicrosoftGraphComponent implements IComEventMicrosoftGraphC */ fallback?: FallbackElement; - constructor(options: ComEventMicrosoftGraphComponentOptions = {}) { + constructor(options: ComUserMicrosoftGraphComponentOptions = {}) { Object.assign(this, options); } - static from( - options: Omit - ): ComEventMicrosoftGraphComponent { - return new ComEventMicrosoftGraphComponent(options); + static from(options: Omit): ComUserMicrosoftGraphComponent { + return new ComUserMicrosoftGraphComponent(options); + } + + withKey(key: string): this { + this.key = key; + return this; } withId(id: string): this { @@ -16587,7 +14951,7 @@ export class ComEventMicrosoftGraphComponent implements IComEventMicrosoftGraphC return this; } - withProperties(properties: ICalendarEventProperties): this { + withProperties(properties: IPersonaProperties): this { this.properties = properties; return this; } @@ -16599,120 +14963,272 @@ export class ComEventMicrosoftGraphComponent implements IComEventMicrosoftGraphC } /** - * The properties of a calendar event. + * Represents the properties of a Persona component. */ -export interface ICalendarEventProperties { +export interface IPersonaProperties { /** - * The ID of the event. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - id?: string; + key?: string; /** - * The title of the event. + * The Id of the persona. */ - title?: string; + id?: string; /** - * The start date and time of the event. + * The UPN of the persona. */ - start?: string; + userPrincipalName?: string; /** - * The end date and time of the event. + * The display name of the persona. */ - end?: string; + displayName?: string; /** - * The status of the event. + * Defines the style of the icon for the persona. */ - status?: string; + iconStyle?: PersonaIconStyle; /** - * The locations of the event. + * Defines how the persona should be displayed. */ - locations?: string[]; + style?: PersonaDisplayStyle; +} + + +export type PersonaPropertiesOptions = Partial; + +/** + * Represents the properties of a Persona component. + */ +export class PersonaProperties implements IPersonaProperties { /** - * The URL of the online meeting. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - onlineMeetingUrl?: string; + key?: string; /** - * Indicates if the event is all day. + * The Id of the persona. */ - isAllDay?: boolean; + id?: string; /** - * The extension of the event. + * The UPN of the persona. */ - extension?: string; + userPrincipalName?: string; /** - * The URL of the event. + * The display name of the persona. */ - url?: string; + displayName?: string; /** - * The attendees of the event. + * Defines the style of the icon for the persona. */ - attendees?: ICalendarEventAttendee[]; + iconStyle?: PersonaIconStyle; /** - * The organizer of the event. + * Defines how the persona should be displayed. */ - organizer?: ICalendarEventAttendee; -} + style?: PersonaDisplayStyle; + + constructor(options: PersonaPropertiesOptions = {}) { + Object.assign(this, options); + } + + static from(options: IPersonaProperties): PersonaProperties { + return new PersonaProperties(options); + } + + withKey(key: string): this { + this.key = key; + return this; + } + + withId(id: string): this { + this.id = id; + return this; + } + + withUserPrincipalName(userPrincipalName: string): this { + this.userPrincipalName = userPrincipalName; + return this; + } + + withDisplayName(displayName: string): this { + this.displayName = displayName; + return this; + } + + withIconStyle(iconStyle: PersonaIconStyle): this { + this.iconStyle = iconStyle; + return this; + } -export type CalendarEventPropertiesOptions = ICalendarEventProperties; + withStyle(style: PersonaDisplayStyle): this { + this.style = style; + return this; + } +} /** - * The properties of a calendar event. + * Displays multiple users' information, including their profile pictures. */ -export class CalendarEventProperties implements ICalendarEventProperties { +export interface IComUsersMicrosoftGraphComponent { /** - * The ID of the event. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * Must be **Component**. + */ + readonly type: 'Component'; + /** + * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ id?: string; /** - * The title of the event. + * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - title?: string; + requires?: IHostCapabilities; /** - * The start date and time of the event. + * The locale associated with the element. */ - start?: string; + lang?: string; /** - * The end date and time of the event. + * Controls the visibility of the element. */ - end?: string; + isVisible?: boolean; /** - * The status of the event. + * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. */ - status?: string; + separator?: boolean; /** - * The locations of the event. + * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. */ - locations?: string[]; + height?: ElementHeight; /** - * The URL of the online meeting. + * Controls how the element should be horizontally aligned. */ - onlineMeetingUrl?: string; + horizontalAlignment?: HorizontalAlignment; /** - * Indicates if the event is all day. + * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ - isAllDay?: boolean; + spacing?: Spacing; /** - * The extension of the event. + * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). */ - extension?: string; + targetWidth?: TargetWidth; /** - * The URL of the event. + * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. */ - url?: string; + isSortKey?: boolean; /** - * The attendees of the event. + * Must be **graph.microsoft.com/users**. */ - attendees?: ICalendarEventAttendee[]; + readonly name: 'graph.microsoft.com/users'; /** - * The organizer of the event. + * The properties of the PersonaSet component. */ - organizer?: ICalendarEventAttendee; + properties?: IPersonaSetProperties; + /** + * The area of a Layout.AreaGrid layout in which an element should be displayed. + */ + 'grid.area'?: string; + /** + * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + */ + fallback?: FallbackElement; +} - constructor(options: CalendarEventPropertiesOptions = {}) { +/** + * @hidden + * @internal + * + * Type guard to check if a value is of type IComUsersMicrosoftGraphComponent. + * + * @param value The value to check. + * @returns True if the value is an instance of ComUsersMicrosoftGraphComponent, false otherwise. + */ +export function isComUsersMicrosoftGraphComponent(value: unknown): value is IComUsersMicrosoftGraphComponent { + const obj = value as IComUsersMicrosoftGraphComponent; + return typeof obj === 'object' && obj.type === 'Component' && obj.name === 'graph.microsoft.com/users'; +} + +export type ComUsersMicrosoftGraphComponentOptions = Partial>; + +/** + * Displays multiple users' information, including their profile pictures. + */ +export class ComUsersMicrosoftGraphComponent implements IComUsersMicrosoftGraphComponent { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * Must be **Component**. + */ + readonly type = 'Component'; + /** + * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + */ + id?: string; + /** + * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + */ + requires?: IHostCapabilities = {}; + /** + * The locale associated with the element. + */ + lang?: string; + /** + * Controls the visibility of the element. + */ + isVisible?: boolean = true; + /** + * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + */ + separator?: boolean = false; + /** + * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + */ + height?: ElementHeight = 'auto'; + /** + * Controls how the element should be horizontally aligned. + */ + horizontalAlignment?: HorizontalAlignment; + /** + * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + */ + spacing?: Spacing = 'Default'; + /** + * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + */ + targetWidth?: TargetWidth; + /** + * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + */ + isSortKey?: boolean = false; + /** + * Must be **graph.microsoft.com/users**. + */ + readonly name = 'graph.microsoft.com/users'; + /** + * The properties of the PersonaSet component. + */ + properties?: IPersonaSetProperties; + /** + * The area of a Layout.AreaGrid layout in which an element should be displayed. + */ + 'grid.area'?: string; + /** + * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + */ + fallback?: FallbackElement; + + constructor(options: ComUsersMicrosoftGraphComponentOptions = {}) { Object.assign(this, options); } - static from(options: ICalendarEventProperties): CalendarEventProperties { - return new CalendarEventProperties(options); + static from(options: Omit): ComUsersMicrosoftGraphComponent { + return new ComUsersMicrosoftGraphComponent(options); + } + + withKey(key: string): this { + this.key = key; + return this; } withId(id: string): this { @@ -16720,157 +15236,149 @@ export class CalendarEventProperties implements ICalendarEventProperties { return this; } - withTitle(title: string): this { - this.title = title; + withRequires(requires: IHostCapabilities): this { + this.requires = requires; return this; } - withStart(start: string): this { - this.start = start; + withLang(lang: string): this { + this.lang = lang; return this; } - withEnd(end: string): this { - this.end = end; + withIsVisible(isVisible = false): this { + this.isVisible = isVisible; return this; } - withStatus(status: string): this { - this.status = status; + withSeparator(separator = true): this { + this.separator = separator; return this; } - withLocations(...locations: string[]): this { - this.locations = locations; + withHeight(height: ElementHeight): this { + this.height = height; return this; } - withOnlineMeetingUrl(onlineMeetingUrl: string): this { - this.onlineMeetingUrl = onlineMeetingUrl; + withHorizontalAlignment(horizontalAlignment: HorizontalAlignment): this { + this.horizontalAlignment = horizontalAlignment; return this; } - withIsAllDay(isAllDay: boolean): this { - this.isAllDay = isAllDay; + withSpacing(spacing: Spacing): this { + this.spacing = spacing; return this; } - withExtension(extension: string): this { - this.extension = extension; + withTargetWidth(targetWidth: TargetWidth): this { + this.targetWidth = targetWidth; return this; } - withUrl(url: string): this { - this.url = url; + withIsSortKey(isSortKey = true): this { + this.isSortKey = isSortKey; return this; } - withAttendees(...attendees: ICalendarEventAttendee[]): this { - this.attendees = attendees; + withProperties(properties: IPersonaSetProperties): this { + this.properties = properties; return this; } - withOrganizer(organizer: ICalendarEventAttendee): this { - this.organizer = organizer; + withFallback(fallback: FallbackElement): this { + this.fallback = fallback; return this; } } /** - * Represents a calendar event attendee. + * Represents the properties of a PersonaSet component. */ -export interface ICalendarEventAttendee { - /** - * The name of the attendee. - */ - name?: string; +export interface IPersonaSetProperties { /** - * The email address of the attendee. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - email?: string; + key?: string; /** - * The title of the attendee. + * The users a PersonaSet component should display. */ - title?: string; + users?: IPersonaProperties[]; /** - * The type of the attendee. + * Defines the style of the icon for the personas in the set. */ - type?: string; + iconStyle?: PersonaIconStyle; /** - * The status of the attendee. + * Defines how each persona in the set should be displayed. */ - status?: string; + style?: PersonaDisplayStyle; } -export type CalendarEventAttendeeOptions = ICalendarEventAttendee; + +export type PersonaSetPropertiesOptions = Partial; /** - * Represents a calendar event attendee. + * Represents the properties of a PersonaSet component. */ -export class CalendarEventAttendee implements ICalendarEventAttendee { - /** - * The name of the attendee. - */ - name?: string; +export class PersonaSetProperties implements IPersonaSetProperties { /** - * The email address of the attendee. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - email?: string; + key?: string; /** - * The title of the attendee. + * The users a PersonaSet component should display. */ - title?: string; + users?: IPersonaProperties[]; /** - * The type of the attendee. + * Defines the style of the icon for the personas in the set. */ - type?: string; + iconStyle?: PersonaIconStyle; /** - * The status of the attendee. + * Defines how each persona in the set should be displayed. */ - status?: string; + style?: PersonaDisplayStyle; - constructor(options: CalendarEventAttendeeOptions = {}) { + constructor(options: PersonaSetPropertiesOptions = {}) { Object.assign(this, options); } - static from(options: ICalendarEventAttendee): CalendarEventAttendee { - return new CalendarEventAttendee(options); - } - - withName(name: string): this { - this.name = name; - return this; + static from(options: IPersonaSetProperties): PersonaSetProperties { + return new PersonaSetProperties(options); } - withEmail(email: string): this { - this.email = email; + withKey(key: string): this { + this.key = key; return this; } - withTitle(title: string): this { - this.title = title; + withUsers(...users: IPersonaProperties[]): this { + this.users = users; return this; } - withType(type: string): this { - this.type = type; + withIconStyle(iconStyle: PersonaIconStyle): this { + this.iconStyle = iconStyle; return this; } - withStatus(status: string): this { - this.status = status; + withStyle(style: PersonaDisplayStyle): this { + this.style = style; return this; } } /** - * A page inside a Carousel element. + * Displays information about a generic graph resource. */ -export interface ICarouselPage { +export interface IComResourceMicrosoftGraphComponent { /** - * Must be **CarouselPage**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type: 'CarouselPage'; + key?: string; + /** + * Must be **Component**. + */ + readonly type: 'Component'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -16888,62 +15396,37 @@ export interface ICarouselPage { */ isVisible?: boolean; /** - * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - */ - height?: ElementHeight; - /** - * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - */ - targetWidth?: TargetWidth; - /** - * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - */ - isSortKey?: boolean; - /** - * An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. - */ - selectAction?: - | IExecuteAction - | IOpenUrlAction - | IResetInputsAction - | ISubmitAction - | IToggleVisibilityAction; - /** - * The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. - */ - style?: ContainerStyle; - /** - * Controls if a border should be displayed around the container. + * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. */ - showBorder?: boolean; + separator?: boolean; /** - * Controls if the container should have rounded corners. + * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. */ - roundedCorners?: boolean; + height?: ElementHeight; /** - * The layouts associated with the container. The container can dynamically switch from one layout to another as the card's width changes. See [Container layouts](https://adaptivecards.microsoft.com/?topic=container-layouts) for more details. + * Controls how the element should be horizontally aligned. */ - layouts?: (IStackLayout | IFlowLayout | IAreaGridLayout)[]; + horizontalAlignment?: HorizontalAlignment; /** - * The minimum height, in pixels, of the container, in the `px` format. + * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ - minHeight?: string; + spacing?: Spacing; /** - * Defines the container's background image. + * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). */ - backgroundImage?: string | IBackgroundImage; + targetWidth?: TargetWidth; /** - * Controls how the container's content should be vertically aligned. + * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. */ - verticalContentAlignment?: VerticalAlignment; + isSortKey?: boolean; /** - * Controls if the content of the card is to be rendered left-to-right or right-to-left. + * Must be **graph.microsoft.com/resource**. */ - rtl?: boolean; + readonly name: 'graph.microsoft.com/resource'; /** - * The maximum height, in pixels, of the container, in the `px` format. When the content of a container exceeds the container's maximum height, a vertical scrollbar is displayed. + * The properties of the resource. */ - maxHeight?: string; + properties?: IResourceProperties; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -16952,36 +15435,36 @@ export interface ICarouselPage { * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. */ fallback?: FallbackElement; - /** - * The elements in the page. - */ - items: CardElementArray; } /** * @hidden * @internal * - * Type guard to check if a value is of type ICarouselPage. + * Type guard to check if a value is of type IComResourceMicrosoftGraphComponent. * * @param value The value to check. - * @returns True if the value is an instance of CarouselPage, false otherwise. + * @returns True if the value is an instance of ComResourceMicrosoftGraphComponent, false otherwise. */ -export function isCarouselPage(value: unknown): value is ICarouselPage { - const obj = value as ICarouselPage; - return typeof obj === 'object' && obj.type === 'CarouselPage'; +export function isComResourceMicrosoftGraphComponent(value: unknown): value is IComResourceMicrosoftGraphComponent { + const obj = value as IComResourceMicrosoftGraphComponent; + return typeof obj === 'object' && obj.type === 'Component' && obj.name === 'graph.microsoft.com/resource'; } -export type CarouselPageOptions = Omit; +export type ComResourceMicrosoftGraphComponentOptions = Partial>; /** - * A page inside a Carousel element. + * Displays information about a generic graph resource. */ -export class CarouselPage implements ICarouselPage { +export class ComResourceMicrosoftGraphComponent implements IComResourceMicrosoftGraphComponent { /** - * Must be **CarouselPage**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type = 'CarouselPage'; + key?: string; + /** + * Must be **Component**. + */ + readonly type = 'Component'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -16989,7 +15472,7 @@ export class CarouselPage implements ICarouselPage { /** * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - requires?: IHostCapabilities; + requires?: IHostCapabilities = {}; /** * The locale associated with the element. */ @@ -16997,64 +15480,39 @@ export class CarouselPage implements ICarouselPage { /** * Controls the visibility of the element. */ - isVisible?: boolean; - /** - * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. - */ - height?: ElementHeight; - /** - * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). - */ - targetWidth?: TargetWidth; - /** - * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - */ - isSortKey?: boolean; - /** - * An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. - */ - selectAction?: - | IExecuteAction - | IOpenUrlAction - | IResetInputsAction - | ISubmitAction - | IToggleVisibilityAction; - /** - * The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. - */ - style?: ContainerStyle; + isVisible?: boolean = true; /** - * Controls if a border should be displayed around the container. + * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. */ - showBorder?: boolean; + separator?: boolean = false; /** - * Controls if the container should have rounded corners. + * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. */ - roundedCorners?: boolean; + height?: ElementHeight = 'auto'; /** - * The layouts associated with the container. The container can dynamically switch from one layout to another as the card's width changes. See [Container layouts](https://adaptivecards.microsoft.com/?topic=container-layouts) for more details. + * Controls how the element should be horizontally aligned. */ - layouts?: (IStackLayout | IFlowLayout | IAreaGridLayout)[]; + horizontalAlignment?: HorizontalAlignment; /** - * The minimum height, in pixels, of the container, in the `px` format. + * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ - minHeight?: string; + spacing?: Spacing = 'Default'; /** - * Defines the container's background image. + * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). */ - backgroundImage?: string | IBackgroundImage; + targetWidth?: TargetWidth; /** - * Controls how the container's content should be vertically aligned. + * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. */ - verticalContentAlignment?: VerticalAlignment; + isSortKey?: boolean = false; /** - * Controls if the content of the card is to be rendered left-to-right or right-to-left. + * Must be **graph.microsoft.com/resource**. */ - rtl?: boolean; + readonly name = 'graph.microsoft.com/resource'; /** - * The maximum height, in pixels, of the container, in the `px` format. When the content of a container exceeds the container's maximum height, a vertical scrollbar is displayed. + * The properties of the resource. */ - maxHeight?: string; + properties?: IResourceProperties; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -17063,17 +15521,17 @@ export class CarouselPage implements ICarouselPage { * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. */ fallback?: FallbackElement; - /** - * The elements in the page. - */ - items: CardElementArray; - constructor(...items: CardElementArray) { - this.items = items; + constructor(options: ComResourceMicrosoftGraphComponentOptions = {}) { + Object.assign(this, options); } - withOptions(value: CarouselPageOptions): this { - Object.assign(this, value); + static from(options: Omit): ComResourceMicrosoftGraphComponent { + return new ComResourceMicrosoftGraphComponent(options); + } + + withKey(key: string): this { + this.key = key; return this; } @@ -17097,11 +15555,26 @@ export class CarouselPage implements ICarouselPage { return this; } + withSeparator(separator = true): this { + this.separator = separator; + return this; + } + withHeight(height: ElementHeight): this { this.height = height; return this; } + withHorizontalAlignment(horizontalAlignment: HorizontalAlignment): this { + this.horizontalAlignment = horizontalAlignment; + return this; + } + + withSpacing(spacing: Spacing): this { + this.spacing = spacing; + return this; + } + withTargetWidth(targetWidth: TargetWidth): this { this.targetWidth = targetWidth; return this; @@ -17112,82 +15585,153 @@ export class CarouselPage implements ICarouselPage { return this; } - withSelectAction( - selectAction: - | IExecuteAction - | IOpenUrlAction - | IResetInputsAction - | ISubmitAction - | IToggleVisibilityAction - ): this { - this.selectAction = selectAction; + withProperties(properties: IResourceProperties): this { + this.properties = properties; return this; } - withStyle(style: ContainerStyle): this { - this.style = style; + withFallback(fallback: FallbackElement): this { + this.fallback = fallback; return this; } +} - withShowBorder(showBorder = true): this { - this.showBorder = showBorder; - return this; +/** + * Represents the properties of a resource component. + */ +export interface IResourceProperties { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * The Id of the resource. + */ + id?: string; + /** + * The reference to the resource. + */ + resourceReference?: Record; + /** + * The visualization of the resource. + */ + resourceVisualization?: IResourceVisualization; +} + + +export type ResourcePropertiesOptions = Partial; + +/** + * Represents the properties of a resource component. + */ +export class ResourceProperties implements IResourceProperties { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * The Id of the resource. + */ + id?: string; + /** + * The reference to the resource. + */ + resourceReference?: Record; + /** + * The visualization of the resource. + */ + resourceVisualization?: IResourceVisualization; + + constructor(options: ResourcePropertiesOptions = {}) { + Object.assign(this, options); } - withRoundedCorners(roundedCorners = true): this { - this.roundedCorners = roundedCorners; - return this; + static from(options: IResourceProperties): ResourceProperties { + return new ResourceProperties(options); } - withLayouts(...layouts: (IStackLayout | IFlowLayout | IAreaGridLayout)[]): this { - this.layouts = layouts; + withKey(key: string): this { + this.key = key; return this; } - withMinHeight(minHeight: string): this { - this.minHeight = minHeight; + withId(id: string): this { + this.id = id; return this; } - withBackgroundImage(backgroundImage: string | IBackgroundImage): this { - this.backgroundImage = backgroundImage; + withResourceReference(resourceReference: Record): this { + this.resourceReference = resourceReference; return this; } - withVerticalContentAlignment(verticalContentAlignment: VerticalAlignment): this { - this.verticalContentAlignment = verticalContentAlignment; + withResourceVisualization(resourceVisualization: IResourceVisualization): this { + this.resourceVisualization = resourceVisualization; return this; } +} - withRtl(rtl: boolean): this { - this.rtl = rtl; - return this; +/** + * Represents a visualization of a resource. + */ +export interface IResourceVisualization { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * The media associated with the resource. + */ + media?: string; +} + + +export type ResourceVisualizationOptions = Partial; + +/** + * Represents a visualization of a resource. + */ +export class ResourceVisualization implements IResourceVisualization { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * The media associated with the resource. + */ + media?: string; + + constructor(options: ResourceVisualizationOptions = {}) { + Object.assign(this, options); } - withMaxHeight(maxHeight: string): this { - this.maxHeight = maxHeight; - return this; + static from(options: IResourceVisualization): ResourceVisualization { + return new ResourceVisualization(options); } - withFallback(fallback: FallbackElement): this { - this.fallback = fallback; + withKey(key: string): this { + this.key = key; return this; } - withItems(...items: CardElementArray): this { - this.items = items; + withMedia(media: string): this { + this.media = media; return this; } } /** - * Represents a row of cells in a table. + * Displays information about a file resource. */ -export interface ITableRow { +export interface IComFileMicrosoftGraphComponent { /** - * Must be **TableRow**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type: 'TableRow'; + key?: string; + /** + * Must be **Component**. + */ + readonly type: 'Component'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -17229,25 +15773,13 @@ export interface ITableRow { */ isSortKey?: boolean; /** - * Controls if a border should be displayed around the container. - */ - showBorder?: boolean; - /** - * Controls if the container should have rounded corners. - */ - roundedCorners?: boolean; - /** - * The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. - */ - style?: ContainerStyle; - /** - * Controls how the content of every cell in the row should be horizontally aligned by default. This property overrides the horizontalCellContentAlignment property of the table and columns. + * Must be **graph.microsoft.com/file**. */ - horizontalCellContentAlignment?: HorizontalAlignment; + readonly name: 'graph.microsoft.com/file'; /** - * Controls how the content of every cell in the row should be vertically aligned by default. This property overrides the verticalCellContentAlignment property of the table and columns. + * The properties of the file. */ - verticalCellContentAlignment?: VerticalAlignment; + properties?: IFileProperties; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -17256,36 +15788,36 @@ export interface ITableRow { * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. */ fallback?: FallbackElement; - /** - * The cells in the row. - */ - cells?: TableCellArray; } /** * @hidden * @internal * - * Type guard to check if a value is of type ITableRow. + * Type guard to check if a value is of type IComFileMicrosoftGraphComponent. * * @param value The value to check. - * @returns True if the value is an instance of TableRow, false otherwise. + * @returns True if the value is an instance of ComFileMicrosoftGraphComponent, false otherwise. */ -export function isTableRow(value: unknown): value is ITableRow { - const obj = value as ITableRow; - return typeof obj === 'object' && obj.type === 'TableRow'; +export function isComFileMicrosoftGraphComponent(value: unknown): value is IComFileMicrosoftGraphComponent { + const obj = value as IComFileMicrosoftGraphComponent; + return typeof obj === 'object' && obj.type === 'Component' && obj.name === 'graph.microsoft.com/file'; } -export type TableRowOptions = Omit; +export type ComFileMicrosoftGraphComponentOptions = Partial>; /** - * Represents a row of cells in a table. + * Displays information about a file resource. */ -export class TableRow implements ITableRow { +export class ComFileMicrosoftGraphComponent implements IComFileMicrosoftGraphComponent { /** - * Must be **TableRow**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type = 'TableRow'; + key?: string; + /** + * Must be **Component**. + */ + readonly type = 'Component'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -17293,7 +15825,7 @@ export class TableRow implements ITableRow { /** * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - requires?: IHostCapabilities; + requires?: IHostCapabilities = {}; /** * The locale associated with the element. */ @@ -17301,15 +15833,15 @@ export class TableRow implements ITableRow { /** * Controls the visibility of the element. */ - isVisible?: boolean; + isVisible?: boolean = true; /** * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. */ - separator?: boolean; + separator?: boolean = false; /** * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. */ - height?: ElementHeight; + height?: ElementHeight = 'auto'; /** * Controls how the element should be horizontally aligned. */ @@ -17317,7 +15849,7 @@ export class TableRow implements ITableRow { /** * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ - spacing?: Spacing; + spacing?: Spacing = 'Default'; /** * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). */ @@ -17325,27 +15857,15 @@ export class TableRow implements ITableRow { /** * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. */ - isSortKey?: boolean; - /** - * Controls if a border should be displayed around the container. - */ - showBorder?: boolean; - /** - * Controls if the container should have rounded corners. - */ - roundedCorners?: boolean; - /** - * The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. - */ - style?: ContainerStyle; + isSortKey?: boolean = false; /** - * Controls how the content of every cell in the row should be horizontally aligned by default. This property overrides the horizontalCellContentAlignment property of the table and columns. + * Must be **graph.microsoft.com/file**. */ - horizontalCellContentAlignment?: HorizontalAlignment; + readonly name = 'graph.microsoft.com/file'; /** - * Controls how the content of every cell in the row should be vertically aligned by default. This property overrides the verticalCellContentAlignment property of the table and columns. + * The properties of the file. */ - verticalCellContentAlignment?: VerticalAlignment; + properties?: IFileProperties; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -17354,17 +15874,18 @@ export class TableRow implements ITableRow { * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. */ fallback?: FallbackElement; - /** - * The cells in the row. - */ - cells?: TableCellArray; - constructor(options: TableRowOptions = {}) { + constructor(options: ComFileMicrosoftGraphComponentOptions = {}) { Object.assign(this, options); } - static from(options: Omit): TableRow { - return new TableRow(options); + static from(options: Omit): ComFileMicrosoftGraphComponent { + return new ComFileMicrosoftGraphComponent(options); + } + + withKey(key: string): this { + this.key = key; + return this; } withId(id: string): this { @@ -17417,50 +15938,104 @@ export class TableRow implements ITableRow { return this; } - withShowBorder(showBorder = true): this { - this.showBorder = showBorder; + withProperties(properties: IFileProperties): this { + this.properties = properties; return this; } - withRoundedCorners(roundedCorners = true): this { - this.roundedCorners = roundedCorners; + withFallback(fallback: FallbackElement): this { + this.fallback = fallback; return this; } +} - withStyle(style: ContainerStyle): this { - this.style = style; - return this; +/** + * Represents the properties of a file component. + */ +export interface IFileProperties { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * The name of the file. + */ + name?: string; + /** + * The file extension. + */ + extension?: string; + /** + * The URL of the file. + */ + url?: string; +} + + +export type FilePropertiesOptions = Partial; + +/** + * Represents the properties of a file component. + */ +export class FileProperties implements IFileProperties { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * The name of the file. + */ + name?: string; + /** + * The file extension. + */ + extension?: string; + /** + * The URL of the file. + */ + url?: string; + + constructor(options: FilePropertiesOptions = {}) { + Object.assign(this, options); } - withHorizontalCellContentAlignment(horizontalCellContentAlignment: HorizontalAlignment): this { - this.horizontalCellContentAlignment = horizontalCellContentAlignment; + static from(options: IFileProperties): FileProperties { + return new FileProperties(options); + } + + withKey(key: string): this { + this.key = key; return this; } - withVerticalCellContentAlignment(verticalCellContentAlignment: VerticalAlignment): this { - this.verticalCellContentAlignment = verticalCellContentAlignment; + withName(name: string): this { + this.name = name; return this; } - withFallback(fallback: FallbackElement): this { - this.fallback = fallback; + withExtension(extension: string): this { + this.extension = extension; return this; } - withCells(...cells: TableCellArray): this { - this.cells = cells; + withUrl(url: string): this { + this.url = url; return this; } } /** - * Represents a cell in a table row. + * Displays information about a calendar event. */ -export interface ITableCell { +export interface IComEventMicrosoftGraphComponent { /** - * Must be **TableCell**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type: 'TableCell'; + key?: string; + /** + * Must be **Component**. + */ + readonly type: 'Component'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -17485,6 +16060,10 @@ export interface ITableCell { * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. */ height?: ElementHeight; + /** + * Controls how the element should be horizontally aligned. + */ + horizontalAlignment?: HorizontalAlignment; /** * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ @@ -17498,46 +16077,13 @@ export interface ITableCell { */ isSortKey?: boolean; /** - * An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. - */ - selectAction?: - | IExecuteAction - | IOpenUrlAction - | IResetInputsAction - | ISubmitAction - | IToggleVisibilityAction; - /** - * The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. - */ - style?: ContainerStyle; - /** - * The layouts associated with the container. The container can dynamically switch from one layout to another as the card's width changes. See [Container layouts](https://adaptivecards.microsoft.com/?topic=container-layouts) for more details. - */ - layouts?: (IStackLayout | IFlowLayout | IAreaGridLayout)[]; - /** - * Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. - */ - bleed?: boolean; - /** - * The minimum height, in pixels, of the container, in the `px` format. - */ - minHeight?: string; - /** - * Defines the container's background image. - */ - backgroundImage?: string | IBackgroundImage; - /** - * Controls how the container's content should be vertically aligned. - */ - verticalContentAlignment?: VerticalAlignment; - /** - * Controls if the content of the card is to be rendered left-to-right or right-to-left. + * Must be **graph.microsoft.com/event**. */ - rtl?: boolean; + readonly name: 'graph.microsoft.com/event'; /** - * The maximum height, in pixels, of the container, in the `px` format. When the content of a container exceeds the container's maximum height, a vertical scrollbar is displayed. + * The properties of the event. */ - maxHeight?: string; + properties?: ICalendarEventProperties; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -17546,36 +16092,36 @@ export interface ITableCell { * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. */ fallback?: FallbackElement; - /** - * The items (elements) in the cell. - */ - items: CardElementArray; } /** * @hidden * @internal * - * Type guard to check if a value is of type ITableCell. + * Type guard to check if a value is of type IComEventMicrosoftGraphComponent. * * @param value The value to check. - * @returns True if the value is an instance of TableCell, false otherwise. + * @returns True if the value is an instance of ComEventMicrosoftGraphComponent, false otherwise. */ -export function isTableCell(value: unknown): value is ITableCell { - const obj = value as ITableCell; - return typeof obj === 'object' && obj.type === 'TableCell'; +export function isComEventMicrosoftGraphComponent(value: unknown): value is IComEventMicrosoftGraphComponent { + const obj = value as IComEventMicrosoftGraphComponent; + return typeof obj === 'object' && obj.type === 'Component' && obj.name === 'graph.microsoft.com/event'; } -export type TableCellOptions = Omit; +export type ComEventMicrosoftGraphComponentOptions = Partial>; /** - * Represents a cell in a table row. + * Displays information about a calendar event. */ -export class TableCell implements ITableCell { +export class ComEventMicrosoftGraphComponent implements IComEventMicrosoftGraphComponent { /** - * Must be **TableCell**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type = 'TableCell'; + key?: string; + /** + * Must be **Component**. + */ + readonly type = 'Component'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -17583,7 +16129,7 @@ export class TableCell implements ITableCell { /** * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - requires?: IHostCapabilities; + requires?: IHostCapabilities = {}; /** * The locale associated with the element. */ @@ -17591,19 +16137,23 @@ export class TableCell implements ITableCell { /** * Controls the visibility of the element. */ - isVisible?: boolean; + isVisible?: boolean = true; /** * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. */ - separator?: boolean; + separator?: boolean = false; /** * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. */ - height?: ElementHeight; + height?: ElementHeight = 'auto'; + /** + * Controls how the element should be horizontally aligned. + */ + horizontalAlignment?: HorizontalAlignment; /** * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. */ - spacing?: Spacing; + spacing?: Spacing = 'Default'; /** * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). */ @@ -17611,48 +16161,15 @@ export class TableCell implements ITableCell { /** * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. */ - isSortKey?: boolean; - /** - * An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. - */ - selectAction?: - | IExecuteAction - | IOpenUrlAction - | IResetInputsAction - | ISubmitAction - | IToggleVisibilityAction; - /** - * The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. - */ - style?: ContainerStyle; - /** - * The layouts associated with the container. The container can dynamically switch from one layout to another as the card's width changes. See [Container layouts](https://adaptivecards.microsoft.com/?topic=container-layouts) for more details. - */ - layouts?: (IStackLayout | IFlowLayout | IAreaGridLayout)[]; - /** - * Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. - */ - bleed?: boolean; - /** - * The minimum height, in pixels, of the container, in the `px` format. - */ - minHeight?: string; - /** - * Defines the container's background image. - */ - backgroundImage?: string | IBackgroundImage; - /** - * Controls how the container's content should be vertically aligned. - */ - verticalContentAlignment?: VerticalAlignment; + isSortKey?: boolean = false; /** - * Controls if the content of the card is to be rendered left-to-right or right-to-left. + * Must be **graph.microsoft.com/event**. */ - rtl?: boolean; + readonly name = 'graph.microsoft.com/event'; /** - * The maximum height, in pixels, of the container, in the `px` format. When the content of a container exceeds the container's maximum height, a vertical scrollbar is displayed. + * The properties of the event. */ - maxHeight?: string; + properties?: ICalendarEventProperties; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -17661,17 +16178,17 @@ export class TableCell implements ITableCell { * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. */ fallback?: FallbackElement; - /** - * The items (elements) in the cell. - */ - items: CardElementArray; - constructor(...items: CardElementArray) { - this.items = items; + constructor(options: ComEventMicrosoftGraphComponentOptions = {}) { + Object.assign(this, options); } - withOptions(value: TableCellOptions): this { - Object.assign(this, value); + static from(options: Omit): ComEventMicrosoftGraphComponent { + return new ComEventMicrosoftGraphComponent(options); + } + + withKey(key: string): this { + this.key = key; return this; } @@ -17705,6 +16222,11 @@ export class TableCell implements ITableCell { return this; } + withHorizontalAlignment(horizontalAlignment: HorizontalAlignment): this { + this.horizontalAlignment = horizontalAlignment; + return this; + } + withSpacing(spacing: Spacing): this { this.spacing = spacing; return this; @@ -17720,355 +16242,322 @@ export class TableCell implements ITableCell { return this; } - withSelectAction( - selectAction: - | IExecuteAction - | IOpenUrlAction - | IResetInputsAction - | ISubmitAction - | IToggleVisibilityAction - ): this { - this.selectAction = selectAction; + withProperties(properties: ICalendarEventProperties): this { + this.properties = properties; return this; } - withStyle(style: ContainerStyle): this { - this.style = style; + withFallback(fallback: FallbackElement): this { + this.fallback = fallback; return this; } - - withLayouts(...layouts: (IStackLayout | IFlowLayout | IAreaGridLayout)[]): this { - this.layouts = layouts; - return this; - } - - withBleed(bleed = true): this { - this.bleed = bleed; - return this; - } - - withMinHeight(minHeight: string): this { - this.minHeight = minHeight; - return this; - } - - withBackgroundImage(backgroundImage: string | IBackgroundImage): this { - this.backgroundImage = backgroundImage; - return this; - } - - withVerticalContentAlignment(verticalContentAlignment: VerticalAlignment): this { - this.verticalContentAlignment = verticalContentAlignment; - return this; - } - - withRtl(rtl: boolean): this { - this.rtl = rtl; - return this; - } - - withMaxHeight(maxHeight: string): this { - this.maxHeight = maxHeight; - return this; - } - - withFallback(fallback: FallbackElement): this { - this.fallback = fallback; - return this; - } - - withItems(...items: CardElementArray): this { - this.items = items; - return this; - } -} +} /** - * A block of text inside a RichTextBlock element. + * The properties of a calendar event. */ -export interface ITextRun { +export interface ICalendarEventProperties { /** - * Must be **TextRun**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type: 'TextRun'; + key?: string; /** - * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + * The ID of the event. */ id?: string; /** - * The locale associated with the element. - */ - lang?: string; - /** - * Controls the visibility of the element. - */ - isVisible?: boolean; - /** - * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - */ - isSortKey?: boolean; - /** - * The text to display. A subset of markdown is supported. - */ - text: string; - /** - * The size of the text. - */ - size?: TextSize; - /** - * The weight of the text. + * The title of the event. */ - weight?: TextWeight; + title?: string; /** - * The color of the text. + * The start date and time of the event. */ - color?: TextColor; + start?: string; /** - * Controls whether the text should be renderer using a subtler variant of the select color. + * The end date and time of the event. */ - isSubtle?: boolean; + end?: string; /** - * The type of font to use for rendering. + * The status of the event. */ - fontType?: FontType; + status?: string; /** - * Controls if the text should be italicized. + * The locations of the event. */ - italic?: boolean; + locations?: string[]; /** - * Controls if the text should be struck through. + * The URL of the online meeting. */ - strikethrough?: boolean; + onlineMeetingUrl?: string; /** - * Controls if the text should be highlighted. + * Indicates if the event is all day. */ - highlight?: boolean; + isAllDay?: boolean; /** - * Controls if the text should be underlined. + * The extension of the event. */ - underline?: boolean; + extension?: string; /** - * An Action that will be invoked when the text is tapped or clicked. Action.ShowCard is not supported. + * The URL of the event. */ - selectAction?: - | IExecuteAction - | IOpenUrlAction - | IResetInputsAction - | ISubmitAction - | IToggleVisibilityAction; + url?: string; /** - * The area of a Layout.AreaGrid layout in which an element should be displayed. + * The attendees of the event. */ - 'grid.area'?: string; + attendees?: ICalendarEventAttendee[]; /** - * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + * The organizer of the event. */ - fallback?: FallbackElement; + organizer?: ICalendarEventAttendee; } -/** - * @hidden - * @internal - * - * Type guard to check if a value is of type ITextRun. - * - * @param value The value to check. - * @returns True if the value is an instance of TextRun, false otherwise. - */ -export function isTextRun(value: unknown): value is ITextRun { - const obj = value as ITextRun; - return typeof obj === 'object' && obj.type === 'TextRun'; -} -export type TextRunOptions = Omit; +export type CalendarEventPropertiesOptions = Partial; /** - * A block of text inside a RichTextBlock element. + * The properties of a calendar event. */ -export class TextRun implements ITextRun { +export class CalendarEventProperties implements ICalendarEventProperties { /** - * Must be **TextRun**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type = 'TextRun'; + key?: string; /** - * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + * The ID of the event. */ id?: string; /** - * The locale associated with the element. - */ - lang?: string; - /** - * Controls the visibility of the element. - */ - isVisible?: boolean; - /** - * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. - */ - isSortKey?: boolean; - /** - * The text to display. A subset of markdown is supported. - */ - text: string; - /** - * The size of the text. - */ - size?: TextSize; - /** - * The weight of the text. + * The title of the event. */ - weight?: TextWeight; + title?: string; /** - * The color of the text. + * The start date and time of the event. */ - color?: TextColor; + start?: string; /** - * Controls whether the text should be renderer using a subtler variant of the select color. + * The end date and time of the event. */ - isSubtle?: boolean; + end?: string; /** - * The type of font to use for rendering. + * The status of the event. */ - fontType?: FontType; + status?: string; /** - * Controls if the text should be italicized. + * The locations of the event. */ - italic?: boolean; + locations?: string[]; /** - * Controls if the text should be struck through. + * The URL of the online meeting. */ - strikethrough?: boolean; + onlineMeetingUrl?: string; /** - * Controls if the text should be highlighted. + * Indicates if the event is all day. */ - highlight?: boolean; + isAllDay?: boolean; /** - * Controls if the text should be underlined. + * The extension of the event. */ - underline?: boolean; + extension?: string; /** - * An Action that will be invoked when the text is tapped or clicked. Action.ShowCard is not supported. + * The URL of the event. */ - selectAction?: - | IExecuteAction - | IOpenUrlAction - | IResetInputsAction - | ISubmitAction - | IToggleVisibilityAction; + url?: string; /** - * The area of a Layout.AreaGrid layout in which an element should be displayed. + * The attendees of the event. */ - 'grid.area'?: string; + attendees?: ICalendarEventAttendee[]; /** - * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + * The organizer of the event. */ - fallback?: FallbackElement; + organizer?: ICalendarEventAttendee; - constructor(text: string, options: TextRunOptions = {}) { + constructor(options: CalendarEventPropertiesOptions = {}) { Object.assign(this, options); - this.text = text; } - static from(options: Omit): TextRun { - return new TextRun(options.text, options); + static from(options: ICalendarEventProperties): CalendarEventProperties { + return new CalendarEventProperties(options); } - withId(id: string): this { - this.id = id; + withKey(key: string): this { + this.key = key; return this; } - withLang(lang: string): this { - this.lang = lang; + withId(id: string): this { + this.id = id; return this; } - withIsVisible(isVisible = false): this { - this.isVisible = isVisible; + withTitle(title: string): this { + this.title = title; return this; } - withIsSortKey(isSortKey = true): this { - this.isSortKey = isSortKey; + withStart(start: string): this { + this.start = start; return this; } - withText(text: string): this { - this.text = text; + withEnd(end: string): this { + this.end = end; return this; } - withSize(size: TextSize): this { - this.size = size; + withStatus(status: string): this { + this.status = status; return this; } - withWeight(weight: TextWeight): this { - this.weight = weight; + withLocations(...locations: string[]): this { + this.locations = locations; return this; } - withColor(color: TextColor): this { - this.color = color; + withOnlineMeetingUrl(onlineMeetingUrl: string): this { + this.onlineMeetingUrl = onlineMeetingUrl; return this; } - withIsSubtle(isSubtle: boolean): this { - this.isSubtle = isSubtle; + withIsAllDay(isAllDay: boolean): this { + this.isAllDay = isAllDay; return this; } - withFontType(fontType: FontType): this { - this.fontType = fontType; + withExtension(extension: string): this { + this.extension = extension; return this; } - withItalic(italic = true): this { - this.italic = italic; + withUrl(url: string): this { + this.url = url; return this; } - withStrikethrough(strikethrough = true): this { - this.strikethrough = strikethrough; + withAttendees(...attendees: ICalendarEventAttendee[]): this { + this.attendees = attendees; return this; } - withHighlight(highlight = true): this { - this.highlight = highlight; + withOrganizer(organizer: ICalendarEventAttendee): this { + this.organizer = organizer; return this; } +} - withUnderline(underline = true): this { - this.underline = underline; +/** + * Represents a calendar event attendee. + */ +export interface ICalendarEventAttendee { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * The name of the attendee. + */ + name?: string; + /** + * The email address of the attendee. + */ + email?: string; + /** + * The title of the attendee. + */ + title?: string; + /** + * The type of the attendee. + */ + type?: string; + /** + * The status of the attendee. + */ + status?: string; +} + + +export type CalendarEventAttendeeOptions = Partial; + +/** + * Represents a calendar event attendee. + */ +export class CalendarEventAttendee implements ICalendarEventAttendee { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * The name of the attendee. + */ + name?: string; + /** + * The email address of the attendee. + */ + email?: string; + /** + * The title of the attendee. + */ + title?: string; + /** + * The type of the attendee. + */ + type?: string; + /** + * The status of the attendee. + */ + status?: string; + + constructor(options: CalendarEventAttendeeOptions = {}) { + Object.assign(this, options); + } + + static from(options: ICalendarEventAttendee): CalendarEventAttendee { + return new CalendarEventAttendee(options); + } + + withKey(key: string): this { + this.key = key; return this; } - withSelectAction( - selectAction: - | IExecuteAction - | IOpenUrlAction - | IResetInputsAction - | ISubmitAction - | IToggleVisibilityAction - ): this { - this.selectAction = selectAction; + withName(name: string): this { + this.name = name; return this; } - withFallback(fallback: FallbackElement): this { - this.fallback = fallback; + withEmail(email: string): this { + this.email = email; + return this; + } + + withTitle(title: string): this { + this.title = title; + return this; + } + + withType(type: string): this { + this.type = type; + return this; + } + + withStatus(status: string): this { + this.status = status; return this; } } /** - * A column in a ColumnSet element. + * A page inside a Carousel element. */ -export interface IColumn { +export interface ICarouselPage { /** - * Optional. If specified, must be **Column**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type: 'Column'; + key?: string; + /** + * Must be **CarouselPage**. + */ + readonly type: 'CarouselPage'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -18085,22 +16574,10 @@ export interface IColumn { * Controls the visibility of the element. */ isVisible?: boolean; - /** - * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. - */ - separator?: boolean; /** * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. */ height?: ElementHeight; - /** - * Controls how the element should be horizontally aligned. - */ - horizontalAlignment?: HorizontalAlignment; - /** - * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. - */ - spacing?: Spacing; /** * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). */ @@ -18112,12 +16589,7 @@ export interface IColumn { /** * An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. */ - selectAction?: - | IExecuteAction - | IOpenUrlAction - | IResetInputsAction - | ISubmitAction - | IToggleVisibilityAction; + selectAction?: IExecuteAction | IInsertImageAction | IOpenUrlAction | IOpenUrlDialogAction | IPopoverAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction; /** * The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. */ @@ -18134,10 +16606,6 @@ export interface IColumn { * The layouts associated with the container. The container can dynamically switch from one layout to another as the card's width changes. See [Container layouts](https://adaptivecards.microsoft.com/?topic=container-layouts) for more details. */ layouts?: (IStackLayout | IFlowLayout | IAreaGridLayout)[]; - /** - * Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. - */ - bleed?: boolean; /** * The minimum height, in pixels, of the container, in the `px` format. */ @@ -18158,10 +16626,6 @@ export interface IColumn { * The maximum height, in pixels, of the container, in the `px` format. When the content of a container exceeds the container's maximum height, a vertical scrollbar is displayed. */ maxHeight?: string; - /** - * The width of the column. If expressed as a number, represents the relative weight of the column in the set. If expressed as a string, `auto` will automatically adjust the column's width according to its content, `stretch` will make the column use the remaining horizontal space (shared with other columns with width set to `stretch`) and using the `px` format will give the column an explicit width in pixels. - */ - width?: 'auto' | 'stretch' | string | number; /** * The area of a Layout.AreaGrid layout in which an element should be displayed. */ @@ -18171,7 +16635,7 @@ export interface IColumn { */ fallback?: FallbackElement; /** - * The elements in the column. + * The elements in the page. */ items: CardElementArray; } @@ -18180,26 +16644,30 @@ export interface IColumn { * @hidden * @internal * - * Type guard to check if a value is of type IColumn. + * Type guard to check if a value is of type ICarouselPage. * * @param value The value to check. - * @returns True if the value is an instance of Column, false otherwise. + * @returns True if the value is an instance of CarouselPage, false otherwise. */ -export function isColumn(value: unknown): value is IColumn { - const obj = value as IColumn; - return typeof obj === 'object' && obj.type === 'Column'; +export function isCarouselPage(value: unknown): value is ICarouselPage { + const obj = value as ICarouselPage; + return typeof obj === 'object' && obj.type === 'CarouselPage'; } -export type ColumnOptions = Omit; +export type CarouselPageOptions = Partial>; /** - * A column in a ColumnSet element. + * A page inside a Carousel element. */ -export class Column implements IColumn { +export class CarouselPage implements ICarouselPage { /** - * Optional. If specified, must be **Column**. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - readonly type = 'Column'; + key?: string; + /** + * Must be **CarouselPage**. + */ + readonly type = 'CarouselPage'; /** * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. */ @@ -18207,7 +16675,7 @@ export class Column implements IColumn { /** * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). */ - requires?: IHostCapabilities; + requires?: IHostCapabilities = {}; /** * The locale associated with the element. */ @@ -18215,103 +16683,2986 @@ export class Column implements IColumn { /** * Controls the visibility of the element. */ - isVisible?: boolean; + isVisible?: boolean = true; /** - * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. */ - separator?: boolean; + height?: ElementHeight = 'auto'; /** - * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). */ - height?: ElementHeight; + targetWidth?: TargetWidth; /** - * Controls how the element should be horizontally aligned. + * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. */ - horizontalAlignment?: HorizontalAlignment; + isSortKey?: boolean = false; /** - * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + * An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. */ - spacing?: Spacing; + selectAction?: IExecuteAction | IInsertImageAction | IOpenUrlAction | IOpenUrlDialogAction | IPopoverAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction; /** - * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + * The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. */ - targetWidth?: TargetWidth; + style?: ContainerStyle; /** - * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + * Controls if a border should be displayed around the container. */ - isSortKey?: boolean; + showBorder?: boolean = false; + /** + * Controls if the container should have rounded corners. + */ + roundedCorners?: boolean = false; + /** + * The layouts associated with the container. The container can dynamically switch from one layout to another as the card's width changes. See [Container layouts](https://adaptivecards.microsoft.com/?topic=container-layouts) for more details. + */ + layouts?: (IStackLayout | IFlowLayout | IAreaGridLayout)[]; + /** + * The minimum height, in pixels, of the container, in the `px` format. + */ + minHeight?: string; + /** + * Defines the container's background image. + */ + backgroundImage?: string | IBackgroundImage; + /** + * Controls how the container's content should be vertically aligned. + */ + verticalContentAlignment?: VerticalAlignment; + /** + * Controls if the content of the card is to be rendered left-to-right or right-to-left. + */ + rtl?: boolean; + /** + * The maximum height, in pixels, of the container, in the `px` format. When the content of a container exceeds the container's maximum height, a vertical scrollbar is displayed. + */ + maxHeight?: string; + /** + * The area of a Layout.AreaGrid layout in which an element should be displayed. + */ + 'grid.area'?: string; + /** + * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + */ + fallback?: FallbackElement; + /** + * The elements in the page. + */ + items: CardElementArray; + + constructor(...items: CardElementArray) { + this.items = items; + } + + withOptions(value: CarouselPageOptions): this { + Object.assign(this, value); + return this; + } + + withKey(key: string): this { + this.key = key; + return this; + } + + withId(id: string): this { + this.id = id; + return this; + } + + withRequires(requires: IHostCapabilities): this { + this.requires = requires; + return this; + } + + withLang(lang: string): this { + this.lang = lang; + return this; + } + + withIsVisible(isVisible = false): this { + this.isVisible = isVisible; + return this; + } + + withHeight(height: ElementHeight): this { + this.height = height; + return this; + } + + withTargetWidth(targetWidth: TargetWidth): this { + this.targetWidth = targetWidth; + return this; + } + + withIsSortKey(isSortKey = true): this { + this.isSortKey = isSortKey; + return this; + } + + withSelectAction(selectAction: IExecuteAction | IInsertImageAction | IOpenUrlAction | IOpenUrlDialogAction | IPopoverAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction): this { + this.selectAction = selectAction; + return this; + } + + withStyle(style: ContainerStyle): this { + this.style = style; + return this; + } + + withShowBorder(showBorder = true): this { + this.showBorder = showBorder; + return this; + } + + withRoundedCorners(roundedCorners = true): this { + this.roundedCorners = roundedCorners; + return this; + } + + withLayouts(...layouts: (IStackLayout | IFlowLayout | IAreaGridLayout)[]): this { + this.layouts = layouts; + return this; + } + + withMinHeight(minHeight: string): this { + this.minHeight = minHeight; + return this; + } + + withBackgroundImage(backgroundImage: string | IBackgroundImage): this { + this.backgroundImage = backgroundImage; + return this; + } + + withVerticalContentAlignment(verticalContentAlignment: VerticalAlignment): this { + this.verticalContentAlignment = verticalContentAlignment; + return this; + } + + withRtl(rtl: boolean): this { + this.rtl = rtl; + return this; + } + + withMaxHeight(maxHeight: string): this { + this.maxHeight = maxHeight; + return this; + } + + withFallback(fallback: FallbackElement): this { + this.fallback = fallback; + return this; + } + + withItems(...items: CardElementArray): this { + this.items = items; + return this; + } +} + +/** + * Represents a row of cells in a table. + */ +export interface ITableRow { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * Must be **TableRow**. + */ + readonly type: 'TableRow'; + /** + * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + */ + id?: string; + /** + * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + */ + requires?: IHostCapabilities; + /** + * The locale associated with the element. + */ + lang?: string; + /** + * Controls the visibility of the element. + */ + isVisible?: boolean; + /** + * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + */ + separator?: boolean; + /** + * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + */ + height?: ElementHeight; + /** + * Controls how the element should be horizontally aligned. + */ + horizontalAlignment?: HorizontalAlignment; + /** + * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + */ + spacing?: Spacing; + /** + * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + */ + targetWidth?: TargetWidth; + /** + * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + */ + isSortKey?: boolean; + /** + * Controls if a border should be displayed around the container. + */ + showBorder?: boolean; + /** + * Controls if the container should have rounded corners. + */ + roundedCorners?: boolean; + /** + * The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. + */ + style?: ContainerStyle; + /** + * Controls how the content of every cell in the row should be horizontally aligned by default. This property overrides the horizontalCellContentAlignment property of the table and columns. + */ + horizontalCellContentAlignment?: HorizontalAlignment; + /** + * Controls how the content of every cell in the row should be vertically aligned by default. This property overrides the verticalCellContentAlignment property of the table and columns. + */ + verticalCellContentAlignment?: VerticalAlignment; + /** + * The area of a Layout.AreaGrid layout in which an element should be displayed. + */ + 'grid.area'?: string; + /** + * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + */ + fallback?: FallbackElement; + /** + * The cells in the row. + */ + cells?: TableCellArray; +} + +/** + * @hidden + * @internal + * + * Type guard to check if a value is of type ITableRow. + * + * @param value The value to check. + * @returns True if the value is an instance of TableRow, false otherwise. + */ +export function isTableRow(value: unknown): value is ITableRow { + const obj = value as ITableRow; + return typeof obj === 'object' && obj.type === 'TableRow'; +} + +export type TableRowOptions = Partial>; + +/** + * Represents a row of cells in a table. + */ +export class TableRow implements ITableRow { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * Must be **TableRow**. + */ + readonly type = 'TableRow'; + /** + * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + */ + id?: string; + /** + * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + */ + requires?: IHostCapabilities = {}; + /** + * The locale associated with the element. + */ + lang?: string; + /** + * Controls the visibility of the element. + */ + isVisible?: boolean = true; + /** + * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + */ + separator?: boolean = false; + /** + * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + */ + height?: ElementHeight = 'auto'; + /** + * Controls how the element should be horizontally aligned. + */ + horizontalAlignment?: HorizontalAlignment; + /** + * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + */ + spacing?: Spacing = 'Default'; + /** + * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + */ + targetWidth?: TargetWidth; + /** + * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + */ + isSortKey?: boolean = false; + /** + * Controls if a border should be displayed around the container. + */ + showBorder?: boolean = false; + /** + * Controls if the container should have rounded corners. + */ + roundedCorners?: boolean = false; + /** + * The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. + */ + style?: ContainerStyle; + /** + * Controls how the content of every cell in the row should be horizontally aligned by default. This property overrides the horizontalCellContentAlignment property of the table and columns. + */ + horizontalCellContentAlignment?: HorizontalAlignment; + /** + * Controls how the content of every cell in the row should be vertically aligned by default. This property overrides the verticalCellContentAlignment property of the table and columns. + */ + verticalCellContentAlignment?: VerticalAlignment; + /** + * The area of a Layout.AreaGrid layout in which an element should be displayed. + */ + 'grid.area'?: string; + /** + * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + */ + fallback?: FallbackElement; + /** + * The cells in the row. + */ + cells?: TableCellArray; + + constructor(options: TableRowOptions = {}) { + Object.assign(this, options); + } + + static from(options: Omit): TableRow { + return new TableRow(options); + } + + withKey(key: string): this { + this.key = key; + return this; + } + + withId(id: string): this { + this.id = id; + return this; + } + + withRequires(requires: IHostCapabilities): this { + this.requires = requires; + return this; + } + + withLang(lang: string): this { + this.lang = lang; + return this; + } + + withIsVisible(isVisible = false): this { + this.isVisible = isVisible; + return this; + } + + withSeparator(separator = true): this { + this.separator = separator; + return this; + } + + withHeight(height: ElementHeight): this { + this.height = height; + return this; + } + + withHorizontalAlignment(horizontalAlignment: HorizontalAlignment): this { + this.horizontalAlignment = horizontalAlignment; + return this; + } + + withSpacing(spacing: Spacing): this { + this.spacing = spacing; + return this; + } + + withTargetWidth(targetWidth: TargetWidth): this { + this.targetWidth = targetWidth; + return this; + } + + withIsSortKey(isSortKey = true): this { + this.isSortKey = isSortKey; + return this; + } + + withShowBorder(showBorder = true): this { + this.showBorder = showBorder; + return this; + } + + withRoundedCorners(roundedCorners = true): this { + this.roundedCorners = roundedCorners; + return this; + } + + withStyle(style: ContainerStyle): this { + this.style = style; + return this; + } + + withHorizontalCellContentAlignment(horizontalCellContentAlignment: HorizontalAlignment): this { + this.horizontalCellContentAlignment = horizontalCellContentAlignment; + return this; + } + + withVerticalCellContentAlignment(verticalCellContentAlignment: VerticalAlignment): this { + this.verticalCellContentAlignment = verticalCellContentAlignment; + return this; + } + + withFallback(fallback: FallbackElement): this { + this.fallback = fallback; + return this; + } + + withCells(...cells: TableCellArray): this { + this.cells = cells; + return this; + } +} + +/** + * Represents a cell in a table row. + */ +export interface ITableCell { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * Must be **TableCell**. + */ + readonly type: 'TableCell'; + /** + * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + */ + id?: string; + /** + * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + */ + requires?: IHostCapabilities; + /** + * The locale associated with the element. + */ + lang?: string; + /** + * Controls the visibility of the element. + */ + isVisible?: boolean; + /** + * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + */ + separator?: boolean; + /** + * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + */ + height?: ElementHeight; + /** + * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + */ + spacing?: Spacing; + /** + * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + */ + targetWidth?: TargetWidth; + /** + * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + */ + isSortKey?: boolean; + /** + * An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. + */ + selectAction?: IExecuteAction | IInsertImageAction | IOpenUrlAction | IOpenUrlDialogAction | IPopoverAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction; + /** + * The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. + */ + style?: ContainerStyle; + /** + * The layouts associated with the container. The container can dynamically switch from one layout to another as the card's width changes. See [Container layouts](https://adaptivecards.microsoft.com/?topic=container-layouts) for more details. + */ + layouts?: (IStackLayout | IFlowLayout | IAreaGridLayout)[]; + /** + * Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. + */ + bleed?: boolean; + /** + * The minimum height, in pixels, of the container, in the `px` format. + */ + minHeight?: string; + /** + * Defines the container's background image. + */ + backgroundImage?: string | IBackgroundImage; + /** + * Controls how the container's content should be vertically aligned. + */ + verticalContentAlignment?: VerticalAlignment; + /** + * Controls if the content of the card is to be rendered left-to-right or right-to-left. + */ + rtl?: boolean; + /** + * The maximum height, in pixels, of the container, in the `px` format. When the content of a container exceeds the container's maximum height, a vertical scrollbar is displayed. + */ + maxHeight?: string; + /** + * The area of a Layout.AreaGrid layout in which an element should be displayed. + */ + 'grid.area'?: string; + /** + * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + */ + fallback?: FallbackElement; + /** + * The items (elements) in the cell. + */ + items: CardElementArray; +} + +/** + * @hidden + * @internal + * + * Type guard to check if a value is of type ITableCell. + * + * @param value The value to check. + * @returns True if the value is an instance of TableCell, false otherwise. + */ +export function isTableCell(value: unknown): value is ITableCell { + const obj = value as ITableCell; + return typeof obj === 'object' && obj.type === 'TableCell'; +} + +export type TableCellOptions = Partial>; + +/** + * Represents a cell in a table row. + */ +export class TableCell implements ITableCell { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * Must be **TableCell**. + */ + readonly type = 'TableCell'; + /** + * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + */ + id?: string; + /** + * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + */ + requires?: IHostCapabilities = {}; + /** + * The locale associated with the element. + */ + lang?: string; + /** + * Controls the visibility of the element. + */ + isVisible?: boolean = true; + /** + * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + */ + separator?: boolean = false; + /** + * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + */ + height?: ElementHeight = 'auto'; + /** + * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + */ + spacing?: Spacing = 'Default'; + /** + * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + */ + targetWidth?: TargetWidth; + /** + * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + */ + isSortKey?: boolean = false; + /** + * An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. + */ + selectAction?: IExecuteAction | IInsertImageAction | IOpenUrlAction | IOpenUrlDialogAction | IPopoverAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction; + /** + * The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. + */ + style?: ContainerStyle; + /** + * The layouts associated with the container. The container can dynamically switch from one layout to another as the card's width changes. See [Container layouts](https://adaptivecards.microsoft.com/?topic=container-layouts) for more details. + */ + layouts?: (IStackLayout | IFlowLayout | IAreaGridLayout)[]; + /** + * Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. + */ + bleed?: boolean = false; + /** + * The minimum height, in pixels, of the container, in the `px` format. + */ + minHeight?: string; + /** + * Defines the container's background image. + */ + backgroundImage?: string | IBackgroundImage; + /** + * Controls how the container's content should be vertically aligned. + */ + verticalContentAlignment?: VerticalAlignment; + /** + * Controls if the content of the card is to be rendered left-to-right or right-to-left. + */ + rtl?: boolean; + /** + * The maximum height, in pixels, of the container, in the `px` format. When the content of a container exceeds the container's maximum height, a vertical scrollbar is displayed. + */ + maxHeight?: string; + /** + * The area of a Layout.AreaGrid layout in which an element should be displayed. + */ + 'grid.area'?: string; + /** + * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + */ + fallback?: FallbackElement; + /** + * The items (elements) in the cell. + */ + items: CardElementArray; + + constructor(...items: CardElementArray) { + this.items = items; + } + + withOptions(value: TableCellOptions): this { + Object.assign(this, value); + return this; + } + + withKey(key: string): this { + this.key = key; + return this; + } + + withId(id: string): this { + this.id = id; + return this; + } + + withRequires(requires: IHostCapabilities): this { + this.requires = requires; + return this; + } + + withLang(lang: string): this { + this.lang = lang; + return this; + } + + withIsVisible(isVisible = false): this { + this.isVisible = isVisible; + return this; + } + + withSeparator(separator = true): this { + this.separator = separator; + return this; + } + + withHeight(height: ElementHeight): this { + this.height = height; + return this; + } + + withSpacing(spacing: Spacing): this { + this.spacing = spacing; + return this; + } + + withTargetWidth(targetWidth: TargetWidth): this { + this.targetWidth = targetWidth; + return this; + } + + withIsSortKey(isSortKey = true): this { + this.isSortKey = isSortKey; + return this; + } + + withSelectAction(selectAction: IExecuteAction | IInsertImageAction | IOpenUrlAction | IOpenUrlDialogAction | IPopoverAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction): this { + this.selectAction = selectAction; + return this; + } + + withStyle(style: ContainerStyle): this { + this.style = style; + return this; + } + + withLayouts(...layouts: (IStackLayout | IFlowLayout | IAreaGridLayout)[]): this { + this.layouts = layouts; + return this; + } + + withBleed(bleed = true): this { + this.bleed = bleed; + return this; + } + + withMinHeight(minHeight: string): this { + this.minHeight = minHeight; + return this; + } + + withBackgroundImage(backgroundImage: string | IBackgroundImage): this { + this.backgroundImage = backgroundImage; + return this; + } + + withVerticalContentAlignment(verticalContentAlignment: VerticalAlignment): this { + this.verticalContentAlignment = verticalContentAlignment; + return this; + } + + withRtl(rtl: boolean): this { + this.rtl = rtl; + return this; + } + + withMaxHeight(maxHeight: string): this { + this.maxHeight = maxHeight; + return this; + } + + withFallback(fallback: FallbackElement): this { + this.fallback = fallback; + return this; + } + + withItems(...items: CardElementArray): this { + this.items = items; + return this; + } +} + +/** + * A block of text inside a RichTextBlock element. + */ +export interface ITextRun { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * Must be **TextRun**. + */ + readonly type: 'TextRun'; + /** + * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + */ + id?: string; + /** + * The locale associated with the element. + */ + lang?: string; + /** + * Controls the visibility of the element. + */ + isVisible?: boolean; + /** + * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + */ + isSortKey?: boolean; + /** + * The text to display. A subset of markdown is supported. + */ + text: string; + /** + * The size of the text. + */ + size?: TextSize; + /** + * The weight of the text. + */ + weight?: TextWeight; + /** + * The color of the text. + */ + color?: TextColor; + /** + * Controls whether the text should be renderer using a subtler variant of the select color. + */ + isSubtle?: boolean; + /** + * The type of font to use for rendering. + */ + fontType?: FontType; + /** + * Controls if the text should be italicized. + */ + italic?: boolean; + /** + * Controls if the text should be struck through. + */ + strikethrough?: boolean; + /** + * Controls if the text should be highlighted. + */ + highlight?: boolean; + /** + * Controls if the text should be underlined. + */ + underline?: boolean; + /** + * An Action that will be invoked when the text is tapped or clicked. Action.ShowCard is not supported. + */ + selectAction?: IExecuteAction | IInsertImageAction | IOpenUrlAction | IOpenUrlDialogAction | IPopoverAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction; + /** + * The area of a Layout.AreaGrid layout in which an element should be displayed. + */ + 'grid.area'?: string; + /** + * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + */ + fallback?: FallbackElement; +} + +/** + * @hidden + * @internal + * + * Type guard to check if a value is of type ITextRun. + * + * @param value The value to check. + * @returns True if the value is an instance of TextRun, false otherwise. + */ +export function isTextRun(value: unknown): value is ITextRun { + const obj = value as ITextRun; + return typeof obj === 'object' && obj.type === 'TextRun'; +} + +export type TextRunOptions = Partial>; + +/** + * A block of text inside a RichTextBlock element. + */ +export class TextRun implements ITextRun { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * Must be **TextRun**. + */ + readonly type = 'TextRun'; + /** + * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + */ + id?: string; + /** + * The locale associated with the element. + */ + lang?: string; + /** + * Controls the visibility of the element. + */ + isVisible?: boolean = true; + /** + * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + */ + isSortKey?: boolean = false; + /** + * The text to display. A subset of markdown is supported. + */ + text: string; + /** + * The size of the text. + */ + size?: TextSize; + /** + * The weight of the text. + */ + weight?: TextWeight; + /** + * The color of the text. + */ + color?: TextColor; + /** + * Controls whether the text should be renderer using a subtler variant of the select color. + */ + isSubtle?: boolean; + /** + * The type of font to use for rendering. + */ + fontType?: FontType; + /** + * Controls if the text should be italicized. + */ + italic?: boolean = false; + /** + * Controls if the text should be struck through. + */ + strikethrough?: boolean = false; + /** + * Controls if the text should be highlighted. + */ + highlight?: boolean = false; + /** + * Controls if the text should be underlined. + */ + underline?: boolean = false; + /** + * An Action that will be invoked when the text is tapped or clicked. Action.ShowCard is not supported. + */ + selectAction?: IExecuteAction | IInsertImageAction | IOpenUrlAction | IOpenUrlDialogAction | IPopoverAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction; + /** + * The area of a Layout.AreaGrid layout in which an element should be displayed. + */ + 'grid.area'?: string; + /** + * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + */ + fallback?: FallbackElement; + + constructor(text: string, options: TextRunOptions = {}) { + Object.assign(this, options); + this.text = text; + } + + static from(options: Omit): TextRun { + return new TextRun(options.text, options); + } + + withKey(key: string): this { + this.key = key; + return this; + } + + withId(id: string): this { + this.id = id; + return this; + } + + withLang(lang: string): this { + this.lang = lang; + return this; + } + + withIsVisible(isVisible = false): this { + this.isVisible = isVisible; + return this; + } + + withIsSortKey(isSortKey = true): this { + this.isSortKey = isSortKey; + return this; + } + + withText(text: string): this { + this.text = text; + return this; + } + + withSize(size: TextSize): this { + this.size = size; + return this; + } + + withWeight(weight: TextWeight): this { + this.weight = weight; + return this; + } + + withColor(color: TextColor): this { + this.color = color; + return this; + } + + withIsSubtle(isSubtle: boolean): this { + this.isSubtle = isSubtle; + return this; + } + + withFontType(fontType: FontType): this { + this.fontType = fontType; + return this; + } + + withItalic(italic = true): this { + this.italic = italic; + return this; + } + + withStrikethrough(strikethrough = true): this { + this.strikethrough = strikethrough; + return this; + } + + withHighlight(highlight = true): this { + this.highlight = highlight; + return this; + } + + withUnderline(underline = true): this { + this.underline = underline; + return this; + } + + withSelectAction(selectAction: IExecuteAction | IInsertImageAction | IOpenUrlAction | IOpenUrlDialogAction | IPopoverAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction): this { + this.selectAction = selectAction; + return this; + } + + withFallback(fallback: FallbackElement): this { + this.fallback = fallback; + return this; + } +} + +/** + * An inline icon inside a RichTextBlock element. + */ +export interface IIconRun { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * Must be **IconRun**. + */ + readonly type: 'IconRun'; + /** + * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + */ + id?: string; + /** + * The locale associated with the element. + */ + lang?: string; + /** + * Controls the visibility of the element. + */ + isVisible?: boolean; + /** + * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + */ + isSortKey?: boolean; + /** + * The name of the inline icon to display. + */ + name?: string; + /** + * The size of the inline icon. + */ + size?: 'Small' | 'Default' | 'Medium' | 'Large' | 'ExtraLarge'; + /** + * The style of the inline icon. + */ + style?: IconStyle; + /** + * The color of the inline icon. + */ + color?: TextColor; + /** + * An Action that will be invoked when the inline icon is tapped or clicked. Action.ShowCard is not supported. + */ + selectAction?: IExecuteAction | IInsertImageAction | IOpenUrlAction | IOpenUrlDialogAction | IPopoverAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction; + /** + * The area of a Layout.AreaGrid layout in which an element should be displayed. + */ + 'grid.area'?: string; + /** + * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + */ + fallback?: FallbackElement; +} + +/** + * @hidden + * @internal + * + * Type guard to check if a value is of type IIconRun. + * + * @param value The value to check. + * @returns True if the value is an instance of IconRun, false otherwise. + */ +export function isIconRun(value: unknown): value is IIconRun { + const obj = value as IIconRun; + return typeof obj === 'object' && obj.type === 'IconRun'; +} + +export type IconRunOptions = Partial>; + +/** + * An inline icon inside a RichTextBlock element. + */ +export class IconRun implements IIconRun { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * Must be **IconRun**. + */ + readonly type = 'IconRun'; + /** + * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + */ + id?: string; + /** + * The locale associated with the element. + */ + lang?: string; + /** + * Controls the visibility of the element. + */ + isVisible?: boolean = true; + /** + * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + */ + isSortKey?: boolean = false; + /** + * The name of the inline icon to display. + */ + name?: string; + /** + * The size of the inline icon. + */ + size?: 'Small' | 'Default' | 'Medium' | 'Large' | 'ExtraLarge' = 'Default'; + /** + * The style of the inline icon. + */ + style?: IconStyle = 'Regular'; + /** + * The color of the inline icon. + */ + color?: TextColor = 'Default'; + /** + * An Action that will be invoked when the inline icon is tapped or clicked. Action.ShowCard is not supported. + */ + selectAction?: IExecuteAction | IInsertImageAction | IOpenUrlAction | IOpenUrlDialogAction | IPopoverAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction; + /** + * The area of a Layout.AreaGrid layout in which an element should be displayed. + */ + 'grid.area'?: string; + /** + * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + */ + fallback?: FallbackElement; + + constructor(options: IconRunOptions = {}) { + Object.assign(this, options); + } + + static from(options: Omit): IconRun { + return new IconRun(options); + } + + withKey(key: string): this { + this.key = key; + return this; + } + + withId(id: string): this { + this.id = id; + return this; + } + + withLang(lang: string): this { + this.lang = lang; + return this; + } + + withIsVisible(isVisible = false): this { + this.isVisible = isVisible; + return this; + } + + withIsSortKey(isSortKey = true): this { + this.isSortKey = isSortKey; + return this; + } + + withName(name: string): this { + this.name = name; + return this; + } + + withSize(size: 'Small' | 'Default' | 'Medium' | 'Large' | 'ExtraLarge'): this { + this.size = size; + return this; + } + + withStyle(style: IconStyle): this { + this.style = style; + return this; + } + + withColor(color: TextColor): this { + this.color = color; + return this; + } + + withSelectAction(selectAction: IExecuteAction | IInsertImageAction | IOpenUrlAction | IOpenUrlDialogAction | IPopoverAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction): this { + this.selectAction = selectAction; + return this; + } + + withFallback(fallback: FallbackElement): this { + this.fallback = fallback; + return this; + } +} + +/** + * An inline image inside a RichTextBlock element. + */ +export interface IImageRun { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * Must be **ImageRun**. + */ + readonly type: 'ImageRun'; + /** + * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + */ + id?: string; + /** + * The locale associated with the element. + */ + lang?: string; + /** + * Controls the visibility of the element. + */ + isVisible?: boolean; + /** + * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + */ + isSortKey?: boolean; + /** + * The URL (or Base64-encoded Data URI) of the image. Acceptable formats are PNG, JPEG, GIF and SVG. + */ + url?: string; + /** + * The size of the inline image. + */ + size?: 'Small' | 'Default' | 'Medium' | 'Large' | 'ExtraLarge'; + /** + * The style of the inline image. + */ + style?: ImageStyle; + /** + * An Action that will be invoked when the image is tapped or clicked. Action.ShowCard is not supported. + */ + selectAction?: IExecuteAction | IInsertImageAction | IOpenUrlAction | IOpenUrlDialogAction | IPopoverAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction; + /** + * A set of theme-specific image URLs. + */ + themedUrls?: IThemedUrl[]; + /** + * The area of a Layout.AreaGrid layout in which an element should be displayed. + */ + 'grid.area'?: string; + /** + * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + */ + fallback?: FallbackElement; +} + +/** + * @hidden + * @internal + * + * Type guard to check if a value is of type IImageRun. + * + * @param value The value to check. + * @returns True if the value is an instance of ImageRun, false otherwise. + */ +export function isImageRun(value: unknown): value is IImageRun { + const obj = value as IImageRun; + return typeof obj === 'object' && obj.type === 'ImageRun'; +} + +export type ImageRunOptions = Partial>; + +/** + * An inline image inside a RichTextBlock element. + */ +export class ImageRun implements IImageRun { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * Must be **ImageRun**. + */ + readonly type = 'ImageRun'; + /** + * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + */ + id?: string; + /** + * The locale associated with the element. + */ + lang?: string; + /** + * Controls the visibility of the element. + */ + isVisible?: boolean = true; + /** + * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + */ + isSortKey?: boolean = false; + /** + * The URL (or Base64-encoded Data URI) of the image. Acceptable formats are PNG, JPEG, GIF and SVG. + */ + url?: string; + /** + * The size of the inline image. + */ + size?: 'Small' | 'Default' | 'Medium' | 'Large' | 'ExtraLarge' = 'Default'; + /** + * The style of the inline image. + */ + style?: ImageStyle = 'Default'; + /** + * An Action that will be invoked when the image is tapped or clicked. Action.ShowCard is not supported. + */ + selectAction?: IExecuteAction | IInsertImageAction | IOpenUrlAction | IOpenUrlDialogAction | IPopoverAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction; + /** + * A set of theme-specific image URLs. + */ + themedUrls?: IThemedUrl[]; + /** + * The area of a Layout.AreaGrid layout in which an element should be displayed. + */ + 'grid.area'?: string; + /** + * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + */ + fallback?: FallbackElement; + + constructor(options: ImageRunOptions = {}) { + Object.assign(this, options); + } + + static from(options: Omit): ImageRun { + return new ImageRun(options); + } + + withKey(key: string): this { + this.key = key; + return this; + } + + withId(id: string): this { + this.id = id; + return this; + } + + withLang(lang: string): this { + this.lang = lang; + return this; + } + + withIsVisible(isVisible = false): this { + this.isVisible = isVisible; + return this; + } + + withIsSortKey(isSortKey = true): this { + this.isSortKey = isSortKey; + return this; + } + + withUrl(url: string): this { + this.url = url; + return this; + } + + withSize(size: 'Small' | 'Default' | 'Medium' | 'Large' | 'ExtraLarge'): this { + this.size = size; + return this; + } + + withStyle(style: ImageStyle): this { + this.style = style; + return this; + } + + withSelectAction(selectAction: IExecuteAction | IInsertImageAction | IOpenUrlAction | IOpenUrlDialogAction | IPopoverAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction): this { + this.selectAction = selectAction; + return this; + } + + withThemedUrls(...themedUrls: IThemedUrl[]): this { + this.themedUrls = themedUrls; + return this; + } + + withFallback(fallback: FallbackElement): this { + this.fallback = fallback; + return this; + } +} + +/** + * A column in a ColumnSet element. + */ +export interface IColumn { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * Optional. If specified, must be **Column**. + */ + readonly type: 'Column'; + /** + * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + */ + id?: string; + /** + * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + */ + requires?: IHostCapabilities; + /** + * The locale associated with the element. + */ + lang?: string; + /** + * Controls the visibility of the element. + */ + isVisible?: boolean; + /** + * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + */ + separator?: boolean; + /** + * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + */ + height?: ElementHeight; + /** + * Controls how the element should be horizontally aligned. + */ + horizontalAlignment?: HorizontalAlignment; + /** + * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + */ + spacing?: Spacing; + /** + * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + */ + targetWidth?: TargetWidth; + /** + * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + */ + isSortKey?: boolean; + /** + * An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. + */ + selectAction?: IExecuteAction | IInsertImageAction | IOpenUrlAction | IOpenUrlDialogAction | IPopoverAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction; + /** + * The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. + */ + style?: ContainerStyle; + /** + * Controls if a border should be displayed around the container. + */ + showBorder?: boolean; + /** + * Controls if the container should have rounded corners. + */ + roundedCorners?: boolean; + /** + * The layouts associated with the container. The container can dynamically switch from one layout to another as the card's width changes. See [Container layouts](https://adaptivecards.microsoft.com/?topic=container-layouts) for more details. + */ + layouts?: (IStackLayout | IFlowLayout | IAreaGridLayout)[]; + /** + * Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. + */ + bleed?: boolean; + /** + * The minimum height, in pixels, of the container, in the `px` format. + */ + minHeight?: string; + /** + * Defines the container's background image. + */ + backgroundImage?: string | IBackgroundImage; + /** + * Controls how the container's content should be vertically aligned. + */ + verticalContentAlignment?: VerticalAlignment; + /** + * Controls if the content of the card is to be rendered left-to-right or right-to-left. + */ + rtl?: boolean; + /** + * The maximum height, in pixels, of the container, in the `px` format. When the content of a container exceeds the container's maximum height, a vertical scrollbar is displayed. + */ + maxHeight?: string; + /** + * The width of the column. If expressed as a number, represents the relative weight of the column in the set. If expressed as a string, `auto` will automatically adjust the column's width according to its content, `stretch` will make the column use the remaining horizontal space (shared with other columns with width set to `stretch`) and using the `px` format will give the column an explicit width in pixels. + */ + width?: 'auto' | 'stretch' | string | number; + /** + * The area of a Layout.AreaGrid layout in which an element should be displayed. + */ + 'grid.area'?: string; + /** + * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + */ + fallback?: FallbackElement; + /** + * The elements in the column. + */ + items: CardElementArray; +} + +/** + * @hidden + * @internal + * + * Type guard to check if a value is of type IColumn. + * + * @param value The value to check. + * @returns True if the value is an instance of Column, false otherwise. + */ +export function isColumn(value: unknown): value is IColumn { + const obj = value as IColumn; + return typeof obj === 'object' && obj.type === 'Column'; +} + +export type ColumnOptions = Partial>; + +/** + * A column in a ColumnSet element. + */ +export class Column implements IColumn { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * Optional. If specified, must be **Column**. + */ + readonly type = 'Column'; + /** + * A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. + */ + id?: string; + /** + * A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided). + */ + requires?: IHostCapabilities = {}; + /** + * The locale associated with the element. + */ + lang?: string; + /** + * Controls the visibility of the element. + */ + isVisible?: boolean = true; + /** + * Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true. + */ + separator?: boolean = false; + /** + * The height of the element. When set to stretch, the element will use the remaining vertical space in its container. + */ + height?: ElementHeight = 'auto'; + /** + * Controls how the element should be horizontally aligned. + */ + horizontalAlignment?: HorizontalAlignment; + /** + * Controls the amount of space between this element and the previous one. No space will be added for the first element in a container. + */ + spacing?: Spacing = 'Default'; + /** + * Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout). + */ + targetWidth?: TargetWidth; + /** + * Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. + */ + isSortKey?: boolean = false; + /** + * An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. + */ + selectAction?: IExecuteAction | IInsertImageAction | IOpenUrlAction | IOpenUrlDialogAction | IPopoverAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction; + /** + * The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. + */ + style?: ContainerStyle; + /** + * Controls if a border should be displayed around the container. + */ + showBorder?: boolean = false; + /** + * Controls if the container should have rounded corners. + */ + roundedCorners?: boolean = false; + /** + * The layouts associated with the container. The container can dynamically switch from one layout to another as the card's width changes. See [Container layouts](https://adaptivecards.microsoft.com/?topic=container-layouts) for more details. + */ + layouts?: (IStackLayout | IFlowLayout | IAreaGridLayout)[]; + /** + * Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. + */ + bleed?: boolean = false; + /** + * The minimum height, in pixels, of the container, in the `px` format. + */ + minHeight?: string; + /** + * Defines the container's background image. + */ + backgroundImage?: string | IBackgroundImage; + /** + * Controls how the container's content should be vertically aligned. + */ + verticalContentAlignment?: VerticalAlignment; + /** + * Controls if the content of the card is to be rendered left-to-right or right-to-left. + */ + rtl?: boolean; + /** + * The maximum height, in pixels, of the container, in the `px` format. When the content of a container exceeds the container's maximum height, a vertical scrollbar is displayed. + */ + maxHeight?: string; + /** + * The width of the column. If expressed as a number, represents the relative weight of the column in the set. If expressed as a string, `auto` will automatically adjust the column's width according to its content, `stretch` will make the column use the remaining horizontal space (shared with other columns with width set to `stretch`) and using the `px` format will give the column an explicit width in pixels. + */ + width?: 'auto' | 'stretch' | string | number; + /** + * The area of a Layout.AreaGrid layout in which an element should be displayed. + */ + 'grid.area'?: string; + /** + * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + */ + fallback?: FallbackElement; + /** + * The elements in the column. + */ + items: CardElementArray; + + constructor(...items: CardElementArray) { + this.items = items; + } + + withOptions(value: ColumnOptions): this { + Object.assign(this, value); + return this; + } + + withKey(key: string): this { + this.key = key; + return this; + } + + withId(id: string): this { + this.id = id; + return this; + } + + withRequires(requires: IHostCapabilities): this { + this.requires = requires; + return this; + } + + withLang(lang: string): this { + this.lang = lang; + return this; + } + + withIsVisible(isVisible = false): this { + this.isVisible = isVisible; + return this; + } + + withSeparator(separator = true): this { + this.separator = separator; + return this; + } + + withHeight(height: ElementHeight): this { + this.height = height; + return this; + } + + withHorizontalAlignment(horizontalAlignment: HorizontalAlignment): this { + this.horizontalAlignment = horizontalAlignment; + return this; + } + + withSpacing(spacing: Spacing): this { + this.spacing = spacing; + return this; + } + + withTargetWidth(targetWidth: TargetWidth): this { + this.targetWidth = targetWidth; + return this; + } + + withIsSortKey(isSortKey = true): this { + this.isSortKey = isSortKey; + return this; + } + + withSelectAction(selectAction: IExecuteAction | IInsertImageAction | IOpenUrlAction | IOpenUrlDialogAction | IPopoverAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction): this { + this.selectAction = selectAction; + return this; + } + + withStyle(style: ContainerStyle): this { + this.style = style; + return this; + } + + withShowBorder(showBorder = true): this { + this.showBorder = showBorder; + return this; + } + + withRoundedCorners(roundedCorners = true): this { + this.roundedCorners = roundedCorners; + return this; + } + + withLayouts(...layouts: (IStackLayout | IFlowLayout | IAreaGridLayout)[]): this { + this.layouts = layouts; + return this; + } + + withBleed(bleed = true): this { + this.bleed = bleed; + return this; + } + + withMinHeight(minHeight: string): this { + this.minHeight = minHeight; + return this; + } + + withBackgroundImage(backgroundImage: string | IBackgroundImage): this { + this.backgroundImage = backgroundImage; + return this; + } + + withVerticalContentAlignment(verticalContentAlignment: VerticalAlignment): this { + this.verticalContentAlignment = verticalContentAlignment; + return this; + } + + withRtl(rtl: boolean): this { + this.rtl = rtl; + return this; + } + + withMaxHeight(maxHeight: string): this { + this.maxHeight = maxHeight; + return this; + } + + withWidth(width: 'auto' | 'stretch' | string | number): this { + this.width = width; + return this; + } + + withFallback(fallback: FallbackElement): this { + this.fallback = fallback; + return this; + } + + withItems(...items: CardElementArray): this { + this.items = items; + return this; + } +} + +/** + * Represents the data of an Action.Submit. + */ +export interface ISubmitActionData extends Record { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + /** + * Defines the optional Teams-specific portion of the action's data. + */ +} + + +export type SubmitActionDataOptions = Partial; + +/** + * Represents the data of an Action.Submit. + */ +export class SubmitActionData implements ISubmitActionData { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + /** + * Defines the optional Teams-specific portion of the action's data. + */ + + constructor(options: SubmitActionDataOptions = {}) { + Object.assign(this, options); + } + + static from(options: ISubmitActionData): SubmitActionData { + return new SubmitActionData(options); + } + [key: string]: any; +} + +/** + * Represents Teams-specific data in an Action.Submit to send an Instant Message back to the Bot. + */ +export interface IImBackSubmitActionData { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * Must be **imBack**. + */ + readonly type: 'imBack'; + /** + * The value that will be sent to the Bot. + */ + value: string; +} + +/** + * @hidden + * @internal + * + * Type guard to check if a value is of type IImBackSubmitActionData. + * + * @param value The value to check. + * @returns True if the value is an instance of ImBackSubmitActionData, false otherwise. + */ +export function isImBackSubmitActionData(value: unknown): value is IImBackSubmitActionData { + const obj = value as IImBackSubmitActionData; + return typeof obj === 'object' && obj.type === 'imBack'; +} + +export type ImBackSubmitActionDataOptions = Partial>; + +/** + * Represents Teams-specific data in an Action.Submit to send an Instant Message back to the Bot. + */ +export class ImBackSubmitActionData implements IImBackSubmitActionData { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * Must be **imBack**. + */ + readonly type = 'imBack'; + /** + * The value that will be sent to the Bot. + */ + value: string; + + constructor(value: string, options: ImBackSubmitActionDataOptions = {}) { + Object.assign(this, options); + this.value = value; + } + + static from(options: Omit): ImBackSubmitActionData { + return new ImBackSubmitActionData(options.value, options); + } + + withKey(key: string): this { + this.key = key; + return this; + } + + withValue(value: string): this { + this.value = value; + return this; + } +} + +/** + * Represents Teams-specific data in an Action.Submit to make an Invoke request to the Bot. + */ +export interface IInvokeSubmitActionData { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * Must be **invoke**. + */ + readonly type: 'invoke'; + /** + * The object to send to the Bot with the Invoke request. Can be strongly typed as one of the below values to trigger a specific action in Teams. + */ + value: any | ICollabStageInvokeDataValue; +} + +/** + * @hidden + * @internal + * + * Type guard to check if a value is of type IInvokeSubmitActionData. + * + * @param value The value to check. + * @returns True if the value is an instance of InvokeSubmitActionData, false otherwise. + */ +export function isInvokeSubmitActionData(value: unknown): value is IInvokeSubmitActionData { + const obj = value as IInvokeSubmitActionData; + return typeof obj === 'object' && obj.type === 'invoke'; +} + +export type InvokeSubmitActionDataOptions = Partial>; + +/** + * Represents Teams-specific data in an Action.Submit to make an Invoke request to the Bot. + */ +export class InvokeSubmitActionData implements IInvokeSubmitActionData { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * Must be **invoke**. + */ + readonly type = 'invoke'; + /** + * The object to send to the Bot with the Invoke request. Can be strongly typed as one of the below values to trigger a specific action in Teams. + */ + value: any | ICollabStageInvokeDataValue; + + constructor(value: any | ICollabStageInvokeDataValue, options: InvokeSubmitActionDataOptions = {}) { + Object.assign(this, options); + this.value = value; + } + + static from(options: Omit): InvokeSubmitActionData { + return new InvokeSubmitActionData(options.value, options); + } + + withKey(key: string): this { + this.key = key; + return this; + } + + withValue(value: any | ICollabStageInvokeDataValue): this { + this.value = value; + return this; + } +} + +/** + * Data for invoking a collaboration stage action. + */ +export interface ICollabStageInvokeDataValue { + /** + * Must be **tab/tabInfoAction**. + */ + readonly type: 'tab/tabInfoAction'; + /** + * Provides information about the iFrame content, rendered in the collab stage popout window. + */ + tabInfo?: ITabInfo; +} + +/** + * @hidden + * @internal + * + * Type guard to check if a value is of type ICollabStageInvokeDataValue. + * + * @param value The value to check. + * @returns True if the value is an instance of CollabStageInvokeDataValue, false otherwise. + */ +export function isCollabStageInvokeDataValue(value: unknown): value is ICollabStageInvokeDataValue { + const obj = value as ICollabStageInvokeDataValue; + return typeof obj === 'object' && obj.type === 'tab/tabInfoAction'; +} + +export type CollabStageInvokeDataValueOptions = Partial>; + +/** + * Data for invoking a collaboration stage action. + */ +export class CollabStageInvokeDataValue implements ICollabStageInvokeDataValue { + /** + * Must be **tab/tabInfoAction**. + */ + readonly type = 'tab/tabInfoAction'; + /** + * Provides information about the iFrame content, rendered in the collab stage popout window. + */ + tabInfo?: ITabInfo; + + constructor(options: CollabStageInvokeDataValueOptions = {}) { + Object.assign(this, options); + } + + static from(options: Omit): CollabStageInvokeDataValue { + return new CollabStageInvokeDataValue(options); + } + + withTabInfo(tabInfo: ITabInfo): this { + this.tabInfo = tabInfo; + return this; + } +} + +/** + * Represents information about the iFrame content, rendered in the collab stage popout window. + */ +export interface ITabInfo { + /** + * The name for the content. This will be displayed as the title of the window hosting the iFrame. + */ + name?: string; + /** + * The URL to open in an iFrame. + */ + contentUrl?: string; + /** + * The unique entity id for this content (e.g., random UUID). + */ + entityId?: string; + /** + * An optional website URL to the content, allowing users to open this content in the browser (if they prefer). + */ + websiteUrl?: string; +} + + +export type TabInfoOptions = Partial; + +/** + * Represents information about the iFrame content, rendered in the collab stage popout window. + */ +export class TabInfo implements ITabInfo { + /** + * The name for the content. This will be displayed as the title of the window hosting the iFrame. + */ + name?: string; + /** + * The URL to open in an iFrame. + */ + contentUrl?: string; + /** + * The unique entity id for this content (e.g., random UUID). + */ + entityId?: string; + /** + * An optional website URL to the content, allowing users to open this content in the browser (if they prefer). + */ + websiteUrl?: string; + + constructor(options: TabInfoOptions = {}) { + Object.assign(this, options); + } + + static from(options: ITabInfo): TabInfo { + return new TabInfo(options); + } + + withName(name: string): this { + this.name = name; + return this; + } + + withContentUrl(contentUrl: string): this { + this.contentUrl = contentUrl; + return this; + } + + withEntityId(entityId: string): this { + this.entityId = entityId; + return this; + } + + withWebsiteUrl(websiteUrl: string): this { + this.websiteUrl = websiteUrl; + return this; + } +} + +/** + * Represents Teams-specific data in an Action.Submit to send a message back to the Bot. + */ +export interface IMessageBackSubmitActionData { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * Must be **messageBack**. + */ + readonly type: 'messageBack'; + /** + * The text that will be sent to the Bot. + */ + text?: string; + /** + * The optional text that will be displayed as a new message in the conversation, as if the end-user sent it. `displayText` is not sent to the Bot. + */ + displayText?: string; + /** + * Optional additional value that will be sent to the Bot. For instance, `value` can encode specific context for the action, such as unique identifiers or a JSON object. + */ + value?: any; +} + +/** + * @hidden + * @internal + * + * Type guard to check if a value is of type IMessageBackSubmitActionData. + * + * @param value The value to check. + * @returns True if the value is an instance of MessageBackSubmitActionData, false otherwise. + */ +export function isMessageBackSubmitActionData(value: unknown): value is IMessageBackSubmitActionData { + const obj = value as IMessageBackSubmitActionData; + return typeof obj === 'object' && obj.type === 'messageBack'; +} + +export type MessageBackSubmitActionDataOptions = Partial>; + +/** + * Represents Teams-specific data in an Action.Submit to send a message back to the Bot. + */ +export class MessageBackSubmitActionData implements IMessageBackSubmitActionData { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * Must be **messageBack**. + */ + readonly type = 'messageBack'; + /** + * The text that will be sent to the Bot. + */ + text?: string; + /** + * The optional text that will be displayed as a new message in the conversation, as if the end-user sent it. `displayText` is not sent to the Bot. + */ + displayText?: string; + /** + * Optional additional value that will be sent to the Bot. For instance, `value` can encode specific context for the action, such as unique identifiers or a JSON object. + */ + value?: any; + + constructor(options: MessageBackSubmitActionDataOptions = {}) { + Object.assign(this, options); + } + + static from(options: Omit): MessageBackSubmitActionData { + return new MessageBackSubmitActionData(options); + } + + withKey(key: string): this { + this.key = key; + return this; + } + + withText(text: string): this { + this.text = text; + return this; + } + + withDisplayText(displayText: string): this { + this.displayText = displayText; + return this; + } + + withValue(value: any): this { + this.value = value; + return this; + } +} + +/** + * Represents Teams-specific data in an Action.Submit to sign in a user. + */ +export interface ISigninSubmitActionData { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * Must be **signin**. + */ + readonly type: 'signin'; + /** + * The URL to redirect the end-user for signing in. + */ + value: string; +} + +/** + * @hidden + * @internal + * + * Type guard to check if a value is of type ISigninSubmitActionData. + * + * @param value The value to check. + * @returns True if the value is an instance of SigninSubmitActionData, false otherwise. + */ +export function isSigninSubmitActionData(value: unknown): value is ISigninSubmitActionData { + const obj = value as ISigninSubmitActionData; + return typeof obj === 'object' && obj.type === 'signin'; +} + +export type SigninSubmitActionDataOptions = Partial>; + +/** + * Represents Teams-specific data in an Action.Submit to sign in a user. + */ +export class SigninSubmitActionData implements ISigninSubmitActionData { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * Must be **signin**. + */ + readonly type = 'signin'; + /** + * The URL to redirect the end-user for signing in. + */ + value: string; + + constructor(value: string, options: SigninSubmitActionDataOptions = {}) { + Object.assign(this, options); + this.value = value; + } + + static from(options: Omit): SigninSubmitActionData { + return new SigninSubmitActionData(options.value, options); + } + + withKey(key: string): this { + this.key = key; + return this; + } + + withValue(value: string): this { + this.value = value; + return this; + } +} + +/** + * Represents Teams-specific data in an Action.Submit to open a task module. + */ +export interface ITaskFetchSubmitActionData { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * Must be **task/fetch**. + */ + readonly type: 'task/fetch'; +} + +/** + * @hidden + * @internal + * + * Type guard to check if a value is of type ITaskFetchSubmitActionData. + * + * @param value The value to check. + * @returns True if the value is an instance of TaskFetchSubmitActionData, false otherwise. + */ +export function isTaskFetchSubmitActionData(value: unknown): value is ITaskFetchSubmitActionData { + const obj = value as ITaskFetchSubmitActionData; + return typeof obj === 'object' && obj.type === 'task/fetch'; +} + +export type TaskFetchSubmitActionDataOptions = Partial>; + +/** + * Represents Teams-specific data in an Action.Submit to open a task module. + */ +export class TaskFetchSubmitActionData implements ITaskFetchSubmitActionData { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * Must be **task/fetch**. + */ + readonly type = 'task/fetch'; + + constructor(options: TaskFetchSubmitActionDataOptions = {}) { + Object.assign(this, options); + } + + static from(options: Omit): TaskFetchSubmitActionData { + return new TaskFetchSubmitActionData(options); + } + + withKey(key: string): this { + this.key = key; + return this; + } +} + +/** + * Teams-specific properties associated with the action. + */ +export interface ITeamsSubmitActionProperties { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * Defines how feedback is provided to the end-user when the action is executed. + */ + feedback?: ITeamsSubmitActionFeedback; +} + + +export type TeamsSubmitActionPropertiesOptions = Partial; + +/** + * Teams-specific properties associated with the action. + */ +export class TeamsSubmitActionProperties implements ITeamsSubmitActionProperties { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * Defines how feedback is provided to the end-user when the action is executed. + */ + feedback?: ITeamsSubmitActionFeedback; + + constructor(options: TeamsSubmitActionPropertiesOptions = {}) { + Object.assign(this, options); + } + + static from(options: ITeamsSubmitActionProperties): TeamsSubmitActionProperties { + return new TeamsSubmitActionProperties(options); + } + + withKey(key: string): this { + this.key = key; + return this; + } + + withFeedback(feedback: ITeamsSubmitActionFeedback): this { + this.feedback = feedback; + return this; + } +} + +/** + * Represents feedback options for an [Action.Submit](https://adaptivecards.microsoft.com/?topic=Action.Submit). + */ +export interface ITeamsSubmitActionFeedback { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * Defines if a feedback message should be displayed after the action is executed. + */ + hide?: boolean; +} + + +export type TeamsSubmitActionFeedbackOptions = Partial; + +/** + * Represents feedback options for an [Action.Submit](https://adaptivecards.microsoft.com/?topic=Action.Submit). + */ +export class TeamsSubmitActionFeedback implements ITeamsSubmitActionFeedback { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * Defines if a feedback message should be displayed after the action is executed. + */ + hide?: boolean; + + constructor(options: TeamsSubmitActionFeedbackOptions = {}) { + Object.assign(this, options); + } + + static from(options: ITeamsSubmitActionFeedback): TeamsSubmitActionFeedback { + return new TeamsSubmitActionFeedback(options); + } + + withKey(key: string): this { + this.key = key; + return this; + } + + withHide(hide: boolean): this { + this.hide = hide; + return this; + } +} + +/** + * Defines how a card can be refreshed by making a request to the target Bot. + */ +export interface IRefreshDefinition { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * The Action.Execute action to invoke to refresh the card. + */ + action?: IExecuteAction; + /** + * The list of user Ids for which the card will be automatically refreshed. In Teams, in chats or channels with more than 60 users, the card will automatically refresh only for users specified in the userIds list. Other users will have to manually click on a "refresh" button. In contexts with fewer than 60 users, the card will automatically refresh for all users. + */ + userIds?: string[]; +} + + +export type RefreshDefinitionOptions = Partial; + +/** + * Defines how a card can be refreshed by making a request to the target Bot. + */ +export class RefreshDefinition implements IRefreshDefinition { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * The Action.Execute action to invoke to refresh the card. + */ + action?: IExecuteAction; + /** + * The list of user Ids for which the card will be automatically refreshed. In Teams, in chats or channels with more than 60 users, the card will automatically refresh only for users specified in the userIds list. Other users will have to manually click on a "refresh" button. In contexts with fewer than 60 users, the card will automatically refresh for all users. + */ + userIds?: string[]; + + constructor(options: RefreshDefinitionOptions = {}) { + Object.assign(this, options); + } + + static from(options: IRefreshDefinition): RefreshDefinition { + return new RefreshDefinition(options); + } + + withKey(key: string): this { + this.key = key; + return this; + } + + withAction(action: IExecuteAction): this { + this.action = action; + return this; + } + + withUserIds(...userIds: string[]): this { + this.userIds = userIds; + return this; + } +} + +/** + * Defines authentication information associated with a card. For more information, refer to the [Bot Framework OAuthCard type](https://docs.microsoft.com/dotnet/api/microsoft.bot.schema.oauthcard) + */ +export interface IAuthentication { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * The text that can be displayed to the end user when prompting them to authenticate. + */ + text?: string; + /** + * The identifier for registered OAuth connection setting information. + */ + connectionName?: string; + /** + * The buttons that should be displayed to the user when prompting for authentication. The array MUST contain one button of type “signin”. Other button types are not currently supported. + */ + buttons?: IAuthCardButton[]; + /** + * Provides information required to enable on-behalf-of single sign-on user authentication. + */ + tokenExchangeResource?: ITokenExchangeResource; +} + + +export type AuthenticationOptions = Partial; + +/** + * Defines authentication information associated with a card. For more information, refer to the [Bot Framework OAuthCard type](https://docs.microsoft.com/dotnet/api/microsoft.bot.schema.oauthcard) + */ +export class Authentication implements IAuthentication { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * The text that can be displayed to the end user when prompting them to authenticate. + */ + text?: string; + /** + * The identifier for registered OAuth connection setting information. + */ + connectionName?: string; + /** + * The buttons that should be displayed to the user when prompting for authentication. The array MUST contain one button of type “signin”. Other button types are not currently supported. + */ + buttons?: IAuthCardButton[]; + /** + * Provides information required to enable on-behalf-of single sign-on user authentication. + */ + tokenExchangeResource?: ITokenExchangeResource; + + constructor(options: AuthenticationOptions = {}) { + Object.assign(this, options); + } + + static from(options: IAuthentication): Authentication { + return new Authentication(options); + } + + withKey(key: string): this { + this.key = key; + return this; + } + + withText(text: string): this { + this.text = text; + return this; + } + + withConnectionName(connectionName: string): this { + this.connectionName = connectionName; + return this; + } + + withButtons(...buttons: IAuthCardButton[]): this { + this.buttons = buttons; + return this; + } + + withTokenExchangeResource(tokenExchangeResource: ITokenExchangeResource): this { + this.tokenExchangeResource = tokenExchangeResource; + return this; + } +} + +/** + * Defines a button as displayed when prompting a user to authenticate. For more information, refer to the [Bot Framework CardAction type](https://docs.microsoft.com/dotnet/api/microsoft.bot.schema.cardaction). + */ +export interface IAuthCardButton { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * Must be **signin**. + */ + type?: string; + /** + * The caption of the button. + */ + title?: string; + /** + * A URL to an image to display alongside the button’s caption. + */ + image?: string; + /** + * The value associated with the button. The meaning of value depends on the button’s type. + */ + value?: string; +} + + +export type AuthCardButtonOptions = Partial; + +/** + * Defines a button as displayed when prompting a user to authenticate. For more information, refer to the [Bot Framework CardAction type](https://docs.microsoft.com/dotnet/api/microsoft.bot.schema.cardaction). + */ +export class AuthCardButton implements IAuthCardButton { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * Must be **signin**. + */ + type?: string; + /** + * The caption of the button. + */ + title?: string; + /** + * A URL to an image to display alongside the button’s caption. + */ + image?: string; + /** + * The value associated with the button. The meaning of value depends on the button’s type. + */ + value?: string; + + constructor(options: AuthCardButtonOptions = {}) { + Object.assign(this, options); + } + + static from(options: IAuthCardButton): AuthCardButton { + return new AuthCardButton(options); + } + + withKey(key: string): this { + this.key = key; + return this; + } + + withType(type: string): this { + this.type = type; + return this; + } + + withTitle(title: string): this { + this.title = title; + return this; + } + + withImage(image: string): this { + this.image = image; + return this; + } + + withValue(value: string): this { + this.value = value; + return this; + } +} + +/** + * Defines information required to enable on-behalf-of single sign-on user authentication. For more information, refer to the [Bot Framework TokenExchangeResource type](https://docs.microsoft.com/dotnet/api/microsoft.bot.schema.tokenexchangeresource) + */ +export interface ITokenExchangeResource { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * The unique identified of this token exchange instance. + */ + id?: string; + /** + * An application ID or resource identifier with which to exchange a token on behalf of. This property is identity provider- and application-specific. + */ + uri?: string; + /** + * An identifier for the identity provider with which to attempt a token exchange. + */ + providerId?: string; +} + + +export type TokenExchangeResourceOptions = Partial; + +/** + * Defines information required to enable on-behalf-of single sign-on user authentication. For more information, refer to the [Bot Framework TokenExchangeResource type](https://docs.microsoft.com/dotnet/api/microsoft.bot.schema.tokenexchangeresource) + */ +export class TokenExchangeResource implements ITokenExchangeResource { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * The unique identified of this token exchange instance. + */ + id?: string; + /** + * An application ID or resource identifier with which to exchange a token on behalf of. This property is identity provider- and application-specific. + */ + uri?: string; + /** + * An identifier for the identity provider with which to attempt a token exchange. + */ + providerId?: string; + + constructor(options: TokenExchangeResourceOptions = {}) { + Object.assign(this, options); + } + + static from(options: ITokenExchangeResource): TokenExchangeResource { + return new TokenExchangeResource(options); + } + + withKey(key: string): this { + this.key = key; + return this; + } + + withId(id: string): this { + this.id = id; + return this; + } + + withUri(uri: string): this { + this.uri = uri; + return this; + } + + withProviderId(providerId: string): this { + this.providerId = providerId; + return this; + } +} + +/** + * Represents a set of Teams-specific properties on a card. + */ +export interface ITeamsCardProperties { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * Controls the width of the card in a Teams chat. + * + * Note that setting `width` to "full" will not actually stretch the card to the "full width" of the chat pane. It will only make the card wider than when the `width` property isn't set. + */ + width?: TeamsCardWidth; + /** + * The Teams-specific entities associated with the card. + */ + entities?: IMention[]; +} + + +export type TeamsCardPropertiesOptions = Partial; + +/** + * Represents a set of Teams-specific properties on a card. + */ +export class TeamsCardProperties implements ITeamsCardProperties { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * Controls the width of the card in a Teams chat. + * + * Note that setting `width` to "full" will not actually stretch the card to the "full width" of the chat pane. It will only make the card wider than when the `width` property isn't set. + */ + width?: TeamsCardWidth; + /** + * The Teams-specific entities associated with the card. + */ + entities?: IMention[]; + + constructor(options: TeamsCardPropertiesOptions = {}) { + Object.assign(this, options); + } + + static from(options: ITeamsCardProperties): TeamsCardProperties { + return new TeamsCardProperties(options); + } + + withKey(key: string): this { + this.key = key; + return this; + } + + withWidth(width: TeamsCardWidth): this { + this.width = width; + return this; + } + + withEntities(...entities: IMention[]): this { + this.entities = entities; + return this; + } +} + +/** + * Represents a mention to a person. + */ +export interface IMention { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; /** - * An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported. + * Must be **mention**. */ - selectAction?: - | IExecuteAction - | IOpenUrlAction - | IResetInputsAction - | ISubmitAction - | IToggleVisibilityAction; + readonly type: 'mention'; /** - * The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met. + * The text that will be substituted with the mention. */ - style?: ContainerStyle; + text?: string; /** - * Controls if a border should be displayed around the container. + * Defines the entity being mentioned. */ - showBorder?: boolean; + mentioned?: IMentionedEntity; +} + +/** + * @hidden + * @internal + * + * Type guard to check if a value is of type IMention. + * + * @param value The value to check. + * @returns True if the value is an instance of Mention, false otherwise. + */ +export function isMention(value: unknown): value is IMention { + const obj = value as IMention; + return typeof obj === 'object' && obj.type === 'mention'; +} + +export type MentionOptions = Partial>; + +/** + * Represents a mention to a person. + */ +export class Mention implements IMention { /** - * Controls if the container should have rounded corners. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - roundedCorners?: boolean; + key?: string; /** - * The layouts associated with the container. The container can dynamically switch from one layout to another as the card's width changes. See [Container layouts](https://adaptivecards.microsoft.com/?topic=container-layouts) for more details. + * Must be **mention**. */ - layouts?: (IStackLayout | IFlowLayout | IAreaGridLayout)[]; + readonly type = 'mention'; /** - * Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding. + * The text that will be substituted with the mention. */ - bleed?: boolean; + text?: string; /** - * The minimum height, in pixels, of the container, in the `px` format. + * Defines the entity being mentioned. */ - minHeight?: string; + mentioned?: IMentionedEntity; + + constructor(options: MentionOptions = {}) { + Object.assign(this, options); + } + + static from(options: Omit): Mention { + return new Mention(options); + } + + withKey(key: string): this { + this.key = key; + return this; + } + + withText(text: string): this { + this.text = text; + return this; + } + + withMentioned(mentioned: IMentionedEntity): this { + this.mentioned = mentioned; + return this; + } +} + +/** + * Represents a mentioned person or tag. + */ +export interface IMentionedEntity { /** - * Defines the container's background image. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - backgroundImage?: string | IBackgroundImage; + key?: string; /** - * Controls how the container's content should be vertically aligned. + * The Id of a person (typically a Microsoft Entra user Id) or tag. */ - verticalContentAlignment?: VerticalAlignment; + id?: string; /** - * Controls if the content of the card is to be rendered left-to-right or right-to-left. + * The name of the mentioned entity. */ - rtl?: boolean; + name?: string; /** - * The maximum height, in pixels, of the container, in the `px` format. When the content of a container exceeds the container's maximum height, a vertical scrollbar is displayed. + * The type of the mentioned entity. */ - maxHeight?: string; + mentionType?: MentionType; +} + + +export type MentionedEntityOptions = Partial; + +/** + * Represents a mentioned person or tag. + */ +export class MentionedEntity implements IMentionedEntity { /** - * The width of the column. If expressed as a number, represents the relative weight of the column in the set. If expressed as a string, `auto` will automatically adjust the column's width according to its content, `stretch` will make the column use the remaining horizontal space (shared with other columns with width set to `stretch`) and using the `px` format will give the column an explicit width in pixels. + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. */ - width?: 'auto' | 'stretch' | string | number; + key?: string; /** - * The area of a Layout.AreaGrid layout in which an element should be displayed. + * The Id of a person (typically a Microsoft Entra user Id) or tag. */ - 'grid.area'?: string; + id?: string; /** - * An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. + * The name of the mentioned entity. */ - fallback?: FallbackElement; + name?: string; /** - * The elements in the column. + * The type of the mentioned entity. */ - items: CardElementArray; + mentionType?: MentionType = 'Person'; - constructor(...items: CardElementArray) { - this.items = items; + constructor(options: MentionedEntityOptions = {}) { + Object.assign(this, options); } - withOptions(value: ColumnOptions): this { - Object.assign(this, value); + static from(options: IMentionedEntity): MentionedEntity { + return new MentionedEntity(options); + } + + withKey(key: string): this { + this.key = key; return this; } @@ -18320,125 +19671,173 @@ export class Column implements IColumn { return this; } - withRequires(requires: IHostCapabilities): this { - this.requires = requires; + withName(name: string): this { + this.name = name; return this; } - withLang(lang: string): this { - this.lang = lang; + withMentionType(mentionType: MentionType): this { + this.mentionType = mentionType; return this; } +} - withIsVisible(isVisible = false): this { - this.isVisible = isVisible; - return this; - } +/** + * Card-level metadata. + */ +export interface ICardMetadata { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * The URL the card originates from. When `webUrl` is set, the card is dubbed an **Adaptive Card-based Loop Component** and, when pasted in Teams or other Loop Component-capable host applications, the URL will unfurl to the same exact card. + */ + webUrl?: string; +} - withSeparator(separator = true): this { - this.separator = separator; - return this; - } - withHeight(height: ElementHeight): this { - this.height = height; - return this; - } +export type CardMetadataOptions = Partial; - withHorizontalAlignment(horizontalAlignment: HorizontalAlignment): this { - this.horizontalAlignment = horizontalAlignment; - return this; - } +/** + * Card-level metadata. + */ +export class CardMetadata implements ICardMetadata { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * The URL the card originates from. When `webUrl` is set, the card is dubbed an **Adaptive Card-based Loop Component** and, when pasted in Teams or other Loop Component-capable host applications, the URL will unfurl to the same exact card. + */ + webUrl?: string; - withSpacing(spacing: Spacing): this { - this.spacing = spacing; - return this; + constructor(options: CardMetadataOptions = {}) { + Object.assign(this, options); } - withTargetWidth(targetWidth: TargetWidth): this { - this.targetWidth = targetWidth; - return this; + static from(options: ICardMetadata): CardMetadata { + return new CardMetadata(options); } - withIsSortKey(isSortKey = true): this { - this.isSortKey = isSortKey; + withKey(key: string): this { + this.key = key; return this; } - withSelectAction( - selectAction: - | IExecuteAction - | IOpenUrlAction - | IResetInputsAction - | ISubmitAction - | IToggleVisibilityAction - ): this { - this.selectAction = selectAction; + withWebUrl(webUrl: string): this { + this.webUrl = webUrl; return this; } +} - withStyle(style: ContainerStyle): this { - this.style = style; - return this; - } +/** + * The resources that can be used in the body of the card. + */ +export interface IResources { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * String resources that can provide translations in multiple languages. String resources make it possible to craft cards that are automatically localized according to the language settings of the application that displays the card. + */ + strings?: Record; +} - withShowBorder(showBorder = true): this { - this.showBorder = showBorder; - return this; - } - withRoundedCorners(roundedCorners = true): this { - this.roundedCorners = roundedCorners; - return this; - } +export type ResourcesOptions = Partial; - withLayouts(...layouts: (IStackLayout | IFlowLayout | IAreaGridLayout)[]): this { - this.layouts = layouts; - return this; - } +/** + * The resources that can be used in the body of the card. + */ +export class Resources implements IResources { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * String resources that can provide translations in multiple languages. String resources make it possible to craft cards that are automatically localized according to the language settings of the application that displays the card. + */ + strings?: Record; - withBleed(bleed = true): this { - this.bleed = bleed; - return this; + constructor(options: ResourcesOptions = {}) { + Object.assign(this, options); } - withMinHeight(minHeight: string): this { - this.minHeight = minHeight; - return this; + static from(options: IResources): Resources { + return new Resources(options); } - withBackgroundImage(backgroundImage: string | IBackgroundImage): this { - this.backgroundImage = backgroundImage; + withKey(key: string): this { + this.key = key; return this; } - withVerticalContentAlignment(verticalContentAlignment: VerticalAlignment): this { - this.verticalContentAlignment = verticalContentAlignment; + withStrings(strings: Record): this { + this.strings = strings; return this; } +} - withRtl(rtl: boolean): this { - this.rtl = rtl; - return this; +/** + * Defines the replacement string values. + */ +export interface IStringResource { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * The default value of the string, which is used when no matching localized value is found. + */ + defaultValue?: string; + /** + * Localized values of the string, where keys represent the locale (e.g. `en-US`) in the `(-)` format. `` is the 2-letter language code and `` is the optional 2-letter country code. + */ + localizedValues?: Record; +} + + +export type StringResourceOptions = Partial; + +/** + * Defines the replacement string values. + */ +export class StringResource implements IStringResource { + /** + * Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application. + */ + key?: string; + /** + * The default value of the string, which is used when no matching localized value is found. + */ + defaultValue?: string; + /** + * Localized values of the string, where keys represent the locale (e.g. `en-US`) in the `(-)` format. `` is the 2-letter language code and `` is the optional 2-letter country code. + */ + localizedValues?: Record; + + constructor(options: StringResourceOptions = {}) { + Object.assign(this, options); } - withMaxHeight(maxHeight: string): this { - this.maxHeight = maxHeight; - return this; + static from(options: IStringResource): StringResource { + return new StringResource(options); } - withWidth(width: 'auto' | 'stretch' | string | number): this { - this.width = width; + withKey(key: string): this { + this.key = key; return this; } - withFallback(fallback: FallbackElement): this { - this.fallback = fallback; + withDefaultValue(defaultValue: string): this { + this.defaultValue = defaultValue; return this; } - withItems(...items: CardElementArray): this { - this.items = items; + withLocalizedValues(localizedValues: Record): this { + this.localizedValues = localizedValues; return this; } -} +} \ No newline at end of file diff --git a/packages/cards/src/index.ts b/packages/cards/src/index.ts index 64eb2e15c..34bf35ad7 100644 --- a/packages/cards/src/index.ts +++ b/packages/cards/src/index.ts @@ -1,3 +1,2 @@ export * from './core'; export * from './actions'; -export * from './common';