@@ -1256,6 +1256,17 @@ export class Session {
1256
1256
*/
1257
1257
send ( message : string | string [ ] | IMessage | IIsMessage , ...args : any [ ] ) : Session ;
1258
1258
1259
+ /**
1260
+ * Sends a message to a user using a specific localization namespace.
1261
+ * @param localizationNamespace Namespace to use for localizing the message.
1262
+ * @param message
1263
+ * * __message:__ _{string}_ - Text of the message to send. The message will be localized using the sessions configured localizer. If arguments are passed in the message will be formatted using [sprintf-js](https://github.com/alexei/sprintf.js).
1264
+ * * __message:__ _{string[]}_ - The sent message will be chosen at random from the array.
1265
+ * * __message:__ _{IMessage|IIsMessage}_ - Message to send.
1266
+ * @param args (Optional) arguments used to format the final output text when __message__ is a _{string|string[]}_.
1267
+ */
1268
+ sendLocalized ( localizationNamespace : string , message : string | string [ ] | IMessage | IIsMessage , ...args : any [ ] ) : Session ;
1269
+
1259
1270
/**
1260
1271
* Sends the user an indication that the bot is typing. For long running operations this should be called every few seconds.
1261
1272
*/
@@ -1649,8 +1660,165 @@ export class ThumbnailCard implements IIsAttachment {
1649
1660
/** This action will be activated when user taps on the card. Not all channels support tap actions and some channels may choose to render the tap action as the titles link. */
1650
1661
tap ( action : ICardAction | IIsCardAction ) : ThumbnailCard ;
1651
1662
1652
- /** Returns the JSON for the card, */
1663
+ /** Returns the JSON for the card */
1664
+ toAttachment ( ) : IAttachment ;
1665
+ }
1666
+
1667
+
1668
+ /** Interface definition for a video card */
1669
+ export interface IVideoCard extends IMediaCard {
1670
+
1671
+ /** Hint of the aspect ratio of the video or animation. (16:9)(4:3) */
1672
+ aspect : string ;
1673
+ }
1674
+
1675
+ /** Interface definition for an audio card */
1676
+ export interface IAudioCard extends IMediaCard {
1677
+ }
1678
+
1679
+ /** Interface definition for an animation card */
1680
+ export interface IAnimationCard extends IMediaCard {
1681
+
1682
+ /** Hint of the aspect ratio of the video or animation. (16:9)(4:3) */
1683
+ aspect : string ;
1684
+ }
1685
+
1686
+ /** Interface definition of a generic MediaCard, which in its concrete form can be an Audio, Animation or Video card */
1687
+ export interface IMediaCard {
1688
+
1689
+ /** Title of the Card */
1690
+ title : string ;
1691
+
1692
+ /** Subtitle appears just below Title field, differs from Title in font styling only */
1693
+ subtitle : string ;
1694
+
1695
+ /** Text field appears just below subtitle, differs from Subtitle in font styling only */
1696
+ text : string ;
1697
+
1698
+ /** Messaging supports all media formats: audio, video, images and thumbnails as well to optimize content download.*/
1699
+ image : ICardImage ;
1700
+
1701
+ /** Media source for video, audio or animations */
1702
+ media : ICardMediaUrl [ ] ;
1703
+
1704
+ /** Set of actions applicable to the current card */
1705
+ buttons ?: ICardAction [ ] ;
1706
+
1707
+ /** Should the media source reproduction run in a loop */
1708
+ autoloop : boolean ;
1709
+
1710
+ /** Should the media start automatically */
1711
+ autostart : boolean ;
1712
+
1713
+ /** Should media be shareable */
1714
+ shareable : boolean ;
1715
+ }
1716
+
1717
+ /** Url information describing media for a card */
1718
+ export interface ICardMediaUrl {
1719
+
1720
+ /** Url to audio, video or animation media */
1721
+ url : string ;
1722
+
1723
+ /** Optional profile hint to the client to differentiate multiple MediaUrl objects from each other */
1724
+ profile : string ;
1725
+ }
1726
+
1727
+ /** Card builder class that simplifies building Video cards. */
1728
+ export class VideoCard extends MediaCard implements IIsAttachment {
1729
+
1730
+ /**
1731
+ * Creates a new VideoCard.
1732
+ * @param session (Optional) will be used to localize any text.
1733
+ */
1734
+ constructor ( session ?: Session ) ;
1735
+ aspect ( text : string | string [ ] , ...args : any [ ] ) : this;
1736
+ }
1737
+
1738
+ /** Card builder class that simplifies building Animation cards. */
1739
+ export class AnimationCard extends MediaCard implements IIsAttachment {
1740
+
1741
+ /**
1742
+ * Creates a new AnimationCard.
1743
+ * @param session (Optional) will be used to localize any text.
1744
+ */
1745
+ constructor ( session ?: Session ) ;
1746
+ }
1747
+
1748
+ /** Card builder class that simplifies building Media cards. */
1749
+ export class AudioCard extends MediaCard implements IIsAttachment {
1750
+
1751
+ /**
1752
+ * Creates a new Audio.
1753
+ * @param session (Optional) will be used to localize any text.
1754
+ */
1755
+ constructor ( session ?: Session ) ;
1756
+ }
1757
+
1758
+ /** Card builder class that simplifies building Media cards. */
1759
+ export class MediaCard implements IIsAttachment {
1760
+
1761
+ /**
1762
+ * Creates a new MediaCard.
1763
+ * @param session (Optional) will be used to localize any text.
1764
+ */
1765
+ constructor ( session ?: Session ) ;
1766
+
1767
+ /** Title of the Card */
1768
+ title ( text : string | string [ ] , ...args : any [ ] ) : this;
1769
+
1770
+ /** Subtitle appears just below Title field, differs from Title in font styling only */
1771
+ subtitle ( text : string | string [ ] , ...args : any [ ] ) : this;
1772
+
1773
+ /** Text field appears just below subtitle, differs from Subtitle in font styling only */
1774
+ text ( text : string | string [ ] , ...args : any [ ] ) : this;
1775
+
1776
+ /** Messaging supports all media formats: audio, video, images and thumbnails as well to optimize content download.*/
1777
+ image ( image : ICardImage | IIsCardImage ) : this;
1778
+
1779
+ /** Media source for video, audio or animations */
1780
+ media ( list : ICardMediaUrl [ ] ) : this;
1781
+
1782
+ /** Returns the JSON for the card*/
1653
1783
toAttachment ( ) : IAttachment ;
1784
+
1785
+ /** Should the media source reproduction run in a loop */
1786
+ autoloop ( choice : boolean ) : this;
1787
+
1788
+ /** Should the media start automatically */
1789
+ autostart ( choice : boolean ) : this;
1790
+
1791
+ /** Should media be shareable */
1792
+ shareable ( choice : boolean ) : this;
1793
+ }
1794
+
1795
+ /** Entities that can be converted to Media for cards */
1796
+ export interface IIsCardMedia {
1797
+
1798
+ /** Returns the url definition for a Media entity for a card */
1799
+ toMedia ( ) : ICardMediaUrl ;
1800
+ }
1801
+
1802
+ /** Definition of a media entity for a card */
1803
+ export class CardMedia implements IIsCardMedia {
1804
+
1805
+ /**
1806
+ * Creates a new CardMedia, which defines a media entity for a card.
1807
+ * @param session (Optional) will be used to localize any text.
1808
+ */
1809
+ constructor ( session ?: Session ) ;
1810
+
1811
+ /** Url of the media */
1812
+ url ( u : string ) : this;
1813
+
1814
+ /** Optional profile hint to the client to differentiate multiple MediaUrl objects from each other */
1815
+ profile ( text : string ) : this;
1816
+
1817
+ /** Returns the url definition for a Media entity for a card */
1818
+ toMedia ( ) : ICardMediaUrl ;
1819
+
1820
+ /** Factory method for creation of Card media entities */
1821
+ static create ( session : Session , url : string ) : CardMedia ;
1654
1822
}
1655
1823
1656
1824
/** Card builder class that simplifies building hero cards. Hero cards contain the same information as a thumbnail card, just with a larger more pronounced layout for the cards images. */
0 commit comments