@microsoft/teams-js 2.0.0-beta.4-dev.7 → 2.0.0-beta.4-dev.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -89,173 +89,6 @@ export namespace bot {
89
89
  export {};
90
90
  }
91
91
 
92
- /**
93
- * @hidden
94
- * Namespace to interact with the menu-specific part of the SDK.
95
- * This object is used to show View Configuration, Action Menu and Navigation Bar Menu.
96
- *
97
- * Hide from docs until feature is complete
98
- * @alpha
99
- */
100
- export namespace menus {
101
- /**
102
- * @hidden
103
- * Represents information about item in View Configuration.
104
- */
105
- interface ViewConfiguration {
106
- /**
107
- * @hidden
108
- * Unique identifier of view.
109
- */
110
- id: string;
111
- /**
112
- * @hidden
113
- * Display title of the view.
114
- */
115
- title: string;
116
- /**
117
- * @hidden
118
- * Additional information for accessibility.
119
- */
120
- contentDescription?: string;
121
- }
122
- /**
123
- * Defines how a menu item should appear in the NavBar.
124
- */
125
- enum DisplayMode {
126
- /**
127
- * Only place this item in the NavBar if there's room for it.
128
- * If there's no room, item is shown in the overflow menu.
129
- */
130
- ifRoom = 0,
131
- /**
132
- * Never place this item in the NavBar.
133
- * The item would always be shown in NavBar's overflow menu.
134
- */
135
- overflowOnly = 1
136
- }
137
- /**
138
- * @hidden
139
- * Represents information about menu item for Action Menu and Navigation Bar Menu.
140
- */
141
- class MenuItem {
142
- /**
143
- * @hidden
144
- * Unique identifier for the menu item.
145
- */
146
- id: string;
147
- /**
148
- * @hidden
149
- * Display title of the menu item.
150
- */
151
- title: string;
152
- /**
153
- * @hidden
154
- * Display icon of the menu item. The icon value must be a string having SVG icon content.
155
- */
156
- icon: string;
157
- /**
158
- * @hidden
159
- * Selected state display icon of the menu item. The icon value must be a string having SVG icon content.
160
- */
161
- iconSelected?: string;
162
- /**
163
- * @hidden
164
- * Additional information for accessibility.
165
- */
166
- contentDescription?: string;
167
- /**
168
- * @hidden
169
- * State of the menu item
170
- */
171
- enabled: boolean;
172
- /**
173
- * @hidden
174
- * Interface to show list of items on selection of menu item.
175
- */
176
- viewData?: ViewData;
177
- /**
178
- * @hidden
179
- * Whether the menu item is selected or not
180
- */
181
- selected: boolean;
182
- /**
183
- * The Display Mode of the menu item.
184
- * Default Behaviour would be DisplayMode.ifRoom if null.
185
- * Refer {@link DisplayMode}
186
- */
187
- displayMode?: DisplayMode;
188
- }
189
- /**
190
- * @hidden
191
- * Represents information about view to show on Navigation Bar Menu item selection
192
- */
193
- interface ViewData {
194
- /**
195
- * @hidden
196
- * Display header title of the item list.
197
- */
198
- listTitle?: string;
199
- /**
200
- * @hidden
201
- * Type of the menu item.
202
- */
203
- listType: MenuListType;
204
- /**
205
- * @hidden
206
- * Array of MenuItem. Icon value will be required for all items in the list.
207
- */
208
- listItems: MenuItem[];
209
- }
210
- /**
211
- * @hidden
212
- * Represents information about type of list to display in Navigation Bar Menu.
213
- */
214
- enum MenuListType {
215
- dropDown = "dropDown",
216
- popOver = "popOver"
217
- }
218
- function initialize(): void;
219
- /**
220
- * @hidden
221
- * Registers list of view configurations and it's handler.
222
- * Handler is responsible for listening selection of View Configuration.
223
- *
224
- * @param viewConfig - List of view configurations. Minimum 1 value is required.
225
- * @param handler - The handler to invoke when the user selects view configuration.
226
- */
227
- function setUpViews(viewConfig: ViewConfiguration[], handler: (id: string) => boolean): void;
228
- /**
229
- * @hidden
230
- * Used to set menu items on the Navigation Bar. If icon is available, icon will be shown, otherwise title will be shown.
231
- *
232
- * @param items List of MenuItems for Navigation Bar Menu.
233
- * @param handler The handler to invoke when the user selects menu item.
234
- */
235
- function setNavBarMenu(items: MenuItem[], handler: (id: string) => boolean): void;
236
- interface ActionMenuParameters {
237
- /**
238
- * @hidden
239
- * Display title for Action Menu
240
- */
241
- title: string;
242
- /**
243
- * @hidden
244
- * List of MenuItems for Action Menu
245
- */
246
- items: MenuItem[];
247
- }
248
- /**
249
- * @hidden
250
- * Used to show Action Menu.
251
- *
252
- * @param params - Parameters for Menu Parameters
253
- * @param handler - The handler to invoke when the user selects menu item.
254
- */
255
- function showActionMenu(params: ActionMenuParameters, handler: (id: string) => boolean): void;
256
- function isSupported(): boolean;
257
- }
258
-
259
92
  /**
260
93
  * @hidden
261
94
  * Namespace to interact with the logging part of the SDK.
@@ -792,6 +625,53 @@ export namespace files {
792
625
  remoteItem?: string;
793
626
  listUrl?: string;
794
627
  }
628
+ /**
629
+ * @hidden
630
+ * Hide from docs
631
+ *
632
+ * Download status enum
633
+ */
634
+ export enum FileDownloadStatus {
635
+ Downloaded = "Downloaded",
636
+ Downloading = "Downloading",
637
+ Failed = "Failed"
638
+ }
639
+ /**
640
+ * @hidden
641
+ * Hide from docs
642
+ *
643
+ * Download Files interface
644
+ */
645
+ export interface IFileItem {
646
+ /**
647
+ * ID of the file metadata
648
+ */
649
+ objectId?: string;
650
+ /**
651
+ * Path of the file
652
+ */
653
+ path?: string;
654
+ /**
655
+ * Size of the file in bytes
656
+ */
657
+ sizeInBytes?: number;
658
+ /**
659
+ * Download status
660
+ */
661
+ status?: FileDownloadStatus;
662
+ /**
663
+ * Download timestamp
664
+ */
665
+ timestamp: Date;
666
+ /**
667
+ * File name
668
+ */
669
+ title: string;
670
+ /**
671
+ * Type of file i.e. the file extension.
672
+ */
673
+ extension: string;
674
+ }
795
675
  /**
796
676
  * @hidden
797
677
  * Hide from docs
@@ -864,6 +744,21 @@ export namespace files {
864
744
  */
865
745
  export function copyMoveFiles(selectedFiles: CloudStorageFolderItem[] | ISharePointFile[], providerCode: CloudStorageProvider, destinationFolder: CloudStorageFolderItem | ISharePointFile, destinationProviderCode: CloudStorageProvider, isMove?: boolean): Promise<void>;
866
746
  export function isSupported(): boolean;
747
+ /**
748
+ * @hidden
749
+ * Hide from docs
750
+ * ------
751
+ * Gets list of downloads for current user
752
+ * @param callback Callback that will be triggered post downloads load
753
+ */
754
+ export function getFileDownloads(callback: (error?: SdkError, files?: IFileItem[]) => void): void;
755
+ /**
756
+ * @hidden
757
+ * Hide from docs
758
+ * ------
759
+ * Open download preference folder
760
+ */
761
+ export function openDownloadFolder(): void;
867
762
  export {};
868
763
  }
869
764
 
@@ -3219,6 +3114,169 @@ export class ParentAppWindow implements IAppWindow {
3219
3114
  addEventListener(type: string, listener: (message: any) => void): void;
3220
3115
  }
3221
3116
 
3117
+ /**
3118
+ * Namespace to interact with the menu-specific part of the SDK.
3119
+ * This object is used to show View Configuration, Action Menu and Navigation Bar Menu.
3120
+ */
3121
+ export namespace menus {
3122
+ /**
3123
+ * @hidden
3124
+ * Represents information about item in View Configuration.
3125
+ */
3126
+ interface ViewConfiguration {
3127
+ /**
3128
+ * @hidden
3129
+ * Unique identifier of view.
3130
+ */
3131
+ id: string;
3132
+ /**
3133
+ * @hidden
3134
+ * Display title of the view.
3135
+ */
3136
+ title: string;
3137
+ /**
3138
+ * @hidden
3139
+ * Additional information for accessibility.
3140
+ */
3141
+ contentDescription?: string;
3142
+ }
3143
+ /**
3144
+ * Defines how a menu item should appear in the NavBar.
3145
+ */
3146
+ enum DisplayMode {
3147
+ /**
3148
+ * Only place this item in the NavBar if there's room for it.
3149
+ * If there's no room, item is shown in the overflow menu.
3150
+ */
3151
+ ifRoom = 0,
3152
+ /**
3153
+ * Never place this item in the NavBar.
3154
+ * The item would always be shown in NavBar's overflow menu.
3155
+ */
3156
+ overflowOnly = 1
3157
+ }
3158
+ /**
3159
+ * @hidden
3160
+ * Represents information about menu item for Action Menu and Navigation Bar Menu.
3161
+ */
3162
+ class MenuItem {
3163
+ /**
3164
+ * @hidden
3165
+ * Unique identifier for the menu item.
3166
+ */
3167
+ id: string;
3168
+ /**
3169
+ * @hidden
3170
+ * Display title of the menu item.
3171
+ */
3172
+ title: string;
3173
+ /**
3174
+ * @hidden
3175
+ * Display icon of the menu item. The icon value must be a string having SVG icon content.
3176
+ */
3177
+ icon: string;
3178
+ /**
3179
+ * @hidden
3180
+ * Selected state display icon of the menu item. The icon value must be a string having SVG icon content.
3181
+ */
3182
+ iconSelected?: string;
3183
+ /**
3184
+ * @hidden
3185
+ * Additional information for accessibility.
3186
+ */
3187
+ contentDescription?: string;
3188
+ /**
3189
+ * @hidden
3190
+ * State of the menu item
3191
+ */
3192
+ enabled: boolean;
3193
+ /**
3194
+ * @hidden
3195
+ * Interface to show list of items on selection of menu item.
3196
+ */
3197
+ viewData?: ViewData;
3198
+ /**
3199
+ * @hidden
3200
+ * Whether the menu item is selected or not
3201
+ */
3202
+ selected: boolean;
3203
+ /**
3204
+ * The Display Mode of the menu item.
3205
+ * Default Behaviour would be DisplayMode.ifRoom if null.
3206
+ * Refer {@link DisplayMode}
3207
+ */
3208
+ displayMode?: DisplayMode;
3209
+ }
3210
+ /**
3211
+ * @hidden
3212
+ * Represents information about view to show on Navigation Bar Menu item selection
3213
+ */
3214
+ interface ViewData {
3215
+ /**
3216
+ * @hidden
3217
+ * Display header title of the item list.
3218
+ */
3219
+ listTitle?: string;
3220
+ /**
3221
+ * @hidden
3222
+ * Type of the menu item.
3223
+ */
3224
+ listType: MenuListType;
3225
+ /**
3226
+ * @hidden
3227
+ * Array of MenuItem. Icon value will be required for all items in the list.
3228
+ */
3229
+ listItems: MenuItem[];
3230
+ }
3231
+ /**
3232
+ * @hidden
3233
+ * Represents information about type of list to display in Navigation Bar Menu.
3234
+ */
3235
+ enum MenuListType {
3236
+ dropDown = "dropDown",
3237
+ popOver = "popOver"
3238
+ }
3239
+ function initialize(): void;
3240
+ /**
3241
+ * @hidden
3242
+ * Registers list of view configurations and it's handler.
3243
+ * Handler is responsible for listening selection of View Configuration.
3244
+ *
3245
+ * @param viewConfig - List of view configurations. Minimum 1 value is required.
3246
+ * @param handler - The handler to invoke when the user selects view configuration.
3247
+ */
3248
+ function setUpViews(viewConfig: ViewConfiguration[], handler: (id: string) => boolean): void;
3249
+ /**
3250
+ * @hidden
3251
+ * Used to set menu items on the Navigation Bar. If icon is available, icon will be shown, otherwise title will be shown.
3252
+ *
3253
+ * @param items List of MenuItems for Navigation Bar Menu.
3254
+ * @param handler The handler to invoke when the user selects menu item.
3255
+ */
3256
+ function setNavBarMenu(items: MenuItem[], handler: (id: string) => boolean): void;
3257
+ interface ActionMenuParameters {
3258
+ /**
3259
+ * @hidden
3260
+ * Display title for Action Menu
3261
+ */
3262
+ title: string;
3263
+ /**
3264
+ * @hidden
3265
+ * List of MenuItems for Action Menu
3266
+ */
3267
+ items: MenuItem[];
3268
+ }
3269
+ /**
3270
+ * @hidden
3271
+ * Used to show Action Menu.
3272
+ *
3273
+ * @param params - Parameters for Menu Parameters
3274
+ * @param handler - The handler to invoke when the user selects menu item.
3275
+ */
3276
+ function showActionMenu(params: ActionMenuParameters, handler: (id: string) => boolean): void;
3277
+ function isSupported(): boolean;
3278
+ }
3279
+
3222
3280
  /**
3223
3281
  * @alpha
3224
3282
  */
@@ -4444,28 +4502,22 @@ export namespace sharing {
4444
4502
  preview?: boolean;
4445
4503
  }
4446
4504
  /**
4447
- * @hidden
4448
4505
  * Feature is under development
4449
4506
  * Opens a share dialog for web content
4450
4507
  *
4451
4508
  * @param shareWebContentRequest - web content info
4452
4509
  * @returns Promise that will be fulfilled when the operation has completed
4453
- *
4454
- * @internal
4455
4510
  */
4456
4511
  export function shareWebContent(shareWebContentRequest: IShareRequest<IShareRequestContentType>): Promise<void>;
4457
4512
  /**
4458
4513
  * @deprecated
4459
4514
  * As of 2.0.0-beta.3, please use {@link sharing.shareWebContent sharing.shareWebContent(shareWebContentRequest: IShareRequest\<IShareRequestContentType\>): Promise\<void\>} instead.
4460
4515
  *
4461
- * @hidden
4462
4516
  * Feature is under development
4463
4517
  * Opens a share dialog for web content
4464
4518
  *
4465
4519
  * @param shareWebContentRequest - web content info
4466
4520
  * @param callback - optional callback
4467
- *
4468
- * @internal
4469
4521
  */
4470
4522
  export function shareWebContent(shareWebContentRequest: IShareRequest<IShareRequestContentType>, callback: (err?: SdkError) => void): void;
4471
4523
  export function isSupported(): boolean;
@@ -4511,7 +4563,19 @@ export namespace stageView {
4511
4563
  *
4512
4564
  * Opens a stage view to display a Teams app
4513
4565
  * @param stageViewParams The parameters to pass into the stage view.
4514
- * @param callback Callback that will be triggered once the stage view is closed.
4566
+ *
4567
+ */
4568
+ function open(stageViewParams: StageViewParams): Promise<void>;
4569
+ /**
4570
+ * @hidden
4571
+ * Feature is under development
4572
+ *
4573
+ * @deprecated
4574
+ * As of 2.0.0-beta.3, please use {@link stageView.open stageView.open(): Promise\<void\>} instead.
4575
+ *
4576
+ * Opens a stage view to display a Teams app
4577
+ * @param stageViewParams The parameters to pass into the stage view.
4578
+ * Optional; @param callback Callback that will be triggered once the stage view is closed.
4515
4579
  * The callback takes as an argument an SdkError in case something happened (i.e.
4516
4580
  * no permissions to execute the API)
4517
4581
  */