@microsoft/teams-js 1.10.1-dev.0 → 1.10.1-dev.1

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.
Files changed (40) hide show
  1. package/dist/MicrosoftTeams.js +1 -1
  2. package/dist/MicrosoftTeams.js.map +1 -1
  3. package/dist/MicrosoftTeams.min.js +1 -1
  4. package/dist/microsoftteams.d.ts +2834 -0
  5. package/dts/index.d.ts +2 -0
  6. package/dts/internal/communication.d.ts +23 -0
  7. package/dts/internal/constants.d.ts +42 -0
  8. package/dts/internal/globalVars.d.ts +15 -0
  9. package/dts/internal/handlers.d.ts +10 -0
  10. package/dts/internal/interfaces.d.ts +44 -0
  11. package/dts/internal/internalAPIs.d.ts +12 -0
  12. package/dts/internal/mediaUtil.d.ts +31 -0
  13. package/dts/internal/utils.d.ts +22 -0
  14. package/dts/private/appEntity.d.ts +49 -0
  15. package/dts/private/bot.d.ts +77 -0
  16. package/dts/private/conversations.d.ts +20 -0
  17. package/dts/private/files.d.ts +169 -0
  18. package/dts/private/index.d.ts +10 -0
  19. package/dts/private/interfaces.d.ts +141 -0
  20. package/dts/private/logs.d.ts +17 -0
  21. package/dts/private/meetingRoom.d.ts +157 -0
  22. package/dts/private/menus.d.ts +117 -0
  23. package/dts/private/privateAPIs.d.ts +104 -0
  24. package/dts/private/remoteCamera.d.ts +196 -0
  25. package/dts/public/appInitialization.d.ts +44 -0
  26. package/dts/public/appWindow.d.ts +14 -0
  27. package/dts/public/authentication.d.ts +177 -0
  28. package/dts/public/constants.d.ts +53 -0
  29. package/dts/public/index.d.ts +13 -0
  30. package/dts/public/interfaces.d.ts +557 -0
  31. package/dts/public/location.d.ts +47 -0
  32. package/dts/public/media.d.ts +219 -0
  33. package/dts/public/meeting.d.ts +158 -0
  34. package/dts/public/navigation.d.ts +28 -0
  35. package/dts/public/people.d.ts +53 -0
  36. package/dts/public/publicAPIs.d.ts +117 -0
  37. package/dts/public/settings.d.ts +95 -0
  38. package/dts/public/tasks.d.ts +25 -0
  39. package/package.json +1 -1
  40. package/dist/MicrosoftTeams.d.ts +0 -5
@@ -1,5 +0,0 @@
1
- declare module '@microsoft/teams-js' {
2
- export = microsoftTeams;
3
- }
4
- declare namespace microsoftTeams {
5
- export class Communication {
6
  static currentWindow: Window | any;
7
1
  static parentOrigin: string;
8
2
  static parentWindow: Window | any;
9
3
  static childWindow: Window;
10
4
  static childOrigin: string;
11
5
  }
12
6
  export function initializeCommunication(callback: Function, validMessageOrigins: string[] | undefined): void;
13
7
  export function uninitializeCommunication(): void;
14
8
  /**
15
9
  * Send a message to parent. Uses nativeInterface on mobile to communicate with parent context
16
10
  */
17
11
  export function sendMessageToParent(actionName: string, callback?: Function): void;
18
12
  /**
19
13
  * Send a message to parent. Uses nativeInterface on mobile to communicate with parent context
20
14
  */
21
15
  export function sendMessageToParent(actionName: string, args: any[], callback?: Function): void;
22
16
  export function waitForMessageQueue(targetWindow: Window, callback: () => void): void;
23
17
  /**
24
18
  * Send a custom message object that can be sent to child window,
25
19
  * instead of a response message to a child
26
20
  */
27
21
  export function sendMessageEventToChild(actionName: string, args?: any[]): void;
28
22
  export const version = "1.10.1-dev.0";
29
23
  /**
30
24
  * This is the SDK version when all SDK APIs started to check platform compatibility for the APIs.
31
25
  */
32
26
  export const defaultSDKVersionForCompatCheck = "1.6.0";
33
27
  /**
34
28
  * Minimum required client supported version for {@link getUserJoinedTeams} to be supported on {@link HostClientType.android}
35
29
  */
36
30
  export const getUserJoinedTeamsSupportedAndroidClientVersion = "2.0.1";
37
31
  /**
38
32
  * This is the SDK version when location APIs (getLocation and showLocation) are supported.
39
33
  */
40
34
  export const locationAPIsRequiredVersion = "1.9.0";
41
35
  /**
42
36
  * This is the SDK version when people picker API is supported on mobile.
43
37
  */
44
38
  export const peoplePickerRequiredVersion = "2.0.0";
45
39
  /**
46
40
  * This is the SDK version when captureImage API is supported on mobile.
47
41
  */
48
42
  export const captureImageMobileSupportVersion = "1.7.0";
49
43
  /**
50
44
  * This is the SDK version when media APIs are supported on all three platforms ios, android and web.
51
45
  */
52
46
  export const mediaAPISupportVersion = "1.8.0";
53
47
  /**
54
48
  * This is the SDK version when getMedia API is supported via Callbacks on all three platforms ios, android and web.
55
49
  */
56
50
  export const getMediaCallbackSupportVersion = "2.0.0";
57
51
  /**
58
52
  * This is the SDK version when scanBarCode API is supported on mobile.
59
53
  */
60
54
  export const scanBarCodeAPIMobileSupportVersion = "1.9.0";
61
55
  /**
62
56
  * List of supported Host origins
63
57
  */
64
58
  export const validOrigins: string[];
65
59
  export const validOriginRegExp: RegExp;
66
60
  /**
67
61
  * USer specified message origins should satisfy this test
68
62
  */
69
63
  export const userOriginUrlValidationRegExp: RegExp;
70
64
  export class GlobalVars {
71
65
  static initializeCalled: boolean;
72
66
  static initializeCompleted: boolean;
73
67
  static additionalValidOrigins: string[];
74
68
  static additionalValidOriginsRegexp: RegExp;
75
69
  static initializeCallbacks: {
76
70
  (): void;
77
71
  }[];
78
72
  static isFramelessWindow: boolean;
79
73
  static frameContext: FrameContexts;
80
74
  static hostClientType: string;
81
75
  static clientSupportedSDKVersion: string;
82
76
  static printCapabilityEnabled: boolean;
83
77
  }
84
78
  export function initializeHandlers(): void;
85
79
  export function callHandler(name: string, args?: any[]): [true, any] | [false, undefined];
86
80
  export function registerHandler(name: string, handler: Function, sendMessage?: boolean, args?: any[]): void;
87
81
  export function removeHandler(name: string): void;
88
82
  export function registerOnThemeChangeHandler(handler: (theme: string) => void): void;
89
83
  export function handleThemeChange(theme: string): void;
90
84
  export function registerBackButtonHandler(handler: () => boolean): void;
91
85
  export function registerOnLoadHandler(handler: (context: LoadContext) => void): void;
92
86
  export function registerBeforeUnloadHandler(handler: (readyToUnload: () => void) => boolean): void;
93
87
  /**
94
88
  * @private
95
89
  * Hide from docs
96
90
  * Shim in definitions used for browser-compat
97
91
  */
98
92
  export interface DOMMessageEvent {
99
93
  origin?: any;
100
94
  source?: any;
101
95
  data?: any;
102
96
  originalEvent: DOMMessageEvent;
103
97
  }
104
98
  /**
105
99
  * @private
106
100
  * Hide from docs
107
101
  */
108
102
  export interface TeamsNativeClient {
109
103
  framelessPostMessage(msg: string): void;
110
104
  }
111
105
  /**
112
106
  * @private
113
107
  * Hide from docs
114
108
  */
115
109
  export interface ExtendedWindow extends Window {
116
110
  nativeInterface: TeamsNativeClient;
117
111
  onNativeMessage(evt: DOMMessageEvent): void;
118
112
  }
119
113
  export interface MessageRequest {
120
114
  id?: number;
121
115
  func: string;
122
116
  timestamp?: number;
123
117
  args?: any[];
124
118
  }
125
119
  export interface MessageResponse {
126
120
  id: number;
127
121
  args?: any[];
128
122
  isPartialResponse?: boolean;
129
123
  }
130
124
  /**
131
125
  * Meant for Message objects that are sent to children without id
132
126
  */
133
127
  export interface DOMMessageEvent {
134
128
  func: string;
135
129
  args?: any[];
136
130
  }
137
131
  export function ensureInitialized(...expectedFrameContexts: string[]): void;
138
132
  /**
139
133
  * Checks whether the platform has knowledge of this API by doing a comparison
140
134
  * on API required version and platform supported version of the SDK
141
135
  * @param requiredVersion SDK version required by the API
142
136
  */
143
137
  export function isAPISupportedByPlatform(requiredVersion?: string): boolean;
144
138
  /**
145
139
  * Processes the valid origins specifuied by the user, de-duplicates and converts them into a regexp
146
140
  * which is used later for message source/origin validation
147
141
  */
148
142
  export function processAdditionalValidOrigins(validMessageOrigins: string[]): void;
149
143
  /**
150
144
  * Helper function to create a blob from media chunks based on their sequence
151
145
  */
152
146
  export function createFile(assembleAttachment: media.AssembleAttachment[], mimeType: string): Blob;
153
147
  /**
154
148
  * Helper function to convert Media chunks into another object type which can be later assemebled
155
149
  * Converts base 64 encoded string to byte array and then into an array of blobs
156
150
  */
157
151
  export function decodeAttachment(attachment: media.MediaChunk, mimeType: string): media.AssembleAttachment;
158
152
  /**
159
153
  * Returns true if the mediaInput params are valid and false otherwise
160
154
  */
161
155
  export function validateSelectMediaInputs(mediaInputs: media.MediaInputs): boolean;
162
156
  /**
163
157
  * Returns true if the get Media params are valid and false otherwise
164
158
  */
165
159
  export function validateGetMediaInputs(mimeType: string, format: media.FileFormat, content: string): boolean;
166
160
  /**
167
161
  * Returns true if the view images param is valid and false otherwise
168
162
  */
169
163
  export function validateViewImagesInput(uriList: media.ImageUri[]): boolean;
170
164
  /**
171
165
  * Returns true if the scan barcode param is valid and false otherwise
172
166
  */
173
167
  export function validateScanBarCodeInput(barCodeConfig: media.BarCodeConfig): boolean;
174
168
  /**
175
169
  * Returns true if the people picker params are valid and false otherwise
176
170
  */
177
171
  export function validatePeoplePickerInput(peoplePickerInputs: people.PeoplePickerInputs): boolean;
178
172
  export function generateRegExpFromUrls(urls: string[]): RegExp;
179
173
  export function getGenericOnCompleteHandler(errorMessage?: string): (success: boolean, reason?: string) => void;
180
174
  /**
181
175
  * Compares SDK versions.
182
176
  * @param v1 first version
183
177
  * @param v2 second version
184
178
  * returns NaN in case inputs are not in right format
185
179
  * -1 if v1 < v2
186
180
  * 1 if v1 > v2
187
181
  * 0 otherwise
188
182
  * For example,
189
183
  * compareSDKVersions('1.2', '1.2.0') returns 0
190
184
  * compareSDKVersions('1.2a', '1.2b') returns NaN
191
185
  * compareSDKVersions('1.2', '1.3') returns -1
192
186
  * compareSDKVersions('2.0', '1.3.2') returns 1
193
187
  * compareSDKVersions('2.0', 2.0) returns NaN
194
188
  */
195
189
  export function compareSDKVersions(v1: string, v2: string): number;
196
190
  /**
197
191
  * Generates a GUID
198
192
  */
199
193
  export function generateGUID(): string;
200
194
  /**
201
195
  * Namespace to interact with the application entities specific part of the SDK.
202
196
  *
203
197
  * @private
204
198
  * Hide from docs
205
199
  */
206
200
  export namespace appEntity {
207
201
  /**
208
202
  * @private
209
203
  * Hide from docs
210
204
  * --------
211
205
  * Information on an app entity
212
206
  */
213
207
  interface AppEntity {
214
208
  /**
215
209
  * App ID of the application
216
210
  */
217
211
  appId: string;
218
212
  /**
219
213
  * URL for the application's icon
220
214
  */
221
215
  appIconUrl: string;
222
216
  /**
223
217
  * Content URL for the app entity
224
218
  */
225
219
  contentUrl: string;
226
220
  /**
227
221
  * The display name for the app entity
228
222
  */
229
223
  displayName: string;
230
224
  /**
231
225
  * Website URL for the app entity. It is meant to be opened by the user in a browser.
232
226
  */
233
227
  websiteUrl: string;
234
228
  }
235
229
  /**
236
230
  * @private
237
231
  * Hide from docs
238
232
  *
239
233
  * Open the Tab Gallery and retrieve the app entity
240
234
  * @param threadId ID of the thread where the app entity will be created
241
235
  * @param categories A list of app categories that will be displayed in the open tab gallery
242
236
  * @param callback Callback that will be triggered once the app entity information is available.
243
237
  * The callback takes two arguments: the app entity configuration, if available and
244
238
  * an optional SdkError in case something happened (i.e. the window was closed)
245
239
  */
246
240
  function selectAppEntity(threadId: string, categories: string[], callback: (appEntity: AppEntity, sdkError?: SdkError) => void): void;
247
241
  }
248
242
  /**
249
243
  * @private
250
244
  * Namespace to interact with bots using the SDK.
251
245
  */
252
246
  export namespace bot {
253
247
  /**
254
248
  * @private
255
249
  * Hide from docs until release.
256
250
  * ------
257
251
  * Sends query to bot in order to retrieve data.
258
252
  * @param botRequest query to send to bot.
259
253
  * @param onSuccess callback to invoke when data is retrieved from bot
260
254
  * @param onError callback to invoke should an error occur
261
255
  */
262
256
  function sendQuery(botRequest: QueryRequest, onSuccess?: (data: QueryResponse) => void, onError?: (error: string) => void): void;
263
257
  /**
264
258
  * @private
265
259
  * Hide from docs until release.
266
260
  * -----
267
261
  * Retrieves list of support commands from bot
268
262
  * @param onSuccess callback to invoke when data is retrieved from bot
269
263
  * @param onError callback to invoke should an error occur
270
264
  */
271
265
  function getSupportedCommands(onSuccess?: (response: Command[]) => void, onError?: (error: string) => void): void;
272
266
  /**
273
267
  * @private
274
268
  * Hide from docs until release.
275
269
  * -----
276
270
  * Authenticates a user for json tab
277
271
  * @param authRequest callback to invoke when data is retrieved from bot
278
272
  * @param onSuccess callback to invoke when user is authenticated
279
273
  * @param onError callback to invoke should an error occur
280
274
  */
281
275
  function authenticate(authRequest: AuthQueryRequest, onSuccess?: (results: Results) => void, onError?: (error: string) => void): void;
282
276
  interface QueryRequest {
283
277
  /**
284
278
  * Query to search for
285
279
  */
286
280
  query: string;
287
281
  commandId?: string;
288
282
  option?: {
289
283
  skip: number;
290
284
  count: number;
291
285
  };
292
286
  }
293
287
  interface QueryResponse {
294
288
  data: Results | Auth;
295
289
  type: ResponseType;
296
290
  }
297
291
  interface Results {
298
292
  attachments: Attachment[];
299
293
  layout: any;
300
294
  botId: string;
301
295
  }
302
296
  interface Auth {
303
297
  url: string;
304
298
  title: string;
305
299
  }
306
300
  interface AuthQueryRequest extends QueryRequest {
307
301
  url: string;
308
302
  }
309
303
  interface Attachment {
310
304
  card: any;
311
305
  previewCard: any;
312
306
  previewRawPayload: any;
313
307
  rawPayload: any;
314
308
  }
315
309
  interface Command {
316
310
  title: string;
317
311
  id: string;
318
312
  initialRun: boolean;
319
313
  }
320
314
  enum ResponseType {
321
315
  Results = "Results",
322
316
  Auth = "Auth"
323
317
  }
324
318
  }
325
319
  /**
326
320
  * Namespace to interact with the conversational subEntities inside the tab
327
321
  */
328
322
  export namespace conversations {
329
323
  /**
330
324
  * @private
331
325
  * Hide from docs
332
326
  * --------------
333
327
  * Allows the user to start or continue a conversation with each subentity inside the tab
334
328
  */
335
329
  function openConversation(openConversationRequest: OpenConversationRequest): void;
336
330
  /**
337
331
  * @private
338
332
  * Hide from docs
339
333
  * --------------
340
334
  * Allows the user to close the conversation in the right pane
341
335
  */
342
336
  function closeConversation(): void;
343
337
  }
344
338
  /**
345
339
  * Namespace to interact with the files specific part of the SDK.
346
340
  *
347
341
  * @private
348
342
  * Hide from docs
349
343
  */
350
344
  export namespace files {
351
345
  /**
352
346
  * @private
353
347
  * Hide from docs
354
348
  *
355
349
  * Cloud storage providers registered with Microsoft Teams
356
350
  */
357
351
  enum CloudStorageProvider {
358
352
  Dropbox = "DROPBOX",
359
353
  Box = "BOX",
360
354
  Sharefile = "SHAREFILE",
361
355
  GoogleDrive = "GOOGLEDRIVE",
362
356
  Egnyte = "EGNYTE"
363
357
  }
364
358
  /**
365
359
  * @private
366
360
  * Hide from docs
367
361
  *
368
362
  * Cloud storage provider integration type
369
363
  */
370
364
  enum CloudStorageProviderType {
371
365
  Sharepoint = 0,
372
366
  WopiIntegration = 1,
373
367
  Google = 2
374
368
  }
375
369
  /**
376
370
  * @private
377
371
  * Hide from docs
378
372
  *
379
373
  * Cloud storage folder interface
380
374
  */
381
375
  interface CloudStorageFolder {
382
376
  /**
383
377
  * ID of the cloud storage folder
384
378
  */
385
379
  id: string;
386
380
  /**
387
381
  * Display Name/Title of the cloud storage folder
388
382
  */
389
383
  title: string;
390
384
  /**
391
385
  * ID of the cloud storage folder in the provider
392
386
  */
393
387
  folderId: string;
394
388
  /**
395
389
  * Type of the cloud storage folder provider integration
396
390
  */
397
391
  providerType: CloudStorageProviderType;
398
392
  /**
399
393
  * Code of the supported cloud storage folder provider
400
394
  */
401
395
  providerCode: CloudStorageProvider;
402
396
  /**
403
397
  * Display name of the owner of the cloud storage folder provider
404
398
  */
405
399
  ownerDisplayName: string;
406
400
  /**
407
401
  * Sharepoint specific siteURL of the folder
408
402
  */
409
403
  siteUrl?: string;
410
404
  /**
411
405
  * Sharepoint specific serverRelativeUrl of the folder
412
406
  */
413
407
  serverRelativeUrl?: string;
414
408
  /**
415
409
  * Sharepoint specific libraryType of the folder
416
410
  */
417
411
  libraryType?: string;
418
412
  /**
419
413
  * Sharepoint specific accessType of the folder
420
414
  */
421
415
  accessType?: string;
422
416
  }
423
417
  /**
424
418
  * @private
425
419
  * Hide from docs
426
420
  *
427
421
  * Cloud storage item interface
428
422
  */
429
423
  interface CloudStorageFolderItem {
430
424
  /**
431
425
  * ID of the item in the provider
432
426
  */
433
427
  id: string;
434
428
  /**
435
429
  * Display name/title
436
430
  */
437
431
  title: string;
438
432
  /**
439
433
  * Key to differentiate files and subdirectory
440
434
  */
441
435
  isSubdirectory: boolean;
442
436
  /**
443
437
  * File extension
444
438
  */
445
439
  type: string;
446
440
  /**
447
441
  * Last modifed time of the item
448
442
  */
449
443
  lastModifiedTime: string;
450
444
  /**
451
445
  * Display size of the items in bytes
452
446
  */
453
447
  size: number;
454
448
  /**
455
449
  * URL of the file
456
450
  */
457
451
  objectUrl: string;
458
452
  /**
459
453
  * Temporary access token for the item
460
454
  */
461
455
  accessToken?: string;
462
456
  }
463
457
  /**
464
458
  * @private
465
459
  * Hide from docs
466
460
  *
467
461
  * Gets a list of cloud storage folders added to the channel
468
462
  * @param channelId ID of the channel whose cloud storage folders should be retrieved
469
463
  * @param callback Callback that will be triggered post folders load
470
464
  */
471
465
  function getCloudStorageFolders(channelId: string, callback: (error: SdkError, folders: CloudStorageFolder[]) => void): void;
472
466
  /**
473
467
  * @private
474
468
  * Hide from docs
475
469
  *
476
470
  * Initiates the add cloud storage folder flow
477
471
  * @param channelId ID of the channel to add cloud storage folder
478
472
  * @param callback Callback that will be triggered post add folder flow is compelete
479
473
  */
480
474
  function addCloudStorageFolder(channelId: string, callback: (error: SdkError, isFolderAdded: boolean, folders: CloudStorageFolder[]) => void): void;
481
475
  /**
482
476
  * @private
483
477
  * Hide from docs
484
478
  *
485
479
  * Deletes a cloud storage folder from channel
486
480
  * @param channelId ID of the channel where folder is to be deleted
487
481
  * @param folderToDelete cloud storage folder to be deleted
488
482
  * @param callback Callback that will be triggered post delete
489
483
  */
490
484
  function deleteCloudStorageFolder(channelId: string, folderToDelete: CloudStorageFolder, callback: (error: SdkError, isFolderDeleted: boolean) => void): void;
491
485
  /**
492
486
  * @private
493
487
  * Hide from docs
494
488
  *
495
489
  * Fetches the contents of a Cloud storage folder (CloudStorageFolder) / sub directory
496
490
  * @param folder Cloud storage folder (CloudStorageFolder) / sub directory (CloudStorageFolderItem)
497
491
  * @param providerCode Code of the cloud storage folder provider
498
492
  * @param callback Callback that will be triggered post contents are loaded
499
493
  */
500
494
  function getCloudStorageFolderContents(folder: CloudStorageFolder | CloudStorageFolderItem, providerCode: CloudStorageProvider, callback: (error: SdkError, items: CloudStorageFolderItem[]) => void): void;
501
495
  /**
502
496
  * @private
503
497
  * Hide from docs
504
498
  *
505
499
  * Open a cloud storage file in teams
506
500
  * @param file cloud storage file that should be opened
507
501
  * @param providerCode Code of the cloud storage folder provider
508
502
  * @param fileOpenPreference Whether file should be opened in web/inline
509
503
  */
510
504
  function openCloudStorageFile(file: CloudStorageFolderItem, providerCode: CloudStorageProvider, fileOpenPreference?: FileOpenPreference.Web | FileOpenPreference.Inline): void;
511
505
  }
512
506
  /**
513
507
  * @private
514
508
  * Hide from docs
515
509
  * --------
516
510
  * Information about all members in a chat
517
511
  */
518
512
  export interface ChatMembersInformation {
519
513
  members: ThreadMember[];
520
514
  }
521
515
  /**
522
516
  * @private
523
517
  * Hide from docs
524
518
  * --------
525
519
  * Information about a chat member
526
520
  */
527
521
  export interface ThreadMember {
528
522
  /**
529
523
  * The member's user principal name in the current tenant.
530
524
  */
531
525
  upn: string;
532
526
  }
533
527
  export enum NotificationTypes {
534
528
  fileDownloadStart = "fileDownloadStart",
535
529
  fileDownloadComplete = "fileDownloadComplete"
536
530
  }
537
531
  export interface ShowNotificationParameters {
538
532
  message: string;
539
533
  notificationType: NotificationTypes;
540
534
  }
541
535
  /**
542
536
  * @private
543
537
  * Hide from docs.
544
538
  * ------
545
539
  */
546
540
  export enum ViewerActionTypes {
547
541
  view = "view",
548
542
  edit = "edit",
549
543
  editNew = "editNew"
550
544
  }
551
545
  /**
552
546
  * * @private
553
547
  * Hide from docs.
554
548
  * ------
555
549
  * User setting changes that can be subscribed to,
556
550
  */
557
551
  export enum UserSettingTypes {
558
552
  /**
559
553
  * Use this key to subscribe to changes in user's file open preference
560
554
  */
561
555
  fileOpenPreference = "fileOpenPreference",
562
556
  /**
563
557
  * Use this key to subscribe to theme changes
564
558
  */
565
559
  theme = "theme"
566
560
  }
567
561
  /**
568
562
  * @private
569
563
  * Hide from docs.
570
564
  * ------
571
565
  */
572
566
  export interface FilePreviewParameters {
573
567
  /**
574
568
  * The developer-defined unique ID for the file.
575
569
  */
576
570
  entityId: string;
577
571
  /**
578
572
  * The display name of the file.
579
573
  */
580
574
  title: string;
581
575
  /**
582
576
  * An optional description of the file.
583
577
  */
584
578
  description?: string;
585
579
  /**
586
580
  * The file extension; e.g. pptx, docx, etc.
587
581
  */
588
582
  type: string;
589
583
  /**
590
584
  * A url to the source of the file, used to open the content in the user's default browser
591
585
  */
592
586
  objectUrl: string;
593
587
  /**
594
588
  * Optional; an alternate self-authenticating url used to preview the file in Mobile clients and offer it for download by the user
595
589
  */
596
590
  downloadUrl?: string;
597
591
  /**
598
592
  * Optional; an alternate url optimized for previewing the file in Teams web and desktop clients
599
593
  */
600
594
  webPreviewUrl?: string;
601
595
  /**
602
596
  * Optional; an alternate url that allows editing of the file in Teams web and desktop clients
603
597
  */
604
598
  webEditUrl?: string;
605
599
  /**
606
600
  * Optional; the base url of the site where the file is hosted
607
601
  */
608
602
  baseUrl?: string;
609
603
  /**
610
604
  * Deprecated; prefer using viewerAction instead
611
605
  * Optional; indicates whether the file should be opened in edit mode
612
606
  */
613
607
  editFile?: boolean;
614
608
  /**
615
609
  * Optional; the developer-defined unique ID for the sub-entity to return to when the file stage closes.
616
610
  * This field should be used to restore to a specific state within an entity, such as scrolling to or activating a specific piece of content.
617
611
  */
618
612
  subEntityId?: string;
619
613
  /**
620
614
  * Optional; indicates the mode in which file should be opened. Takes precedence over edit mode.
621
615
  */
622
616
  viewerAction?: ViewerActionTypes;
623
617
  /**
624
618
  * Optional; indicates how user prefers to open the file
625
619
  */
626
620
  fileOpenPreference?: FileOpenPreference;
627
621
  }
628
622
  /**
629
623
  * @private
630
624
  * Hide from docs
631
625
  * --------
632
626
  * Query parameters used when fetching team information
633
627
  */
634
628
  export interface TeamInstanceParameters {
635
629
  /**
636
630
  * Flag allowing to select favorite teams only
637
631
  */
638
632
  favoriteTeamsOnly?: boolean;
639
633
  }
640
634
  /**
641
635
  * @private
642
636
  * Hide from docs
643
637
  * --------
644
638
  * Information on userJoined Teams
645
639
  */
646
640
  export interface UserJoinedTeamsInformation {
647
641
  /**
648
642
  * List of team information
649
643
  */
650
644
  userJoinedTeams: TeamInformation[];
651
645
  }
652
646
  /**
653
647
  * Namespace to interact with the logging part of the SDK.
654
648
  * This object is used to send the app logs on demand to the host client
655
649
  *
656
650
  * @private
657
651
  * Hide from docs
658
652
  */
659
653
  export namespace logs {
660
654
  /**
661
655
  * @private
662
656
  * Hide from docs
663
657
  * ------
664
658
  * Registers a handler for getting app log
665
659
  * @param handler The handler to invoke to get the app log
666
660
  */
667
661
  function registerGetLogHandler(handler: () => string): void;
668
662
  }
669
663
  export namespace meetingRoom {
670
664
  /**
671
665
  * @private
672
666
  * Hide from docs
673
667
  *
674
668
  * Data structure to represent a meeting room.
675
669
  */
676
670
  interface MeetingRoomInfo {
677
671
  /**
678
672
  * Endpoint id of the meeting room.
679
673
  */
680
674
  endpointId: string;
681
675
  /**
682
676
  * Device name of the meeting room.
683
677
  */
684
678
  deviceName: string;
685
679
  /**
686
680
  * Client type of the meeting room.
687
681
  */
688
682
  clientType: string;
689
683
  /**
690
684
  * Client version of the meeting room.
691
685
  */
692
686
  clientVersion: string;
693
687
  }
694
688
  /**
695
689
  * @private
696
690
  * Hide from docs
697
691
  *
698
692
  * Enum used to indicate meeting room capabilities.
699
693
  */
700
694
  enum Capability {
701
695
  /**
702
696
  * Media control capability: toggle mute.
703
697
  */
704
698
  toggleMute = "toggleMute",
705
699
  /**
706
700
  * Media control capability: toggle camera.
707
701
  */
708
702
  toggleCamera = "toggleCamera",
709
703
  /**
710
704
  * Media control capability: toggle captions.
711
705
  */
712
706
  toggleCaptions = "toggleCaptions",
713
707
  /**
714
708
  * Media control capability: volume ajustion.
715
709
  */
716
710
  volume = "volume",
717
711
  /**
718
712
  * Stage layout control capability: show gallery mode.
719
713
  */
720
714
  showVideoGallery = "showVideoGallery",
721
715
  /**
722
716
  * Stage layout control capability: show content mode.
723
717
  */
724
718
  showContent = "showContent",
725
719
  /**
726
720
  * Stage layout control capability: show content + gallery mode.
727
721
  */
728
722
  showVideoGalleryAndContent = "showVideoGalleryAndContent",
729
723
  /**
730
724
  * Stage layout control capability: show laryge gallery mode.
731
725
  */
732
726
  showLargeGallery = "showLargeGallery",
733
727
  /**
734
728
  * Stage layout control capability: show together mode.
735
729
  */
736
730
  showTogether = "showTogether",
737
731
  /**
738
732
  * Meeting control capability: leave meeting.
739
733
  */
740
734
  leaveMeeting = "leaveMeeting"
741
735
  }
742
736
  /**
743
737
  * @private
744
738
  * Hide from docs
745
739
  *
746
740
  * Data structure to represent capabilities of a meeting room.
747
741
  */
748
742
  interface MeetingRoomCapability {
749
743
  /**
750
744
  * Media control capabilities, value can be "toggleMute", "toggleCamera", "toggleCaptions", "volume".
751
745
  */
752
746
  mediaControls: string[];
753
747
  /**
754
748
  * Main stage layout control capabilities, value can be "showVideoGallery", "showContent", "showVideoGalleryAndContent", "showLargeGallery", "showTogether".
755
749
  */
756
750
  stageLayoutControls: string[];
757
751
  /**
758
752
  * Meeting control capabilities, value can be "leaveMeeting".
759
753
  */
760
754
  meetingControls: string[];
761
755
  }
762
756
  /**
763
757
  * @private
764
758
  * Hide from docs
765
759
  *
766
760
  * Data structure to represent states of a meeting room.
767
761
  */
768
762
  interface MeetingRoomState {
769
763
  /**
770
764
  * Current mute state, true: mute, false: unmute.
771
765
  */
772
766
  toggleMute: boolean;
773
767
  /**
774
768
  * Current camera state, true: camera on, false: camera off.
775
769
  */
776
770
  toggleCamera: boolean;
777
771
  /**
778
772
  * Current captions state, true: captions on, false: captions off.
779
773
  */
780
774
  toggleCaptions: boolean;
781
775
  /**
782
776
  * Current main stage layout state, value can be one of "Gallery", "Content + gallery", "Content", "Large gallery" and "Together mode".
783
777
  */
784
778
  stageLayout: string;
785
779
  /**
786
780
  * Current leaveMeeting state, true: leave, false: no-op.
787
781
  */
788
782
  leaveMeeting: boolean;
789
783
  }
790
784
  /**
791
785
  * @private
792
786
  * Hide from docs
793
787
  *
794
788
  * Fetch the meeting room info that paired with current client.
795
789
  * @param callback Callback to invoke when the meeting room info is fetched.
796
790
  */
797
791
  function getPairedMeetingRoomInfo(callback: (sdkError: SdkError, meetingRoomInfo: MeetingRoomInfo) => void): void;
798
792
  /**
799
793
  * @private
800
794
  * Hide from docs
801
795
  *
802
796
  * Send a command to paired meeting room.
803
797
  * @param commandName The command name.
804
798
  * @param callback Callback to invoke when the command response returns.
805
799
  */
806
800
  function sendCommandToPairedMeetingRoom(commandName: string, callback: (sdkError: SdkError) => void): void;
807
801
  /**
808
802
  * @private
809
803
  * Hide from docs
810
804
  *
811
805
  * Registers a handler for meeting room capabilities update.
812
806
  * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
813
807
  * @param handler The handler to invoke when the capabilities of meeting room update.
814
808
  */
815
809
  function registerMeetingRoomCapabilitiesUpdateHandler(handler: (capabilities: MeetingRoomCapability) => void): void;
816
810
  /**
817
811
  * @private
818
812
  * Hide from docs
819
813
  * Registers a handler for meeting room states update.
820
814
  * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
821
815
  * @param handler The handler to invoke when the states of meeting room update.
822
816
  */
823
817
  function registerMeetingRoomStatesUpdateHandler(handler: (states: MeetingRoomState) => void): void;
824
818
  }
825
819
  /**
826
820
  * Namespace to interact with the menu-specific part of the SDK.
827
821
  * This object is used to show View Configuration, Action Menu and Navigation Bar Menu.
828
822
  *
829
823
  * @private
830
824
  * Hide from docs until feature is complete
831
825
  */
832
826
  export namespace menus {
833
827
  /**
834
828
  * Represents information about item in View Configuration.
835
829
  */
836
830
  interface ViewConfiguration {
837
831
  /**
838
832
  * Unique identifier of view.
839
833
  */
840
834
  id: string;
841
835
  /**
842
836
  * Display title of the view.
843
837
  */
844
838
  title: string;
845
839
  /**
846
840
  * Additional information for accessibility.
847
841
  */
848
842
  contentDescription?: string;
849
843
  }
850
844
  /**
851
845
  * Represents information about menu item for Action Menu and Navigation Bar Menu.
852
846
  */
853
847
  class MenuItem {
854
848
  /**
855
849
  * Unique identifier for the menu item.
856
850
  */
857
851
  id: string;
858
852
  /**
859
853
  * Display title of the menu item.
860
854
  */
861
855
  title: string;
862
856
  /**
863
857
  * Display icon of the menu item. The icon value must be a string having SVG icon content.
864
858
  */
865
859
  icon: string;
866
860
  /**
867
861
  * Selected state display icon of the menu item. The icon value must be a string having SVG icon content.
868
862
  */
869
863
  iconSelected?: string;
870
864
  /**
871
865
  * Additional information for accessibility.
872
866
  */
873
867
  contentDescription?: string;
874
868
  /**
875
869
  * State of the menu item
876
870
  */
877
871
  enabled: boolean;
878
872
  /**
879
873
  * Interface to show list of items on selection of menu item.
880
874
  */
881
875
  viewData: ViewData;
882
876
  /**
883
877
  * Whether the menu item is selected or not
884
878
  */
885
879
  selected: boolean;
886
880
  }
887
881
  /**
888
882
  * Represents information about view to show on Navigation Bar Menu item selection
889
883
  */
890
884
  interface ViewData {
891
885
  /**
892
886
  * Display header title of the item list.
893
887
  */
894
888
  listTitle?: string;
895
889
  /**
896
890
  * Type of the menu item.
897
891
  */
898
892
  listType: MenuListType;
899
893
  /**
900
894
  * Array of MenuItem. Icon value will be required for all items in the list.
901
895
  */
902
896
  listItems: MenuItem[];
903
897
  }
904
898
  /**
905
899
  * Represents information about type of list to display in Navigation Bar Menu.
906
900
  */
907
901
  enum MenuListType {
908
902
  dropDown = "dropDown",
909
903
  popOver = "popOver"
910
904
  }
911
905
  function initialize(): void;
912
906
  /**
913
907
  * Registers list of view configurations and it's handler.
914
908
  * Handler is responsible for listening selection of View Configuration.
915
909
  * @param viewConfig List of view configurations. Minimum 1 value is required.
916
910
  * @param handler The handler to invoke when the user selects view configuration.
917
911
  */
918
912
  function setUpViews(viewConfig: ViewConfiguration[], handler: (id: string) => boolean): void;
919
913
  /**
920
914
  * Used to set menu items on the Navigation Bar. If icon is available, icon will be shown, otherwise title will be shown.
921
915
  * @param items List of MenuItems for Navigation Bar Menu.
922
916
  * @param handler The handler to invoke when the user selects menu item.
923
917
  */
924
918
  function setNavBarMenu(items: MenuItem[], handler: (id: string) => boolean): void;
925
919
  interface ActionMenuParameters {
926
920
  /**
927
921
  * Display title for Action Menu
928
922
  */
929
923
  title: string;
930
924
  /**
931
925
  * List of MenuItems for Action Menu
932
926
  */
933
927
  items: MenuItem[];
934
928
  }
935
929
  /**
936
930
  * Used to show Action Menu.
937
931
  * @param params Parameters for Menu Parameters
938
932
  * @param handler The handler to invoke when the user selects menu item.
939
933
  */
940
934
  function showActionMenu(params: ActionMenuParameters, handler: (id: string) => boolean): void;
941
935
  }
942
936
  export function initializePrivateApis(): void;
943
937
  /**
944
938
  * @private
945
939
  * Hide from docs
946
940
  * ------
947
941
  * Allows an app to retrieve information of all user joined teams
948
942
  * @param callback The callback to invoke when the {@link TeamInstanceParameters} object is retrieved.
949
943
  * @param teamInstanceParameters OPTIONAL Flags that specify whether to scope call to favorite teams
950
944
  */
951
945
  export function getUserJoinedTeams(callback: (userJoinedTeamsInformation: UserJoinedTeamsInformation) => void, teamInstanceParameters?: TeamInstanceParameters): void;
952
946
  /**
953
947
  * @private
954
948
  * Hide from docs
955
949
  * ------
956
950
  * Place the tab into full-screen mode.
957
951
  */
958
952
  export function enterFullscreen(): void;
959
953
  /**
960
954
  * @private
961
955
  * Hide from docs
962
956
  * ------
963
957
  * Reverts the tab into normal-screen mode.
964
958
  */
965
959
  export function exitFullscreen(): void;
966
960
  /**
967
961
  * @private
968
962
  * Hide from docs.
969
963
  * ------
970
964
  * Opens a client-friendly preview of the specified file.
971
965
  * @param file The file to preview.
972
966
  */
973
967
  export function openFilePreview(filePreviewParameters: FilePreviewParameters): void;
974
968
  /**
975
969
  * @private
976
970
  * Hide from docs.
977
971
  * ------
978
972
  * display notification API.
979
973
  * @param message Notification message.
980
974
  * @param notificationType Notification type
981
975
  */
982
976
  export function showNotification(showNotificationParameters: ShowNotificationParameters): void;
983
977
  /**
984
978
  * @private
985
979
  * Hide from docs.
986
980
  * ------
987
981
  * Upload a custom App manifest directly to both team and personal scopes.
988
982
  * This method works just for the first party Apps.
989
983
  */
990
984
  export function uploadCustomApp(manifestBlob: Blob, onComplete?: (status: boolean, reason?: string) => void): void;
991
985
  /**
992
986
  * @private
993
987
  * Internal use only
994
988
  * Sends a custom action MessageRequest to Teams or parent window
995
989
  * @param actionName Specifies name of the custom action to be sent
996
990
  * @param args Specifies additional arguments passed to the action
997
991
  * @param callback Optionally specify a callback to receive response parameters from the parent
998
992
  * @returns id of sent message
999
993
  */
1000
994
  export function sendCustomMessage(actionName: string, args?: any[], callback?: (...args: any[]) => void): void;
1001
995
  /**
1002
996
  * @private
1003
997
  * Internal use only
1004
998
  * Sends a custom action MessageEvent to a child iframe/window, only if you are not using auth popup.
1005
999
  * Otherwise it will go to the auth popup (which becomes the child)
1006
1000
  * @param actionName Specifies name of the custom action to be sent
1007
1001
  * @param args Specifies additional arguments passed to the action
1008
1002
  * @returns id of sent message
1009
1003
  */
1010
1004
  export function sendCustomEvent(actionName: string, args?: any[]): void;
1011
1005
  /**
1012
1006
  * @private
1013
1007
  * Internal use only
1014
1008
  * Adds a handler for an action sent by a child window or parent window
1015
1009
  * @param actionName Specifies name of the action message to handle
1016
1010
  * @param customHandler The callback to invoke when the action message is received. The return value is sent to the child
1017
1011
  */
1018
1012
  export function registerCustomHandler(actionName: string, customHandler: (...args: any[]) => any[]): void;
1019
1013
  /**
1020
1014
  * @private
1021
1015
  * Hide from docs
1022
1016
  * ------
1023
1017
  * Allows an app to retrieve information of all chat members
1024
1018
  * Because a malicious party run your content in a browser, this value should
1025
1019
  * be used only as a hint as to who the members are and never as proof of membership.
1026
1020
  * @param callback The callback to invoke when the {@link ChatMembersInformation} object is retrieved.
1027
1021
  */
1028
1022
  export function getChatMembers(callback: (chatMembersInformation: ChatMembersInformation) => void): void;
1029
1023
  /**
1030
1024
  * @private
1031
1025
  * Hide from docs
1032
1026
  * ------
1033
1027
  * Allows an app to get the configuration setting value
1034
1028
  * @param callback The callback to invoke when the value is retrieved.
1035
1029
  * @param key The key for the config setting
1036
1030
  */
1037
1031
  export function getConfigSetting(callback: (value: string) => void, key: string): void;
1038
1032
  /**
1039
1033
  * @private
1040
1034
  * register a handler to be called when a user setting changes. The changed setting type & value is provided in the callback.
1041
1035
  * @param settingTypes List of user setting changes to subscribe
1042
1036
  * @param handler When a subscribed setting is updated this handler is called
1043
1037
  */
1044
1038
  export function registerUserSettingsChangeHandler(settingTypes: UserSettingTypes[], handler: (settingType: UserSettingTypes, value: any) => void): void;
1045
1039
  export namespace remoteCamera {
1046
1040
  /**
1047
1041
  * @private
1048
1042
  * Hide from docs
1049
1043
  *
1050
1044
  * Data structure to represent patricipant details needed to request control of camera.
1051
1045
  */
1052
1046
  interface Participant {
1053
1047
  /**
1054
1048
  * Id of participant.
1055
1049
  */
1056
1050
  id: string;
1057
1051
  /**
1058
1052
  * Display name of participant.
1059
1053
  */
1060
1054
  displayName?: string;
1061
1055
  /**
1062
1056
  * Active indicates whether the participant's device is actively being controlled.
1063
1057
  */
1064
1058
  active?: boolean;
1065
1059
  }
1066
1060
  /**
1067
1061
  * @private
1068
1062
  * Hide from docs
1069
1063
  *
1070
1064
  * Enum used to indicate possible camera control commands.
1071
1065
  */
1072
1066
  enum ControlCommand {
1073
1067
  Reset = "Reset",
1074
1068
  ZoomIn = "ZoomIn",
1075
1069
  ZoomOut = "ZoomOut",
1076
1070
  PanLeft = "PanLeft",
1077
1071
  PanRight = "PanRight",
1078
1072
  TiltUp = "TiltUp",
1079
1073
  TiltDown = "TiltDown"
1080
1074
  }
1081
1075
  /**
1082
1076
  * @private
1083
1077
  * Hide from docs
1084
1078
  *
1085
1079
  * Data structure to indicate the current state of the device.
1086
1080
  */
1087
1081
  interface DeviceState {
1088
1082
  /**
1089
1083
  * All operation are available to apply.
1090
1084
  */
1091
1085
  available: boolean;
1092
1086
  /**
1093
1087
  * Either camera doesnt support to get state or It unable to apply command.
1094
1088
  */
1095
1089
  error: boolean;
1096
1090
  /**
1097
1091
  * Reset max out or already applied. Client Disable Reset.
1098
1092
  */
1099
1093
  reset: boolean;
1100
1094
  /**
1101
1095
  * ZoomIn maxed out.
1102
1096
  */
1103
1097
  zoomIn: boolean;
1104
1098
  /**
1105
1099
  * ZoomOut maxed out.
1106
1100
  */
1107
1101
  zoomOut: boolean;
1108
1102
  /**
1109
1103
  * PanLeft reached max left.
1110
1104
  */
1111
1105
  panLeft: boolean;
1112
1106
  /**
1113
1107
  * PanRight reached max right.
1114
1108
  */
1115
1109
  panRight: boolean;
1116
1110
  /**
1117
1111
  * TiltUp reached top.
1118
1112
  */
1119
1113
  tiltUp: boolean;
1120
1114
  /**
1121
1115
  * TiltDown reached bottom.
1122
1116
  */
1123
1117
  tiltDown: boolean;
1124
1118
  }
1125
1119
  /**
1126
1120
  * @private
1127
1121
  * Hide from docs
1128
1122
  *
1129
1123
  * Enum used to indicate the reason for the error.
1130
1124
  */
1131
1125
  enum ErrorReason {
1132
1126
  CommandResetError = 0,
1133
1127
  CommandZoomInError = 1,
1134
1128
  CommandZoomOutError = 2,
1135
1129
  CommandPanLeftError = 3,
1136
1130
  CommandPanRightError = 4,
1137
1131
  CommandTiltUpError = 5,
1138
1132
  CommandTiltDownError = 6,
1139
1133
  SendDataError = 7
1140
1134
  }
1141
1135
  /**
1142
1136
  * @private
1143
1137
  * Hide from docs
1144
1138
  *
1145
1139
  * Data structure to indicate the status of the current session.
1146
1140
  */
1147
1141
  interface SessionStatus {
1148
1142
  /**
1149
1143
  * Whether the far-end user is controlling a device.
1150
1144
  */
1151
1145
  inControl: boolean;
1152
1146
  /**
1153
1147
  * Reason the control session was terminated.
1154
1148
  */
1155
1149
  terminatedReason?: SessionTerminatedReason;
1156
1150
  }
1157
1151
  /**
1158
1152
  * @private
1159
1153
  * Hide from docs
1160
1154
  *
1161
1155
  * Enum used to indicate the reason the session was terminated.
1162
1156
  */
1163
1157
  enum SessionTerminatedReason {
1164
1158
  None = 0,
1165
1159
  ControlDenied = 1,
1166
1160
  ControlNoResponse = 2,
1167
1161
  ControlBusy = 3,
1168
1162
  AckTimeout = 4,
1169
1163
  ControlTerminated = 5,
1170
1164
  ControllerTerminated = 6,
1171
1165
  DataChannelError = 7,
1172
1166
  ControllerCancelled = 8,
1173
1167
  ControlDisabled = 9
1174
1168
  }
1175
1169
  /**
1176
1170
  * @private
1177
1171
  * Hide from docs
1178
1172
  *
1179
1173
  * Fetch a list of the participants with controllable-cameras in a meeting.
1180
1174
  * @param callback Callback contains 2 parameters, error and participants.
1181
1175
  * error can either contain an error of type SdkError, incase of an error, or null when fetch is successful
1182
1176
  * participants can either contain an array of Participant objects, incase of a successful fetch or null when it fails
1183
1177
  * participants: object that contains an array of participants with controllable-cameras
1184
1178
  */
1185
1179
  function getCapableParticipants(callback: (error: SdkError | null, participants: Participant[] | null) => void): void;
1186
1180
  /**
1187
1181
  * @private
1188
1182
  * Hide from docs
1189
1183
  *
1190
1184
  * Request control of a participant's camera.
1191
1185
  * @param participant Participant specifies the participant to send the request for camera control.
1192
1186
  * @param callback Callback contains 2 parameters, error and requestResponse.
1193
1187
  * error can either contain an error of type SdkError, incase of an error, or null when fetch is successful
1194
1188
  * requestResponse can either contain the true/false value, incase of a successful request or null when it fails
1195
1189
  * requestResponse: True means request was accepted and false means request was denied
1196
1190
  */
1197
1191
  function requestControl(participant: Participant, callback: (error: SdkError | null, requestResponse: boolean | null) => void): void;
1198
1192
  /**
1199
1193
  * @private
1200
1194
  * Hide from docs
1201
1195
  *
1202
1196
  * Send control command to the participant's camera.
1203
1197
  * @param ControlCommand ControlCommand specifies the command for controling the camera.
1204
1198
  * @param callback Callback to invoke when the command response returns.
1205
1199
  */
1206
1200
  function sendControlCommand(ControlCommand: ControlCommand, callback: (error: SdkError | null) => void): void;
1207
1201
  /**
1208
1202
  * @private
1209
1203
  * Hide from docs
1210
1204
  *
1211
1205
  * Terminate the remote session
1212
1206
  * @param callback Callback to invoke when the command response returns.
1213
1207
  */
1214
1208
  function terminateSession(callback: (error: SdkError | null) => void): void;
1215
1209
  /**
1216
1210
  * Registers a handler for change in participants with controllable-cameras.
1217
1211
  * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
1218
1212
  * @param handler The handler to invoke when the list of participants with controllable-cameras changes.
1219
1213
  */
1220
1214
  function registerOnCapableParticipantsChangeHandler(handler: (participantChange: Participant[]) => void): void;
1221
1215
  /**
1222
1216
  * Registers a handler for error.
1223
1217
  * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
1224
1218
  * @param handler The handler to invoke when there is an error from the camera handler.
1225
1219
  */
1226
1220
  function registerOnErrorHandler(handler: (error: ErrorReason) => void): void;
1227
1221
  /**
1228
1222
  * Registers a handler for device state change.
1229
1223
  * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
1230
1224
  * @param handler The handler to invoke when the controlled device changes state.
1231
1225
  */
1232
1226
  function registerOnDeviceStateChangeHandler(handler: (deviceStateChange: DeviceState) => void): void;
1233
1227
  /**
1234
1228
  * Registers a handler for session status change.
1235
1229
  * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
1236
1230
  * @param handler The handler to invoke when the current session status changes.
1237
1231
  */
1238
1232
  function registerOnSessionStatusChangeHandler(handler: (sessionStatusChange: SessionStatus) => void): void;
1239
1233
  }
1240
1234
  export namespace appInitialization {
1241
1235
  const Messages: {
1242
1236
  AppLoaded: string;
1243
1237
  Success: string;
1244
1238
  Failure: string;
1245
1239
  ExpectedFailure: string;
1246
1240
  };
1247
1241
  enum FailedReason {
1248
1242
  AuthFailed = "AuthFailed",
1249
1243
  Timeout = "Timeout",
1250
1244
  Other = "Other"
1251
1245
  }
1252
1246
  enum ExpectedFailureReason {
1253
1247
  PermissionError = "PermissionError",
1254
1248
  NotFound = "NotFound",
1255
1249
  Throttling = "Throttling",
1256
1250
  Offline = "Offline",
1257
1251
  Other = "Other"
1258
1252
  }
1259
1253
  interface IFailedRequest {
1260
1254
  reason: FailedReason;
1261
1255
  message?: string;
1262
1256
  }
1263
1257
  interface IExpectedFailureRequest {
1264
1258
  reason: ExpectedFailureReason;
1265
1259
  message?: string;
1266
1260
  }
1267
1261
  /**
1268
1262
  * Notifies the frame that app has loaded and to hide the loading indicator if one is shown.
1269
1263
  */
1270
1264
  function notifyAppLoaded(): void;
1271
1265
  /**
1272
1266
  * Notifies the frame that app initialization is successful and is ready for user interaction.
1273
1267
  */
1274
1268
  function notifySuccess(): void;
1275
1269
  /**
1276
1270
  * Notifies the frame that app initialization has failed and to show an error page in its place.
1277
1271
  */
1278
1272
  function notifyFailure(appInitializationFailedRequest: IFailedRequest): void;
1279
1273
  /**
1280
1274
  * Notifies the frame that app initialized with some expected errors.
1281
1275
  */
1282
1276
  function notifyExpectedFailure(expectedFailureRequest: IExpectedFailureRequest): void;
1283
1277
  }
1284
1278
  export interface IAppWindow {
1285
1279
  postMessage(message: any): void;
1286
1280
  addEventListener(type: string, listener: Function): void;
1287
1281
  }
1288
1282
  export class ChildAppWindow implements IAppWindow {
1289
1283
  postMessage(message: any, onComplete?: (status: boolean, reason?: string) => void): void;
1290
1284
  addEventListener(type: string, listener: (message: any) => void): void;
1291
1285
  }
1292
1286
  export class ParentAppWindow implements IAppWindow {
1293
1287
  private static _instance;
1294
1288
  static readonly Instance: IAppWindow;
1295
1289
  postMessage(message: any, onComplete?: (status: boolean, reason?: string) => void): void;
1296
1290
  addEventListener(type: string, listener: (message: any) => void): void;
1297
1291
  }
1298
1292
  /**
1299
1293
  * Namespace to interact with the authentication-specific part of the SDK.
1300
1294
  * This object is used for starting or completing authentication flows.
1301
1295
  */
1302
1296
  export namespace authentication {
1303
1297
  function initialize(): void;
1304
1298
  /**
1305
1299
  * Registers the authentication Communication.handlers
1306
1300
  * @param authenticateParameters A set of values that configure the authentication pop-up.
1307
1301
  */
1308
1302
  function registerAuthenticationHandlers(authenticateParameters: AuthenticateParameters): void;
1309
1303
  /**
1310
1304
  * Initiates an authentication request, which opens a new window with the specified settings.
1311
1305
  */
1312
1306
  function authenticate(authenticateParameters?: AuthenticateParameters): void;
1313
1307
  /**
1314
1308
  * Requests an Azure AD token to be issued on behalf of the app. The token is acquired from the cache
1315
1309
  * if it is not expired. Otherwise a request is sent to Azure AD to obtain a new token.
1316
1310
  * @param authTokenRequest A set of values that configure the token request.
1317
1311
  */
1318
1312
  function getAuthToken(authTokenRequest: AuthTokenRequest): void;
1319
1313
  /**
1320
1314
  * @private
1321
1315
  * Hide from docs.
1322
1316
  * ------
1323
1317
  * Requests the decoded Azure AD user identity on behalf of the app.
1324
1318
  */
1325
1319
  function getUser(userRequest: UserRequest): void;
1326
1320
  /**
1327
1321
  * Notifies the frame that initiated this authentication request that the request was successful.
1328
1322
  * This function is usable only on the authentication window.
1329
1323
  * This call causes the authentication window to be closed.
1330
1324
  * @param result Specifies a result for the authentication. If specified, the frame that initiated the authentication pop-up receives this value in its callback.
1331
1325
  * @param callbackUrl Specifies the url to redirect back to if the client is Win32 Outlook.
1332
1326
  */
1333
1327
  function notifySuccess(result?: string, callbackUrl?: string): void;
1334
1328
  /**
1335
1329
  * Notifies the frame that initiated this authentication request that the request failed.
1336
1330
  * This function is usable only on the authentication window.
1337
1331
  * This call causes the authentication window to be closed.
1338
1332
  * @param result Specifies a result for the authentication. If specified, the frame that initiated the authentication pop-up receives this value in its callback.
1339
1333
  * @param callbackUrl Specifies the url to redirect back to if the client is Win32 Outlook.
1340
1334
  */
1341
1335
  function notifyFailure(reason?: string, callbackUrl?: string): void;
1342
1336
  interface AuthenticateParameters {
1343
1337
  /**
1344
1338
  * The URL for the authentication pop-up.
1345
1339
  */
1346
1340
  url: string;
1347
1341
  /**
1348
1342
  * The preferred width for the pop-up. This value can be ignored if outside the acceptable bounds.
1349
1343
  */
1350
1344
  width?: number;
1351
1345
  /**
1352
1346
  * The preferred height for the pop-up. This value can be ignored if outside the acceptable bounds.
1353
1347
  */
1354
1348
  height?: number;
1355
1349
  /**
1356
1350
  * A function that is called if the authentication succeeds, with the result returned from the authentication pop-up.
1357
1351
  */
1358
1352
  successCallback?: (result?: string) => void;
1359
1353
  /**
1360
1354
  * A function that is called if the authentication fails, with the reason for the failure returned from the authentication pop-up.
1361
1355
  */
1362
1356
  failureCallback?: (reason?: string) => void;
1363
1357
  }
1364
1358
  interface AuthTokenRequest {
1365
1359
  /**
1366
1360
  * An optional list of resource for which to acquire the access token; only used for full trust apps.
1367
1361
  */
1368
1362
  resources?: string[];
1369
1363
  /**
1370
1364
  * An optional list of claims which to pass to AAD when requesting the access token.
1371
1365
  */
1372
1366
  claims?: string[];
1373
1367
  /**
1374
1368
  * An optional flag indicating whether to attempt the token acquisition silently or allow a prompt to be shown.
1375
1369
  */
1376
1370
  silent?: boolean;
1377
1371
  /**
1378
1372
  * A function that is called if the token request succeeds, with the resulting token.
1379
1373
  */
1380
1374
  successCallback?: (token: string) => void;
1381
1375
  /**
1382
1376
  * A function that is called if the token request fails, with the reason for the failure.
1383
1377
  */
1384
1378
  failureCallback?: (reason: string) => void;
1385
1379
  }
1386
1380
  /**
1387
1381
  * @private
1388
1382
  * Hide from docs.
1389
1383
  * ------
1390
1384
  */
1391
1385
  interface UserRequest {
1392
1386
  /**
1393
1387
  * A function that is called if the token request succeeds, with the resulting token.
1394
1388
  */
1395
1389
  successCallback?: (user: UserProfile) => void;
1396
1390
  /**
1397
1391
  * A function that is called if the token request fails, with the reason for the failure.
1398
1392
  */
1399
1393
  failureCallback?: (reason: string) => void;
1400
1394
  }
1401
1395
  /**
1402
1396
  * @private
1403
1397
  * Hide from docs.
1404
1398
  * ------
1405
1399
  */
1406
1400
  interface UserProfile {
1407
1401
  /**
1408
1402
  * The intended recipient of the token. The application that receives the token must verify that the audience
1409
1403
  * value is correct and reject any tokens intended for a different audience.
1410
1404
  */
1411
1405
  aud: string;
1412
1406
  /**
1413
1407
  * Identifies how the subject of the token was authenticated.
1414
1408
  */
1415
1409
  amr: string[];
1416
1410
  /**
1417
1411
  * Stores the time at which the token was issued. It is often used to measure token freshness.
1418
1412
  */
1419
1413
  iat: number;
1420
1414
  /**
1421
1415
  * Identifies the security token service (STS) that constructs and returns the token. In the tokens that Azure AD
1422
1416
  * returns, the issuer is sts.windows.net. The GUID in the issuer claim value is the tenant ID of the Azure AD
1423
1417
  * directory. The tenant ID is an immutable and reliable identifier of the directory.
1424
1418
  */
1425
1419
  iss: string;
1426
1420
  /**
1427
1421
  * Provides the last name, surname, or family name of the user as defined in the Azure AD user object.
1428
1422
  */
1429
1423
  family_name: string;
1430
1424
  /**
1431
1425
  * Provides the first or "given" name of the user, as set on the Azure AD user object.
1432
1426
  */
1433
1427
  given_name: string;
1434
1428
  /**
1435
1429
  * Provides a human-readable value that identifies the subject of the token. This value is not guaranteed to
1436
1430
  * be unique within a tenant and is designed to be used only for display purposes.
1437
1431
  */
1438
1432
  unique_name: string;
1439
1433
  /**
1440
1434
  * Contains a unique identifier of an object in Azure AD. This value is immutable and cannot be reassigned or
1441
1435
  * reused. Use the object ID to identify an object in queries to Azure AD.
1442
1436
  */
1443
1437
  oid: string;
1444
1438
  /**
1445
1439
  * Identifies the principal about which the token asserts information, such as the user of an application.
1446
1440
  * This value is immutable and cannot be reassigned or reused, so it can be used to perform authorization
1447
1441
  * checks safely. Because the subject is always present in the tokens the Azure AD issues, we recommended
1448
1442
  * using this value in a general-purpose authorization system.
1449
1443
  */
1450
1444
  sub: string;
1451
1445
  /**
1452
1446
  * An immutable, non-reusable identifier that identifies the directory tenant that issued the token. You can
1453
1447
  * use this value to access tenant-specific directory resources in a multitenant application. For example,
1454
1448
  * you can use this value to identify the tenant in a call to the Graph API.
1455
1449
  */
1456
1450
  tid: string;
1457
1451
  /**
1458
1452
  * Defines the time interval within which a token is valid. The service that validates the token should verify
1459
1453
  * that the current date is within the token lifetime; otherwise it should reject the token. The service might
1460
1454
  * allow for up to five minutes beyond the token lifetime to account for any differences in clock time ("time
1461
1455
  * skew") between Azure AD and the service.
1462
1456
  */
1463
1457
  exp: number;
1464
1458
  nbf: number;
1465
1459
  /**
1466
1460
  * Stores the user name of the user principal.
1467
1461
  */
1468
1462
  upn: string;
1469
1463
  /**
1470
1464
  * Stores the version number of the token.
1471
1465
  */
1472
1466
  ver: string;
1473
1467
  }
1474
1468
  }
1475
1469
  export enum HostClientType {
1476
1470
  desktop = "desktop",
1477
1471
  web = "web",
1478
1472
  android = "android",
1479
1473
  ios = "ios",
1480
1474
  rigel = "rigel",
1481
1475
  surfaceHub = "surfaceHub"
1482
1476
  }
1483
1477
  export enum FrameContexts {
1484
1478
  settings = "settings",
1485
1479
  content = "content",
1486
1480
  authentication = "authentication",
1487
1481
  remove = "remove",
1488
1482
  task = "task",
1489
1483
  sidePanel = "sidePanel",
1490
1484
  stage = "stage",
1491
1485
  meetingStage = "meetingStage"
1492
1486
  }
1493
1487
  /**
1494
1488
  * Indicates the team type, currently used to distinguish between different team
1495
1489
  * types in Office 365 for Education (team types 1, 2, 3, and 4).
1496
1490
  */
1497
1491
  export enum TeamType {
1498
1492
  Standard = 0,
1499
1493
  Edu = 1,
1500
1494
  Class = 2,
1501
1495
  Plc = 3,
1502
1496
  Staff = 4
1503
1497
  }
1504
1498
  /**
1505
1499
  * Indicates the various types of roles of a user in a team.
1506
1500
  */
1507
1501
  export enum UserTeamRole {
1508
1502
  Admin = 0,
1509
1503
  User = 1,
1510
1504
  Guest = 2
1511
1505
  }
1512
1506
  /**
1513
1507
  * Task module dimension enum
1514
1508
  */
1515
1509
  export enum TaskModuleDimension {
1516
1510
  Large = "large",
1517
1511
  Medium = "medium",
1518
1512
  Small = "small"
1519
1513
  }
1520
1514
  /**
1521
1515
  * The type of the channel with which the content is associated.
1522
1516
  */
1523
1517
  export enum ChannelType {
1524
1518
  Regular = "Regular",
1525
1519
  Private = "Private",
1526
1520
  Shared = "Shared"
1527
1521
  }
1528
1522
  /**
1529
1523
  * Represents information about tabs for an app
1530
1524
  */
1531
1525
  export interface TabInformation {
1532
1526
  teamTabs: TabInstance[];
1533
1527
  }
1534
1528
  /**
1535
1529
  * Represents information about a tab instance
1536
1530
  */
1537
1531
  export interface TabInstance {
1538
1532
  /**
1539
1533
  * The name of the tab
1540
1534
  */
1541
1535
  tabName: string;
1542
1536
  /**
1543
1537
  * Internal: do not use
1544
1538
  * @protected
1545
1539
  */
1546
1540
  internalTabInstanceId?: string;
1547
1541
  /**
1548
1542
  * Last viewed time of this tab. null means unknown
1549
1543
  */
1550
1544
  lastViewUnixEpochTime?: string;
1551
1545
  /**
1552
1546
  * The developer-defined unique ID for the entity this content points to.
1553
1547
  */
1554
1548
  entityId?: string;
1555
1549
  /**
1556
1550
  * The Microsoft Teams ID for the channel with which the content is associated.
1557
1551
  */
1558
1552
  channelId?: string;
1559
1553
  /**
1560
1554
  * The name for the channel with which the content is associated.
1561
1555
  */
1562
1556
  channelName?: string;
1563
1557
  /**
1564
1558
  * Is this tab in a favorite channel?
1565
1559
  */
1566
1560
  channelIsFavorite?: boolean;
1567
1561
  /**
1568
1562
  * The Microsoft Teams ID for the team with which the content is associated.
1569
1563
  */
1570
1564
  teamId?: string;
1571
1565
  /**
1572
1566
  * The name for the team with which the content is associated.
1573
1567
  */
1574
1568
  teamName?: string;
1575
1569
  /**
1576
1570
  * Is this tab in a favorite team?
1577
1571
  */
1578
1572
  teamIsFavorite?: boolean;
1579
1573
  /**
1580
1574
  * The Office 365 group ID for the team with which the content is associated.
1581
1575
  * This field is available only when the identity permission is requested in the manifest.
1582
1576
  */
1583
1577
  groupId?: string;
1584
1578
  /**
1585
1579
  * Content URL of this tab
1586
1580
  */
1587
1581
  url?: string;
1588
1582
  /**
1589
1583
  * Website URL of this tab
1590
1584
  */
1591
1585
  websiteUrl?: string;
1592
1586
  }
1593
1587
  /**
1594
1588
  * Indicates information about the tab instance for filtering purposes.
1595
1589
  */
1596
1590
  export interface TabInstanceParameters {
1597
1591
  /**
1598
1592
  * Flag allowing to select favorite channels only
1599
1593
  */
1600
1594
  favoriteChannelsOnly?: boolean;
1601
1595
  /**
1602
1596
  * Flag allowing to select favorite teams only
1603
1597
  */
1604
1598
  favoriteTeamsOnly?: boolean;
1605
1599
  }
1606
1600
  /**
1607
1601
  * Represents Team Information
1608
1602
  */
1609
1603
  export interface TeamInformation {
1610
1604
  /**
1611
1605
  * Id of the team
1612
1606
  */
1613
1607
  teamId: string;
1614
1608
  /**
1615
1609
  * Team display name
1616
1610
  */
1617
1611
  teamName: string;
1618
1612
  /**
1619
1613
  * Team description
1620
1614
  */
1621
1615
  teamDescription?: string;
1622
1616
  /**
1623
1617
  * Thumbnail Uri
1624
1618
  */
1625
1619
  thumbnailUri?: string;
1626
1620
  /**
1627
1621
  * The Office 365 group ID for the team with which the content is associated.
1628
1622
  * This field is available only when the identity permission is requested in the manifest.
1629
1623
  */
1630
1624
  groupId?: string;
1631
1625
  /**
1632
1626
  * Role of current user in the team
1633
1627
  */
1634
1628
  userTeamRole?: UserTeamRole;
1635
1629
  /**
1636
1630
  * The type of the team.
1637
1631
  */
1638
1632
  teamType?: TeamType;
1639
1633
  /**
1640
1634
  * The locked status of the team
1641
1635
  */
1642
1636
  isTeamLocked?: boolean;
1643
1637
  /**
1644
1638
  * The archived status of the team
1645
1639
  */
1646
1640
  isTeamArchived?: boolean;
1647
1641
  }
1648
1642
  /**
1649
1643
  * Represents OS locale info used for formatting date and time data
1650
1644
  */
1651
1645
  export interface LocaleInfo {
1652
1646
  platform: 'windows' | 'macos';
1653
1647
  regionalFormat: string;
1654
1648
  shortDate: string;
1655
1649
  longDate: string;
1656
1650
  shortTime: string;
1657
1651
  longTime: string;
1658
1652
  }
1659
1653
  /**
1660
1654
  * Allowed user file open preferences
1661
1655
  */
1662
1656
  export enum FileOpenPreference {
1663
1657
  Inline = "inline",
1664
1658
  Desktop = "desktop",
1665
1659
  Web = "web"
1666
1660
  }
1667
1661
  export interface Context {
1668
1662
  /**
1669
1663
  * The Office 365 group ID for the team with which the content is associated.
1670
1664
  * This field is available only when the identity permission is requested in the manifest.
1671
1665
  */
1672
1666
  groupId?: string;
1673
1667
  /**
1674
1668
  * The Microsoft Teams ID for the team with which the content is associated.
1675
1669
  */
1676
1670
  teamId?: string;
1677
1671
  /**
1678
1672
  * The name for the team with which the content is associated.
1679
1673
  */
1680
1674
  teamName?: string;
1681
1675
  /**
1682
1676
  * The Microsoft Teams ID for the channel with which the content is associated.
1683
1677
  */
1684
1678
  channelId?: string;
1685
1679
  /**
1686
1680
  * The name for the channel with which the content is associated.
1687
1681
  */
1688
1682
  channelName?: string;
1689
1683
  /**
1690
1684
  * The type of the channel with which the content is associated.
1691
1685
  */
1692
1686
  channelType?: ChannelType;
1693
1687
  /**
1694
1688
  * The developer-defined unique ID for the entity this content points to.
1695
1689
  */
1696
1690
  entityId: string;
1697
1691
  /**
1698
1692
  * The developer-defined unique ID for the sub-entity this content points to.
1699
1693
  * This field should be used to restore to a specific state within an entity,
1700
1694
  * such as scrolling to or activating a specific piece of content.
1701
1695
  */
1702
1696
  subEntityId?: string;
1703
1697
  /**
1704
1698
  * The current locale that the user has configured for the app formatted as
1705
1699
  * languageId-countryId (for example, en-us).
1706
1700
  */
1707
1701
  locale: string;
1708
1702
  /**
1709
1703
  * More detailed locale info from the user's OS if available. Can be used together with
1710
1704
  * the @microsoft/globe NPM package to ensure your app respects the user's OS date and
1711
1705
  * time format configuration
1712
1706
  */
1713
1707
  osLocaleInfo?: LocaleInfo;
1714
1708
  /**
1715
1709
  * @deprecated Use loginHint or userPrincipalName.
1716
1710
  * The UPN of the current user.
1717
1711
  * Because a malicious party can run your content in a browser, this value should
1718
1712
  * be used only as a hint as to who the user is and never as proof of identity.
1719
1713
  * This field is available only when the identity permission is requested in the manifest.
1720
1714
  */
1721
1715
  upn?: string;
1722
1716
  /**
1723
1717
  * The Azure AD tenant ID of the current user.
1724
1718
  * Because a malicious party can run your content in a browser, this value should
1725
1719
  * be used only as a hint as to who the user is and never as proof of identity.
1726
1720
  * This field is available only when the identity permission is requested in the manifest.
1727
1721
  */
1728
1722
  tid?: string;
1729
1723
  /**
1730
1724
  * The current UI theme.
1731
1725
  */
1732
1726
  theme?: string;
1733
1727
  /**
1734
1728
  * Indication whether the tab is in full-screen mode.
1735
1729
  */
1736
1730
  isFullScreen?: boolean;
1737
1731
  /**
1738
1732
  * The type of the team.
1739
1733
  */
1740
1734
  teamType?: TeamType;
1741
1735
  /**
1742
1736
  * The root SharePoint site associated with the team.
1743
1737
  */
1744
1738
  teamSiteUrl?: string;
1745
1739
  /**
1746
1740
  * The domain of the root SharePoint site associated with the team.
1747
1741
  */
1748
1742
  teamSiteDomain?: string;
1749
1743
  /**
1750
1744
  * The relative path to the SharePoint site associated with the team.
1751
1745
  */
1752
1746
  teamSitePath?: string;
1753
1747
  /**
1754
1748
  * The tenant ID of the host team.
1755
1749
  */
1756
1750
  hostTeamTenantId?: string;
1757
1751
  /**
1758
1752
  * The AAD group ID of the host team.
1759
1753
  */
1760
1754
  hostTeamGroupId?: string;
1761
1755
  /**
1762
1756
  * The relative path to the SharePoint folder associated with the channel.
1763
1757
  */
1764
1758
  channelRelativeUrl?: string;
1765
1759
  /**
1766
1760
  * Unique ID for the current Teams session for use in correlating telemetry data.
1767
1761
  */
1768
1762
  sessionId?: string;
1769
1763
  /**
1770
1764
  * The user's role in the team.
1771
1765
  * Because a malicious party can run your content in a browser, this value should
1772
1766
  * be used only as a hint as to the user's role, and never as proof of her role.
1773
1767
  */
1774
1768
  userTeamRole?: UserTeamRole;
1775
1769
  /**
1776
1770
  * The Microsoft Teams ID for the chat with which the content is associated.
1777
1771
  */
1778
1772
  chatId?: string;
1779
1773
  /**
1780
1774
  * A value suitable for use as a login_hint when authenticating with Azure AD.
1781
1775
  * Because a malicious party can run your content in a browser, this value should
1782
1776
  * be used only as a hint as to who the user is and never as proof of identity.
1783
1777
  * This field is available only when the identity permission is requested in the manifest.
1784
1778
  */
1785
1779
  loginHint?: string;
1786
1780
  /**
1787
1781
  * The UPN of the current user. This may be an externally-authenticated UPN (e.g., guest users).
1788
1782
  * Because a malicious party run your content in a browser, this value should
1789
1783
  * be used only as a hint as to who the user is and never as proof of identity.
1790
1784
  * This field is available only when the identity permission is requested in the manifest.
1791
1785
  */
1792
1786
  userPrincipalName?: string;
1793
1787
  /**
1794
1788
  * The Azure AD object id of the current user.
1795
1789
  * Because a malicious party run your content in a browser, this value should
1796
1790
  * be used only as a hint as to who the user is and never as proof of identity.
1797
1791
  * This field is available only when the identity permission is requested in the manifest.
1798
1792
  */
1799
1793
  userObjectId?: string;
1800
1794
  /**
1801
1795
  * Indicates whether team is archived.
1802
1796
  * Apps should use this as a signal to prevent any changes to content associated with archived teams.
1803
1797
  */
1804
1798
  isTeamArchived?: boolean;
1805
1799
  /**
1806
1800
  * The type of the host client. Possible values are : android, ios, web, desktop, rigel
1807
1801
  */
1808
1802
  hostClientType?: HostClientType;
1809
1803
  /**
1810
1804
  * The context where tab url is loaded (content, task, setting, remove, sidePanel)
1811
1805
  */
1812
1806
  frameContext?: FrameContexts;
1813
1807
  /**
1814
1808
  * SharePoint context. This is only available when hosted in SharePoint.
1815
1809
  */
1816
1810
  sharepoint?: any;
1817
1811
  /**
1818
1812
  * The type of license for the current users tenant.
1819
1813
  */
1820
1814
  tenantSKU?: string;
1821
1815
  /**
1822
1816
  * The license type for the current user.
1823
1817
  */
1824
1818
  userLicenseType?: string;
1825
1819
  /**
1826
1820
  * The ID of the parent message from which this task module was launched.
1827
1821
  * This is only available in task modules launched from bot cards.
1828
1822
  */
1829
1823
  parentMessageId?: string;
1830
1824
  /**
1831
1825
  * Current ring ID
1832
1826
  */
1833
1827
  ringId?: string;
1834
1828
  /**
1835
1829
  * Unique ID for the current session for use in correlating telemetry data.
1836
1830
  */
1837
1831
  appSessionId?: string;
1838
1832
  /**
1839
1833
  * Represents whether calling is allowed for the current logged in User
1840
1834
  */
1841
1835
  isCallingAllowed?: boolean;
1842
1836
  /**
1843
1837
  * Represents whether PSTN calling is allowed for the current logged in User
1844
1838
  */
1845
1839
  isPSTNCallingAllowed?: boolean;
1846
1840
  /**
1847
1841
  * Meeting Id used by tab when running in meeting context
1848
1842
  */
1849
1843
  meetingId?: string;
1850
1844
  /**
1851
1845
  * The OneNote section ID that is linked to the channel.
1852
1846
  */
1853
1847
  defaultOneNoteSectionId?: string;
1854
1848
  /**
1855
1849
  * Indication whether the tab is in a pop out window
1856
1850
  */
1857
1851
  isMultiWindow?: boolean;
1858
1852
  /**
1859
1853
  * Personal app icon y coordinate position
1860
1854
  */
1861
1855
  appIconPosition?: number;
1862
1856
  /**
1863
1857
  * Source origin from where the tab is opened
1864
1858
  */
1865
1859
  sourceOrigin?: string;
1866
1860
  /**
1867
1861
  * Time when the user clicked on the tab
1868
1862
  */
1869
1863
  userClickTime?: number;
1870
1864
  /**
1871
1865
  * Team Template ID if there was a Team Template associated with the creation of the team.
1872
1866
  */
1873
1867
  teamTemplateId?: string;
1874
1868
  /**
1875
1869
  * Where the user prefers the file to be opened from by default during file open
1876
1870
  */
1877
1871
  userFileOpenPreference?: FileOpenPreference;
1878
1872
  }
1879
1873
  export interface DeepLinkParameters {
1880
1874
  /**
1881
1875
  * The developer-defined unique ID for the sub-entity to which this deep link points in the current entity.
1882
1876
  * This field should be used to restore to a specific state within an entity, such as scrolling to or activating a specific piece of content.
1883
1877
  */
1884
1878
  subEntityId: string;
1885
1879
  /**
1886
1880
  * The label for the sub-entity that should be displayed when the deep link is rendered in a client.
1887
1881
  */
1888
1882
  subEntityLabel: string;
1889
1883
  /**
1890
1884
  * The fallback URL to which to navigate the user if the client cannot render the page.
1891
1885
  * This URL should lead directly to the sub-entity.
1892
1886
  */
1893
1887
  subEntityWebUrl?: string;
1894
1888
  }
1895
1889
  export interface TaskInfo {
1896
1890
  /**
1897
1891
  * The url to be rendered in the webview/iframe.
1898
1892
  */
1899
1893
  url?: string;
1900
1894
  /**
1901
1895
  * JSON defining an adaptive card.
1902
1896
  */
1903
1897
  card?: string;
1904
1898
  /**
1905
1899
  * The requested height of the webview/iframe.
1906
1900
  */
1907
1901
  height?: TaskModuleDimension | number;
1908
1902
  /**
1909
1903
  * The requested width of the webview/iframe.
1910
1904
  */
1911
1905
  width?: TaskModuleDimension | number;
1912
1906
  /**
1913
1907
  * Title of the task module.
1914
1908
  */
1915
1909
  title?: string;
1916
1910
  /**
1917
1911
  * If client doesnt support the URL, the URL that needs to be opened in the browser.
1918
1912
  */
1919
1913
  fallbackUrl?: string;
1920
1914
  /**
1921
1915
  * Specifies a bot ID to send the result of the user's interaction with the task module.
1922
1916
  * If specified, the bot will receive a task/complete invoke event with a JSON object
1923
1917
  * in the event payload.
1924
1918
  */
1925
1919
  completionBotId?: string;
1926
1920
  }
1927
1921
  /**
1928
1922
  * @private
1929
1923
  * Hide from docs.
1930
1924
  * ------
1931
1925
  */
1932
1926
  export interface OpenConversationRequest {
1933
1927
  /**
1934
1928
  * The Id of the subEntity where the conversation is taking place
1935
1929
  */
1936
1930
  subEntityId: string;
1937
1931
  /**
1938
1932
  * The title of the conversation
1939
1933
  */
1940
1934
  title: string;
1941
1935
  /**
1942
1936
  * The Id of the conversation. This is optional and should be specified whenever a previous conversation about a specific sub-entity has already been started before
1943
1937
  */
1944
1938
  conversationId?: string;
1945
1939
  /**
1946
1940
  * The Id of the channel. This is optional and should be specified whenever a conversation is started or opened in a personal app scope
1947
1941
  */
1948
1942
  channelId?: string;
1949
1943
  /**
1950
1944
  * The entity Id of the tab
1951
1945
  */
1952
1946
  entityId: string;
1953
1947
  /**
1954
1948
  * A function that is called once the conversation Id has been created
1955
1949
  */
1956
1950
  onStartConversation?: (conversationResponse: ConversationResponse) => void;
1957
1951
  /**
1958
1952
  * A function that is called if the pane is closed
1959
1953
  */
1960
1954
  onCloseConversation?: (conversationResponse: ConversationResponse) => void;
1961
1955
  }
1962
1956
  /**
1963
1957
  * @private
1964
1958
  * Hide from docs.
1965
1959
  * ------
1966
1960
  */
1967
1961
  export interface ConversationResponse {
1968
1962
  /**
1969
1963
  * The Id of the subEntity where the conversation is taking place
1970
1964
  */
1971
1965
  subEntityId: string;
1972
1966
  /**
1973
1967
  * The Id of the conversation. This is optional and should be specified whenever a previous conversation about a specific sub-entity has already been started before
1974
1968
  */
1975
1969
  conversationId?: string;
1976
1970
  /**
1977
1971
  * The Id of the channel. This is optional and should be specified whenever a conversation is started or opened in a personal app scope
1978
1972
  */
1979
1973
  channelId?: string;
1980
1974
  /**
1981
1975
  * The entity Id of the tab
1982
1976
  */
1983
1977
  entityId?: string;
1984
1978
  }
1985
1979
  /**
1986
1980
  * @private
1987
1981
  * Hide from docs.
1988
1982
  */
1989
1983
  export interface LoadContext {
1990
1984
  /**
1991
1985
  * The enitity that is requested to be loaded
1992
1986
  */
1993
1987
  entityId: string;
1994
1988
  /**
1995
1989
  * The content URL that is requested to be loaded
1996
1990
  */
1997
1991
  contentUrl: string;
1998
1992
  }
1999
1993
  export interface FrameContext {
2000
1994
  /**
2001
1995
  * The current URL that needs to be used in the iframe if the tab is reloaded
2002
1996
  */
2003
1997
  contentUrl: string;
2004
1998
  /**
2005
1999
  * The current URL that needs to be used for opening the website when the user clicks on 'Go to website'
2006
2000
  */
2007
2001
  websiteUrl: string;
2008
2002
  }
2009
2003
  export interface SdkError {
2010
2004
  /**
2011
2005
  error code
2012
2006
  */
2013
2007
  errorCode: ErrorCode;
2014
2008
  /**
2015
2009
  Optional description for the error. This may contain useful information for web-app developers.
2016
2010
  This string will not be localized and is not for end-user consumption.
2017
2011
  App should not depend on the string content. The exact value may change. This is only for debugging purposes.
2018
2012
  */
2019
2013
  message?: string;
2020
2014
  }
2021
2015
  export enum ErrorCode {
2022
2016
  /**
2023
2017
  * API not supported in the current platform.
2024
2018
  */
2025
2019
  NOT_SUPPORTED_ON_PLATFORM = 100,
2026
2020
  /**
2027
2021
  * Internal error encountered while performing the required operation.
2028
2022
  */
2029
2023
  INTERNAL_ERROR = 500,
2030
2024
  /**
2031
2025
  * API is not supported in the current context
2032
2026
  */
2033
2027
  NOT_SUPPORTED_IN_CURRENT_CONTEXT = 501,
2034
2028
  /**
2035
2029
  Permissions denied by user
2036
2030
  */
2037
2031
  PERMISSION_DENIED = 1000,
2038
2032
  /**
2039
2033
  * Network issue
2040
2034
  */
2041
2035
  NETWORK_ERROR = 2000,
2042
2036
  /**
2043
2037
  * Underlying hardware doesn't support the capability
2044
2038
  */
2045
2039
  NO_HW_SUPPORT = 3000,
2046
2040
  /**
2047
2041
  * One or more arguments are invalid
2048
2042
  */
2049
2043
  INVALID_ARGUMENTS = 4000,
2050
2044
  /**
2051
2045
  * User is not authorized for this operation
2052
2046
  */
2053
2047
  UNAUTHORIZED_USER_OPERATION = 5000,
2054
2048
  /**
2055
2049
  * Could not complete the operation due to insufficient resources
2056
2050
  */
2057
2051
  INSUFFICIENT_RESOURCES = 6000,
2058
2052
  /**
2059
2053
  * Platform throttled the request because of API was invoked too frequently
2060
2054
  */
2061
2055
  THROTTLE = 7000,
2062
2056
  /**
2063
2057
  * User aborted the operation
2064
2058
  */
2065
2059
  USER_ABORT = 8000,
2066
2060
  /**
2067
2061
  * Could not complete the operation in the given time interval
2068
2062
  */
2069
2063
  OPERATION_TIMED_OUT = 8001,
2070
2064
  /**
2071
2065
  * Platform code is old and doesn't implement this API
2072
2066
  */
2073
2067
  OLD_PLATFORM = 9000,
2074
2068
  /**
2075
2069
  * The file specified was not found on the given location
2076
2070
  */
2077
2071
  FILE_NOT_FOUND = 404,
2078
2072
  /**
2079
2073
  * The return value is too big and has exceeded our size boundries
2080
2074
  */
2081
2075
  SIZE_EXCEEDED = 10000
2082
2076
  }
2083
2077
  export namespace location {
2084
2078
  interface LocationProps {
2085
2079
  /**
2086
2080
  whether user can alter location or not
2087
2081
  if false, user will be shown current location
2088
2082
  and wouldn't be allowed to alter it
2089
2083
  */
2090
2084
  allowChooseLocation: boolean;
2091
2085
  /**
2092
2086
  whether selected location should be shown to user on map or not.
2093
2087
  If allowChooseLocation is true, this parameter will be ignored by platform.
2094
2088
  If allowChooseLocation is false, and this paramater is not provided, default
2095
2089
  value will be false.
2096
2090
  */
2097
2091
  showMap?: boolean;
2098
2092
  }
2099
2093
  interface Location {
2100
2094
  /**
2101
2095
  Latitude of the location
2102
2096
  */
2103
2097
  latitude: number;
2104
2098
  /**
2105
2099
  Longitude of the location
2106
2100
  */
2107
2101
  longitude: number;
2108
2102
  /**
2109
2103
  Accuracy of the coordinates captured
2110
2104
  */
2111
2105
  accuracy?: number;
2112
2106
  /**
2113
2107
  Time stamp when the location was captured
2114
2108
  */
2115
2109
  timestamp?: number;
2116
2110
  }
2117
2111
  /**
2118
2112
  * Fetches current user coordinates or allows user to choose location on map
2119
2113
  * @param callback Callback to invoke when current user location is fetched
2120
2114
  */
2121
2115
  function getLocation(props: LocationProps, callback: (error: SdkError, location: Location) => void): void;
2122
2116
  /**
2123
2117
  * Shows the location on map corresponding to the given coordinates
2124
2118
  * @param location {@link Location} which needs to be shown on map
2125
2119
  * @param callback Callback to invoke when the location is opened on map
2126
2120
  */
2127
2121
  function showLocation(location: Location, callback: (error: SdkError, status: boolean) => void): void;
2128
2122
  }
2129
2123
  export namespace media {
2130
2124
  /**
2131
2125
  * Enum for file formats supported
2132
2126
  */
2133
2127
  enum FileFormat {
2134
2128
  Base64 = "base64",
2135
2129
  ID = "id"
2136
2130
  }
2137
2131
  /**
2138
2132
  * File object that can be used to represent image or video or audio
2139
2133
  */
2140
2134
  class File {
2141
2135
  /**
2142
2136
  * Content of the file. When format is Base64, this is the base64 content
2143
2137
  * When format is ID, this is id mapping to the URI
2144
2138
  * When format is base64 and app needs to use this directly in HTML tags, it should convert this to dataUrl.
2145
2139
  */
2146
2140
  content: string;
2147
2141
  /**
2148
2142
  * Format of the content
2149
2143
  */
2150
2144
  format: FileFormat;
2151
2145
  /**
2152
2146
  * Size of the file in KB
2153
2147
  */
2154
2148
  size: number;
2155
2149
  /**
2156
2150
  * MIME type. This can be used for constructing a dataUrl, if needed.
2157
2151
  */
2158
2152
  mimeType: string;
2159
2153
  /**
2160
2154
  * Optional: Name of the file
2161
2155
  */
2162
2156
  name?: string;
2163
2157
  }
2164
2158
  /**
2165
2159
  * Launch camera, capture image or choose image from gallery and return the images as a File[] object to the callback.
2166
2160
  * Callback will be called with an error, if there are any. App should first check the error.
2167
2161
  * If it is present the user can be updated with appropriate error message.
2168
2162
  * If error is null or undefined, then files will have the required result.
2169
2163
  * Note: Currently we support getting one File through this API, i.e. the file arrays size will be one.
2170
2164
  * Note: For desktop, this API is not supported. Callback will be resolved with ErrorCode.NotSupported.
2171
2165
  * @see File
2172
2166
  * @see SdkError
2173
2167
  */
2174
2168
  function captureImage(callback: (error: SdkError, files: File[]) => void): void;
2175
2169
  /**
2176
2170
  * Media object returned by the select Media API
2177
2171
  */
2178
2172
  class Media extends File {
2179
2173
  constructor(that?: Media);
2180
2174
  /**
2181
2175
  * A preview of the file which is a lightweight representation.
2182
2176
  * In case of images this will be a thumbnail/compressed image in base64 encoding.
2183
2177
  */
2184
2178
  preview: string;
2185
2179
  /**
2186
2180
  * Gets the media in chunks irrespecitve of size, these chunks are assembled and sent back to the webapp as file/blob
2187
2181
  * @param callback returns blob of media
2188
2182
  */
2189
2183
  getMedia(callback: (error: SdkError, blob: Blob) => void): void;
2190
2184
  private getMediaViaCallback;
2191
2185
  private getMediaViaHandler;
2192
2186
  }
2193
2187
  /**
2194
2188
  * Input parameter supplied to the select Media API
2195
2189
  */
2196
2190
  interface MediaInputs {
2197
2191
  /**
2198
2192
  * Only one media type can be selected at a time
2199
2193
  */
2200
2194
  mediaType: MediaType;
2201
2195
  /**
2202
2196
  * max limit of media allowed to be selected in one go, current max limit is 10 set by office lens.
2203
2197
  */
2204
2198
  maxMediaCount: number;
2205
2199
  /**
2206
2200
  * Additional properties for customization of select media in mobile devices
2207
2201
  */
2208
2202
  imageProps?: ImageProps;
2209
2203
  /**
2210
2204
  * Additional properties for audio capture flows.
2211
2205
  */
2212
2206
  audioProps?: AudioProps;
2213
2207
  }
2214
2208
  /**
2215
2209
  * All properties in ImageProps are optional and have default values in the platform
2216
2210
  */
2217
2211
  interface ImageProps {
2218
2212
  /**
2219
2213
  * Optional; Lets the developer specify the image source, more than one can be specified.
2220
2214
  * Default value is both camera and gallery
2221
2215
  */
2222
2216
  sources?: Source[];
2223
2217
  /**
2224
2218
  * Optional; Specify in which mode the camera will be opened.
2225
2219
  * Default value is Photo
2226
2220
  */
2227
2221
  startMode?: CameraStartMode;
2228
2222
  /**
2229
2223
  * Optional; indicate if inking on the selected Image is allowed or not
2230
2224
  * Default value is true
2231
2225
  */
2232
2226
  ink?: boolean;
2233
2227
  /**
2234
2228
  * Optional; indicate if user is allowed to move between front and back camera
2235
2229
  * Default value is true
2236
2230
  */
2237
2231
  cameraSwitcher?: boolean;
2238
2232
  /**
2239
2233
  * Optional; indicate if putting text stickers on the selected Image is allowed or not
2240
2234
  * Default value is true
2241
2235
  */
2242
2236
  textSticker?: boolean;
2243
2237
  /**
2244
2238
  * Optional; indicate if image filtering mode is enabled on the selected image
2245
2239
  * Default value is false
2246
2240
  */
2247
2241
  enableFilter?: boolean;
2248
2242
  }
2249
2243
  /**
2250
2244
  * All properties in AudioProps are optional and have default values in the platform
2251
2245
  */
2252
2246
  interface AudioProps {
2253
2247
  /**
2254
2248
  * Optional; the maximum duration in minutes after which the recording should terminate automatically.
2255
2249
  * Default value is defined by the platform serving the API.
2256
2250
  */
2257
2251
  maxDuration?: number;
2258
2252
  }
2259
2253
  /**
2260
2254
  * The modes in which camera can be launched in select Media API
2261
2255
  */
2262
2256
  enum CameraStartMode {
2263
2257
  Photo = 1,
2264
2258
  Document = 2,
2265
2259
  Whiteboard = 3,
2266
2260
  BusinessCard = 4
2267
2261
  }
2268
2262
  /**
2269
2263
  * Specifies the image source
2270
2264
  */
2271
2265
  enum Source {
2272
2266
  Camera = 1,
2273
2267
  Gallery = 2
2274
2268
  }
2275
2269
  /**
2276
2270
  * Specifies the type of Media
2277
2271
  */
2278
2272
  enum MediaType {
2279
2273
  Image = 1,
2280
2274
  Audio = 4
2281
2275
  }
2282
2276
  /**
2283
2277
  * Input for view images API
2284
2278
  */
2285
2279
  interface ImageUri {
2286
2280
  value: string;
2287
2281
  type: ImageUriType;
2288
2282
  }
2289
2283
  /**
2290
2284
  * ID contains a mapping for content uri on platform's side, URL is generic
2291
2285
  */
2292
2286
  enum ImageUriType {
2293
2287
  ID = 1,
2294
2288
  URL = 2
2295
2289
  }
2296
2290
  /**
2297
2291
  * Media chunks an output of getMedia API from platform
2298
2292
  */
2299
2293
  interface MediaChunk {
2300
2294
  /**
2301
2295
  * Base 64 data for the requested uri
2302
2296
  */
2303
2297
  chunk: string;
2304
2298
  /**
2305
2299
  * chunk sequence number​
2306
2300
  */
2307
2301
  chunkSequence: number;
2308
2302
  }
2309
2303
  /**
2310
2304
  * Helper object to assembled media chunks
2311
2305
  */
2312
2306
  interface AssembleAttachment {
2313
2307
  sequence: number;
2314
2308
  file: Blob;
2315
2309
  }
2316
2310
  /**
2317
2311
  * Select an attachment using camera/gallery
2318
2312
  * @param mediaInputs The input params to customize the media to be selected
2319
2313
  * @param callback The callback to invoke after fetching the media
2320
2314
  */
2321
2315
  function selectMedia(mediaInputs: MediaInputs, callback: (error: SdkError, attachments: Media[]) => void): void;
2322
2316
  /**
2323
2317
  * View images using native image viewer
2324
2318
  * @param uriList urilist of images to be viewed - can be content uri or server url. supports upto 10 Images in one go
2325
2319
  * @param callback returns back error if encountered, returns null in case of success
2326
2320
  */
2327
2321
  function viewImages(uriList: ImageUri[], callback: (error?: SdkError) => void): void;
2328
2322
  /**
2329
2323
  * Barcode configuration supplied to scanBarCode API to customize barcode scanning experience in mobile
2330
2324
  * All properties in BarCodeConfig are optional and have default values in the platform
2331
2325
  */
2332
2326
  interface BarCodeConfig {
2333
2327
  /**
2334
2328
  * Optional; Lets the developer specify the scan timeout interval in seconds
2335
2329
  * Default value is 30 seconds and max allowed value is 60 seconds
2336
2330
  */
2337
2331
  timeOutIntervalInSec?: number;
2338
2332
  }
2339
2333
  /**
2340
2334
  * Scan Barcode/QRcode using camera
2341
2335
  * Note: For desktop and web, this API is not supported. Callback will be resolved with ErrorCode.NotSupported.
2342
2336
  * @param callback callback to invoke after scanning the barcode
2343
2337
  * @param config optional input configuration to customize the barcode scanning experience
2344
2338
  */
2345
2339
  function scanBarCode(callback: (error: SdkError, decodedText: string) => void, config?: BarCodeConfig): void;
2346
2340
  }
2347
2341
  export namespace meeting {
2348
2342
  /**
2349
2343
  * @private
2350
2344
  * Hide from docs
2351
2345
  * Data structure to represent a meeting details.
2352
2346
  */
2353
2347
  interface IMeetingDetails {
2354
2348
  /**
2355
2349
  * details object
2356
2350
  */
2357
2351
  details: IDetails;
2358
2352
  /**
2359
2353
  * conversation object
2360
2354
  */
2361
2355
  conversation: IConversation;
2362
2356
  /**
2363
2357
  * organizer object
2364
2358
  */
2365
2359
  organizer: IOrganizer;
2366
2360
  }
2367
2361
  /**
2368
2362
  * @private
2369
2363
  * Hide from docs
2370
2364
  * Data structure to represent details.
2371
2365
  */
2372
2366
  interface IDetails {
2373
2367
  /**
2374
2368
  * Scheduled start time of the meeting
2375
2369
  */
2376
2370
  scheduledStartTime: string;
2377
2371
  /**
2378
2372
  * Scheduled end time of the meeting
2379
2373
  */
2380
2374
  scheduledEndTime: string;
2381
2375
  /**
2382
2376
  * url to join the current meeting
2383
2377
  */
2384
2378
  joinUrl?: string;
2385
2379
  /**
2386
2380
  * meeting title name of the meeting
2387
2381
  */
2388
2382
  title?: string;
2389
2383
  /**
2390
2384
  * type of the meeting
2391
2385
  */
2392
2386
  type?: MeetingType;
2393
2387
  }
2394
2388
  /**
2395
2389
  * @private
2396
2390
  * Hide from docs
2397
2391
  * Data structure to represent a conversation object.
2398
2392
  */
2399
2393
  interface IConversation {
2400
2394
  /**
2401
2395
  * conversation id of the meeting
2402
2396
  */
2403
2397
  id: string;
2404
2398
  }
2405
2399
  /**
2406
2400
  * @private
2407
2401
  * Hide from docs
2408
2402
  * Data structure to represent an organizer object.
2409
2403
  */
2410
2404
  interface IOrganizer {
2411
2405
  /**
2412
2406
  * organizer id of the meeting
2413
2407
  */
2414
2408
  id?: string;
2415
2409
  /**
2416
2410
  * tenant id of the meeting
2417
2411
  */
2418
2412
  tenantId?: string;
2419
2413
  }
2420
2414
  interface LiveStreamState {
2421
2415
  /**
2422
2416
  * indicates whether meeting is streaming
2423
2417
  */
2424
2418
  isStreaming: boolean;
2425
2419
  /**
2426
2420
  * error object in case there is a failure
2427
2421
  */
2428
2422
  error?: {
2429
2423
  /** error code from the streaming service, e.g. IngestionFailure */
2430
2424
  code: string;
2431
2425
  /** detailed error message string */
2432
2426
  message?: string;
2433
2427
  };
2434
2428
  }
2435
2429
  enum MeetingType {
2436
2430
  Unknown = "Unknown",
2437
2431
  Adhoc = "Adhoc",
2438
2432
  Scheduled = "Scheduled",
2439
2433
  Recurring = "Recurring",
2440
2434
  Broadcast = "Broadcast",
2441
2435
  MeetNow = "MeetNow"
2442
2436
  }
2443
2437
  /**
2444
2438
  * Allows an app to get the incoming audio speaker setting for the meeting user
2445
2439
  * @param callback Callback contains 2 parameters, error and result.
2446
2440
  * error can either contain an error of type SdkError, incase of an error, or null when fetch is successful
2447
2441
  * result can either contain the true/false value, incase of a successful fetch or null when the fetching fails
2448
2442
  * result: True means incoming audio is muted and false means incoming audio is unmuted
2449
2443
  */
2450
2444
  function getIncomingClientAudioState(callback: (error: SdkError | null, result: boolean | null) => void): void;
2451
2445
  /**
2452
2446
  * Allows an app to toggle the incoming audio speaker setting for the meeting user from mute to unmute or vice-versa
2453
2447
  * @param callback Callback contains 2 parameters, error and result.
2454
2448
  * error can either contain an error of type SdkError, incase of an error, or null when toggle is successful
2455
2449
  * result can either contain the true/false value, incase of a successful toggle or null when the toggling fails
2456
2450
  * result: True means incoming audio is muted and false means incoming audio is unmuted
2457
2451
  */
2458
2452
  function toggleIncomingClientAudio(callback: (error: SdkError | null, result: boolean | null) => void): void;
2459
2453
  /**
2460
2454
  * @private
2461
2455
  * Hide from docs
2462
2456
  * Allows an app to get the meeting details for the meeting
2463
2457
  * @param callback Callback contains 2 parameters, error and meetingDetails.
2464
2458
  * error can either contain an error of type SdkError, incase of an error, or null when get is successful
2465
2459
  * result can either contain a IMeetingDetails value, incase of a successful get or null when the get fails
2466
2460
  */
2467
2461
  function getMeetingDetails(callback: (error: SdkError | null, meetingDetails: IMeetingDetails | null) => void): void;
2468
2462
  /**
2469
2463
  * @private
2470
2464
  * Allows an app to get the authentication token for the anonymous or guest user in the meeting
2471
2465
  * @param callback Callback contains 2 parameters, error and authenticationTokenOfAnonymousUser.
2472
2466
  * error can either contain an error of type SdkError, incase of an error, or null when get is successful
2473
2467
  * authenticationTokenOfAnonymousUser can either contain a string value, incase of a successful get or null when the get fails
2474
2468
  */
2475
2469
  function getAuthenticationTokenForAnonymousUser(callback: (error: SdkError | null, authenticationTokenOfAnonymousUser: string | null) => void): void;
2476
2470
  /**
2477
2471
  * Allows an app to get the state of the live stream in the current meeting
2478
2472
  * @param callback Callback contains 2 parameters: error and liveStreamState.
2479
2473
  * error can either contain an error of type SdkError, in case of an error, or null when get is successful
2480
2474
  * liveStreamState can either contain a LiveStreamState value, or null when operation fails
2481
2475
  */
2482
2476
  function getLiveStreamState(callback: (error: SdkError | null, liveStreamState: LiveStreamState | null) => void): void;
2483
2477
  /**
2484
2478
  * Allows an app to request the live streaming be started at the given streaming url
2485
2479
  * @param streamUrl the url to the stream resource
2486
2480
  * @param streamKey the key to the stream resource
2487
2481
  * @param callback Callback contains error parameter which can be of type SdkError in case of an error, or null when operation is successful
2488
2482
  * Use getLiveStreamState or registerLiveStreamChangedHandler to get updates on the live stream state
2489
2483
  */
2490
2484
  function requestStartLiveStreaming(callback: (error: SdkError | null) => void, streamUrl: string, streamKey?: string): void;
2491
2485
  /**
2492
2486
  * Allows an app to request the live streaming be stopped at the given streaming url
2493
2487
  * @param callback Callback contains error parameter which can be of type SdkError in case of an error, or null when operation is successful
2494
2488
  * Use getLiveStreamState or registerLiveStreamChangedHandler to get updates on the live stream state
2495
2489
  */
2496
2490
  function requestStopLiveStreaming(callback: (error: SdkError | null) => void): void;
2497
2491
  /**
2498
2492
  * Registers a handler for changes to the live stream.
2499
2493
  * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
2500
2494
  * @param handler The handler to invoke when the live stream state changes
2501
2495
  */
2502
2496
  function registerLiveStreamChangedHandler(handler: (liveStreamState: LiveStreamState) => void): void;
2503
2497
  }
2504
2498
  /**
2505
2499
  * Navigation specific part of the SDK.
2506
2500
  */
2507
2501
  /**
2508
2502
  * Return focus to the main Teams app. Will focus search bar if navigating foward and app bar if navigating back.
2509
2503
  * @param navigateForward Determines the direction to focus in teams app.
2510
2504
  */
2511
2505
  export function returnFocus(navigateForward?: boolean): void;
2512
2506
  /**
2513
2507
  * Navigates the Microsoft Teams app to the specified tab instance.
2514
2508
  * @param tabInstance The tab instance to navigate to.
2515
2509
  */
2516
2510
  export function navigateToTab(tabInstance: TabInstance, onComplete?: (status: boolean, reason?: string) => void): void;
2517
2511
  /**
2518
2512
  * Navigates the frame to a new cross-domain URL. The domain of this URL must match at least one of the
2519
2513
  * valid domains specified in the validDomains block of the manifest; otherwise, an exception will be
2520
2514
  * thrown. This function needs to be used only when navigating the frame to a URL in a different domain
2521
2515
  * than the current one in a way that keeps the app informed of the change and allows the SDK to
2522
2516
  * continue working.
2523
2517
  * @param url The URL to navigate the frame to.
2524
2518
  */
2525
2519
  export function navigateCrossDomain(url: string, onComplete?: (status: boolean, reason?: string) => void): void;
2526
2520
  /**
2527
2521
  * Navigates back in the Teams client. See registerBackButtonHandler for more information on when
2528
2522
  * it's appropriate to use this method.
2529
2523
  */
2530
2524
  export function navigateBack(onComplete?: (status: boolean, reason?: string) => void): void;
2531
2525
  export namespace people {
2532
2526
  /**
2533
2527
  * Launches a people picker and allows the user to select one or more people from the list
2534
2528
  * If the app is added to personal app scope the people picker launched is org wide and if the app is added to a chat/channel, people picker launched is also limited to the members of chat/channel
2535
2529
  * @param callback Returns list of JSON object of type PeoplePickerResult which consists of AAD IDs, display names and emails of the selected users
2536
2530
  * @param peoplePickerInputs Input parameters to launch customized people picker
2537
2531
  */
2538
2532
  function selectPeople(callback: (error: SdkError, people: PeoplePickerResult[]) => void, peoplePickerInputs?: PeoplePickerInputs): void;
2539
2533
  /**
2540
2534
  * Input parameter supplied to the People Picker API
2541
2535
  */
2542
2536
  interface PeoplePickerInputs {
2543
2537
  /**
2544
2538
  * Optional; Set title for the people picker
2545
2539
  * Default value is "Select people" for multiselect and "Select a person" for single select
2546
2540
  */
2547
2541
  title?: string;
2548
2542
  /**
2549
2543
  * Optional; AAD ids of the users to be pre-populated in the search box of people picker control
2550
2544
  * If single select is enabled this value, only the first user in the list will be pre-populated
2551
2545
  * Default value is null
2552
2546
  */
2553
2547
  setSelected?: string[];
2554
2548
  /**
2555
2549
  * Optional; launches the people picker in org wide scope even if the app is added to a chat or channel
2556
2550
  * Default value is false
2557
2551
  */
2558
2552
  openOrgWideSearchInChatOrChannel?: boolean;
2559
2553
  /**
2560
2554
  * Optional; launches the people picker for which only 1 person can be selected
2561
2555
  * Default value is false
2562
2556
  */
2563
2557
  singleSelect?: boolean;
2564
2558
  }
2565
2559
  /**
2566
2560
  * Output user object of people picker API
2567
2561
  */
2568
2562
  interface PeoplePickerResult {
2569
2563
  /**
2570
2564
  * user object Id (also known as aad id) of the selected user
2571
2565
  */
2572
2566
  objectId: string;
2573
2567
  /**
2574
2568
  * Optional; display name of the selected user
2575
2569
  */
2576
2570
  displayName?: string;
2577
2571
  /**
2578
2572
  * Optional; email of the selected user
2579
2573
  */
2580
2574
  email?: string;
2581
2575
  }
2582
2576
  }
2583
2577
  /**
2584
2578
  * Initializes the library. This must be called before any other SDK calls
2585
2579
  * but after the frame is loaded successfully.
2586
2580
  * @param callback Optionally specify a callback to invoke when Teams SDK has successfully initialized
2587
2581
  * @param validMessageOrigins Optionally specify a list of cross frame message origins. There must have
2588
2582
  * https: protocol otherwise they will be ignored. Example: https://www.example.com
2589
2583
  */
2590
2584
  export function initialize(callback?: () => void, validMessageOrigins?: string[]): void;
2591
2585
  /**
2592
2586
  * @private
2593
2587
  * Hide from docs.
2594
2588
  * ------
2595
2589
  * Undocumented function used to set a mock window for unit tests
2596
2590
  */
2597
2591
  export function _initialize(hostWindow: any): void;
2598
2592
  /**
2599
2593
  * @private
2600
2594
  * Hide from docs.
2601
2595
  * ------
2602
2596
  * Undocumented function used to clear state between unit tests
2603
2597
  */
2604
2598
  export function _uninitialize(): void;
2605
2599
  /**
2606
2600
  * Enable print capability to support printing page using Ctrl+P and cmd+P
2607
2601
  */
2608
2602
  export function enablePrintCapability(): void;
2609
2603
  /**
2610
2604
  * default print handler
2611
2605
  */
2612
2606
  export function print(): void;
2613
2607
  /**
2614
2608
  * Retrieves the current context the frame is running in.
2615
2609
  * @param callback The callback to invoke when the {@link Context} object is retrieved.
2616
2610
  */
2617
2611
  export function getContext(callback: (context: Context) => void): void;
2618
2612
  /**
2619
2613
  * Registers a handler for theme changes.
2620
2614
  * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
2621
2615
  * @param handler The handler to invoke when the user changes their theme.
2622
2616
  */
2623
2617
  export function registerOnThemeChangeHandler(handler: (theme: string) => void): void;
2624
2618
  /**
2625
2619
  * Registers a handler for changes from or to full-screen view for a tab.
2626
2620
  * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
2627
2621
  * @param handler The handler to invoke when the user toggles full-screen view for a tab.
2628
2622
  */
2629
2623
  export function registerFullScreenHandler(handler: (isFullScreen: boolean) => void): void;
2630
2624
  /**
2631
2625
  * Registers a handler for clicking the app button.
2632
2626
  * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
2633
2627
  * @param handler The handler to invoke when the personal app button is clicked in the app bar.
2634
2628
  */
2635
2629
  export function registerAppButtonClickHandler(handler: () => void): void;
2636
2630
  /**
2637
2631
  * Registers a handler for entering hover of the app button.
2638
2632
  * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
2639
2633
  * @param handler The handler to invoke when entering hover of the personal app button in the app bar.
2640
2634
  */
2641
2635
  export function registerAppButtonHoverEnterHandler(handler: () => void): void;
2642
2636
  /**
2643
2637
  * Registers a handler for exiting hover of the app button.
2644
2638
  * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
2645
2639
  * @param handler The handler to invoke when exiting hover of the personal app button in the app bar.
2646
2640
  */
2647
2641
  export function registerAppButtonHoverLeaveHandler(handler: () => void): void;
2648
2642
  /**
2649
2643
  * Registers a handler for user presses of the Team client's back button. Experiences that maintain an internal
2650
2644
  * navigation stack should use this handler to navigate the user back within their frame. If an app finds
2651
2645
  * that after running its back button handler it cannot handle the event it should call the navigateBack
2652
2646
  * method to ask the Teams client to handle it instead.
2653
2647
  * @param handler The handler to invoke when the user presses their Team client's back button.
2654
2648
  */
2655
2649
  export function registerBackButtonHandler(handler: () => boolean): void;
2656
2650
  /**
2657
2651
  * @private
2658
2652
  * Registers a handler to be called when the page has been requested to load.
2659
2653
  * @param handler The handler to invoke when the page is loaded.
2660
2654
  */
2661
2655
  export function registerOnLoadHandler(handler: (context: LoadContext) => void): void;
2662
2656
  /**
2663
2657
  * @private
2664
2658
  * Registers a handler to be called before the page is unloaded.
2665
2659
  * @param handler The handler to invoke before the page is unloaded. If this handler returns true the page should
2666
2660
  * invoke the readyToUnload function provided to it once it's ready to be unloaded.
2667
2661
  */
2668
2662
  export function registerBeforeUnloadHandler(handler: (readyToUnload: () => void) => boolean): void;
2669
2663
  /**
2670
2664
  * Registers a handler for when the user reconfigurated tab
2671
2665
  * @param handler The handler to invoke when the user click on Settings.
2672
2666
  */
2673
2667
  export function registerChangeSettingsHandler(handler: () => void): void;
2674
2668
  /**
2675
2669
  * Allows an app to retrieve for this user tabs that are owned by this app.
2676
2670
  * If no TabInstanceParameters are passed, the app defaults to favorite teams and favorite channels.
2677
2671
  * @param callback The callback to invoke when the {@link TabInstanceParameters} object is retrieved.
2678
2672
  * @param tabInstanceParameters OPTIONAL Flags that specify whether to scope call to favorite teams or channels.
2679
2673
  */
2680
2674
  export function getTabInstances(callback: (tabInfo: TabInformation) => void, tabInstanceParameters?: TabInstanceParameters): void;
2681
2675
  /**
2682
2676
  * Allows an app to retrieve the most recently used tabs for this user.
2683
2677
  * @param callback The callback to invoke when the {@link TabInformation} object is retrieved.
2684
2678
  * @param tabInstanceParameters OPTIONAL Ignored, kept for future use
2685
2679
  */
2686
2680
  export function getMruTabInstances(callback: (tabInfo: TabInformation) => void, tabInstanceParameters?: TabInstanceParameters): void;
2687
2681
  /**
2688
2682
  * Shares a deep link that a user can use to navigate back to a specific state in this page.
2689
2683
  * @param deepLinkParameters ID and label for the link and fallback URL.
2690
2684
  */
2691
2685
  export function shareDeepLink(deepLinkParameters: DeepLinkParameters): void;
2692
2686
  /**
2693
2687
  * execute deep link API.
2694
2688
  * @param deepLink deep link.
2695
2689
  */
2696
2690
  export function executeDeepLink(deepLink: string, onComplete?: (status: boolean, reason?: string) => void): void;
2697
2691
  export function setFrameContext(frameContext: FrameContext): void;
2698
2692
  export function initializeWithFrameContext(frameContext: FrameContext, callback?: () => void, validMessageOrigins?: string[]): void;
2699
2693
  /**
2700
2694
  * Namespace to interact with the settings-specific part of the SDK.
2701
2695
  * This object is usable only on the settings frame.
2702
2696
  */
2703
2697
  export namespace settings {
2704
2698
  function initialize(): void;
2705
2699
  /**
2706
2700
  * Sets the validity state for the settings.
2707
2701
  * The initial value is false, so the user cannot save the settings until this is called with true.
2708
2702
  * @param validityState Indicates whether the save or remove button is enabled for the user.
2709
2703
  */
2710
2704
  function setValidityState(validityState: boolean): void;
2711
2705
  /**
2712
2706
  * Gets the settings for the current instance.
2713
2707
  * @param callback The callback to invoke when the {@link Settings} object is retrieved.
2714
2708
  */
2715
2709
  function getSettings(callback: (instanceSettings: Settings) => void): void;
2716
2710
  /**
2717
2711
  * Sets the settings for the current instance.
2718
2712
  * This is an asynchronous operation; calls to getSettings are not guaranteed to reflect the changed state.
2719
2713
  * @param settings The desired settings for this instance.
2720
2714
  */
2721
2715
  function setSettings(instanceSettings: Settings, onComplete?: (status: boolean, reason?: string) => void): void;
2722
2716
  /**
2723
2717
  * Registers a handler for when the user attempts to save the settings. This handler should be used
2724
2718
  * to create or update the underlying resource powering the content.
2725
2719
  * The object passed to the handler must be used to notify whether to proceed with the save.
2726
2720
  * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
2727
2721
  * @param handler The handler to invoke when the user selects the save button.
2728
2722
  */
2729
2723
  function registerOnSaveHandler(handler: (evt: SaveEvent) => void): void;
2730
2724
  /**
2731
2725
  * Registers a handler for user attempts to remove content. This handler should be used
2732
2726
  * to remove the underlying resource powering the content.
2733
2727
  * The object passed to the handler must be used to indicate whether to proceed with the removal.
2734
2728
  * Only one handler may be registered at a time. Subsequent registrations will override the first.
2735
2729
  * @param handler The handler to invoke when the user selects the remove button.
2736
2730
  */
2737
2731
  function registerOnRemoveHandler(handler: (evt: RemoveEvent) => void): void;
2738
2732
  interface Settings {
2739
2733
  /**
2740
2734
  * A suggested display name for the new content.
2741
2735
  * In the settings for an existing instance being updated, this call has no effect.
2742
2736
  */
2743
2737
  suggestedDisplayName?: string;
2744
2738
  /**
2745
2739
  * Sets the URL to use for the content of this instance.
2746
2740
  */
2747
2741
  contentUrl: string;
2748
2742
  /**
2749
2743
  * Sets the URL for the removal configuration experience.
2750
2744
  */
2751
2745
  removeUrl?: string;
2752
2746
  /**
2753
2747
  * Sets the URL to use for the external link to view the underlying resource in a browser.
2754
2748
  */
2755
2749
  websiteUrl?: string;
2756
2750
  /**
2757
2751
  * The developer-defined unique ID for the entity to which this content points.
2758
2752
  */
2759
2753
  entityId?: string;
2760
2754
  }
2761
2755
  interface SaveEvent {
2762
2756
  /**
2763
2757
  * Object containing properties passed as arguments to the settings.save event.
2764
2758
  */
2765
2759
  result: SaveParameters;
2766
2760
  /**
2767
2761
  * Indicates that the underlying resource has been created and the settings can be saved.
2768
2762
  */
2769
2763
  notifySuccess(): void;
2770
2764
  /**
2771
2765
  * Indicates that creation of the underlying resource failed and that the settings cannot be saved.
2772
2766
  * @param reason Specifies a reason for the failure. If provided, this string is displayed to the user; otherwise a generic error is displayed.
2773
2767
  */
2774
2768
  notifyFailure(reason?: string): void;
2775
2769
  }
2776
2770
  interface RemoveEvent {
2777
2771
  /**
2778
2772
  * Indicates that the underlying resource has been removed and the content can be removed.
2779
2773
  */
2780
2774
  notifySuccess(): void;
2781
2775
  /**
2782
2776
  * Indicates that removal of the underlying resource failed and that the content cannot be removed.
2783
2777
  * @param reason Specifies a reason for the failure. If provided, this string is displayed to the user; otherwise a generic error is displayed.
2784
2778
  */
2785
2779
  notifyFailure(reason?: string): void;
2786
2780
  }
2787
2781
  interface SaveParameters {
2788
2782
  /**
2789
2783
  * Connector's webhook Url returned as arguments to settings.save event as part of user clicking on Save
2790
2784
  */
2791
2785
  webhookUrl?: string;
2792
2786
  }
2793
2787
  }
2794
2788
  /**
2795
2789
  * Namespace to interact with the task module-specific part of the SDK.
2796
2790
  * This object is usable only on the content frame.
2797
2791
  */
2798
2792
  export namespace tasks {
2799
2793
  /**
2800
2794
  * Allows an app to open the task module.
2801
2795
  * @param taskInfo An object containing the parameters of the task module
2802
2796
  * @param submitHandler Handler to call when the task module is completed
2803
2797
  */
2804
2798
  function startTask(taskInfo: TaskInfo, submitHandler?: (err: string, result: string) => void): IAppWindow;
2805
2799
  /**
2806
2800
  * Update height/width task info properties.
2807
2801
  * @param taskInfo An object containing width and height properties
2808
2802
  */
2809
2803
  function updateTask(taskInfo: TaskInfo): void;
2810
2804
  /**
2811
2805
  * Submit the task module.
2812
2806
  * @param result Contains the result to be sent to the bot or the app. Typically a JSON object or a serialized version of it
2813
2807
  * @param appIds Helps to validate that the call originates from the same appId as the one that invoked the task module
2814
2808
  */
2815
2809
  function submitTask(result?: string | object, appIds?: string | string[]): void;
2816
2810
  }