@microsoft/teams-js 2.0.0-beta.4-dev.10 → 2.0.0-beta.4-dev.13
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.
package/dist/MicrosoftTeams.d.ts
CHANGED
|
@@ -751,6 +751,17 @@ export namespace files {
|
|
|
751
751
|
* Gets list of downloads for current user
|
|
752
752
|
* @param callback Callback that will be triggered post downloads load
|
|
753
753
|
*/
|
|
754
|
+
export function getFileDownloads(): Promise<IFileItem[]>;
|
|
755
|
+
/**
|
|
756
|
+
* @hidden
|
|
757
|
+
* Hide from docs
|
|
758
|
+
* ------
|
|
759
|
+
*
|
|
760
|
+
* @deprecated
|
|
761
|
+
* As of 2.0.0-beta.4, please use {@link file.getFileDownloads file.getFileDownloads(): Promise\<IFileItem[]\>} instead.
|
|
762
|
+
* Gets list of downloads for current user
|
|
763
|
+
* @param callback Callback that will be triggered post downloads load
|
|
764
|
+
*/
|
|
754
765
|
export function getFileDownloads(callback: (error?: SdkError, files?: IFileItem[]) => void): void;
|
|
755
766
|
/**
|
|
756
767
|
* @hidden
|
|
@@ -2759,6 +2770,20 @@ export namespace dialog {
|
|
|
2759
2770
|
* @param appIds - Helps to validate that the call originates from the same appId as the one that invoked the task module
|
|
2760
2771
|
*/
|
|
2761
2772
|
function submit(result?: string | object, appIds?: string | string[]): void;
|
|
2773
|
+
/**
|
|
2774
|
+
* Send message to the parent from dialog
|
|
2775
|
+
*
|
|
2776
|
+
* @param message - The message to send
|
|
2777
|
+
* @param onComplete - The callback to know if the message to parent has been success/failed.
|
|
2778
|
+
*/
|
|
2779
|
+
function sendMessageToParentFromDialog(message: any, onComplete?: (status: boolean, reason?: string) => void): void;
|
|
2780
|
+
/**
|
|
2781
|
+
* Fucntion to call when an event is received from the Parent
|
|
2782
|
+
*
|
|
2783
|
+
* @param type - The event to listen to. Currently the only supported type is 'message'.
|
|
2784
|
+
* @param listener - listener - The listener that will be called.
|
|
2785
|
+
*/
|
|
2786
|
+
function registerOnMessageFromParent(listener: (message: any) => void): void;
|
|
2762
2787
|
function isSupported(): boolean;
|
|
2763
2788
|
}
|
|
2764
2789
|
|
|
@@ -3059,15 +3084,9 @@ export namespace pages {
|
|
|
3059
3084
|
export interface IAppWindow {
|
|
3060
3085
|
/**
|
|
3061
3086
|
* Send a message to the AppWindow.
|
|
3087
|
+
*
|
|
3062
3088
|
* @param message - The message to send
|
|
3063
|
-
* @
|
|
3064
|
-
*/
|
|
3065
|
-
postMessage(message: any): Promise<void>;
|
|
3066
|
-
/**
|
|
3067
|
-
* @deprecated
|
|
3068
|
-
* As of 2.0.0-beta.1, please use {@link IAppWindow.postMessage IAppWindow.postMessage(message: any): Promise\<void\>} instead.
|
|
3069
|
-
* @param message - The message to send
|
|
3070
|
-
* @param onComplete - The deprecated way of invoking a callback to know if the postMessage has been success/failed.
|
|
3089
|
+
* @param onComplete - The callback to know if the postMessage has been success/failed.
|
|
3071
3090
|
*/
|
|
3072
3091
|
postMessage(message: any, onComplete?: (status: boolean, reason?: string) => void): void;
|
|
3073
3092
|
/**
|
|
@@ -3080,37 +3099,35 @@ export interface IAppWindow {
|
|
|
3080
3099
|
}
|
|
3081
3100
|
export class ChildAppWindow implements IAppWindow {
|
|
3082
3101
|
/**
|
|
3083
|
-
* Send a message to the
|
|
3102
|
+
* Send a message to the ChildAppWindow.
|
|
3103
|
+
*
|
|
3084
3104
|
* @param message - The message to send
|
|
3085
|
-
* @
|
|
3105
|
+
* @param onComplete - The callback to know if the postMessage has been success/failed.
|
|
3086
3106
|
*/
|
|
3087
|
-
postMessage(message: any):
|
|
3107
|
+
postMessage(message: any, onComplete?: (status: boolean, reason?: string) => void): void;
|
|
3088
3108
|
/**
|
|
3089
|
-
*
|
|
3090
|
-
*
|
|
3091
|
-
* @param
|
|
3092
|
-
* @param
|
|
3109
|
+
* Add a listener that will be called when an event is received from the ChildAppWindow.
|
|
3110
|
+
*
|
|
3111
|
+
* @param type - The event to listen to. Currently the only supported type is 'message'.
|
|
3112
|
+
* @param listener - The listener that will be called
|
|
3093
3113
|
*/
|
|
3094
|
-
postMessage(message: any, onComplete: (status: boolean, reason?: string) => void): void;
|
|
3095
|
-
postMessageHelper(message: any): Promise<void>;
|
|
3096
3114
|
addEventListener(type: string, listener: (message: any) => void): void;
|
|
3097
3115
|
}
|
|
3098
3116
|
export class ParentAppWindow implements IAppWindow {
|
|
3099
3117
|
static get Instance(): IAppWindow;
|
|
3100
3118
|
/**
|
|
3101
|
-
* Send a message to the
|
|
3119
|
+
* Send a message to the ParentAppWindow.
|
|
3120
|
+
*
|
|
3102
3121
|
* @param message - The message to send
|
|
3103
|
-
* @
|
|
3122
|
+
* @param onComplete - The callback to know if the postMessage has been success/failed.
|
|
3104
3123
|
*/
|
|
3105
|
-
postMessage(message: any):
|
|
3124
|
+
postMessage(message: any, onComplete?: (status: boolean, reason?: string) => void): void;
|
|
3106
3125
|
/**
|
|
3107
|
-
*
|
|
3108
|
-
*
|
|
3109
|
-
* @param
|
|
3110
|
-
* @param
|
|
3126
|
+
* Add a listener that will be called when an event is received from the ParentAppWindow.
|
|
3127
|
+
*
|
|
3128
|
+
* @param type - The event to listen to. Currently the only supported type is 'message'.
|
|
3129
|
+
* @param listener - The listener that will be called
|
|
3111
3130
|
*/
|
|
3112
|
-
postMessage(message: any, onComplete: (status: boolean, reason?: string) => void): void;
|
|
3113
|
-
postMessageHelper(message: any): Promise<void>;
|
|
3114
3131
|
addEventListener(type: string, listener: (message: any) => void): void;
|
|
3115
3132
|
}
|
|
3116
3133
|
|
package/dist/MicrosoftTeams.js
CHANGED
|
@@ -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.
|
|
1124
|
+
var version = "2.0.0-beta.4-dev.13";
|
|
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
|
-
|
|
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
|
-
|
|
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);
|
|
@@ -4327,6 +4318,7 @@ var ParentAppWindow = /** @class */ (function () {
|
|
|
4327
4318
|
|
|
4328
4319
|
|
|
4329
4320
|
;// CONCATENATED MODULE: ./src/public/dialog.ts
|
|
4321
|
+
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
4330
4322
|
/* eslint-disable @typescript-eslint/ban-types */
|
|
4331
4323
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
4332
4324
|
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
@@ -4345,6 +4337,8 @@ var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
|
4345
4337
|
|
|
4346
4338
|
|
|
4347
4339
|
|
|
4340
|
+
|
|
4341
|
+
|
|
4348
4342
|
/**
|
|
4349
4343
|
* Namespace to interact with the dialog module-specific part of the SDK.
|
|
4350
4344
|
*
|
|
@@ -4395,6 +4389,31 @@ var dialog;
|
|
|
4395
4389
|
sendMessageToParent('tasks.completeTask', [result, Array.isArray(appIds) ? appIds : [appIds]]);
|
|
4396
4390
|
}
|
|
4397
4391
|
dialog.submit = submit;
|
|
4392
|
+
/**
|
|
4393
|
+
* Send message to the parent from dialog
|
|
4394
|
+
*
|
|
4395
|
+
* @param message - The message to send
|
|
4396
|
+
* @param onComplete - The callback to know if the message to parent has been success/failed.
|
|
4397
|
+
*/
|
|
4398
|
+
function sendMessageToParentFromDialog(
|
|
4399
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4400
|
+
message, onComplete) {
|
|
4401
|
+
ensureInitialized(FrameContexts.task);
|
|
4402
|
+
sendMessageToParent('messageForParent', [message], onComplete ? onComplete : getGenericOnCompleteHandler());
|
|
4403
|
+
}
|
|
4404
|
+
dialog.sendMessageToParentFromDialog = sendMessageToParentFromDialog;
|
|
4405
|
+
/**
|
|
4406
|
+
* Fucntion to call when an event is received from the Parent
|
|
4407
|
+
*
|
|
4408
|
+
* @param type - The event to listen to. Currently the only supported type is 'message'.
|
|
4409
|
+
* @param listener - listener - The listener that will be called.
|
|
4410
|
+
*/
|
|
4411
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4412
|
+
function registerOnMessageFromParent(listener) {
|
|
4413
|
+
ensureInitialized();
|
|
4414
|
+
registerHandler('messageForChild', listener);
|
|
4415
|
+
}
|
|
4416
|
+
dialog.registerOnMessageFromParent = registerOnMessageFromParent;
|
|
4398
4417
|
function isSupported() {
|
|
4399
4418
|
return runtime.supports.dialog ? true : false;
|
|
4400
4419
|
}
|
|
@@ -6415,6 +6434,7 @@ var tasks;
|
|
|
6415
6434
|
|
|
6416
6435
|
|
|
6417
6436
|
|
|
6437
|
+
|
|
6418
6438
|
/**
|
|
6419
6439
|
* @hidden
|
|
6420
6440
|
* Hide from docs
|
|
@@ -6671,19 +6691,12 @@ var files;
|
|
|
6671
6691
|
return runtime.supports.files ? true : false;
|
|
6672
6692
|
}
|
|
6673
6693
|
files_1.isSupported = isSupported;
|
|
6674
|
-
/**
|
|
6675
|
-
* @hidden
|
|
6676
|
-
* Hide from docs
|
|
6677
|
-
* ------
|
|
6678
|
-
* Gets list of downloads for current user
|
|
6679
|
-
* @param callback Callback that will be triggered post downloads load
|
|
6680
|
-
*/
|
|
6681
6694
|
function getFileDownloads(callback) {
|
|
6682
6695
|
ensureInitialized(FrameContexts.content);
|
|
6683
|
-
|
|
6684
|
-
|
|
6685
|
-
}
|
|
6686
|
-
|
|
6696
|
+
var wrappedFunction = function () {
|
|
6697
|
+
return new Promise(function (resolve) { return resolve(sendAndHandleSdkError('files.getFileDownloads', [])); });
|
|
6698
|
+
};
|
|
6699
|
+
return callCallbackWithErrorOrResultFromPromiseAndReturnPromise(wrappedFunction, callback);
|
|
6687
6700
|
}
|
|
6688
6701
|
files_1.getFileDownloads = getFileDownloads;
|
|
6689
6702
|
/**
|