@microsoft/teams-js 2.15.0 → 2.16.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2705,6 +2705,10 @@ export enum HostName {
2705
2705
  * Microsoft-internal test Host
2706
2706
  */
2707
2707
  orange = "Orange",
2708
+ /**
2709
+ * Microsoft connected workplace platform
2710
+ */
2711
+ places = "Places",
2708
2712
  /**
2709
2713
  * Teams
2710
2714
  */
@@ -3626,9 +3630,9 @@ export interface DialogInfo {
3626
3630
  export type TaskInfo = DialogInfo;
3627
3631
  /**
3628
3632
  * @beta
3629
- * Data structure to be used with the {@link teamsCore.registerOnLoadHandler teamsCore.registerOnLoadHandler(handler: (context: LoadContext) => void): void} to pass the context to the app.
3633
+ * Data structure to be used with the {@link app.lifecycle.registerOnResumeHandler app.lifecycle.registerOnResumeHandler(handler: (context: ResumeContext) => void): void} to pass the context to the app.
3630
3634
  */
3631
- export interface LoadContext {
3635
+ export interface ResumeContext {
3632
3636
  /**
3633
3637
  * The entity that is requested to be loaded
3634
3638
  */
@@ -3638,6 +3642,11 @@ export interface LoadContext {
3638
3642
  */
3639
3643
  contentUrl: string;
3640
3644
  }
3645
+ /**
3646
+ * @deprecated
3647
+ * As of 2.14.1, please use ResumeContext instead.
3648
+ */
3649
+ export type LoadContext = ResumeContext;
3641
3650
  /** Represents information about a frame within a tab or dialog module. */
3642
3651
  export interface FrameInfo {
3643
3652
  /**
@@ -4281,6 +4290,56 @@ export namespace app {
4281
4290
  * @returns Promise that will be fulfilled when the operation has completed
4282
4291
  */
4283
4292
  export function openLink(deepLink: string): Promise<void>;
4293
+ /**
4294
+ * A namespace for enabling the suspension or delayed termination of an app when the user navigates away.
4295
+ * When an app registers for the registerBeforeSuspendOrTerminateHandler, it chooses to delay termination.
4296
+ * When an app registers for both registerBeforeSuspendOrTerminateHandler and registerOnResumeHandler, it chooses the suspension of the app .
4297
+ * Please note that selecting suspension doesn't guarantee prevention of background termination.
4298
+ * The outcome is influenced by factors such as available memory and the number of suspended apps.
4299
+ *
4300
+ * @beta
4301
+ */
4302
+ export namespace lifecycle {
4303
+ /**
4304
+ * Register on resume handler function type
4305
+ *
4306
+ * @param context - Data structure to be used to pass the context to the app.
4307
+ */
4308
+ type registerOnResumeHandlerFunctionType = (context: ResumeContext) => void;
4309
+ /**
4310
+ * Register before suspendOrTerminate handler function type
4311
+ *
4312
+ * @returns void
4313
+ */
4314
+ type registerBeforeSuspendOrTerminateHandlerFunctionType = () => void;
4315
+ /**
4316
+ * Registers a handler to be called before the page is suspended or terminated. Once a user navigates away from an app,
4317
+ * the handler will be invoked. App developers can use this handler to save unsaved data, pause sync calls etc.
4318
+ *
4319
+ * @param handler - The handler to invoke before the page is suspended or terminated. When invoked, app can perform tasks like cleanups, logging etc.
4320
+ * Upon returning, the app will be suspended or terminated.
4321
+ *
4322
+ */
4323
+ export function registerBeforeSuspendOrTerminateHandler(handler: registerBeforeSuspendOrTerminateHandlerFunctionType): void;
4324
+ /**
4325
+ * Registers a handler to be called when the page has been requested to resume from being suspended.
4326
+ *
4327
+ * @param handler - The handler to invoke when the page is requested to be resumed. The app is supposed to navigate to
4328
+ * the appropriate page using the ResumeContext. Once done, the app should then call {@link notifySuccess}.
4329
+ *
4330
+ * @beta
4331
+ */
4332
+ export function registerOnResumeHandler(handler: registerOnResumeHandlerFunctionType): void;
4333
+ /**
4334
+ * Checks if app.lifecycle is supported by the host.
4335
+ * @returns boolean to represent whether the lifecycle capability is supported
4336
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
4337
+ *
4338
+ * @beta
4339
+ */
4340
+ export function isSupported(): boolean;
4341
+ export {};
4342
+ }
4284
4343
  export {};
4285
4344
  }
4286
4345
 
@@ -6873,6 +6932,9 @@ export namespace teamsCore {
6873
6932
  *
6874
6933
  * @param handler - The handler to invoke when the page is loaded.
6875
6934
  *
6935
+ * @deprecated
6936
+ * As of 2.14.1, please use {@link app.lifecycle.registerOnResumeHandler} instead.
6937
+ *
6876
6938
  * @beta
6877
6939
  */
6878
6940
  export function registerOnLoadHandler(handler: registerOnLoadHandlerFunctionType): void;
@@ -6885,6 +6947,8 @@ export namespace teamsCore {
6885
6947
  *
6886
6948
  * @param handler - The handler to invoke when the page is loaded.
6887
6949
  * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
6950
+ *
6951
+ * @deprecated
6888
6952
  */
6889
6953
  export function registerOnLoadHandlerHelper(handler: registerOnLoadHandlerFunctionType, versionSpecificHelper?: () => void): void;
6890
6954
  /**
@@ -6896,6 +6960,7 @@ export namespace teamsCore {
6896
6960
  * @param handler - The handler to invoke before the page is unloaded. If this handler returns true the page should
6897
6961
  * invoke the readyToUnload function provided to it once it's ready to be unloaded.
6898
6962
  *
6963
+ * @deprecated
6899
6964
  * @beta
6900
6965
  */
6901
6966
  export function registerBeforeUnloadHandler(handler: registerBeforeUnloadHandlerFunctionType): void;
@@ -6909,6 +6974,8 @@ export namespace teamsCore {
6909
6974
  * @param handler - - The handler to invoke before the page is unloaded. If this handler returns true the page should
6910
6975
  * invoke the readyToUnload function provided to it once it's ready to be unloaded.
6911
6976
  * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
6977
+ *
6978
+ * @deprecated
6912
6979
  */
6913
6980
  export function registerBeforeUnloadHandlerHelper(handler: registerBeforeUnloadHandlerFunctionType, versionSpecificHelper?: () => void): void;
6914
6981
  /**
@@ -1351,6 +1351,10 @@ var HostName;
1351
1351
  * Microsoft-internal test Host
1352
1352
  */
1353
1353
  HostName["orange"] = "Orange";
1354
+ /**
1355
+ * Microsoft connected workplace platform
1356
+ */
1357
+ HostName["places"] = "Places";
1354
1358
  /**
1355
1359
  * Teams
1356
1360
  */
@@ -1972,6 +1976,11 @@ var teamsRuntimeConfig = {
1972
1976
  hostVersionsInfo: teamsMinAdaptiveCardVersion,
1973
1977
  isLegacyTeams: true,
1974
1978
  supports: {
1979
+ app: {
1980
+ lifecycle: {
1981
+ caching: {},
1982
+ },
1983
+ },
1975
1984
  appInstallDialog: {},
1976
1985
  appEntity: {},
1977
1986
  call: {},
@@ -2203,7 +2212,7 @@ var _minRuntimeConfigToUninitialize = {
2203
2212
  * @hidden
2204
2213
  * Package version.
2205
2214
  */
2206
- var version = "2.15.0";
2215
+ var version = "2.16.0-beta.1";
2207
2216
 
2208
2217
  ;// CONCATENATED MODULE: ./src/internal/internalAPIs.ts
2209
2218
 
@@ -3354,137 +3363,6 @@ var menus;
3354
3363
  menus.isSupported = isSupported;
3355
3364
  })(menus || (menus = {}));
3356
3365
 
3357
- ;// CONCATENATED MODULE: ./src/public/teamsAPIs.ts
3358
-
3359
- // Conflict with some names
3360
-
3361
-
3362
-
3363
-
3364
- /**
3365
- * Namespace containing the set of APIs that support Teams-specific functionalities.
3366
- */
3367
- var teamsCore;
3368
- (function (teamsCore) {
3369
- /**
3370
- * Enable print capability to support printing page using Ctrl+P and cmd+P
3371
- */
3372
- function enablePrintCapability() {
3373
- if (!GlobalVars.printCapabilityEnabled) {
3374
- ensureInitialized(runtime);
3375
- if (!isSupported()) {
3376
- throw errorNotSupportedOnPlatform;
3377
- }
3378
- GlobalVars.printCapabilityEnabled = true;
3379
- // adding ctrl+P and cmd+P handler
3380
- document.addEventListener('keydown', function (event) {
3381
- if ((event.ctrlKey || event.metaKey) && event.keyCode === 80) {
3382
- print();
3383
- event.cancelBubble = true;
3384
- event.preventDefault();
3385
- event.stopImmediatePropagation();
3386
- }
3387
- });
3388
- }
3389
- }
3390
- teamsCore.enablePrintCapability = enablePrintCapability;
3391
- /**
3392
- * default print handler
3393
- */
3394
- function print() {
3395
- ssrSafeWindow().print();
3396
- }
3397
- teamsCore.print = print;
3398
- /**
3399
- * Registers a handler to be called when the page has been requested to load.
3400
- *
3401
- * @remarks Check out [App Caching in Teams](https://learn.microsoft.com/microsoftteams/platform/apps-in-teams-meetings/build-tabs-for-meeting?tabs=desktop%2Cmeeting-chat-view-desktop%2Cmeeting-stage-view-desktop%2Cchannel-meeting-desktop#app-caching)
3402
- * for a more detailed explanation about using this API.
3403
- *
3404
- * @param handler - The handler to invoke when the page is loaded.
3405
- *
3406
- * @beta
3407
- */
3408
- function registerOnLoadHandler(handler) {
3409
- registerOnLoadHandlerHelper(handler, function () {
3410
- if (handler && !isSupported()) {
3411
- throw errorNotSupportedOnPlatform;
3412
- }
3413
- });
3414
- }
3415
- teamsCore.registerOnLoadHandler = registerOnLoadHandler;
3416
- /**
3417
- * @hidden
3418
- * Undocumented helper function with shared code between deprecated version and current version of the registerOnLoadHandler API.
3419
- *
3420
- * @internal
3421
- * Limited to Microsoft-internal use
3422
- *
3423
- * @param handler - The handler to invoke when the page is loaded.
3424
- * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
3425
- */
3426
- function registerOnLoadHandlerHelper(handler, versionSpecificHelper) {
3427
- // allow for registration cleanup even when not finished initializing
3428
- handler && ensureInitialized(runtime);
3429
- if (handler && versionSpecificHelper) {
3430
- versionSpecificHelper();
3431
- }
3432
- handlers_registerOnLoadHandler(handler);
3433
- }
3434
- teamsCore.registerOnLoadHandlerHelper = registerOnLoadHandlerHelper;
3435
- /**
3436
- * Registers a handler to be called before the page is unloaded.
3437
- *
3438
- * @remarks Check out [App Caching in Teams](https://learn.microsoft.com/microsoftteams/platform/apps-in-teams-meetings/build-tabs-for-meeting?tabs=desktop%2Cmeeting-chat-view-desktop%2Cmeeting-stage-view-desktop%2Cchannel-meeting-desktop#app-caching)
3439
- * for a more detailed explanation about using this API.
3440
- *
3441
- * @param handler - The handler to invoke before the page is unloaded. If this handler returns true the page should
3442
- * invoke the readyToUnload function provided to it once it's ready to be unloaded.
3443
- *
3444
- * @beta
3445
- */
3446
- function registerBeforeUnloadHandler(handler) {
3447
- registerBeforeUnloadHandlerHelper(handler, function () {
3448
- if (handler && !isSupported()) {
3449
- throw errorNotSupportedOnPlatform;
3450
- }
3451
- });
3452
- }
3453
- teamsCore.registerBeforeUnloadHandler = registerBeforeUnloadHandler;
3454
- /**
3455
- * @hidden
3456
- * Undocumented helper function with shared code between deprecated version and current version of the registerBeforeUnloadHandler API.
3457
- *
3458
- * @internal
3459
- * Limited to Microsoft-internal use
3460
- *
3461
- * @param handler - - The handler to invoke before the page is unloaded. If this handler returns true the page should
3462
- * invoke the readyToUnload function provided to it once it's ready to be unloaded.
3463
- * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
3464
- */
3465
- function registerBeforeUnloadHandlerHelper(handler, versionSpecificHelper) {
3466
- // allow for registration cleanup even when not finished initializing
3467
- handler && ensureInitialized(runtime);
3468
- if (handler && versionSpecificHelper) {
3469
- versionSpecificHelper();
3470
- }
3471
- handlers_registerBeforeUnloadHandler(handler);
3472
- }
3473
- teamsCore.registerBeforeUnloadHandlerHelper = registerBeforeUnloadHandlerHelper;
3474
- /**
3475
- * Checks if teamsCore capability is supported by the host
3476
- *
3477
- * @returns boolean to represent whether the teamsCore capability is supported
3478
- *
3479
- * @throws Error if {@linkcode app.initialize} has not successfully completed
3480
- *
3481
- */
3482
- function isSupported() {
3483
- return ensureInitialized(runtime) && runtime.supports.teamsCore ? true : false;
3484
- }
3485
- teamsCore.isSupported = isSupported;
3486
- })(teamsCore || (teamsCore = {}));
3487
-
3488
3366
  ;// CONCATENATED MODULE: ./src/public/app.ts
3489
3367
  /* eslint-disable @typescript-eslint/no-empty-function */
3490
3368
  /* eslint-disable @typescript-eslint/explicit-module-boundary-types */
@@ -3503,8 +3381,6 @@ var teamsCore;
3503
3381
 
3504
3382
 
3505
3383
 
3506
-
3507
-
3508
3384
  /**
3509
3385
  * Namespace to interact with app initialization and lifecycle.
3510
3386
  */
@@ -3713,24 +3589,7 @@ var app;
3713
3589
  if (!GlobalVars.initializeCalled) {
3714
3590
  return;
3715
3591
  }
3716
- if (GlobalVars.frameContext) {
3717
- /* eslint-disable strict-null-checks/all */ /* Fix tracked by 5730662 */
3718
- registerOnThemeChangeHandler(null);
3719
- pages.backStack.registerBackButtonHandler(null);
3720
- pages.registerFullScreenHandler(null);
3721
- teamsCore.registerBeforeUnloadHandler(null);
3722
- teamsCore.registerOnLoadHandler(null);
3723
- logs.registerGetLogHandler(null); /* Fix tracked by 5730662 */
3724
- /* eslint-enable strict-null-checks/all */
3725
- }
3726
- if (GlobalVars.frameContext === FrameContexts.settings) {
3727
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
3728
- pages.config.registerOnSaveHandler(null);
3729
- }
3730
- if (GlobalVars.frameContext === FrameContexts.remove) {
3731
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
3732
- pages.config.registerOnRemoveHandler(null);
3733
- }
3592
+ uninitializeHandlers();
3734
3593
  GlobalVars.initializeCalled = false;
3735
3594
  GlobalVars.initializeCompleted = false;
3736
3595
  GlobalVars.initializePromise = null;
@@ -3820,6 +3679,66 @@ var app;
3820
3679
  });
3821
3680
  }
3822
3681
  app.openLink = openLink;
3682
+ /**
3683
+ * A namespace for enabling the suspension or delayed termination of an app when the user navigates away.
3684
+ * When an app registers for the registerBeforeSuspendOrTerminateHandler, it chooses to delay termination.
3685
+ * When an app registers for both registerBeforeSuspendOrTerminateHandler and registerOnResumeHandler, it chooses the suspension of the app .
3686
+ * Please note that selecting suspension doesn't guarantee prevention of background termination.
3687
+ * The outcome is influenced by factors such as available memory and the number of suspended apps.
3688
+ *
3689
+ * @beta
3690
+ */
3691
+ var lifecycle;
3692
+ (function (lifecycle) {
3693
+ /**
3694
+ * Registers a handler to be called before the page is suspended or terminated. Once a user navigates away from an app,
3695
+ * the handler will be invoked. App developers can use this handler to save unsaved data, pause sync calls etc.
3696
+ *
3697
+ * @param handler - The handler to invoke before the page is suspended or terminated. When invoked, app can perform tasks like cleanups, logging etc.
3698
+ * Upon returning, the app will be suspended or terminated.
3699
+ *
3700
+ */
3701
+ function registerBeforeSuspendOrTerminateHandler(handler) {
3702
+ if (!handler) {
3703
+ throw new Error('[app.lifecycle.registerBeforeSuspendOrTerminateHandler] Handler cannot be null');
3704
+ }
3705
+ if (!isSupported()) {
3706
+ throw errorNotSupportedOnPlatform;
3707
+ }
3708
+ handlers_registerBeforeSuspendOrTerminateHandler(handler);
3709
+ }
3710
+ lifecycle.registerBeforeSuspendOrTerminateHandler = registerBeforeSuspendOrTerminateHandler;
3711
+ /**
3712
+ * Registers a handler to be called when the page has been requested to resume from being suspended.
3713
+ *
3714
+ * @param handler - The handler to invoke when the page is requested to be resumed. The app is supposed to navigate to
3715
+ * the appropriate page using the ResumeContext. Once done, the app should then call {@link notifySuccess}.
3716
+ *
3717
+ * @beta
3718
+ */
3719
+ function registerOnResumeHandler(handler) {
3720
+ if (!handler) {
3721
+ throw new Error('[app.lifecycle.registerOnResumeHandler] Handler cannot be null');
3722
+ }
3723
+ if (!isSupported()) {
3724
+ throw errorNotSupportedOnPlatform;
3725
+ }
3726
+ handlers_registerOnResumeHandler(handler);
3727
+ }
3728
+ lifecycle.registerOnResumeHandler = registerOnResumeHandler;
3729
+ /**
3730
+ * Checks if app.lifecycle is supported by the host.
3731
+ * @returns boolean to represent whether the lifecycle capability is supported
3732
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
3733
+ *
3734
+ * @beta
3735
+ */
3736
+ function isSupported() {
3737
+ var _a;
3738
+ return ensureInitialized(runtime) && !!((_a = runtime.supports.app) === null || _a === void 0 ? void 0 : _a.lifecycle);
3739
+ }
3740
+ lifecycle.isSupported = isSupported;
3741
+ })(lifecycle = app.lifecycle || (app.lifecycle = {}));
3823
3742
  })(app || (app = {}));
3824
3743
  /**
3825
3744
  * @hidden
@@ -4681,6 +4600,33 @@ var handlersLogger = getLogger('handlers');
4681
4600
  var HandlersPrivate = /** @class */ (function () {
4682
4601
  function HandlersPrivate() {
4683
4602
  }
4603
+ /**
4604
+ * @internal
4605
+ * Limited to Microsoft-internal use
4606
+ * Initializes the handlers.
4607
+ */
4608
+ HandlersPrivate.initializeHandlers = function () {
4609
+ // ::::::::::::::::::::MicrosoftTeams SDK Internal :::::::::::::::::
4610
+ HandlersPrivate.handlers['themeChange'] = handleThemeChange;
4611
+ HandlersPrivate.handlers['load'] = handleLoad;
4612
+ HandlersPrivate.handlers['beforeUnload'] = handleBeforeUnload;
4613
+ HandlersPrivate.handlers['beforeSuspendOrTerminate'] = handleBeforeSuspendOrTerminate;
4614
+ HandlersPrivate.handlers['resume'] = handleResume;
4615
+ pages.backStack._initialize();
4616
+ };
4617
+ /**
4618
+ * @internal
4619
+ * Limited to Microsoft-internal use
4620
+ * Uninitializes the handlers.
4621
+ */
4622
+ HandlersPrivate.uninitializeHandlers = function () {
4623
+ HandlersPrivate.handlers = {};
4624
+ HandlersPrivate.themeChangeHandler = null;
4625
+ HandlersPrivate.loadHandler = null;
4626
+ HandlersPrivate.beforeUnloadHandler = null;
4627
+ HandlersPrivate.beforeSuspendOrTerminateHandler = null;
4628
+ HandlersPrivate.resumeHandler = null;
4629
+ };
4684
4630
  HandlersPrivate.handlers = {};
4685
4631
  return HandlersPrivate;
4686
4632
  }());
@@ -4689,11 +4635,14 @@ var HandlersPrivate = /** @class */ (function () {
4689
4635
  * Limited to Microsoft-internal use
4690
4636
  */
4691
4637
  function initializeHandlers() {
4692
- // ::::::::::::::::::::MicrosoftTeams SDK Internal :::::::::::::::::
4693
- HandlersPrivate.handlers['themeChange'] = handleThemeChange;
4694
- HandlersPrivate.handlers['load'] = handleLoad;
4695
- HandlersPrivate.handlers['beforeUnload'] = handleBeforeUnload;
4696
- pages.backStack._initialize();
4638
+ HandlersPrivate.initializeHandlers();
4639
+ }
4640
+ /**
4641
+ * @internal
4642
+ * Limited to Microsoft-internal use
4643
+ */
4644
+ function uninitializeHandlers() {
4645
+ HandlersPrivate.uninitializeHandlers();
4697
4646
  }
4698
4647
  var callHandlerLogger = handlersLogger.extend('callHandler');
4699
4648
  /**
@@ -4788,6 +4737,8 @@ function handleThemeChange(theme) {
4788
4737
  /**
4789
4738
  * @internal
4790
4739
  * Limited to Microsoft-internal use
4740
+ *
4741
+ * @deprecated
4791
4742
  */
4792
4743
  function handlers_registerOnLoadHandler(handler) {
4793
4744
  HandlersPrivate.loadHandler = handler;
@@ -4796,6 +4747,8 @@ function handlers_registerOnLoadHandler(handler) {
4796
4747
  /**
4797
4748
  * @internal
4798
4749
  * Limited to Microsoft-internal use
4750
+ *
4751
+ * @deprecated
4799
4752
  */
4800
4753
  function handleLoad(context) {
4801
4754
  if (HandlersPrivate.loadHandler) {
@@ -4808,6 +4761,8 @@ function handleLoad(context) {
4808
4761
  /**
4809
4762
  * @internal
4810
4763
  * Limited to Microsoft-internal use
4764
+ *
4765
+ * @deprecated
4811
4766
  */
4812
4767
  function handlers_registerBeforeUnloadHandler(handler) {
4813
4768
  HandlersPrivate.beforeUnloadHandler = handler;
@@ -4816,6 +4771,8 @@ function handlers_registerBeforeUnloadHandler(handler) {
4816
4771
  /**
4817
4772
  * @internal
4818
4773
  * Limited to Microsoft-internal use
4774
+ *
4775
+ * @deprecated
4819
4776
  */
4820
4777
  function handleBeforeUnload() {
4821
4778
  var readyToUnload = function () {
@@ -4830,6 +4787,52 @@ function handleBeforeUnload() {
4830
4787
  }
4831
4788
  }
4832
4789
  }
4790
+ /**
4791
+ * @internal
4792
+ * Limited to Microsoft-internal use
4793
+ */
4794
+ function handlers_registerBeforeSuspendOrTerminateHandler(handler) {
4795
+ HandlersPrivate.beforeSuspendOrTerminateHandler = handler;
4796
+ handler && sendMessageToParent('registerHandler', ['beforeSuspendOrTerminate']);
4797
+ }
4798
+ /**
4799
+ * @internal
4800
+ * Limited to Microsoft-internal use
4801
+ */
4802
+ function handleBeforeSuspendOrTerminate() {
4803
+ var readyToSuspendOrTerminate = function () {
4804
+ sendMessageToParent('readyToSuspendOrTerminate', []);
4805
+ };
4806
+ if (HandlersPrivate.beforeSuspendOrTerminateHandler) {
4807
+ HandlersPrivate.beforeSuspendOrTerminateHandler();
4808
+ }
4809
+ if (Communication.childWindow) {
4810
+ sendMessageEventToChild('beforeSuspendOrTerminate');
4811
+ }
4812
+ else {
4813
+ readyToSuspendOrTerminate();
4814
+ }
4815
+ }
4816
+ /**
4817
+ * @internal
4818
+ * Limited to Microsoft-internal use
4819
+ */
4820
+ function handlers_registerOnResumeHandler(handler) {
4821
+ HandlersPrivate.loadHandler = handler;
4822
+ handler && sendMessageToParent('registerHandler', ['resume']);
4823
+ }
4824
+ /**
4825
+ * @internal
4826
+ * Limited to Microsoft-internal use
4827
+ */
4828
+ function handleResume(context) {
4829
+ if (HandlersPrivate.loadHandler) {
4830
+ HandlersPrivate.loadHandler(context);
4831
+ }
4832
+ if (Communication.childWindow) {
4833
+ sendMessageEventToChild('resume', [context]);
4834
+ }
4835
+ }
4833
4836
 
4834
4837
  ;// CONCATENATED MODULE: ./src/internal/communication.ts
4835
4838
  /* eslint-disable @typescript-eslint/ban-types */
@@ -7952,6 +7955,145 @@ var mail;
7952
7955
  })(ComposeMailType = mail.ComposeMailType || (mail.ComposeMailType = {}));
7953
7956
  })(mail || (mail = {}));
7954
7957
 
7958
+ ;// CONCATENATED MODULE: ./src/public/teamsAPIs.ts
7959
+
7960
+ // Conflict with some names
7961
+
7962
+
7963
+
7964
+
7965
+ /**
7966
+ * Namespace containing the set of APIs that support Teams-specific functionalities.
7967
+ */
7968
+ var teamsCore;
7969
+ (function (teamsCore) {
7970
+ /**
7971
+ * Enable print capability to support printing page using Ctrl+P and cmd+P
7972
+ */
7973
+ function enablePrintCapability() {
7974
+ if (!GlobalVars.printCapabilityEnabled) {
7975
+ ensureInitialized(runtime);
7976
+ if (!isSupported()) {
7977
+ throw errorNotSupportedOnPlatform;
7978
+ }
7979
+ GlobalVars.printCapabilityEnabled = true;
7980
+ // adding ctrl+P and cmd+P handler
7981
+ document.addEventListener('keydown', function (event) {
7982
+ if ((event.ctrlKey || event.metaKey) && event.keyCode === 80) {
7983
+ print();
7984
+ event.cancelBubble = true;
7985
+ event.preventDefault();
7986
+ event.stopImmediatePropagation();
7987
+ }
7988
+ });
7989
+ }
7990
+ }
7991
+ teamsCore.enablePrintCapability = enablePrintCapability;
7992
+ /**
7993
+ * default print handler
7994
+ */
7995
+ function print() {
7996
+ ssrSafeWindow().print();
7997
+ }
7998
+ teamsCore.print = print;
7999
+ /**
8000
+ * Registers a handler to be called when the page has been requested to load.
8001
+ *
8002
+ * @remarks Check out [App Caching in Teams](https://learn.microsoft.com/microsoftteams/platform/apps-in-teams-meetings/build-tabs-for-meeting?tabs=desktop%2Cmeeting-chat-view-desktop%2Cmeeting-stage-view-desktop%2Cchannel-meeting-desktop#app-caching)
8003
+ * for a more detailed explanation about using this API.
8004
+ *
8005
+ * @param handler - The handler to invoke when the page is loaded.
8006
+ *
8007
+ * @deprecated
8008
+ * As of 2.14.1, please use {@link app.lifecycle.registerOnResumeHandler} instead.
8009
+ *
8010
+ * @beta
8011
+ */
8012
+ function registerOnLoadHandler(handler) {
8013
+ registerOnLoadHandlerHelper(handler, function () {
8014
+ if (handler && !isSupported()) {
8015
+ throw errorNotSupportedOnPlatform;
8016
+ }
8017
+ });
8018
+ }
8019
+ teamsCore.registerOnLoadHandler = registerOnLoadHandler;
8020
+ /**
8021
+ * @hidden
8022
+ * Undocumented helper function with shared code between deprecated version and current version of the registerOnLoadHandler API.
8023
+ *
8024
+ * @internal
8025
+ * Limited to Microsoft-internal use
8026
+ *
8027
+ * @param handler - The handler to invoke when the page is loaded.
8028
+ * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
8029
+ *
8030
+ * @deprecated
8031
+ */
8032
+ function registerOnLoadHandlerHelper(handler, versionSpecificHelper) {
8033
+ // allow for registration cleanup even when not finished initializing
8034
+ handler && ensureInitialized(runtime);
8035
+ if (handler && versionSpecificHelper) {
8036
+ versionSpecificHelper();
8037
+ }
8038
+ handlers_registerOnLoadHandler(handler);
8039
+ }
8040
+ teamsCore.registerOnLoadHandlerHelper = registerOnLoadHandlerHelper;
8041
+ /**
8042
+ * Registers a handler to be called before the page is unloaded.
8043
+ *
8044
+ * @remarks Check out [App Caching in Teams](https://learn.microsoft.com/microsoftteams/platform/apps-in-teams-meetings/build-tabs-for-meeting?tabs=desktop%2Cmeeting-chat-view-desktop%2Cmeeting-stage-view-desktop%2Cchannel-meeting-desktop#app-caching)
8045
+ * for a more detailed explanation about using this API.
8046
+ *
8047
+ * @param handler - The handler to invoke before the page is unloaded. If this handler returns true the page should
8048
+ * invoke the readyToUnload function provided to it once it's ready to be unloaded.
8049
+ *
8050
+ * @deprecated
8051
+ * @beta
8052
+ */
8053
+ function registerBeforeUnloadHandler(handler) {
8054
+ registerBeforeUnloadHandlerHelper(handler, function () {
8055
+ if (handler && !isSupported()) {
8056
+ throw errorNotSupportedOnPlatform;
8057
+ }
8058
+ });
8059
+ }
8060
+ teamsCore.registerBeforeUnloadHandler = registerBeforeUnloadHandler;
8061
+ /**
8062
+ * @hidden
8063
+ * Undocumented helper function with shared code between deprecated version and current version of the registerBeforeUnloadHandler API.
8064
+ *
8065
+ * @internal
8066
+ * Limited to Microsoft-internal use
8067
+ *
8068
+ * @param handler - - The handler to invoke before the page is unloaded. If this handler returns true the page should
8069
+ * invoke the readyToUnload function provided to it once it's ready to be unloaded.
8070
+ * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
8071
+ *
8072
+ * @deprecated
8073
+ */
8074
+ function registerBeforeUnloadHandlerHelper(handler, versionSpecificHelper) {
8075
+ // allow for registration cleanup even when not finished initializing
8076
+ handler && ensureInitialized(runtime);
8077
+ if (handler && versionSpecificHelper) {
8078
+ versionSpecificHelper();
8079
+ }
8080
+ handlers_registerBeforeUnloadHandler(handler);
8081
+ }
8082
+ teamsCore.registerBeforeUnloadHandlerHelper = registerBeforeUnloadHandlerHelper;
8083
+ /**
8084
+ * Checks if teamsCore capability is supported by the host
8085
+ *
8086
+ * @returns boolean to represent whether the teamsCore capability is supported
8087
+ *
8088
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
8089
+ *
8090
+ */
8091
+ function isSupported() {
8092
+ return ensureInitialized(runtime) && runtime.supports.teamsCore ? true : false;
8093
+ }
8094
+ teamsCore.isSupported = isSupported;
8095
+ })(teamsCore || (teamsCore = {}));
8096
+
7955
8097
  ;// CONCATENATED MODULE: ./src/public/people.ts
7956
8098
 
7957
8099