@microsoft/teams-js 2.0.0-beta.4-dev.11 → 2.0.0-beta.4-dev.12

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.
@@ -3070,15 +3070,9 @@ export namespace pages {
3070
3070
  export interface IAppWindow {
3071
3071
  /**
3072
3072
  * Send a message to the AppWindow.
3073
+ *
3073
3074
  * @param message - The message to send
3074
- * @returns Promise that will be fulfilled when the AppWindow posts back a response
3075
- */
3076
- postMessage(message: any): Promise<void>;
3077
- /**
3078
- * @deprecated
3079
- * As of 2.0.0-beta.1, please use {@link IAppWindow.postMessage IAppWindow.postMessage(message: any): Promise\<void\>} instead.
3080
- * @param message - The message to send
3081
- * @param onComplete - The deprecated way of invoking a callback to know if the postMessage has been success/failed.
3075
+ * @param onComplete - The callback to know if the postMessage has been success/failed.
3082
3076
  */
3083
3077
  postMessage(message: any, onComplete?: (status: boolean, reason?: string) => void): void;
3084
3078
  /**
@@ -3091,37 +3085,35 @@ export interface IAppWindow {
3091
3085
  }
3092
3086
  export class ChildAppWindow implements IAppWindow {
3093
3087
  /**
3094
- * Send a message to the AppWindow.
3088
+ * Send a message to the ChildAppWindow.
3089
+ *
3095
3090
  * @param message - The message to send
3096
- * @returns Promise that will be fulfilled when the AppWindow posts back a response
3091
+ * @param onComplete - The callback to know if the postMessage has been success/failed.
3097
3092
  */
3098
- postMessage(message: any): Promise<void>;
3093
+ postMessage(message: any, onComplete?: (status: boolean, reason?: string) => void): void;
3099
3094
  /**
3100
- * @deprecated
3101
- * As of 2.0.0-beta.1, please use {@link ChildAppWindow.postMessage ChildAppWindow.postMessage(message: any): Promise\<void\>} instead.
3102
- * @param message - The message to send
3103
- * @param onComplete - The deprecated way of invoking a callback to know if the postMessage has been success/failed.
3095
+ * Add a listener that will be called when an event is received from the ChildAppWindow.
3096
+ *
3097
+ * @param type - The event to listen to. Currently the only supported type is 'message'.
3098
+ * @param listener - The listener that will be called
3104
3099
  */
3105
- postMessage(message: any, onComplete: (status: boolean, reason?: string) => void): void;
3106
- postMessageHelper(message: any): Promise<void>;
3107
3100
  addEventListener(type: string, listener: (message: any) => void): void;
3108
3101
  }
3109
3102
  export class ParentAppWindow implements IAppWindow {
3110
3103
  static get Instance(): IAppWindow;
3111
3104
  /**
3112
- * Send a message to the AppWindow.
3105
+ * Send a message to the ParentAppWindow.
3106
+ *
3113
3107
  * @param message - The message to send
3114
- * @returns Promise that will be fulfilled when the AppWindow posts back a response
3108
+ * @param onComplete - The callback to know if the postMessage has been success/failed.
3115
3109
  */
3116
- postMessage(message: any): Promise<void>;
3110
+ postMessage(message: any, onComplete?: (status: boolean, reason?: string) => void): void;
3117
3111
  /**
3118
- * @deprecated
3119
- * As of 2.0.0-beta.1, please use {@link ParentAppWindow.postMessage ParentAppWindow.postMessage(message: any): Promise\<void\>} instead.
3120
- * @param message - The message to send
3121
- * @param onComplete - The deprecated way of invoking a callback to know if the postMessage has been success/failed.
3112
+ * Add a listener that will be called when an event is received from the ParentAppWindow.
3113
+ *
3114
+ * @param type - The event to listen to. Currently the only supported type is 'message'.
3115
+ * @param listener - The listener that will be called
3122
3116
  */
3123
- postMessage(message: any, onComplete: (status: boolean, reason?: string) => void): void;
3124
- postMessageHelper(message: any): Promise<void>;
3125
3117
  addEventListener(type: string, listener: (message: any) => void): void;
3126
3118
  }
3127
3119
 
@@ -1121,7 +1121,7 @@ __webpack_require__.d(__webpack_exports__, {
1121
1121
  });
1122
1122
 
1123
1123
  ;// CONCATENATED MODULE: ./src/internal/constants.ts
1124
- var version = "2.0.0-beta.4-dev.11";
1124
+ var version = "2.0.0-beta.4-dev.12";
1125
1125
  /**
1126
1126
  * @hidden
1127
1127
  * The client version when all SDK APIs started to check platform compatibility for the APIs was 1.6.0.
@@ -4253,30 +4253,26 @@ var appInstallDialog;
4253
4253
 
4254
4254
 
4255
4255
 
4256
+
4256
4257
  var ChildAppWindow = /** @class */ (function () {
4257
4258
  function ChildAppWindow() {
4258
4259
  }
4260
+ /**
4261
+ * Send a message to the ChildAppWindow.
4262
+ *
4263
+ * @param message - The message to send
4264
+ * @param onComplete - The callback to know if the postMessage has been success/failed.
4265
+ */
4259
4266
  ChildAppWindow.prototype.postMessage = function (message, onComplete) {
4260
4267
  ensureInitialized();
4261
- return this.postMessageHelper(message)
4262
- .then(function () {
4263
- if (onComplete) {
4264
- onComplete(true);
4265
- }
4266
- })
4267
- .catch(function (err) {
4268
- if (onComplete) {
4269
- onComplete(false, err.message);
4270
- return;
4271
- }
4272
- throw err;
4273
- });
4274
- };
4275
- ChildAppWindow.prototype.postMessageHelper = function (message) {
4276
- return new Promise(function (resolve) {
4277
- resolve(sendAndHandleStatusAndReason('messageForChild', message));
4278
- });
4268
+ sendMessageToParent('messageForChild', [message], onComplete ? onComplete : getGenericOnCompleteHandler());
4279
4269
  };
4270
+ /**
4271
+ * Add a listener that will be called when an event is received from the ChildAppWindow.
4272
+ *
4273
+ * @param type - The event to listen to. Currently the only supported type is 'message'.
4274
+ * @param listener - The listener that will be called
4275
+ */
4280
4276
  ChildAppWindow.prototype.addEventListener = function (type, listener) {
4281
4277
  if (type === 'message') {
4282
4278
  registerHandler('messageForParent', listener);
@@ -4296,27 +4292,22 @@ var ParentAppWindow = /** @class */ (function () {
4296
4292
  enumerable: false,
4297
4293
  configurable: true
4298
4294
  });
4295
+ /**
4296
+ * Send a message to the ParentAppWindow.
4297
+ *
4298
+ * @param message - The message to send
4299
+ * @param onComplete - The callback to know if the postMessage has been success/failed.
4300
+ */
4299
4301
  ParentAppWindow.prototype.postMessage = function (message, onComplete) {
4300
4302
  ensureInitialized(FrameContexts.task);
4301
- return this.postMessageHelper(message)
4302
- .then(function () {
4303
- if (onComplete) {
4304
- onComplete(true);
4305
- }
4306
- })
4307
- .catch(function (err) {
4308
- if (onComplete) {
4309
- onComplete(false, err.message);
4310
- return;
4311
- }
4312
- throw err;
4313
- });
4314
- };
4315
- ParentAppWindow.prototype.postMessageHelper = function (message) {
4316
- return new Promise(function (resolve) {
4317
- resolve(sendAndHandleStatusAndReason('messageForParent', message));
4318
- });
4303
+ sendMessageToParent('messageForParent', [message], onComplete ? onComplete : getGenericOnCompleteHandler());
4319
4304
  };
4305
+ /**
4306
+ * Add a listener that will be called when an event is received from the ParentAppWindow.
4307
+ *
4308
+ * @param type - The event to listen to. Currently the only supported type is 'message'.
4309
+ * @param listener - The listener that will be called
4310
+ */
4320
4311
  ParentAppWindow.prototype.addEventListener = function (type, listener) {
4321
4312
  if (type === 'message') {
4322
4313
  registerHandler('messageForChild', listener);