@microsoft/teams-js 1.10.1-dev.0

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