@microsoft/teams-js 2.0.0-beta.6-dev.21 → 2.0.0-beta.7-dev.0

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/README.md CHANGED
@@ -24,7 +24,7 @@ To install the latest [2.0 preview version](https://docs.microsoft.com/en-us/jav
24
24
 
25
25
  ### Production
26
26
 
27
- You can access [these files on unpkg](https://res.cdn.office.net/teams-js/2.0.0-beta.5/js/MicrosoftTeams.min.js), download them, or point your package manager to them.
27
+ You can access [these files on unpkg](https://res.cdn.office.net/teams-js/2.0.0-beta.6/js/MicrosoftTeams.min.js), download them, or point your package manager to them.
28
28
 
29
29
  ## Usage
30
30
 
@@ -45,13 +45,13 @@ Reference the SDK inside of your `.html` page using:
45
45
  ```html
46
46
  <!-- Microsoft Teams JavaScript API (via CDN) -->
47
47
  <script
48
- src="https://res.cdn.office.net/teams-js/2.0.0-beta.5/js/MicrosoftTeams.min.js"
49
- integrity="sha384-vZRWEk6i8zcVUxh4lQUp+rKbFHv1Thlixb5Z3DAanwntS8owtI9t2K9BmCU0WBxL"
48
+ src="https://res.cdn.office.net/teams-js/2.0.0-beta.6/js/MicrosoftTeams.min.js"
49
+ integrity="sha384-zUXDMKhIVeFW07S2xPrtvwSCnfjFTHafmXXzxnNT0ONpSv4NOmekx15PEdsHDDf4"
50
50
  crossorigin="anonymous"
51
51
  ></script>
52
52
 
53
53
  <!-- Microsoft Teams JavaScript API (via npm) -->
54
- <script src="node_modules/@microsoft/teams-js@2.0.0-beta.5/dist/MicrosoftTeams.min.js"></script>
54
+ <script src="node_modules/@microsoft/teams-js@2.0.0-beta.6/dist/MicrosoftTeams.min.js"></script>
55
55
 
56
56
  <!-- Microsoft Teams JavaScript API (via local) -->
57
57
  <script src="MicrosoftTeams.min.js"></script>
@@ -2992,7 +2992,7 @@ export namespace dialog {
2992
2992
  }
2993
2993
 
2994
2994
  /**
2995
- * Navigation specific part of the SDK.
2995
+ * Navigation-specific part of the SDK.
2996
2996
  *
2997
2997
  * @beta
2998
2998
  */
@@ -3005,6 +3005,7 @@ export namespace pages {
3005
3005
  function returnFocus(navigateForward?: boolean): void;
3006
3006
  /**
3007
3007
  * @hidden
3008
+ *
3008
3009
  * Registers a handler when focus needs to be passed from teams to the place of choice on app.
3009
3010
  *
3010
3011
  * @param handler - The handler to invoked by the app when they want the focus to be in the place of their choice.
@@ -3012,8 +3013,26 @@ export namespace pages {
3012
3013
  * @internal
3013
3014
  */
3014
3015
  function registerFocusEnterHandler(handler: (navigateForward: boolean) => void): void;
3016
+ /**
3017
+ * Sets/Updates the current frame with new information
3018
+ *
3019
+ * @param frameInfo - Frame information containing the URL used in the iframe on reload and the URL for when the
3020
+ * user clicks 'Go To Website'
3021
+ */
3015
3022
  function setCurrentFrame(frameInfo: FrameInfo): void;
3023
+ /**
3024
+ * Initializes the library with context information for the frame
3025
+ *
3026
+ * @param frameInfo - Frame information containing the URL used in the iframe on reload and the URL for when the
3027
+ * user clicks 'Go To Website'
3028
+ * @param callback - An optional user-set callback that is executed once the app has finished initialization.
3029
+ * @param validMessageOrigins - An optional list of cross-frame message origins. They must have
3030
+ * https: protocol otherwise they will be ignored. Example: https:www.example.com
3031
+ */
3016
3032
  function initializeWithFrameContext(frameInfo: FrameInfo, callback?: () => void, validMessageOrigins?: string[]): void;
3033
+ /**
3034
+ * Defines the configuration of the current or desired instance
3035
+ */
3017
3036
  interface InstanceConfig {
3018
3037
  /**
3019
3038
  * A suggested display name for the new content.
@@ -3075,7 +3094,9 @@ export namespace pages {
3075
3094
  */
3076
3095
  function registerFullScreenHandler(handler: (isFullScreen: boolean) => void): void;
3077
3096
  /**
3078
- * Checks if page capability is supported currently
3097
+ * Checks if the current application host supports the pages capability
3098
+ * @returns true if the pages capability is enabled in runtime.supports.pages and
3099
+ * false if it is disabled
3079
3100
  */
3080
3101
  function isSupported(): boolean;
3081
3102
  /**
@@ -3118,17 +3139,19 @@ export namespace pages {
3118
3139
  * Allows an app to retrieve for this user tabs that are owned by this app.
3119
3140
  * If no TabInstanceParameters are passed, the app defaults to favorite teams and favorite channels.
3120
3141
  * @param tabInstanceParameters OPTIONAL Flags that specify whether to scope call to favorite teams or channels.
3121
- * @returns Promise that resolves with the {@link TabInformation}.
3142
+ * @returns Promise that resolves with the {@link TabInformation}. Contains information for the user's tabs that are owned by this application {@link TabInstance}.
3122
3143
  */
3123
3144
  function getTabInstances(tabInstanceParameters?: TabInstanceParameters): Promise<TabInformation>;
3124
3145
  /**
3125
3146
  * Allows an app to retrieve the most recently used tabs for this user.
3126
- * @param tabInstanceParameters OPTIONAL Ignored, kept for future use
3127
- * @returns Promise that resolves with the {@link TabInformation}.
3147
+ * @param tabInstanceParameters OPTIONAL Ignored, kept for future use.
3148
+ * @returns Promise that resolves with the {@link TabInformation}. Contains information for the users' most recently used tabs {@link TabInstance}.
3128
3149
  */
3129
3150
  function getMruTabInstances(tabInstanceParameters?: TabInstanceParameters): Promise<TabInformation>;
3130
3151
  /**
3131
- * Checks if pages.tabs capability is supported currently
3152
+ * Checks if the current application host supports the pages.tab capability
3153
+ * @returns true if the pages.tabs capability is enabled in runtime.supports.pages.tabs and
3154
+ * false if it is disabled
3132
3155
  */
3133
3156
  function isSupported(): boolean;
3134
3157
  }
@@ -3137,6 +3160,13 @@ export namespace pages {
3137
3160
  * This object is usable only on the config frame.
3138
3161
  */
3139
3162
  namespace config {
3163
+ /**
3164
+ * @hidden
3165
+ * Hide from docs because this function is only used during initialization
3166
+ * ------------------
3167
+ * Adds register handlers for settings.save and settings.remove upon initialization. Function is called in {@link app.initializeHelper}
3168
+ * @internal
3169
+ */
3140
3170
  function initialize(): void;
3141
3171
  /**
3142
3172
  * Sets the validity state for the config.
@@ -3168,10 +3198,14 @@ export namespace pages {
3168
3198
  */
3169
3199
  function registerOnRemoveHandler(handler: (evt: RemoveEvent) => void): void;
3170
3200
  /**
3171
- * Registers a handler for when the user reconfigurated tab
3201
+ * Registers a handler for when the tab configuration is changed by the user
3172
3202
  * @param handler The handler to invoke when the user click on Settings.
3173
3203
  */
3174
3204
  function registerChangeConfigHandler(handler: () => void): void;
3205
+ /**
3206
+ * Describes the results of the settings.save event. Includes result, notifySuccess, and notifyFailure
3207
+ * to indicate the return object (result) and the status of whether the settings.save call succeeded or not and why.
3208
+ */
3175
3209
  interface SaveEvent {
3176
3210
  /**
3177
3211
  * Object containing properties passed as arguments to the settings.save event.
@@ -3187,6 +3221,10 @@ export namespace pages {
3187
3221
  */
3188
3222
  notifyFailure(reason?: string): void;
3189
3223
  }
3224
+ /**
3225
+ * Describes the results of the settings.remove event. Includes notifySuccess, and notifyFailure
3226
+ * to indicate the status of whether the settings.save call succeeded or not and why.
3227
+ */
3190
3228
  interface RemoveEvent {
3191
3229
  /**
3192
3230
  * Indicates that the underlying resource has been removed and the content can be removed.
@@ -3198,6 +3236,9 @@ export namespace pages {
3198
3236
  */
3199
3237
  notifyFailure(reason?: string): void;
3200
3238
  }
3239
+ /**
3240
+ * Parameters used in the settings.save event
3241
+ */
3201
3242
  interface SaveParameters {
3202
3243
  /**
3203
3244
  * Connector's webhook Url returned as arguments to settings.save event as part of user clicking on Save
@@ -3205,7 +3246,9 @@ export namespace pages {
3205
3246
  webhookUrl?: string;
3206
3247
  }
3207
3248
  /**
3208
- * Checks if pages.config capability is supported currently
3249
+ * Checks if the current application host supports the pages.config capability
3250
+ * @returns true if the pages.config capability is enabled in runtime.supports.pages.config and
3251
+ * false if it is disabled
3209
3252
  */
3210
3253
  function isSupported(): boolean;
3211
3254
  }
@@ -3229,10 +3272,18 @@ export namespace pages {
3229
3272
  */
3230
3273
  function registerBackButtonHandler(handler: () => boolean): void;
3231
3274
  /**
3232
- * Checks if pages.backStack capability is supported currently
3275
+ * Checks if the current application host supports the pages.backStack capability
3276
+ * @returns true if the pages.backStack capability is enabled in runtime.supports.pages.backStack and
3277
+ * false if it is disabled
3233
3278
  */
3234
3279
  function isSupported(): boolean;
3235
3280
  }
3281
+ /**
3282
+ * @hidden
3283
+ * Hide from docs
3284
+ * ------
3285
+ * Namespace to interact with the full-trust part of the SDK. Limited to 1P apps
3286
+ */
3236
3287
  namespace fullTrust {
3237
3288
  /**
3238
3289
  * @hidden
@@ -3249,7 +3300,12 @@ export namespace pages {
3249
3300
  */
3250
3301
  function exitFullscreen(): void;
3251
3302
  /**
3252
- * Checks if pages.fullTrust capability is supported currently
3303
+ * @hidden
3304
+ * Hide from docs
3305
+ * ------
3306
+ * Checks if the current application host supports the pages.fullTrust capability
3307
+ * @returns true if the pages.fullTrust capability is enabled in runtime.supports.pages.fullTrust and
3308
+ * false if it is disabled
3253
3309
  */
3254
3310
  function isSupported(): boolean;
3255
3311
  }
@@ -3277,6 +3333,8 @@ export namespace pages {
3277
3333
  function onHoverLeave(handler: () => void): void;
3278
3334
  /**
3279
3335
  * Checks if pages.appButton capability is supported currently
3336
+ * @returns true if the pages.appButton capability is enabled in runtime.supports.pages.appButton and
3337
+ * false if it is disabled
3280
3338
  */
3281
3339
  function isSupported(): boolean;
3282
3340
  }
@@ -1122,7 +1122,7 @@ __webpack_require__.d(__webpack_exports__, {
1122
1122
  });
1123
1123
 
1124
1124
  ;// CONCATENATED MODULE: ./src/internal/constants.ts
1125
- var version = "2.0.0-beta.6-dev.21";
1125
+ var version = "2.0.0-beta.7-dev.0";
1126
1126
  /**
1127
1127
  * @hidden
1128
1128
  * The client version when all SDK APIs started to check platform compatibility for the APIs was 1.6.0.
@@ -3413,7 +3413,7 @@ function transformLegacyContextToAppContext(legacyContext) {
3413
3413
 
3414
3414
 
3415
3415
  /**
3416
- * Navigation specific part of the SDK.
3416
+ * Navigation-specific part of the SDK.
3417
3417
  *
3418
3418
  * @beta
3419
3419
  */
@@ -3434,6 +3434,7 @@ var pages;
3434
3434
  pages.returnFocus = returnFocus;
3435
3435
  /**
3436
3436
  * @hidden
3437
+ *
3437
3438
  * Registers a handler when focus needs to be passed from teams to the place of choice on app.
3438
3439
  *
3439
3440
  * @param handler - The handler to invoked by the app when they want the focus to be in the place of their choice.
@@ -3448,6 +3449,12 @@ var pages;
3448
3449
  registerHandler('focusEnter', handler);
3449
3450
  }
3450
3451
  pages.registerFocusEnterHandler = registerFocusEnterHandler;
3452
+ /**
3453
+ * Sets/Updates the current frame with new information
3454
+ *
3455
+ * @param frameInfo - Frame information containing the URL used in the iframe on reload and the URL for when the
3456
+ * user clicks 'Go To Website'
3457
+ */
3451
3458
  function setCurrentFrame(frameInfo) {
3452
3459
  ensureInitialized(FrameContexts.content);
3453
3460
  if (!isSupported()) {
@@ -3456,6 +3463,15 @@ var pages;
3456
3463
  sendMessageToParent('setFrameContext', [frameInfo]);
3457
3464
  }
3458
3465
  pages.setCurrentFrame = setCurrentFrame;
3466
+ /**
3467
+ * Initializes the library with context information for the frame
3468
+ *
3469
+ * @param frameInfo - Frame information containing the URL used in the iframe on reload and the URL for when the
3470
+ * user clicks 'Go To Website'
3471
+ * @param callback - An optional user-set callback that is executed once the app has finished initialization.
3472
+ * @param validMessageOrigins - An optional list of cross-frame message origins. They must have
3473
+ * https: protocol otherwise they will be ignored. Example: https:www.example.com
3474
+ */
3459
3475
  function initializeWithFrameContext(frameInfo, callback, validMessageOrigins) {
3460
3476
  app_app.initialize(validMessageOrigins).then(function () { return callback && callback(); });
3461
3477
  setCurrentFrame(frameInfo);
@@ -3550,7 +3566,9 @@ var pages;
3550
3566
  }
3551
3567
  pages.registerFullScreenHandler = registerFullScreenHandler;
3552
3568
  /**
3553
- * Checks if page capability is supported currently
3569
+ * Checks if the current application host supports the pages capability
3570
+ * @returns true if the pages capability is enabled in runtime.supports.pages and
3571
+ * false if it is disabled
3554
3572
  */
3555
3573
  function isSupported() {
3556
3574
  return runtime.supports.pages ? true : false;
@@ -3581,7 +3599,7 @@ var pages;
3581
3599
  * Allows an app to retrieve for this user tabs that are owned by this app.
3582
3600
  * If no TabInstanceParameters are passed, the app defaults to favorite teams and favorite channels.
3583
3601
  * @param tabInstanceParameters OPTIONAL Flags that specify whether to scope call to favorite teams or channels.
3584
- * @returns Promise that resolves with the {@link TabInformation}.
3602
+ * @returns Promise that resolves with the {@link TabInformation}. Contains information for the user's tabs that are owned by this application {@link TabInstance}.
3585
3603
  */
3586
3604
  function getTabInstances(tabInstanceParameters) {
3587
3605
  return new Promise(function (resolve) {
@@ -3595,8 +3613,8 @@ var pages;
3595
3613
  tabs.getTabInstances = getTabInstances;
3596
3614
  /**
3597
3615
  * Allows an app to retrieve the most recently used tabs for this user.
3598
- * @param tabInstanceParameters OPTIONAL Ignored, kept for future use
3599
- * @returns Promise that resolves with the {@link TabInformation}.
3616
+ * @param tabInstanceParameters OPTIONAL Ignored, kept for future use.
3617
+ * @returns Promise that resolves with the {@link TabInformation}. Contains information for the users' most recently used tabs {@link TabInstance}.
3600
3618
  */
3601
3619
  function getMruTabInstances(tabInstanceParameters) {
3602
3620
  return new Promise(function (resolve) {
@@ -3609,7 +3627,9 @@ var pages;
3609
3627
  }
3610
3628
  tabs.getMruTabInstances = getMruTabInstances;
3611
3629
  /**
3612
- * Checks if pages.tabs capability is supported currently
3630
+ * Checks if the current application host supports the pages.tab capability
3631
+ * @returns true if the pages.tabs capability is enabled in runtime.supports.pages.tabs and
3632
+ * false if it is disabled
3613
3633
  */
3614
3634
  function isSupported() {
3615
3635
  return runtime.supports.pages ? (runtime.supports.pages.tabs ? true : false) : false;
@@ -3624,6 +3644,13 @@ var pages;
3624
3644
  (function (config) {
3625
3645
  var saveHandler;
3626
3646
  var removeHandler;
3647
+ /**
3648
+ * @hidden
3649
+ * Hide from docs because this function is only used during initialization
3650
+ * ------------------
3651
+ * Adds register handlers for settings.save and settings.remove upon initialization. Function is called in {@link app.initializeHelper}
3652
+ * @internal
3653
+ */
3627
3654
  function initialize() {
3628
3655
  registerHandler('settings.save', handleSave, false);
3629
3656
  registerHandler('settings.remove', handleRemove, false);
@@ -3701,7 +3728,7 @@ var pages;
3701
3728
  }
3702
3729
  }
3703
3730
  /**
3704
- * Registers a handler for when the user reconfigurated tab
3731
+ * Registers a handler for when the tab configuration is changed by the user
3705
3732
  * @param handler The handler to invoke when the user click on Settings.
3706
3733
  */
3707
3734
  function registerChangeConfigHandler(handler) {
@@ -3774,7 +3801,9 @@ var pages;
3774
3801
  return RemoveEventImpl;
3775
3802
  }());
3776
3803
  /**
3777
- * Checks if pages.config capability is supported currently
3804
+ * Checks if the current application host supports the pages.config capability
3805
+ * @returns true if the pages.config capability is enabled in runtime.supports.pages.config and
3806
+ * false if it is disabled
3778
3807
  */
3779
3808
  function isSupported() {
3780
3809
  return runtime.supports.pages ? (runtime.supports.pages.config ? true : false) : false;
@@ -3829,13 +3858,21 @@ var pages;
3829
3858
  }
3830
3859
  }
3831
3860
  /**
3832
- * Checks if pages.backStack capability is supported currently
3861
+ * Checks if the current application host supports the pages.backStack capability
3862
+ * @returns true if the pages.backStack capability is enabled in runtime.supports.pages.backStack and
3863
+ * false if it is disabled
3833
3864
  */
3834
3865
  function isSupported() {
3835
3866
  return runtime.supports.pages ? (runtime.supports.pages.backStack ? true : false) : false;
3836
3867
  }
3837
3868
  backStack.isSupported = isSupported;
3838
3869
  })(backStack = pages.backStack || (pages.backStack = {}));
3870
+ /**
3871
+ * @hidden
3872
+ * Hide from docs
3873
+ * ------
3874
+ * Namespace to interact with the full-trust part of the SDK. Limited to 1P apps
3875
+ */
3839
3876
  var fullTrust;
3840
3877
  (function (fullTrust) {
3841
3878
  /**
@@ -3867,7 +3904,12 @@ var pages;
3867
3904
  }
3868
3905
  fullTrust.exitFullscreen = exitFullscreen;
3869
3906
  /**
3870
- * Checks if pages.fullTrust capability is supported currently
3907
+ * @hidden
3908
+ * Hide from docs
3909
+ * ------
3910
+ * Checks if the current application host supports the pages.fullTrust capability
3911
+ * @returns true if the pages.fullTrust capability is enabled in runtime.supports.pages.fullTrust and
3912
+ * false if it is disabled
3871
3913
  */
3872
3914
  function isSupported() {
3873
3915
  return runtime.supports.pages ? (runtime.supports.pages.fullTrust ? true : false) : false;
@@ -3920,6 +3962,8 @@ var pages;
3920
3962
  appButton.onHoverLeave = onHoverLeave;
3921
3963
  /**
3922
3964
  * Checks if pages.appButton capability is supported currently
3965
+ * @returns true if the pages.appButton capability is enabled in runtime.supports.pages.appButton and
3966
+ * false if it is disabled
3923
3967
  */
3924
3968
  function isSupported() {
3925
3969
  return runtime.supports.pages ? (runtime.supports.pages.appButton ? true : false) : false;