@microsoft/teams-js 2.30.0 → 2.31.0-beta.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (134) hide show
  1. package/dist/esm/_virtual/__polyfill-node.os.js +1 -0
  2. package/dist/esm/_virtual/_polyfill-node.os.js +1 -0
  3. package/dist/esm/node_modules/.pnpm/debug@4.3.5/node_modules/debug/src/node.js +1 -1
  4. package/dist/esm/node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js +1 -0
  5. package/dist/esm/node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js +1 -0
  6. package/dist/esm/packages/teams-js/dts/index.d.ts +2 -0
  7. package/dist/esm/packages/teams-js/dts/internal/VideoFrameTypes.d.ts +78 -0
  8. package/dist/esm/packages/teams-js/dts/internal/appHelpers.d.ts +8 -0
  9. package/dist/esm/packages/teams-js/dts/internal/appIdValidation.d.ts +16 -0
  10. package/dist/esm/packages/teams-js/dts/internal/communication.d.ts +162 -0
  11. package/dist/esm/packages/teams-js/dts/internal/constants.d.ts +146 -0
  12. package/dist/esm/packages/teams-js/dts/internal/deepLinkConstants.d.ts +26 -0
  13. package/dist/esm/packages/teams-js/dts/internal/deepLinkUtilities.d.ts +4 -0
  14. package/dist/esm/packages/teams-js/dts/internal/emailAddressValidation.d.ts +1 -0
  15. package/dist/esm/packages/teams-js/dts/internal/globalVars.d.ts +12 -0
  16. package/dist/esm/packages/teams-js/dts/internal/handlers.d.ts +80 -0
  17. package/dist/esm/packages/teams-js/dts/internal/interfaces.d.ts +47 -0
  18. package/dist/esm/packages/teams-js/dts/internal/internalAPIs.d.ts +61 -0
  19. package/dist/esm/packages/teams-js/dts/internal/marketplaceUtils.d.ts +94 -0
  20. package/dist/esm/packages/teams-js/dts/internal/mediaUtil.d.ts +95 -0
  21. package/dist/esm/packages/teams-js/dts/internal/messageObjects.d.ts +73 -0
  22. package/dist/esm/packages/teams-js/dts/internal/nestedAppAuthUtils.d.ts +105 -0
  23. package/dist/esm/packages/teams-js/dts/internal/profileUtil.d.ts +11 -0
  24. package/dist/esm/packages/teams-js/dts/internal/responseHandler.d.ts +30 -0
  25. package/dist/esm/packages/teams-js/dts/internal/telemetry.d.ts +344 -0
  26. package/dist/esm/packages/teams-js/dts/internal/typeCheckUtilities.d.ts +1 -0
  27. package/dist/esm/packages/teams-js/dts/internal/utils.d.ts +200 -0
  28. package/dist/esm/packages/teams-js/dts/internal/uuidObject.d.ts +11 -0
  29. package/dist/esm/packages/teams-js/dts/internal/validOrigins.d.ts +6 -0
  30. package/dist/esm/packages/teams-js/dts/internal/videoEffectsUtils.d.ts +31 -0
  31. package/dist/esm/packages/teams-js/dts/internal/videoFrameTick.d.ts +10 -0
  32. package/dist/esm/packages/teams-js/dts/internal/videoPerformanceMonitor.d.ts +54 -0
  33. package/dist/esm/packages/teams-js/dts/internal/videoPerformanceStatistics.d.ts +49 -0
  34. package/dist/esm/packages/teams-js/dts/private/appEntity.d.ts +89 -0
  35. package/dist/esm/packages/teams-js/dts/private/constants.d.ts +9 -0
  36. package/dist/esm/packages/teams-js/dts/private/conversations.d.ts +152 -0
  37. package/dist/esm/packages/teams-js/dts/private/copilot.d.ts +39 -0
  38. package/dist/esm/packages/teams-js/dts/private/externalAppAuthentication.d.ts +378 -0
  39. package/dist/esm/packages/teams-js/dts/private/externalAppAuthenticationForCEA.d.ts +75 -0
  40. package/dist/esm/packages/teams-js/dts/private/externalAppCardActions.d.ts +112 -0
  41. package/dist/esm/packages/teams-js/dts/private/externalAppCardActionsForCEA.d.ts +49 -0
  42. package/dist/esm/packages/teams-js/dts/private/externalAppCommands.d.ts +123 -0
  43. package/dist/esm/packages/teams-js/dts/private/files.d.ts +758 -0
  44. package/dist/esm/packages/teams-js/dts/private/hostEntity.d.ts +176 -0
  45. package/dist/esm/packages/teams-js/dts/private/index.d.ts +20 -0
  46. package/dist/esm/packages/teams-js/dts/private/interfaces.d.ts +250 -0
  47. package/dist/esm/packages/teams-js/dts/private/logs.d.ts +25 -0
  48. package/dist/esm/packages/teams-js/dts/private/meetingRoom.d.ts +203 -0
  49. package/dist/esm/packages/teams-js/dts/private/messageChannels.d.ts +107 -0
  50. package/dist/esm/packages/teams-js/dts/private/notifications.d.ts +26 -0
  51. package/dist/esm/packages/teams-js/dts/private/otherAppStateChange.d.ts +81 -0
  52. package/dist/esm/packages/teams-js/dts/private/privateAPIs.d.ts +60 -0
  53. package/dist/esm/packages/teams-js/dts/private/remoteCamera.d.ts +298 -0
  54. package/dist/esm/packages/teams-js/dts/private/teams.d.ts +116 -0
  55. package/dist/esm/packages/teams-js/dts/private/videoEffectsEx.d.ts +244 -0
  56. package/dist/esm/packages/teams-js/dts/public/adaptiveCards.d.ts +6 -0
  57. package/dist/esm/packages/teams-js/dts/public/app.d.ts +592 -0
  58. package/dist/esm/packages/teams-js/dts/public/appId.d.ts +33 -0
  59. package/dist/esm/packages/teams-js/dts/public/appInitialization.d.ts +57 -0
  60. package/dist/esm/packages/teams-js/dts/public/appInstallDialog.d.ts +18 -0
  61. package/dist/esm/packages/teams-js/dts/public/appWindow.d.ts +66 -0
  62. package/dist/esm/packages/teams-js/dts/public/authentication.d.ts +409 -0
  63. package/dist/esm/packages/teams-js/dts/public/barCode.d.ts +53 -0
  64. package/dist/esm/packages/teams-js/dts/public/calendar.d.ts +40 -0
  65. package/dist/esm/packages/teams-js/dts/public/call.d.ts +53 -0
  66. package/dist/esm/packages/teams-js/dts/public/chat.d.ts +66 -0
  67. package/dist/esm/packages/teams-js/dts/public/clipboard.d.ts +34 -0
  68. package/dist/esm/packages/teams-js/dts/public/constants.d.ts +179 -0
  69. package/dist/esm/packages/teams-js/dts/public/dialog.d.ts +286 -0
  70. package/dist/esm/packages/teams-js/dts/public/emailAddress.d.ts +12 -0
  71. package/dist/esm/packages/teams-js/dts/public/geoLocation.d.ts +100 -0
  72. package/dist/esm/packages/teams-js/dts/public/index.d.ts +44 -0
  73. package/dist/esm/packages/teams-js/dts/public/interfaces.d.ts +1133 -0
  74. package/dist/esm/packages/teams-js/dts/public/liveShareHost.d.ts +221 -0
  75. package/dist/esm/packages/teams-js/dts/public/location.d.ts +86 -0
  76. package/dist/esm/packages/teams-js/dts/public/mail.d.ts +95 -0
  77. package/dist/esm/packages/teams-js/dts/public/marketplace.d.ts +321 -0
  78. package/dist/esm/packages/teams-js/dts/public/media.d.ts +440 -0
  79. package/dist/esm/packages/teams-js/dts/public/meeting.d.ts +906 -0
  80. package/dist/esm/packages/teams-js/dts/public/menus.d.ts +188 -0
  81. package/dist/esm/packages/teams-js/dts/public/monetization.d.ts +58 -0
  82. package/dist/esm/packages/teams-js/dts/public/navigation.d.ts +45 -0
  83. package/dist/esm/packages/teams-js/dts/public/nestedAppAuth.d.ts +15 -0
  84. package/dist/esm/packages/teams-js/dts/public/pages.d.ts +574 -0
  85. package/dist/esm/packages/teams-js/dts/public/people.d.ts +75 -0
  86. package/dist/esm/packages/teams-js/dts/public/profile.d.ts +127 -0
  87. package/dist/esm/packages/teams-js/dts/public/publicAPIs.d.ts +218 -0
  88. package/dist/esm/packages/teams-js/dts/public/runtime.d.ts +207 -0
  89. package/dist/esm/packages/teams-js/dts/public/search.d.ts +91 -0
  90. package/dist/esm/packages/teams-js/dts/public/secondaryBrowser.d.ts +32 -0
  91. package/dist/esm/packages/teams-js/dts/public/serializable.interface.d.ts +17 -0
  92. package/dist/esm/packages/teams-js/dts/public/settings.d.ts +101 -0
  93. package/dist/esm/packages/teams-js/dts/public/sharing.d.ts +124 -0
  94. package/dist/esm/packages/teams-js/dts/public/stageView.d.ts +104 -0
  95. package/dist/esm/packages/teams-js/dts/public/tasks.d.ts +62 -0
  96. package/dist/esm/packages/teams-js/dts/public/teamsAPIs.d.ts +77 -0
  97. package/dist/esm/packages/teams-js/dts/public/thirdPartyCloudStorage.d.ts +119 -0
  98. package/dist/esm/packages/teams-js/dts/public/version.d.ts +5 -0
  99. package/dist/esm/packages/teams-js/dts/public/videoEffects.d.ts +213 -0
  100. package/dist/esm/packages/teams-js/dts/public/visualMedia.d.ts +192 -0
  101. package/dist/esm/packages/teams-js/dts/public/webStorage.d.ts +27 -0
  102. package/dist/esm/packages/teams-js/src/index.js +1 -1
  103. package/dist/esm/packages/teams-js/src/internal/appHelpers.js +1 -0
  104. package/dist/esm/packages/teams-js/src/internal/communication.js +1 -1
  105. package/dist/esm/packages/teams-js/src/internal/deepLinkUtilities.js +1 -1
  106. package/dist/esm/packages/teams-js/src/internal/responseHandler.js +1 -0
  107. package/dist/esm/packages/teams-js/src/private/externalAppAuthentication.js +1 -1
  108. package/dist/esm/packages/teams-js/src/private/externalAppAuthenticationForCEA.js +1 -1
  109. package/dist/esm/packages/teams-js/src/private/hostEntity.js +1 -1
  110. package/dist/esm/packages/teams-js/src/private/videoEffectsEx.js +1 -1
  111. package/dist/esm/packages/teams-js/src/public/app.js +1 -1
  112. package/dist/esm/packages/teams-js/src/public/appId.js +1 -1
  113. package/dist/esm/packages/teams-js/src/public/appInitialization.js +1 -1
  114. package/dist/esm/packages/teams-js/src/public/appInstallDialog.js +1 -1
  115. package/dist/esm/packages/teams-js/src/public/authentication.js +1 -1
  116. package/dist/esm/packages/teams-js/src/public/barCode.js +1 -1
  117. package/dist/esm/packages/teams-js/src/public/calendar.js +1 -1
  118. package/dist/esm/packages/teams-js/src/public/call.js +1 -1
  119. package/dist/esm/packages/teams-js/src/public/clipboard.js +1 -1
  120. package/dist/esm/packages/teams-js/src/public/constants.js +1 -1
  121. package/dist/esm/packages/teams-js/src/public/pages.js +1 -1
  122. package/dist/esm/packages/teams-js/src/public/publicAPIs.js +1 -1
  123. package/dist/esm/packages/teams-js/src/public/serializable.interface.js +1 -0
  124. package/dist/esm/packages/teams-js/src/public/settings.js +1 -1
  125. package/dist/esm/packages/teams-js/src/public/tasks.js +1 -1
  126. package/dist/esm/packages/teams-js/src/public/version.js +1 -1
  127. package/dist/esm/packages/teams-js/src/public/webStorage.js +1 -1
  128. package/dist/umd/MicrosoftTeams.d.ts +10740 -10768
  129. package/dist/umd/MicrosoftTeams.js +1571 -1359
  130. package/dist/umd/MicrosoftTeams.js.map +1 -1
  131. package/dist/umd/MicrosoftTeams.min.js +1 -1
  132. package/dist/umd/MicrosoftTeams.min.js.map +1 -1
  133. package/package.json +1 -51
  134. package/dist/esm/node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/browser.js +0 -1
@@ -0,0 +1,592 @@
1
+ import { ChannelType, FrameContexts, HostClientType, HostName, TeamType, UserTeamRole } from './constants';
2
+ import { ActionInfo, FileOpenPreference, LocaleInfo, ResumeContext } from './interfaces';
3
+ /** App Initialization Messages */
4
+ export declare const Messages: {
5
+ /** App loaded. */
6
+ AppLoaded: string;
7
+ /** App initialized successfully. */
8
+ Success: string;
9
+ /** App initialization failed. */
10
+ Failure: string;
11
+ /** App initialization expected failure. */
12
+ ExpectedFailure: string;
13
+ };
14
+ /**
15
+ * Describes errors that caused app initialization to fail
16
+ */
17
+ export declare enum FailedReason {
18
+ /**
19
+ * Authentication failed
20
+ */
21
+ AuthFailed = "AuthFailed",
22
+ /**
23
+ * The application timed out
24
+ */
25
+ Timeout = "Timeout",
26
+ /**
27
+ * The app failed for a different reason
28
+ */
29
+ Other = "Other"
30
+ }
31
+ /**
32
+ * Describes expected errors that occurred during an otherwise successful
33
+ * app initialization
34
+ */
35
+ export declare enum ExpectedFailureReason {
36
+ /**
37
+ * There was a permission error
38
+ */
39
+ PermissionError = "PermissionError",
40
+ /**
41
+ * The item was not found
42
+ */
43
+ NotFound = "NotFound",
44
+ /**
45
+ * The network is currently throttled
46
+ */
47
+ Throttling = "Throttling",
48
+ /**
49
+ * The application is currently offline
50
+ */
51
+ Offline = "Offline",
52
+ /**
53
+ * The app failed for a different reason
54
+ */
55
+ Other = "Other"
56
+ }
57
+ /**
58
+ * Represents the failed request sent during a failed app initialization.
59
+ */
60
+ export interface IFailedRequest {
61
+ /**
62
+ * The reason for the failure
63
+ */
64
+ reason: FailedReason;
65
+ /**
66
+ * This property is currently unused.
67
+ */
68
+ message?: string;
69
+ }
70
+ /**
71
+ * Represents the failure request sent during an erroneous app initialization.
72
+ */
73
+ export interface IExpectedFailureRequest {
74
+ /**
75
+ * The reason for the failure
76
+ */
77
+ reason: ExpectedFailureReason;
78
+ /**
79
+ * A message that describes the failure
80
+ */
81
+ message?: string;
82
+ }
83
+ /**
84
+ * Represents application information.
85
+ */
86
+ export interface AppInfo {
87
+ /**
88
+ * The current locale that the user has configured for the app formatted as
89
+ * languageId-countryId (for example, en-us).
90
+ */
91
+ locale: string;
92
+ /**
93
+ * The current UI theme of the host. Possible values: "default", "dark", "contrast" or "glass".
94
+ */
95
+ theme: string;
96
+ /**
97
+ * Unique ID for the current session for use in correlating telemetry data. A session corresponds to the lifecycle of an app. A new session begins upon the creation of a webview (on Teams mobile) or iframe (in Teams desktop) hosting the app, and ends when it is destroyed.
98
+ */
99
+ sessionId: string;
100
+ /**
101
+ * Info of the host
102
+ */
103
+ host: AppHostInfo;
104
+ /**
105
+ * More detailed locale info from the user's OS if available. Can be used together with
106
+ * the @microsoft/globe NPM package to ensure your app respects the user's OS date and
107
+ * time format configuration
108
+ */
109
+ osLocaleInfo?: LocaleInfo;
110
+ /**
111
+ * Personal app icon y coordinate position
112
+ */
113
+ iconPositionVertical?: number;
114
+ /**
115
+ * Time when the user clicked on the tab
116
+ */
117
+ userClickTime?: number;
118
+ /**
119
+ * The ID of the parent message from which this task module was launched.
120
+ * This is only available in task modules launched from bot cards.
121
+ */
122
+ parentMessageId?: string;
123
+ /**
124
+ * Where the user prefers the file to be opened from by default during file open
125
+ */
126
+ userFileOpenPreference?: FileOpenPreference;
127
+ /**
128
+ * ID for the current visible app which is different for across cached sessions. Used for correlating telemetry data.
129
+ */
130
+ appLaunchId?: string;
131
+ }
132
+ /**
133
+ * Represents information about the application's host.
134
+ */
135
+ export interface AppHostInfo {
136
+ /**
137
+ * Identifies which host is running your app
138
+ */
139
+ name: HostName;
140
+ /**
141
+ * The client type on which the host is running
142
+ */
143
+ clientType: HostClientType;
144
+ /**
145
+ * Unique ID for the current Host session for use in correlating telemetry data.
146
+ */
147
+ sessionId: string;
148
+ /**
149
+ * Current ring ID
150
+ */
151
+ ringId?: string;
152
+ }
153
+ /**
154
+ * Represents Channel information.
155
+ */
156
+ export interface ChannelInfo {
157
+ /**
158
+ * The Microsoft Teams ID for the channel with which the content is associated.
159
+ */
160
+ id: string;
161
+ /**
162
+ * The name for the channel with which the content is associated.
163
+ */
164
+ displayName?: string;
165
+ /**
166
+ * The relative path to the SharePoint folder associated with the channel.
167
+ */
168
+ relativeUrl?: string;
169
+ /**
170
+ * The type of the channel with which the content is associated.
171
+ */
172
+ membershipType?: ChannelType;
173
+ /**
174
+ * The OneNote section ID that is linked to the channel.
175
+ */
176
+ defaultOneNoteSectionId?: string;
177
+ /**
178
+ * The tenant ID of the team which owns the channel.
179
+ */
180
+ ownerTenantId?: string;
181
+ /**
182
+ * The Microsoft Entra group ID of the team which owns the channel.
183
+ */
184
+ ownerGroupId?: string;
185
+ }
186
+ /**
187
+ * Represents Chat information.
188
+ */
189
+ export interface ChatInfo {
190
+ /**
191
+ * The Microsoft Teams ID for the chat with which the content is associated.
192
+ */
193
+ id: string;
194
+ }
195
+ /**
196
+ * Represents Meeting information.
197
+ */
198
+ export interface MeetingInfo {
199
+ /**
200
+ * Meeting Id used by tab when running in meeting context
201
+ */
202
+ id: string;
203
+ }
204
+ /**
205
+ * Represents Page information.
206
+ */
207
+ export interface PageInfo {
208
+ /**
209
+ * The developer-defined unique ID for the page this content points to.
210
+ */
211
+ id: string;
212
+ /**
213
+ * The context where page url is loaded (content, task, setting, remove, sidePanel)
214
+ */
215
+ frameContext: FrameContexts;
216
+ /**
217
+ * The developer-defined unique ID for the sub-page this content points to.
218
+ * This field should be used to restore to a specific state within a page,
219
+ * such as scrolling to or activating a specific piece of content.
220
+ */
221
+ subPageId?: string;
222
+ /**
223
+ * Indication whether the page is in full-screen mode.
224
+ */
225
+ isFullScreen?: boolean;
226
+ /**
227
+ * Indication whether the page is in a pop out window
228
+ */
229
+ isMultiWindow?: boolean;
230
+ /**
231
+ * Indicates whether the page is being loaded in the background as
232
+ * part of an opt-in performance enhancement.
233
+ */
234
+ isBackgroundLoad?: boolean;
235
+ /**
236
+ * Source origin from where the page is opened
237
+ */
238
+ sourceOrigin?: string;
239
+ }
240
+ /**
241
+ * Represents Team information.
242
+ */
243
+ export interface TeamInfo {
244
+ /**
245
+ * The Microsoft Teams ID for the team with which the content is associated.
246
+ */
247
+ internalId: string;
248
+ /**
249
+ * The name for the team with which the content is associated.
250
+ */
251
+ displayName?: string;
252
+ /**
253
+ * The type of the team.
254
+ */
255
+ type?: TeamType;
256
+ /**
257
+ * The Office 365 group ID for the team with which the content is associated.
258
+ * This field is available only when the identity permission is requested in the manifest.
259
+ */
260
+ groupId?: string;
261
+ /**
262
+ * Indicates whether team is archived.
263
+ * Apps should use this as a signal to prevent any changes to content associated with archived teams.
264
+ */
265
+ isArchived?: boolean;
266
+ /**
267
+ * Team Template ID if there was a Team Template associated with the creation of the team.
268
+ */
269
+ templateId?: string;
270
+ /**
271
+ * The user's role in the team.
272
+
273
+ * Because a malicious party can run your content in a browser, this value should
274
+ * be used only as a hint as to the user's role, and never as proof of her role.
275
+ */
276
+ userRole?: UserTeamRole;
277
+ }
278
+ /**
279
+ * Represents User information.
280
+ */
281
+ export interface UserInfo {
282
+ /**
283
+ * The Microsoft Entra object id of the current user.
284
+ *
285
+ * Because a malicious party can run your content in a browser, this value should
286
+ * be used only as a optimization hint as to who the user is and never as proof of identity.
287
+ * Specifically, this value should never be used to determine if a user is authorized to access
288
+ * a resource; access tokens should be used for that.
289
+ * See {@link authentication.getAuthToken} and {@link authentication.authenticate} for more information on access tokens.
290
+ *
291
+ * This field is available only when the identity permission is requested in the manifest.
292
+ */
293
+ id: string;
294
+ /**
295
+ * The address book name of the current user.
296
+ */
297
+ displayName?: string;
298
+ /**
299
+ * Represents whether calling is allowed for the current logged in User
300
+ */
301
+ isCallingAllowed?: boolean;
302
+ /**
303
+ * Represents whether PSTN calling is allowed for the current logged in User
304
+ */
305
+ isPSTNCallingAllowed?: boolean;
306
+ /**
307
+ * The license type for the current user. Possible values are:
308
+ * "Unknown", "Teacher", "Student", "Free", "SmbBusinessVoice", "SmbNonVoice", "FrontlineWorker", "Anonymous"
309
+ */
310
+ licenseType?: string;
311
+ /**
312
+ * A value suitable for use when providing a login_hint to Microsoft Entra ID for authentication purposes.
313
+ * See [Provide optional claims to your app](https://learn.microsoft.com/azure/active-directory/develop/active-directory-optional-claims#v10-and-v20-optional-claims-set)
314
+ * for more information about the use of login_hint
315
+ *
316
+ * Because a malicious party can run your content in a browser, this value should
317
+ * be used only as a optimization hint as to who the user is and never as proof of identity.
318
+ * Specifically, this value should never be used to determine if a user is authorized to access
319
+ * a resource; access tokens should be used for that.
320
+ * See {@link authentication.getAuthToken} and {@link authentication.authenticate} for more information on access tokens.
321
+ */
322
+ loginHint?: string;
323
+ /**
324
+ * The UPN of the current user. This may be an externally-authenticated UPN (e.g., guest users).
325
+
326
+ * Because a malicious party can run your content in a browser, this value should
327
+ * be used only as a optimization hint as to who the user is and never as proof of identity.
328
+ * Specifically, this value should never be used to determine if a user is authorized to access
329
+ * a resource; access tokens should be used for that.
330
+ * See {@link authentication.getAuthToken} and {@link authentication.authenticate} for more information on access tokens.
331
+ */
332
+ userPrincipalName?: string;
333
+ /**
334
+ * The tenant related info of the current user.
335
+ */
336
+ tenant?: TenantInfo;
337
+ }
338
+ /**
339
+ * Represents Tenant information.
340
+ */
341
+ export interface TenantInfo {
342
+ /**
343
+ * The Microsoft Entra tenant ID of the current user.
344
+
345
+ * Because a malicious party can run your content in a browser, this value should
346
+ * be used only as a optimization hint as to who the user is and never as proof of identity.
347
+ * Specifically, this value should never be used to determine if a user is authorized to access
348
+ * a resource; access tokens should be used for that.
349
+ * See {@link authentication.getAuthToken} and {@link authentication.authenticate} for more information on access tokens.
350
+ */
351
+ id: string;
352
+ /**
353
+ * The type of license for the current user's tenant. Possible values are enterprise, free, edu, and unknown.
354
+ */
355
+ teamsSku?: string;
356
+ }
357
+ /** Represents information about a SharePoint site */
358
+ export interface SharePointSiteInfo {
359
+ /**
360
+ * The root SharePoint site associated with the team.
361
+ */
362
+ teamSiteUrl?: string;
363
+ /**
364
+ * The domain of the root SharePoint site associated with the team.
365
+ */
366
+ teamSiteDomain?: string;
367
+ /**
368
+ * The relative path to the SharePoint site associated with the team.
369
+ */
370
+ teamSitePath?: string;
371
+ /**
372
+ * Teamsite ID, aka sharepoint site id.
373
+ */
374
+ teamSiteId?: string;
375
+ /**
376
+ * The SharePoint my site domain associated with the user.
377
+ */
378
+ mySiteDomain?: string;
379
+ /**
380
+ * The SharePoint relative path to the current users mysite
381
+ */
382
+ mySitePath?: string;
383
+ }
384
+ /**
385
+ * Represents structure of the received context message.
386
+ */
387
+ export interface Context {
388
+ /**
389
+ * Content Action Info
390
+ *
391
+ * @beta
392
+ */
393
+ actionInfo?: ActionInfo;
394
+ /**
395
+ * Properties about the current session for your app
396
+ */
397
+ app: AppInfo;
398
+ /**
399
+ * Info about the current page context hosting your app
400
+ */
401
+ page: PageInfo;
402
+ /**
403
+ * Info about the currently logged in user running the app.
404
+ * If the current user is not logged in/authenticated (e.g. a meeting app running for an anonymously-joined partcipant) this will be `undefined`.
405
+ */
406
+ user?: UserInfo;
407
+ /**
408
+ * When running in the context of a Teams channel, provides information about the channel, else `undefined`
409
+ */
410
+ channel?: ChannelInfo;
411
+ /**
412
+ * When running in the context of a Teams chat, provides information about the chat, else `undefined`
413
+ */
414
+ chat?: ChatInfo;
415
+ /**
416
+ * When running in the context of a Teams meeting, provides information about the meeting, else `undefined`
417
+ */
418
+ meeting?: MeetingInfo;
419
+ /**
420
+ * When hosted in SharePoint, this is the [SharePoint PageContext](https://learn.microsoft.com/javascript/api/sp-page-context/pagecontext?view=sp-typescript-latest), else `undefined`
421
+ */
422
+ sharepoint?: any;
423
+ /**
424
+ * When running in Teams for an organization with a tenant, provides information about the SharePoint site associated with the team.
425
+ * Will be `undefined` when not running in Teams for an organization with a tenant.
426
+ */
427
+ sharePointSite?: SharePointSiteInfo;
428
+ /**
429
+ * When running in Teams, provides information about the Team context in which your app is running.
430
+ * Will be `undefined` when not running in Teams.
431
+ */
432
+ team?: TeamInfo;
433
+ /**
434
+ * When `processActionCommand` activates a dialog, this dialog should automatically fill in some fields with information. This information comes from M365 and is given to `processActionCommand` as `extractedParameters`.
435
+ * App developers need to use these `extractedParameters` in their dialog.
436
+ * They help pre-fill the dialog with necessary information (`dialogParameters`) along with other details.
437
+ * If there's no key/value pairs passed, the object will be empty in the case
438
+ */
439
+ dialogParameters: Record<string, string>;
440
+ }
441
+ /**
442
+ * This function is passed to registerOnThemeHandler. It is called every time the user changes their theme.
443
+ */
444
+ export type themeHandler = (theme: string) => void;
445
+ /**
446
+ * Checks whether the Teams client SDK has been initialized.
447
+ * @returns whether the Teams client SDK has been initialized.
448
+ */
449
+ export declare function isInitialized(): boolean;
450
+ /**
451
+ * Gets the Frame Context that the App is running in. See {@link FrameContexts} for the list of possible values.
452
+ * @returns the Frame Context.
453
+ */
454
+ export declare function getFrameContext(): FrameContexts | undefined;
455
+ /**
456
+ * Initializes the library.
457
+ *
458
+ * @remarks
459
+ * Initialize must have completed successfully (as determined by the resolved Promise) before any other library calls are made
460
+ *
461
+ * @param validMessageOrigins - Optionally specify a list of cross-frame message origins. This parameter is used if you know that your app
462
+ * will be hosted on a custom domain (i.e., not a standard Microsoft 365 host like Teams, Outlook, etc.) Most apps will never need
463
+ * to pass a value for this parameter.
464
+ * Any domains passed in the array must have the https: protocol on the string otherwise they will be ignored. Example: https://www.example.com
465
+ * @returns Promise that will be fulfilled when initialization has completed, or rejected if the initialization fails or times out
466
+ */
467
+ export declare function initialize(validMessageOrigins?: string[]): Promise<void>;
468
+ /**
469
+ * @hidden
470
+ * Undocumented function used to set a mock window for unit tests
471
+ *
472
+ * @internal
473
+ * Limited to Microsoft-internal use
474
+ */
475
+ export declare function _initialize(hostWindow: any): void;
476
+ /**
477
+ * @hidden
478
+ * Undocumented function used to clear state between unit tests
479
+ *
480
+ * @internal
481
+ * Limited to Microsoft-internal use
482
+ */
483
+ export declare function _uninitialize(): void;
484
+ /**
485
+ * Retrieves the current context the frame is running in.
486
+ *
487
+ * @returns Promise that will resolve with the {@link app.Context} object.
488
+ */
489
+ export declare function getContext(): Promise<Context>;
490
+ /**
491
+ * Notifies the frame that app has loaded and to hide the loading indicator if one is shown.
492
+ */
493
+ export declare function notifyAppLoaded(): void;
494
+ /**
495
+ * Notifies the frame that app initialization is successful and is ready for user interaction.
496
+ */
497
+ export declare function notifySuccess(): void;
498
+ /**
499
+ * Notifies the frame that app initialization has failed and to show an error page in its place.
500
+ *
501
+ * @param appInitializationFailedRequest - The failure request containing the reason for why the app failed
502
+ * during initialization as well as an optional message.
503
+ */
504
+ export declare function notifyFailure(appInitializationFailedRequest: IFailedRequest): void;
505
+ /**
506
+ * Notifies the frame that app initialized with some expected errors.
507
+ *
508
+ * @param expectedFailureRequest - The expected failure request containing the reason and an optional message
509
+ */
510
+ export declare function notifyExpectedFailure(expectedFailureRequest: IExpectedFailureRequest): void;
511
+ /**
512
+ * Registers a handler for theme changes.
513
+ *
514
+ * @remarks
515
+ * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
516
+ *
517
+ * @param handler - The handler to invoke when the user changes their theme.
518
+ */
519
+ export declare function registerOnThemeChangeHandler(handler: themeHandler): void;
520
+ /**
521
+ * This function opens deep links to other modules in the host such as chats or channels or
522
+ * general-purpose links (to external websites). It should not be used for navigating to your
523
+ * own or other apps.
524
+ *
525
+ * @remarks
526
+ * If you need to navigate to your own or other apps, use:
527
+ *
528
+ * - {@link pages.currentApp.navigateToDefaultPage} for navigating to the default page of your own app
529
+ * - {@link pages.currentApp.navigateTo} for navigating to a section of your own app
530
+ * - {@link pages.navigateToApp} for navigating to other apps besides your own
531
+ *
532
+ * Many areas of functionality previously provided by deep links are now handled by strongly-typed functions in capabilities.
533
+ * If your app is using a deep link to trigger these specific components, use the strongly-typed alternatives.
534
+ * For example (this list is not exhaustive):
535
+ * - To open an app installation dialog, use the {@link appInstallDialog} capability
536
+ * - To start a call, use the {@link call} capability
537
+ * - To open a chat, use the {@link chat} capability
538
+ * - To open a dialog, use the {@link dialog} capability
539
+ * - To create a new meeting, use the {@link calendar.composeMeeting} function
540
+ * - To open a Stage View, use the {@link stageView} capability
541
+ *
542
+ * In each of these capabilities, you can use the `isSupported()` function to determine if the host supports that capability.
543
+ * When using a deep link to trigger these components, there's no way to determine whether the host supports it.
544
+ *
545
+ * For more information on crafting deep links to the host, see [Configure deep links](https://learn.microsoft.com/microsoftteams/platform/concepts/build-and-test/deep-links)
546
+ *
547
+ * @param deepLink The host deep link or external web URL to which to navigate
548
+ * @returns `Promise` that will be fulfilled when the navigation has initiated. A successful `Promise` resolution
549
+ * does not necessarily indicate whether the target loaded successfully.
550
+ */
551
+ export declare function openLink(deepLink: string): Promise<void>;
552
+ /**
553
+ * A namespace for enabling the suspension or delayed termination of an app when the user navigates away.
554
+ * When an app registers for the registerBeforeSuspendOrTerminateHandler, it chooses to delay termination.
555
+ * When an app registers for both registerBeforeSuspendOrTerminateHandler and registerOnResumeHandler, it chooses the suspension of the app .
556
+ * Please note that selecting suspension doesn't guarantee prevention of background termination.
557
+ * The outcome is influenced by factors such as available memory and the number of suspended apps.
558
+ *
559
+ * @beta
560
+ */
561
+ export declare namespace lifecycle {
562
+ /**
563
+ * Register on resume handler function type
564
+ *
565
+ * @param context - Data structure to be used to pass the context to the app.
566
+ */
567
+ type registerOnResumeHandlerFunctionType = (context: ResumeContext) => void;
568
+ /**
569
+ * Register before suspendOrTerminate handler function type
570
+ *
571
+ * @returns void
572
+ */
573
+ type registerBeforeSuspendOrTerminateHandlerFunctionType = () => Promise<void>;
574
+ /**
575
+ * Registers a handler to be called before the page is suspended or terminated. Once a user navigates away from an app,
576
+ * the handler will be invoked. App developers can use this handler to save unsaved data, pause sync calls etc.
577
+ *
578
+ * @param handler - The handler to invoke before the page is suspended or terminated. When invoked, app can perform tasks like cleanups, logging etc.
579
+ * Upon returning, the app will be suspended or terminated.
580
+ *
581
+ */
582
+ function registerBeforeSuspendOrTerminateHandler(handler: registerBeforeSuspendOrTerminateHandlerFunctionType): void;
583
+ /**
584
+ * Registers a handler to be called when the page has been requested to resume from being suspended.
585
+ *
586
+ * @param handler - The handler to invoke when the page is requested to be resumed. The app is supposed to navigate to
587
+ * the appropriate page using the ResumeContext. Once done, the app should then call {@link notifySuccess}.
588
+ *
589
+ * @beta
590
+ */
591
+ function registerOnResumeHandler(handler: registerOnResumeHandlerFunctionType): void;
592
+ }
@@ -0,0 +1,33 @@
1
+ import { ISerializable } from './serializable.interface';
2
+ /**
3
+ * A strongly-typed class used to represent a "valid" app id.
4
+ *
5
+ * Valid is a relative term, in this case. Truly valid app ids are UUIDs as documented in the schema:
6
+ * https://learn.microsoft.com/en-us/microsoftteams/platform/resources/schema/manifest-schema#id
7
+ * However, there are some older internal/hard-coded apps which violate this schema and use names like
8
+ * com.microsoft.teamspace.tab.youtube. For compatibility with these legacy apps, we unfortunately cannot
9
+ * securely and completely validate app ids as UUIDs. Based on this, the validation is limited to checking
10
+ * for script tags, length, and non-printable characters. Validation will be updated in the future to ensure
11
+ * the app id is a valid UUID as legacy apps update.
12
+ */
13
+ export declare class AppId implements ISerializable {
14
+ private readonly appIdAsString;
15
+ /**
16
+ * Creates a strongly-typed AppId from a string
17
+ *
18
+ * @param appIdAsString An app id represented as a string
19
+ * @throws Error with a message describing the exact validation violation
20
+ */
21
+ constructor(appIdAsString: string);
22
+ /**
23
+ * @hidden
24
+ * @internal
25
+ *
26
+ * @returns A serializable representation of an AppId, used for passing AppIds to the host.
27
+ */
28
+ serialize(): object | string;
29
+ /**
30
+ * Returns the app id as a string
31
+ */
32
+ toString(): string;
33
+ }
@@ -0,0 +1,57 @@
1
+ import { ExpectedFailureReason, FailedReason, IExpectedFailureRequest, IFailedRequest, Messages } from './app';
2
+ /**
3
+ * @deprecated
4
+ * As of TeamsJS v2.0.0, please use {@link app.Messages} instead.
5
+ */
6
+ export { Messages };
7
+ /**
8
+ * @deprecated
9
+ * As of TeamsJS v2.0.0, please use {@link app.FailedReason} instead.
10
+ */
11
+ export { FailedReason };
12
+ /**
13
+ * @deprecated
14
+ * As of TeamsJS v2.0.0, please use {@link app.ExpectedFailureReason} instead.
15
+ */
16
+ export { ExpectedFailureReason };
17
+ /**
18
+ * @deprecated
19
+ * As of TeamsJS v2.0.0, please use {@link app.IFailedRequest} instead.
20
+ */
21
+ export { IFailedRequest };
22
+ /**
23
+ * @deprecated
24
+ * As of TeamsJS v2.0.0, please use {@link app.IExpectedFailureRequest} instead.
25
+ */
26
+ export { IExpectedFailureRequest };
27
+ /**
28
+ * @deprecated
29
+ * As of TeamsJS v2.0.0, please use {@link app.notifyAppLoaded app.notifyAppLoaded(): void} instead.
30
+ *
31
+ * Notifies the frame that app has loaded and to hide the loading indicator if one is shown.
32
+ */
33
+ export declare function notifyAppLoaded(): void;
34
+ /**
35
+ * @deprecated
36
+ * As of TeamsJS v2.0.0, please use {@link app.notifySuccess app.notifySuccess(): void} instead.
37
+ *
38
+ * Notifies the frame that app initialization is successful and is ready for user interaction.
39
+ */
40
+ export declare function notifySuccess(): void;
41
+ /**
42
+ * @deprecated
43
+ * As of TeamsJS v2.0.0, please use {@link app.notifyFailure app.notifyFailure(appInitializationFailedRequest: IFailedRequest): void} instead.
44
+ *
45
+ * Notifies the frame that app initialization has failed and to show an error page in its place.
46
+ * @param appInitializationFailedRequest - The failure request containing the reason for why the app failed
47
+ * during initialization as well as an optional message.
48
+ */
49
+ export declare function notifyFailure(appInitializationFailedRequest: IFailedRequest): void;
50
+ /**
51
+ * @deprecated
52
+ * As of TeamsJS v2.0.0, please use {@link app.notifyExpectedFailure app.notifyExpectedFailure(expectedFailureRequest: IExpectedFailureRequest): void} instead.
53
+ *
54
+ * Notifies the frame that app initialized with some expected errors.
55
+ * @param expectedFailureRequest - The expected failure request containing the reason and an optional message
56
+ */
57
+ export declare function notifyExpectedFailure(expectedFailureRequest: IExpectedFailureRequest): void;
@@ -0,0 +1,18 @@
1
+ /** Represents set of parameters needed to open the appInstallDialog. */
2
+ export interface OpenAppInstallDialogParams {
3
+ /** A unique identifier for the app being installed. */
4
+ appId: string;
5
+ }
6
+ /**
7
+ * Displays a dialog box that allows users to install a specific app within the host environment.
8
+ *
9
+ * @param openAPPInstallDialogParams - See {@link OpenAppInstallDialogParams | OpenAppInstallDialogParams} for more information.
10
+ */
11
+ export declare function openAppInstallDialog(openAPPInstallDialogParams: OpenAppInstallDialogParams): Promise<void>;
12
+ /**
13
+ * Checks if the appInstallDialog capability is supported by the host
14
+ * @returns boolean to represent whether the appInstallDialog capability is supported
15
+ *
16
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
17
+ */
18
+ export declare function isSupported(): boolean;