@microsoft/teams-js 2.17.0-beta.1 → 2.17.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +4 -4
- package/dist/MicrosoftTeams.d.ts +221 -4
- package/dist/MicrosoftTeams.js +362 -58
- package/dist/MicrosoftTeams.js.map +1 -1
- package/dist/MicrosoftTeams.min.js +1 -1
- package/dist/MicrosoftTeams.min.js.map +1 -1
- package/package.json +35 -1
package/README.md
CHANGED
@@ -24,7 +24,7 @@ To install the stable [version](https://learn.microsoft.com/javascript/api/overv
|
|
24
24
|
|
25
25
|
### Production
|
26
26
|
|
27
|
-
You can reference these files directly [from here](https://res.cdn.office.net/teams-js/2.
|
27
|
+
You can reference these files directly [from here](https://res.cdn.office.net/teams-js/2.17.0/js/MicrosoftTeams.min.js) or point your package manager at them.
|
28
28
|
|
29
29
|
## Usage
|
30
30
|
|
@@ -45,13 +45,13 @@ Reference the library 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.
|
49
|
-
integrity="sha384-
|
48
|
+
src="https://res.cdn.office.net/teams-js/2.17.0/js/MicrosoftTeams.min.js"
|
49
|
+
integrity="sha384-xp55t/129OsN192JZYLP0rGhzjCF9aYtjY0LVtXvolkDrBe4Jchylp56NrUYJ4S2"
|
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.
|
54
|
+
<script src="node_modules/@microsoft/teams-js@2.17.0/dist/MicrosoftTeams.min.js"></script>
|
55
55
|
|
56
56
|
<!-- Microsoft Teams JavaScript API (via local) -->
|
57
57
|
<script src="MicrosoftTeams.min.js"></script>
|
package/dist/MicrosoftTeams.d.ts
CHANGED
@@ -2819,6 +2819,20 @@ export const minAdaptiveCardVersion: AdaptiveCardVersion;
|
|
2819
2819
|
* Adaptive Card version supported by the Teams v1 client.
|
2820
2820
|
*/
|
2821
2821
|
export const teamsMinAdaptiveCardVersion: HostVersionsInfo;
|
2822
|
+
/**
|
2823
|
+
* @hidden
|
2824
|
+
* An error object indicates that the image count from visualMedia.image API is invalid.
|
2825
|
+
*
|
2826
|
+
* @beta
|
2827
|
+
*/
|
2828
|
+
export const errorInvalidCount: Error;
|
2829
|
+
/**
|
2830
|
+
* @hidden
|
2831
|
+
* An error object indicates that the response from the visualMedia.image API is invalid.
|
2832
|
+
*
|
2833
|
+
* @beta
|
2834
|
+
*/
|
2835
|
+
export const errorInvalidResponse: Error;
|
2822
2836
|
|
2823
2837
|
/**
|
2824
2838
|
* Represents information about tabs for an app
|
@@ -6036,14 +6050,18 @@ export namespace media {
|
|
6036
6050
|
}
|
6037
6051
|
|
6038
6052
|
/**
|
6039
|
-
* Namespace to power up the in-app browser experiences in the
|
6040
|
-
* For e.g., opening a URL in the
|
6053
|
+
* Namespace to power up the in-app browser experiences in the host app.
|
6054
|
+
* For e.g., opening a URL in the host app inside a browser
|
6041
6055
|
*
|
6042
6056
|
* @beta
|
6043
6057
|
*/
|
6044
6058
|
export namespace secondaryBrowser {
|
6045
6059
|
/**
|
6046
|
-
* Open a URL in the secondary browser
|
6060
|
+
* Open a URL in the secondary browser.
|
6061
|
+
*
|
6062
|
+
* On mobile, this is the in-app browser.
|
6063
|
+
*
|
6064
|
+
* On web and desktop, please use the `window.open()` method or other native external browser methods.
|
6047
6065
|
*
|
6048
6066
|
* @param url Url to open in the browser
|
6049
6067
|
* @returns Promise that successfully resolves if the URL opens in the secondaryBrowser
|
@@ -7796,6 +7814,199 @@ export namespace stageView {
|
|
7796
7814
|
*/
|
7797
7815
|
export const version = "ERROR: This value should be replaced by webpack!";
|
7798
7816
|
|
7817
|
+
/**
|
7818
|
+
* @hidden
|
7819
|
+
* Interact with images. Allows the app developer ask the user to get images from their camera / camera roll / file system.
|
7820
|
+
*
|
7821
|
+
* @beta
|
7822
|
+
*/
|
7823
|
+
export namespace visualMedia {
|
7824
|
+
/**
|
7825
|
+
* @hidden
|
7826
|
+
* All properties common to Image and Video Props
|
7827
|
+
*
|
7828
|
+
* @beta
|
7829
|
+
*/
|
7830
|
+
interface VisualMediaProps {
|
7831
|
+
/**
|
7832
|
+
* @hidden
|
7833
|
+
* The maximum number of media items that can be selected at once is limited to values that are less than or equal to the maximum visual media selection limit.
|
7834
|
+
*/
|
7835
|
+
maxVisualMediaCount: number;
|
7836
|
+
}
|
7837
|
+
/**
|
7838
|
+
* @hidden
|
7839
|
+
* The required value of the visualMedia files from gallery
|
7840
|
+
*
|
7841
|
+
* @beta
|
7842
|
+
*/
|
7843
|
+
export interface GalleryProps {
|
7844
|
+
/**
|
7845
|
+
* The visualMedia source
|
7846
|
+
*/
|
7847
|
+
source: Source.Gallery;
|
7848
|
+
}
|
7849
|
+
/**
|
7850
|
+
* @hidden
|
7851
|
+
* The required value of the visualMedia files from camera
|
7852
|
+
*
|
7853
|
+
* @beta
|
7854
|
+
*/
|
7855
|
+
export interface CameraProps {
|
7856
|
+
/**
|
7857
|
+
* @hidden
|
7858
|
+
* The visualMedia source
|
7859
|
+
*/
|
7860
|
+
source: Source.Camera;
|
7861
|
+
/**
|
7862
|
+
* @hidden
|
7863
|
+
* Optional; Specify whether users have the option to switch between the front and rear cameras. The default setting is FrontOrRear.
|
7864
|
+
* Default value is FrontOrRear
|
7865
|
+
*/
|
7866
|
+
cameraRestriction?: CameraRestriction;
|
7867
|
+
}
|
7868
|
+
/**
|
7869
|
+
* @hidden
|
7870
|
+
* Indicate if user is allowed to move between front and back camera or stay in front/back camera only
|
7871
|
+
* If the camera option requested by the app isn't available, the SDK will silently default to the platform's standard camera.
|
7872
|
+
*
|
7873
|
+
* @beta
|
7874
|
+
*/
|
7875
|
+
export enum CameraRestriction {
|
7876
|
+
/** User can move between front and back camera */
|
7877
|
+
FrontOrRear = 1,
|
7878
|
+
/** User can only use the front camera */
|
7879
|
+
FrontOnly = 2,
|
7880
|
+
/** User can only use the back camera */
|
7881
|
+
RearOnly = 3
|
7882
|
+
}
|
7883
|
+
/**
|
7884
|
+
* @hidden
|
7885
|
+
* Specifies the image source
|
7886
|
+
*
|
7887
|
+
* @beta
|
7888
|
+
*/
|
7889
|
+
export enum Source {
|
7890
|
+
/** The camera is the source of visual media. */
|
7891
|
+
Camera = 1,
|
7892
|
+
/** The source of visual media is the gallery. */
|
7893
|
+
Gallery = 2
|
7894
|
+
}
|
7895
|
+
/**
|
7896
|
+
* @hidden
|
7897
|
+
* VisualMediaFile object that can be used to represent image or video from host apps.
|
7898
|
+
*
|
7899
|
+
* @beta
|
7900
|
+
*/
|
7901
|
+
export interface VisualMediaFile {
|
7902
|
+
/**
|
7903
|
+
* @hidden
|
7904
|
+
* This is the base64 content of file.
|
7905
|
+
* If app needs to use this directly in HTML tags, it should convert this to a data url.
|
7906
|
+
*/
|
7907
|
+
content: string;
|
7908
|
+
/**
|
7909
|
+
* @hidden
|
7910
|
+
* The size of file represented in VisualMediaFile in KB
|
7911
|
+
*/
|
7912
|
+
sizeInKB: number;
|
7913
|
+
/**
|
7914
|
+
* @hidden
|
7915
|
+
* Name of the file (does not include the extension)
|
7916
|
+
*/
|
7917
|
+
name: string;
|
7918
|
+
/**
|
7919
|
+
* @hidden
|
7920
|
+
* File's MIME type. More information on supported `mimeTypes`(https://docs.lens.xyz/docs/metadata-standards#supported-mime-types-for-imagesaudiovideos).
|
7921
|
+
*/
|
7922
|
+
mimeType: string;
|
7923
|
+
}
|
7924
|
+
/**
|
7925
|
+
* @hidden
|
7926
|
+
* Checks whether or not visualMedia has user permission
|
7927
|
+
* @returns Promise that will resolve with true if the user had granted the app permission to media information(including Camera and Gallery permission), or with false otherwise,
|
7928
|
+
* In case of an error, promise will reject with the error.
|
7929
|
+
* @throws NOT_SUPPORTED_ON_PLATFORM Error if the DevicePermission.Media permission has not successfully granted.
|
7930
|
+
*
|
7931
|
+
* @beta
|
7932
|
+
*/
|
7933
|
+
export function hasPermission(): Promise<boolean>;
|
7934
|
+
/**
|
7935
|
+
* @hidden
|
7936
|
+
* Requests user permission for visualMedia
|
7937
|
+
* @returns Promise that will resolve with true if the user consented permission for media(including Camera and Gallery permission), or with false otherwise,
|
7938
|
+
* In case of an error, promise will reject with the error.
|
7939
|
+
* @throws NOT_SUPPORTED_ON_PLATFORM Error if the DevicePermission.Media permission has not successfully granted.
|
7940
|
+
*
|
7941
|
+
* @beta
|
7942
|
+
*/
|
7943
|
+
export function requestPermission(): Promise<boolean>;
|
7944
|
+
/**
|
7945
|
+
* @hidden
|
7946
|
+
* To enable this image capability will let the app developer ask the user to get images from camera/local storage
|
7947
|
+
*
|
7948
|
+
* @beta
|
7949
|
+
*/
|
7950
|
+
export namespace image {
|
7951
|
+
/**
|
7952
|
+
* @hidden
|
7953
|
+
* CameraImageProperties is for the image taken from the camera
|
7954
|
+
*
|
7955
|
+
* @beta
|
7956
|
+
*/
|
7957
|
+
interface CameraImageProperties extends VisualMediaProps {
|
7958
|
+
/**
|
7959
|
+
* @hidden
|
7960
|
+
* The source in CameraImageProperties should always be CameraProps
|
7961
|
+
*/
|
7962
|
+
sourceProps: CameraProps;
|
7963
|
+
}
|
7964
|
+
/**
|
7965
|
+
* @hidden
|
7966
|
+
* CameraImageProperties is for the image taken from the camera
|
7967
|
+
*
|
7968
|
+
* @beta
|
7969
|
+
*/
|
7970
|
+
interface GalleryImageProperties extends VisualMediaProps {
|
7971
|
+
/**
|
7972
|
+
* @hidden
|
7973
|
+
* The source in GalleryImageProperties should always be GalleryProps
|
7974
|
+
*/
|
7975
|
+
sourceProps: GalleryProps;
|
7976
|
+
}
|
7977
|
+
/**
|
7978
|
+
* @hidden
|
7979
|
+
* Capture one or multiple image(s) using camera.
|
7980
|
+
* @param cameraImageInputs - The input params to customize the image(s) to be captured
|
7981
|
+
* @returns Promise that will resolve with {@link VisualMediaFile[]} object or reject with an error.
|
7982
|
+
* @throws INVALID_ARGUMENTS Error if imageInputs is null or imageInputs.maxVisualMediaCount is greater than maxVisualMediaSelectionLimit or lesser than 1.
|
7983
|
+
*
|
7984
|
+
* @beta
|
7985
|
+
*/
|
7986
|
+
function captureImages(cameraImageInputs: CameraImageProperties): Promise<VisualMediaFile[]>;
|
7987
|
+
/**
|
7988
|
+
* @hidden
|
7989
|
+
* Upload the existing image(s) from the gallery.
|
7990
|
+
* @param galleryImageInputs - The input params to customize the image(s) to be captured
|
7991
|
+
* @returns Promise that will resolve with {@link VisualMediaFile[]} object or reject with an error.
|
7992
|
+
* @throws INVALID_ARGUMENTS Error if imageInputs is null or imageInputs.maxVisualMediaCount is greater than maxVisualMediaSelectionLimit or lesser than 1.
|
7993
|
+
*
|
7994
|
+
* @beta
|
7995
|
+
*/
|
7996
|
+
function retrieveImages(galleryImageInputs: GalleryImageProperties): Promise<VisualMediaFile[]>;
|
7997
|
+
/**
|
7998
|
+
* @hidden
|
7999
|
+
* Checks if visualMedia.image capability is supported by the host
|
8000
|
+
* @returns boolean to represent whether visualMedia.image is supported
|
8001
|
+
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
8002
|
+
*
|
8003
|
+
* @beta
|
8004
|
+
*/
|
8005
|
+
function isSupported(): boolean;
|
8006
|
+
}
|
8007
|
+
export {};
|
8008
|
+
}
|
8009
|
+
|
7799
8010
|
/**
|
7800
8011
|
* Contains functionality to allow web apps to store data in webview cache
|
7801
8012
|
*
|
@@ -8305,7 +8516,13 @@ export namespace settings {
|
|
8305
8516
|
* The tasks namespace will be deprecated. Please use dialog for future developments.
|
8306
8517
|
*/
|
8307
8518
|
export namespace tasks {
|
8308
|
-
/**
|
8519
|
+
/**
|
8520
|
+
* Function type that is used to receive the result when a task module is submitted by
|
8521
|
+
* calling {@link tasks.submitTask tasks.submitTask(result?: string | object, appIds?: string | string[]): void}
|
8522
|
+
*
|
8523
|
+
* @param err - If the task module failed, this string contains the reason for failure. If the task module succeeded, this value is the empty string.
|
8524
|
+
* @param result - On success, this is the value passed to the `result` parameter of {@link tasks.submitTask tasks.submitTask(result?: string | object, appIds?: string | string[]): void}. On failure, this is the empty string.
|
8525
|
+
*/
|
8309
8526
|
type startTaskSubmitHandlerFunctionType = (err: string, result: string | object) => void;
|
8310
8527
|
/**
|
8311
8528
|
* @deprecated
|