@microsoft/teams-js 2.24.0-beta.2 → 2.24.0-beta.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -4358,13 +4358,22 @@ export interface ResumeContext {
4358
4358
  /**
4359
4359
  * The content URL that is requested to be loaded
4360
4360
  */
4361
- contentUrl: string;
4361
+ contentUrl: URL;
4362
4362
  }
4363
4363
  /**
4364
4364
  * @deprecated
4365
4365
  * As of 2.14.1, please use {@link ResumeContext} instead.
4366
4366
  */
4367
- export type LoadContext = ResumeContext;
4367
+ export interface LoadContext {
4368
+ /**
4369
+ * The entity that is requested to be loaded
4370
+ */
4371
+ entityId: string;
4372
+ /**
4373
+ * The content URL that is requested to be loaded
4374
+ */
4375
+ contentUrl: string;
4376
+ }
4368
4377
  /** Represents information about a frame within a tab or dialog module. */
4369
4378
  export interface FrameInfo {
4370
4379
  /**
@@ -5074,7 +5083,7 @@ export namespace app {
5074
5083
  *
5075
5084
  * @returns void
5076
5085
  */
5077
- type registerBeforeSuspendOrTerminateHandlerFunctionType = () => void;
5086
+ type registerBeforeSuspendOrTerminateHandlerFunctionType = () => Promise<void>;
5078
5087
  /**
5079
5088
  * Registers a handler to be called before the page is suspended or terminated. Once a user navigates away from an app,
5080
5089
  * the handler will be invoked. App developers can use this handler to save unsaved data, pause sync calls etc.
@@ -3395,7 +3395,7 @@ const _minRuntimeConfigToUninitialize = {
3395
3395
  * @hidden
3396
3396
  * Package version.
3397
3397
  */
3398
- const version = "2.24.0-beta.2";
3398
+ const version = "2.24.0-beta.3";
3399
3399
 
3400
3400
  ;// CONCATENATED MODULE: ./src/internal/internalAPIs.ts
3401
3401
 
@@ -6196,6 +6196,15 @@ var pages;
6196
6196
 
6197
6197
  ;// CONCATENATED MODULE: ./src/internal/handlers.ts
6198
6198
  /* eslint-disable @typescript-eslint/ban-types */
6199
+ var handlers_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
6200
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
6201
+ return new (P || (P = Promise))(function (resolve, reject) {
6202
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6203
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6204
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
6205
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
6206
+ });
6207
+ };
6199
6208
 
6200
6209
 
6201
6210
 
@@ -6364,17 +6373,31 @@ function handlers_registerOnLoadHandler(apiVersionTag, handler) {
6364
6373
  * @internal
6365
6374
  * Limited to Microsoft-internal use
6366
6375
  */
6367
- function handleLoad(context) {
6376
+ function handleLoad(loadContext) {
6377
+ const resumeContext = convertToResumeContext(loadContext);
6368
6378
  if (HandlersPrivate.resumeHandler) {
6369
- HandlersPrivate.resumeHandler(context);
6379
+ HandlersPrivate.resumeHandler(resumeContext);
6380
+ if (Communication.childWindow) {
6381
+ sendMessageEventToChild('load', [resumeContext]);
6382
+ }
6370
6383
  }
6371
6384
  else if (HandlersPrivate.loadHandler) {
6372
- HandlersPrivate.loadHandler(context);
6373
- }
6374
- if (Communication.childWindow) {
6375
- sendMessageEventToChild('load', [context]);
6385
+ HandlersPrivate.loadHandler(loadContext);
6386
+ if (Communication.childWindow) {
6387
+ sendMessageEventToChild('load', [loadContext]);
6388
+ }
6376
6389
  }
6377
6390
  }
6391
+ /**
6392
+ * @internal
6393
+ * Limited to Microsoft-internal use
6394
+ */
6395
+ function convertToResumeContext(context) {
6396
+ return {
6397
+ entityId: context.entityId,
6398
+ contentUrl: new URL(context.contentUrl),
6399
+ };
6400
+ }
6378
6401
  /**
6379
6402
  * @internal
6380
6403
  * Limited to Microsoft-internal use
@@ -6390,26 +6413,28 @@ function handlers_registerBeforeUnloadHandler(apiVersionTag, handler) {
6390
6413
  * Limited to Microsoft-internal use
6391
6414
  */
6392
6415
  function handleBeforeUnload() {
6393
- const readyToUnload = () => {
6394
- sendMessageToParent(getApiVersionTag("v2" /* ApiVersionNumber.V_2 */, "handleBeforeUnload" /* ApiName.HandleBeforeUnload */), 'readyToUnload', []);
6395
- };
6396
- if (HandlersPrivate.beforeSuspendOrTerminateHandler) {
6397
- HandlersPrivate.beforeSuspendOrTerminateHandler();
6398
- if (Communication.childWindow) {
6399
- sendMessageEventToChild('beforeUnload');
6400
- }
6401
- else {
6402
- readyToUnload();
6403
- }
6404
- }
6405
- else if (!HandlersPrivate.beforeUnloadHandler || !HandlersPrivate.beforeUnloadHandler(readyToUnload)) {
6406
- if (Communication.childWindow) {
6407
- sendMessageEventToChild('beforeUnload');
6416
+ return handlers_awaiter(this, void 0, void 0, function* () {
6417
+ const readyToUnload = () => {
6418
+ sendMessageToParent(getApiVersionTag("v2" /* ApiVersionNumber.V_2 */, "handleBeforeUnload" /* ApiName.HandleBeforeUnload */), 'readyToUnload', []);
6419
+ };
6420
+ if (HandlersPrivate.beforeSuspendOrTerminateHandler) {
6421
+ yield HandlersPrivate.beforeSuspendOrTerminateHandler();
6422
+ if (Communication.childWindow) {
6423
+ sendMessageEventToChild('beforeUnload');
6424
+ }
6425
+ else {
6426
+ readyToUnload();
6427
+ }
6408
6428
  }
6409
- else {
6410
- readyToUnload();
6429
+ else if (!HandlersPrivate.beforeUnloadHandler || !HandlersPrivate.beforeUnloadHandler(readyToUnload)) {
6430
+ if (Communication.childWindow) {
6431
+ sendMessageEventToChild('beforeUnload');
6432
+ }
6433
+ else {
6434
+ readyToUnload();
6435
+ }
6411
6436
  }
6412
- }
6437
+ });
6413
6438
  }
6414
6439
  /**
6415
6440
  * @internal