@microsoft/teams-js 2.31.0-beta.0 → 2.31.0-beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. package/dist/esm/packages/teams-js/dts/internal/appHelpers.d.ts +1 -1
  2. package/dist/esm/packages/teams-js/dts/internal/dialogHelpers.d.ts +32 -0
  3. package/dist/esm/packages/teams-js/dts/internal/marketplaceUtils.d.ts +1 -1
  4. package/dist/esm/packages/teams-js/dts/internal/mediaUtil.d.ts +2 -2
  5. package/dist/esm/packages/teams-js/dts/public/{app.d.ts → app/app.d.ts} +13 -44
  6. package/dist/esm/packages/teams-js/dts/public/app/lifecycle.d.ts +40 -0
  7. package/dist/esm/packages/teams-js/dts/public/appInitialization.d.ts +1 -1
  8. package/dist/esm/packages/teams-js/dts/public/chat.d.ts +26 -28
  9. package/dist/esm/packages/teams-js/dts/public/dialog/adaptiveCard/adaptiveCard.d.ts +30 -0
  10. package/dist/esm/packages/teams-js/dts/public/dialog/adaptiveCard/bot.d.ts +26 -0
  11. package/dist/esm/packages/teams-js/dts/public/dialog/dialog.d.ts +69 -0
  12. package/dist/esm/packages/teams-js/dts/public/dialog/update.d.ts +23 -0
  13. package/dist/esm/packages/teams-js/dts/public/dialog/url/bot.d.ts +29 -0
  14. package/dist/esm/packages/teams-js/dts/public/dialog/url/parentCommunication.d.ts +49 -0
  15. package/dist/esm/packages/teams-js/dts/public/dialog/url/url.d.ts +60 -0
  16. package/dist/esm/packages/teams-js/dts/public/geoLocation/geoLocation.d.ts +67 -0
  17. package/dist/esm/packages/teams-js/dts/public/geoLocation/map.d.ts +27 -0
  18. package/dist/esm/packages/teams-js/dts/public/index.d.ts +20 -18
  19. package/dist/esm/packages/teams-js/dts/public/interfaces.d.ts +12 -1
  20. package/dist/esm/packages/teams-js/dts/public/liveShareHost.d.ts +134 -136
  21. package/dist/esm/packages/teams-js/dts/public/location.d.ts +72 -74
  22. package/dist/esm/packages/teams-js/dts/public/mail.d.ts +79 -81
  23. package/dist/esm/packages/teams-js/dts/public/marketplace.d.ts +314 -316
  24. package/dist/esm/packages/teams-js/dts/public/media.d.ts +425 -427
  25. package/dist/esm/packages/teams-js/dts/public/menus.d.ts +164 -166
  26. package/dist/esm/packages/teams-js/dts/public/monetization.d.ts +48 -50
  27. package/dist/esm/packages/teams-js/dts/public/nestedAppAuth.d.ts +9 -11
  28. package/dist/esm/packages/teams-js/dts/public/people.d.ts +61 -63
  29. package/dist/esm/packages/teams-js/dts/public/search.d.ts +76 -86
  30. package/dist/esm/packages/teams-js/dts/public/secondaryBrowser.d.ts +25 -27
  31. package/dist/esm/packages/teams-js/dts/public/tasks.d.ts +52 -54
  32. package/dist/esm/packages/teams-js/dts/public/teamsAPIs.d.ts +74 -76
  33. package/dist/esm/packages/teams-js/dts/public/thirdPartyCloudStorage.d.ts +96 -98
  34. package/dist/esm/packages/teams-js/src/index.js +1 -1
  35. package/dist/esm/packages/teams-js/src/internal/appHelpers.js +1 -1
  36. package/dist/esm/packages/teams-js/src/internal/deepLinkUtilities.js +1 -1
  37. package/dist/esm/packages/teams-js/src/internal/dialogHelpers.js +1 -0
  38. package/dist/esm/packages/teams-js/src/internal/marketplaceUtils.js +1 -1
  39. package/dist/esm/packages/teams-js/src/internal/mediaUtil.js +1 -1
  40. package/dist/esm/packages/teams-js/src/public/app/app.js +1 -0
  41. package/dist/esm/packages/teams-js/src/public/app/lifecycle.js +1 -0
  42. package/dist/esm/packages/teams-js/src/public/appInitialization.js +1 -1
  43. package/dist/esm/packages/teams-js/src/public/chat.js +1 -1
  44. package/dist/esm/packages/teams-js/src/public/dialog/adaptiveCard/adaptiveCard.js +1 -0
  45. package/dist/esm/packages/teams-js/src/public/dialog/adaptiveCard/bot.js +1 -0
  46. package/dist/esm/packages/teams-js/src/public/dialog/dialog.js +1 -0
  47. package/dist/esm/packages/teams-js/src/public/dialog/update.js +1 -0
  48. package/dist/esm/packages/teams-js/src/public/dialog/url/bot.js +1 -0
  49. package/dist/esm/packages/teams-js/src/public/dialog/url/parentCommunication.js +1 -0
  50. package/dist/esm/packages/teams-js/src/public/dialog/url/url.js +1 -0
  51. package/dist/esm/packages/teams-js/src/public/geoLocation/geoLocation.js +1 -0
  52. package/dist/esm/packages/teams-js/src/public/geoLocation/map.js +1 -0
  53. package/dist/esm/packages/teams-js/src/public/liveShareHost.js +1 -1
  54. package/dist/esm/packages/teams-js/src/public/location.js +1 -1
  55. package/dist/esm/packages/teams-js/src/public/mail.js +1 -1
  56. package/dist/esm/packages/teams-js/src/public/marketplace.js +1 -1
  57. package/dist/esm/packages/teams-js/src/public/media.js +1 -1
  58. package/dist/esm/packages/teams-js/src/public/menus.js +1 -1
  59. package/dist/esm/packages/teams-js/src/public/monetization.js +1 -1
  60. package/dist/esm/packages/teams-js/src/public/nestedAppAuth.js +1 -1
  61. package/dist/esm/packages/teams-js/src/public/people.js +1 -1
  62. package/dist/esm/packages/teams-js/src/public/publicAPIs.js +1 -1
  63. package/dist/esm/packages/teams-js/src/public/search.js +1 -1
  64. package/dist/esm/packages/teams-js/src/public/secondaryBrowser.js +1 -1
  65. package/dist/esm/packages/teams-js/src/public/tasks.js +1 -1
  66. package/dist/esm/packages/teams-js/src/public/teamsAPIs.js +1 -1
  67. package/dist/esm/packages/teams-js/src/public/thirdPartyCloudStorage.js +1 -1
  68. package/dist/esm/packages/teams-js/src/public/version.js +1 -1
  69. package/dist/esm/packages/teams-js/src/public/webStorage.js +1 -1
  70. package/dist/umd/MicrosoftTeams.d.ts +2219 -2022
  71. package/dist/umd/MicrosoftTeams.js +2397 -2244
  72. package/dist/umd/MicrosoftTeams.js.map +1 -1
  73. package/dist/umd/MicrosoftTeams.min.js +1 -1
  74. package/dist/umd/MicrosoftTeams.min.js.map +1 -1
  75. package/package.json +1 -1
  76. package/dist/esm/packages/teams-js/dts/public/dialog.d.ts +0 -286
  77. package/dist/esm/packages/teams-js/dts/public/geoLocation.d.ts +0 -100
  78. package/dist/esm/packages/teams-js/src/public/app.js +0 -1
  79. package/dist/esm/packages/teams-js/src/public/dialog.js +0 -1
  80. package/dist/esm/packages/teams-js/src/public/geoLocation.js +0 -1
@@ -2,439 +2,437 @@ import { SdkError } from './interfaces';
2
2
  /**
3
3
  * Interact with media, including capturing and viewing images.
4
4
  */
5
- export declare namespace media {
6
- /**
7
- * Function callback type used when calling {@link media.captureImage}.
8
- *
9
- * @param error - Error encountered during the API call, if any, {@link SdkError}
10
- * @param files - Collection of File objects (images) captured by the user. Will be an empty array in the case of an error.
11
- * */
12
- export type captureImageCallbackFunctionType = (error: SdkError, files: File[]) => void;
13
- /**
14
- * Function callback type used when calling {@link media.selectMedia}.
15
- *
16
- * @param error - Error encountered during the API call, if any, {@link SdkError}
17
- * @param attachments - Collection of {@link Media} objects selected by the user. Will be an empty array in the case of an error.
18
- * */
19
- export type selectMediaCallbackFunctionType = (error: SdkError, attachments: Media[]) => void;
20
- /** Error callback function type. */
21
- export type errorCallbackFunctionType = (error?: SdkError) => void;
22
- /**
23
- * Function callback type used when calling {@link media.scanBarCode}.
24
- *
25
- * @param error - Error encountered during the API call, if any, {@link SdkError}
26
- * @param decodedText - Decoded text from the barcode, if any. In the case of an error, this will be the empty string.
27
- * */
28
- export type scanBarCodeCallbackFunctionType = (error: SdkError, decodedText: string) => void;
29
- /**
30
- * Function callback type used when calling {@link media.Media.getMedia}
31
- *
32
- * @param error - Error encountered during the API call, if any, {@link SdkError}
33
- * @param blob - Blob of media returned. Will be a blob with no BlobParts, in the case of an error.
34
- * */
35
- export type getMediaCallbackFunctionType = (error: SdkError, blob: Blob) => void;
36
- /**
37
- * Enum for file formats supported
38
- */
39
- export enum FileFormat {
40
- /** Base64 encoding */
41
- Base64 = "base64",
42
- /** File id */
43
- ID = "id"
44
- }
45
- /**
46
- * File object that can be used to represent image or video or audio
47
- */
48
- export class File {
49
- /**
50
- * Content of the file. When format is Base64, this is the base64 content
51
- * When format is ID, this is id mapping to the URI
52
- * When format is base64 and app needs to use this directly in HTML tags, it should convert this to dataUrl.
53
- */
54
- content: string;
55
- /**
56
- * Format of the content
57
- */
58
- format: FileFormat;
59
- /**
60
- * Size of the file in KB
61
- */
62
- size: number;
63
- /**
64
- * MIME type. This can be used for constructing a dataUrl, if needed.
65
- */
66
- mimeType: string;
67
- /**
68
- * Optional: Name of the file
69
- */
70
- name?: string;
71
- }
72
- /**
73
- * Launch camera, capture image or choose image from gallery and return the images as a File[] object to the callback.
74
- *
75
- * @params callback - Callback will be called with an @see SdkError if there are any.
76
- * If error is null or undefined, the callback will be called with a collection of @see File objects
77
- * @remarks
78
- * Note: Currently we support getting one File through this API, i.e. the file arrays size will be one.
79
- * Note: For desktop, this API is not supported. Callback will be resolved with ErrorCode.NotSupported.
80
- *
81
- */
82
- export function captureImage(callback: captureImageCallbackFunctionType): void;
83
- /**
84
- * Checks whether or not media has user permission
85
- *
86
- * @returns Promise that will resolve with true if the user had granted the app permission to media information, or with false otherwise,
87
- * In case of an error, promise will reject with the error. Function can also throw a NOT_SUPPORTED_ON_PLATFORM error
88
- *
89
- * @beta
90
- */
91
- export function hasPermission(): Promise<boolean>;
92
- /**
93
- * Requests user permission for media
94
- *
95
- * @returns Promise that will resolve with true if the user consented permission for media, or with false otherwise,
96
- * In case of an error, promise will reject with the error. Function can also throw a NOT_SUPPORTED_ON_PLATFORM error
97
- *
98
- * @beta
99
- */
100
- export function requestPermission(): Promise<boolean>;
101
- /**
102
- * Media object returned by the select Media API
103
- */
104
- export class Media extends File {
105
- constructor(that?: Media);
106
- /**
107
- * A preview of the file which is a lightweight representation.
108
- * In case of images this will be a thumbnail/compressed image in base64 encoding.
109
- */
110
- preview: string;
111
- /**
112
- * Gets the media in chunks irrespective of size, these chunks are assembled and sent back to the webapp as file/blob
113
- * @param callback - callback is called with the @see SdkError if there is an error
114
- * If error is null or undefined, the callback will be called with @see Blob.
115
- */
116
- getMedia(callback: getMediaCallbackFunctionType): void;
117
- /** Function to retrieve media content, such as images or videos, via callback. */
118
- private getMediaViaCallback;
119
- /** Function to retrieve media content, such as images or videos, via handler. */
120
- private getMediaViaHandler;
121
- }
122
- /**
123
- * Input parameter supplied to the select Media API
124
- */
125
- export interface MediaInputs {
126
- /**
127
- * Only one media type can be selected at a time
128
- */
129
- mediaType: MediaType;
130
- /**
131
- * max limit of media allowed to be selected in one go, current max limit is 10 set by office lens.
132
- */
133
- maxMediaCount: number;
134
- /**
135
- * Additional properties for customization of select media - Image in mobile devices
136
- */
137
- imageProps?: ImageProps;
138
- /**
139
- * Additional properties for customization of select media - Video in mobile devices
140
- */
141
- videoProps?: VideoProps;
142
- /**
143
- * Additional properties for customization of select media - VideoAndImage in mobile devices
144
- */
145
- videoAndImageProps?: VideoAndImageProps;
146
- /**
147
- * Additional properties for audio capture flows.
148
- */
149
- audioProps?: AudioProps;
150
- }
5
+ /**
6
+ * Function callback type used when calling {@link media.captureImage}.
7
+ *
8
+ * @param error - Error encountered during the API call, if any, {@link SdkError}
9
+ * @param files - Collection of File objects (images) captured by the user. Will be an empty array in the case of an error.
10
+ * */
11
+ export type captureImageCallbackFunctionType = (error: SdkError, files: File[]) => void;
12
+ /**
13
+ * Function callback type used when calling {@link media.selectMedia}.
14
+ *
15
+ * @param error - Error encountered during the API call, if any, {@link SdkError}
16
+ * @param attachments - Collection of {@link Media} objects selected by the user. Will be an empty array in the case of an error.
17
+ * */
18
+ export type selectMediaCallbackFunctionType = (error: SdkError, attachments: Media[]) => void;
19
+ /** Error callback function type. */
20
+ export type errorCallbackFunctionType = (error?: SdkError) => void;
21
+ /**
22
+ * Function callback type used when calling {@link media.scanBarCode}.
23
+ *
24
+ * @param error - Error encountered during the API call, if any, {@link SdkError}
25
+ * @param decodedText - Decoded text from the barcode, if any. In the case of an error, this will be the empty string.
26
+ * */
27
+ export type scanBarCodeCallbackFunctionType = (error: SdkError, decodedText: string) => void;
28
+ /**
29
+ * Function callback type used when calling {@link media.Media.getMedia}
30
+ *
31
+ * @param error - Error encountered during the API call, if any, {@link SdkError}
32
+ * @param blob - Blob of media returned. Will be a blob with no BlobParts, in the case of an error.
33
+ * */
34
+ export type getMediaCallbackFunctionType = (error: SdkError, blob: Blob) => void;
35
+ /**
36
+ * Enum for file formats supported
37
+ */
38
+ export declare enum FileFormat {
39
+ /** Base64 encoding */
40
+ Base64 = "base64",
41
+ /** File id */
42
+ ID = "id"
43
+ }
44
+ /**
45
+ * File object that can be used to represent image or video or audio
46
+ */
47
+ export declare class File {
48
+ /**
49
+ * Content of the file. When format is Base64, this is the base64 content
50
+ * When format is ID, this is id mapping to the URI
51
+ * When format is base64 and app needs to use this directly in HTML tags, it should convert this to dataUrl.
52
+ */
53
+ content: string;
54
+ /**
55
+ * Format of the content
56
+ */
57
+ format: FileFormat;
58
+ /**
59
+ * Size of the file in KB
60
+ */
61
+ size: number;
62
+ /**
63
+ * MIME type. This can be used for constructing a dataUrl, if needed.
64
+ */
65
+ mimeType: string;
66
+ /**
67
+ * Optional: Name of the file
68
+ */
69
+ name?: string;
70
+ }
71
+ /**
72
+ * Launch camera, capture image or choose image from gallery and return the images as a File[] object to the callback.
73
+ *
74
+ * @params callback - Callback will be called with an @see SdkError if there are any.
75
+ * If error is null or undefined, the callback will be called with a collection of @see File objects
76
+ * @remarks
77
+ * Note: Currently we support getting one File through this API, i.e. the file arrays size will be one.
78
+ * Note: For desktop, this API is not supported. Callback will be resolved with ErrorCode.NotSupported.
79
+ *
80
+ */
81
+ export declare function captureImage(callback: captureImageCallbackFunctionType): void;
82
+ /**
83
+ * Checks whether or not media has user permission
84
+ *
85
+ * @returns Promise that will resolve with true if the user had granted the app permission to media information, or with false otherwise,
86
+ * In case of an error, promise will reject with the error. Function can also throw a NOT_SUPPORTED_ON_PLATFORM error
87
+ *
88
+ * @beta
89
+ */
90
+ export declare function hasPermission(): Promise<boolean>;
91
+ /**
92
+ * Requests user permission for media
93
+ *
94
+ * @returns Promise that will resolve with true if the user consented permission for media, or with false otherwise,
95
+ * In case of an error, promise will reject with the error. Function can also throw a NOT_SUPPORTED_ON_PLATFORM error
96
+ *
97
+ * @beta
98
+ */
99
+ export declare function requestPermission(): Promise<boolean>;
100
+ /**
101
+ * Media object returned by the select Media API
102
+ */
103
+ export declare class Media extends File {
104
+ constructor(that?: Media);
105
+ /**
106
+ * A preview of the file which is a lightweight representation.
107
+ * In case of images this will be a thumbnail/compressed image in base64 encoding.
108
+ */
109
+ preview: string;
110
+ /**
111
+ * Gets the media in chunks irrespective of size, these chunks are assembled and sent back to the webapp as file/blob
112
+ * @param callback - callback is called with the @see SdkError if there is an error
113
+ * If error is null or undefined, the callback will be called with @see Blob.
114
+ */
115
+ getMedia(callback: getMediaCallbackFunctionType): void;
116
+ /** Function to retrieve media content, such as images or videos, via callback. */
117
+ private getMediaViaCallback;
118
+ /** Function to retrieve media content, such as images or videos, via handler. */
119
+ private getMediaViaHandler;
120
+ }
121
+ /**
122
+ * Input parameter supplied to the select Media API
123
+ */
124
+ export interface MediaInputs {
125
+ /**
126
+ * Only one media type can be selected at a time
127
+ */
128
+ mediaType: MediaType;
129
+ /**
130
+ * max limit of media allowed to be selected in one go, current max limit is 10 set by office lens.
131
+ */
132
+ maxMediaCount: number;
133
+ /**
134
+ * Additional properties for customization of select media - Image in mobile devices
135
+ */
136
+ imageProps?: ImageProps;
137
+ /**
138
+ * Additional properties for customization of select media - Video in mobile devices
139
+ */
140
+ videoProps?: VideoProps;
141
+ /**
142
+ * Additional properties for customization of select media - VideoAndImage in mobile devices
143
+ */
144
+ videoAndImageProps?: VideoAndImageProps;
145
+ /**
146
+ * Additional properties for audio capture flows.
147
+ */
148
+ audioProps?: AudioProps;
149
+ }
150
+ /**
151
+ * @hidden
152
+ * Hide from docs
153
+ * --------
154
+ * All properties common to Image and Video Props
155
+ */
156
+ interface MediaProps {
157
+ /**
158
+ * @hidden
159
+ * Optional; Lets the developer specify the media source, more than one can be specified.
160
+ * Default value is both camera and gallery
161
+ */
162
+ sources?: Source[];
163
+ /**
164
+ * @hidden
165
+ * Optional; Specify in which mode the camera will be opened.
166
+ * Default value is Photo
167
+ */
168
+ startMode?: CameraStartMode;
169
+ /**
170
+ * @hidden
171
+ * Optional; indicate if user is allowed to move between front and back camera
172
+ * Default value is true
173
+ */
174
+ cameraSwitcher?: boolean;
175
+ }
176
+ /**
177
+ * All properties in ImageProps are optional and have default values in the platform
178
+ */
179
+ export interface ImageProps extends MediaProps {
180
+ /**
181
+ * Optional; indicate if inking on the selected Image is allowed or not
182
+ * Default value is true
183
+ */
184
+ ink?: boolean;
185
+ /**
186
+ * Optional; indicate if putting text stickers on the selected Image is allowed or not
187
+ * Default value is true
188
+ */
189
+ textSticker?: boolean;
190
+ /**
191
+ * Optional; indicate if image filtering mode is enabled on the selected image
192
+ * Default value is false
193
+ */
194
+ enableFilter?: boolean;
195
+ /**
196
+ * Optional; Lets the developer specify the image output formats, more than one can be specified.
197
+ * Default value is Image.
198
+ */
199
+ imageOutputFormats?: ImageOutputFormats[];
200
+ }
201
+ /**
202
+ * All properties in VideoProps are optional and have default values in the platform
203
+ */
204
+ export interface VideoProps extends MediaProps {
205
+ /**
206
+ * Optional; the maximum duration in seconds after which the recording should terminate automatically.
207
+ * Default value is defined by the platform serving the API.
208
+ */
209
+ maxDuration?: number;
210
+ /**
211
+ * Optional; to determine if the video capturing flow needs to be launched
212
+ * in Full Screen Mode (Lens implementation) or PictureInPicture Mode (Native implementation).
213
+ * Default value is true, indicating video will always launch in Full Screen Mode via lens.
214
+ */
215
+ isFullScreenMode?: boolean;
216
+ /**
217
+ * Optional; controls the visibility of stop button in PictureInPicture Mode.
218
+ * Default value is true, indicating the user will be able to stop the video.
219
+ */
220
+ isStopButtonVisible?: boolean;
221
+ /**
222
+ * Optional; setting VideoController will register your app to listen to the lifecycle events during the video capture flow.
223
+ * Your app can also dynamically control the experience while capturing the video by notifying the host client.
224
+ */
225
+ videoController?: VideoController;
226
+ }
227
+ /**
228
+ * All properties in VideoAndImageProps are optional and have default values in the platform
229
+ */
230
+ export interface VideoAndImageProps extends ImageProps, VideoProps {
231
+ }
232
+ /**
233
+ * All properties in AudioProps are optional and have default values in the platform
234
+ */
235
+ export interface AudioProps {
236
+ /**
237
+ * Optional; the maximum duration in minutes after which the recording should terminate automatically
238
+ * Default value is defined by the platform serving the API.
239
+ */
240
+ maxDuration?: number;
241
+ }
242
+ /**
243
+ * @hidden
244
+ * Hide from docs
245
+ * --------
246
+ * Base class which holds the callback and notifies events to the host client
247
+ */
248
+ declare abstract class MediaController<T> {
249
+ /** Callback that can be registered to handle events related to the playback and control of video content. */
250
+ protected controllerCallback?: T;
251
+ constructor(controllerCallback?: T);
252
+ protected abstract getMediaType(): MediaType;
151
253
  /**
152
254
  * @hidden
153
255
  * Hide from docs
154
256
  * --------
155
- * All properties common to Image and Video Props
156
- */
157
- interface MediaProps {
158
- /**
159
- * @hidden
160
- * Optional; Lets the developer specify the media source, more than one can be specified.
161
- * Default value is both camera and gallery
162
- */
163
- sources?: Source[];
164
- /**
165
- * @hidden
166
- * Optional; Specify in which mode the camera will be opened.
167
- * Default value is Photo
168
- */
169
- startMode?: CameraStartMode;
170
- /**
171
- * @hidden
172
- * Optional; indicate if user is allowed to move between front and back camera
173
- * Default value is true
174
- */
175
- cameraSwitcher?: boolean;
176
- }
177
- /**
178
- * All properties in ImageProps are optional and have default values in the platform
179
- */
180
- export interface ImageProps extends MediaProps {
181
- /**
182
- * Optional; indicate if inking on the selected Image is allowed or not
183
- * Default value is true
184
- */
185
- ink?: boolean;
186
- /**
187
- * Optional; indicate if putting text stickers on the selected Image is allowed or not
188
- * Default value is true
189
- */
190
- textSticker?: boolean;
191
- /**
192
- * Optional; indicate if image filtering mode is enabled on the selected image
193
- * Default value is false
194
- */
195
- enableFilter?: boolean;
196
- /**
197
- * Optional; Lets the developer specify the image output formats, more than one can be specified.
198
- * Default value is Image.
199
- */
200
- imageOutputFormats?: ImageOutputFormats[];
201
- }
202
- /**
203
- * All properties in VideoProps are optional and have default values in the platform
204
- */
205
- export interface VideoProps extends MediaProps {
206
- /**
207
- * Optional; the maximum duration in seconds after which the recording should terminate automatically.
208
- * Default value is defined by the platform serving the API.
209
- */
210
- maxDuration?: number;
211
- /**
212
- * Optional; to determine if the video capturing flow needs to be launched
213
- * in Full Screen Mode (Lens implementation) or PictureInPicture Mode (Native implementation).
214
- * Default value is true, indicating video will always launch in Full Screen Mode via lens.
215
- */
216
- isFullScreenMode?: boolean;
217
- /**
218
- * Optional; controls the visibility of stop button in PictureInPicture Mode.
219
- * Default value is true, indicating the user will be able to stop the video.
220
- */
221
- isStopButtonVisible?: boolean;
222
- /**
223
- * Optional; setting VideoController will register your app to listen to the lifecycle events during the video capture flow.
224
- * Your app can also dynamically control the experience while capturing the video by notifying the host client.
225
- */
226
- videoController?: VideoController;
227
- }
228
- /**
229
- * All properties in VideoAndImageProps are optional and have default values in the platform
230
- */
231
- export interface VideoAndImageProps extends ImageProps, VideoProps {
232
- }
233
- /**
234
- * All properties in AudioProps are optional and have default values in the platform
235
- */
236
- export interface AudioProps {
237
- /**
238
- * Optional; the maximum duration in minutes after which the recording should terminate automatically
239
- * Default value is defined by the platform serving the API.
240
- */
241
- maxDuration?: number;
242
- }
257
+ * This function will be implemented by the respective media class which holds the logic
258
+ * of specific events that needs to be notified to the app.
259
+ * @param mediaEvent indicates the event signed by the host client to the app
260
+ */
261
+ protected abstract notifyEventToApp(mediaEvent: MediaControllerEvent): void;
243
262
  /**
244
263
  * @hidden
245
264
  * Hide from docs
246
265
  * --------
247
- * Base class which holds the callback and notifies events to the host client
248
- */
249
- abstract class MediaController<T> {
250
- /** Callback that can be registered to handle events related to the playback and control of video content. */
251
- protected controllerCallback?: T;
252
- constructor(controllerCallback?: T);
253
- protected abstract getMediaType(): MediaType;
254
- /**
255
- * @hidden
256
- * Hide from docs
257
- * --------
258
- * This function will be implemented by the respective media class which holds the logic
259
- * of specific events that needs to be notified to the app.
260
- * @param mediaEvent indicates the event signed by the host client to the app
261
- */
262
- protected abstract notifyEventToApp(mediaEvent: MediaControllerEvent): void;
263
- /**
264
- * @hidden
265
- * Hide from docs
266
- * --------
267
- * Function to notify the host client to programatically control the experience
268
- * @param mediaEvent indicates what the event that needs to be signaled to the host client
269
- * Optional; @param callback is used to send app if host client has successfully handled the notification event or not
270
- */
271
- protected notifyEventToHost(mediaEvent: MediaControllerEvent, callback?: errorCallbackFunctionType): void;
272
- /**
273
- * Function to programatically stop the ongoing media event
274
- * Optional; @param callback is used to send app if host client has successfully stopped the event or not
275
- */
276
- stop(callback?: errorCallbackFunctionType): void;
277
- }
278
- /**
279
- * Callback which will register your app to listen to lifecycle events during the video capture flow
280
- */
281
- export interface VideoControllerCallback {
282
- /** The event is a type of callback that can be enlisted to handle various events linked to `onRecordingStarted`, which helps with playback of video content. */
283
- onRecordingStarted?(): void;
284
- }
285
- /**
286
- * VideoController class is used to communicate between the app and the host client during the video capture flow
287
- */
288
- export class VideoController extends MediaController<VideoControllerCallback> {
289
- /** Gets media type video. */
290
- protected getMediaType(): MediaType;
291
- /** Notify or send an event related to the playback and control of video content to a registered application. */
292
- notifyEventToApp(mediaEvent: MediaControllerEvent): void;
293
- }
294
- /**
295
- * @beta
296
- * Events which are used to communicate between the app and the host client during the media recording flow
297
- */
298
- export enum MediaControllerEvent {
299
- /** Start recording. */
300
- StartRecording = 1,
301
- /** Stop recording. */
302
- StopRecording = 2
303
- }
304
- /**
305
- * The modes in which camera can be launched in select Media API
306
- */
307
- export enum CameraStartMode {
308
- /** Photo mode. */
309
- Photo = 1,
310
- /** Document mode. */
311
- Document = 2,
312
- /** Whiteboard mode. */
313
- Whiteboard = 3,
314
- /** Business card mode. */
315
- BusinessCard = 4
316
- }
317
- /**
318
- * Specifies the image source
319
- */
320
- export enum Source {
321
- /** Image source is camera. */
322
- Camera = 1,
323
- /** Image source is gallery. */
324
- Gallery = 2
325
- }
326
- /**
327
- * Specifies the type of Media
328
- */
329
- export enum MediaType {
330
- /** Media type photo or image */
331
- Image = 1,
332
- /** Media type video. */
333
- Video = 2,
334
- /** Media type video and image. */
335
- VideoAndImage = 3,
336
- /** Media type audio. */
337
- Audio = 4
338
- }
339
- /**
340
- * Input for view images API
341
- */
342
- export interface ImageUri {
343
- /** Image location */
344
- value: string;
345
- /** Image Uri type */
346
- type: ImageUriType;
347
- }
348
- /**
349
- * ID contains a mapping for content uri on platform's side, URL is generic
350
- */
351
- export enum ImageUriType {
352
- /** Image Id. */
353
- ID = 1,
354
- /** Image URL. */
355
- URL = 2
356
- }
357
- /**
358
- * Specifies the image output formats.
359
- */
360
- export enum ImageOutputFormats {
361
- /** Outputs image. */
362
- IMAGE = 1,
363
- /** Outputs pdf. */
364
- PDF = 2
365
- }
366
- /**
367
- * Media chunks an output of getMedia API from platform
368
- */
369
- export interface MediaChunk {
370
- /**
371
- * Base 64 data for the requested uri
372
- */
373
- chunk: string;
374
- /**
375
- * chunk sequence number
376
- */
377
- chunkSequence: number;
378
- }
379
- /**
380
- * Output of getMedia API from platform
381
- */
382
- export interface MediaResult {
383
- /**
384
- * error encountered in getMedia API
385
- */
386
- error: SdkError;
387
- /**
388
- * Media chunk which will be assemebled and converted into a blob
389
- */
390
- mediaChunk: MediaChunk;
391
- }
392
- /**
393
- * Helper object to assembled media chunks
394
- */
395
- export interface AssembleAttachment {
396
- /** A number representing the sequence of the attachment in the media chunks. */
397
- sequence: number;
398
- /** A Blob object representing the data of the media chunks. */
399
- file: Blob;
400
- }
401
- /**
402
- * Select an attachment using camera/gallery
403
- *
404
- * @param mediaInputs - The input params to customize the media to be selected
405
- * @param callback - The callback to invoke after fetching the media
406
- */
407
- export function selectMedia(mediaInputs: MediaInputs, callback: selectMediaCallbackFunctionType): void;
408
- /**
409
- * View images using native image viewer
410
- *
411
- * @param uriList - list of URIs for images to be viewed - can be content URI or server URL. Supports up to 10 Images in a single call
412
- * @param callback - returns back error if encountered, returns null in case of success
413
- */
414
- export function viewImages(uriList: ImageUri[], callback: errorCallbackFunctionType): void;
415
- /**
416
- * Barcode configuration supplied to scanBarCode API to customize barcode scanning experience in mobile
417
- * All properties in BarCodeConfig are optional and have default values in the platform
418
- */
419
- export interface BarCodeConfig {
420
- /**
421
- * Optional; Lets the developer specify the scan timeout interval in seconds
422
- * Default value is 30 seconds and max allowed value is 60 seconds
423
- */
424
- timeOutIntervalInSec?: number;
425
- }
426
- /**
427
- * @deprecated
428
- * As of 2.1.0, please use {@link barCode.scanBarCode barCode.scanBarCode(config?: BarCodeConfig): Promise\<string\>} instead.
429
-
430
- * Scan Barcode/QRcode using camera
431
- *
432
- * @remarks
433
- * Note: For desktop and web, this API is not supported. Callback will be resolved with ErrorCode.NotSupported.
434
- *
435
- * @param callback - callback to invoke after scanning the barcode
436
- * @param config - optional input configuration to customize the barcode scanning experience
437
- */
438
- export function scanBarCode(callback: scanBarCodeCallbackFunctionType, config?: BarCodeConfig): void;
439
- export {};
266
+ * Function to notify the host client to programatically control the experience
267
+ * @param mediaEvent indicates what the event that needs to be signaled to the host client
268
+ * Optional; @param callback is used to send app if host client has successfully handled the notification event or not
269
+ */
270
+ protected notifyEventToHost(mediaEvent: MediaControllerEvent, callback?: errorCallbackFunctionType): void;
271
+ /**
272
+ * Function to programatically stop the ongoing media event
273
+ * Optional; @param callback is used to send app if host client has successfully stopped the event or not
274
+ */
275
+ stop(callback?: errorCallbackFunctionType): void;
276
+ }
277
+ /**
278
+ * Callback which will register your app to listen to lifecycle events during the video capture flow
279
+ */
280
+ export interface VideoControllerCallback {
281
+ /** The event is a type of callback that can be enlisted to handle various events linked to `onRecordingStarted`, which helps with playback of video content. */
282
+ onRecordingStarted?(): void;
440
283
  }
284
+ /**
285
+ * VideoController class is used to communicate between the app and the host client during the video capture flow
286
+ */
287
+ export declare class VideoController extends MediaController<VideoControllerCallback> {
288
+ /** Gets media type video. */
289
+ protected getMediaType(): MediaType;
290
+ /** Notify or send an event related to the playback and control of video content to a registered application. */
291
+ notifyEventToApp(mediaEvent: MediaControllerEvent): void;
292
+ }
293
+ /**
294
+ * @beta
295
+ * Events which are used to communicate between the app and the host client during the media recording flow
296
+ */
297
+ export declare enum MediaControllerEvent {
298
+ /** Start recording. */
299
+ StartRecording = 1,
300
+ /** Stop recording. */
301
+ StopRecording = 2
302
+ }
303
+ /**
304
+ * The modes in which camera can be launched in select Media API
305
+ */
306
+ export declare enum CameraStartMode {
307
+ /** Photo mode. */
308
+ Photo = 1,
309
+ /** Document mode. */
310
+ Document = 2,
311
+ /** Whiteboard mode. */
312
+ Whiteboard = 3,
313
+ /** Business card mode. */
314
+ BusinessCard = 4
315
+ }
316
+ /**
317
+ * Specifies the image source
318
+ */
319
+ export declare enum Source {
320
+ /** Image source is camera. */
321
+ Camera = 1,
322
+ /** Image source is gallery. */
323
+ Gallery = 2
324
+ }
325
+ /**
326
+ * Specifies the type of Media
327
+ */
328
+ export declare enum MediaType {
329
+ /** Media type photo or image */
330
+ Image = 1,
331
+ /** Media type video. */
332
+ Video = 2,
333
+ /** Media type video and image. */
334
+ VideoAndImage = 3,
335
+ /** Media type audio. */
336
+ Audio = 4
337
+ }
338
+ /**
339
+ * Input for view images API
340
+ */
341
+ export interface ImageUri {
342
+ /** Image location */
343
+ value: string;
344
+ /** Image Uri type */
345
+ type: ImageUriType;
346
+ }
347
+ /**
348
+ * ID contains a mapping for content uri on platform's side, URL is generic
349
+ */
350
+ export declare enum ImageUriType {
351
+ /** Image Id. */
352
+ ID = 1,
353
+ /** Image URL. */
354
+ URL = 2
355
+ }
356
+ /**
357
+ * Specifies the image output formats.
358
+ */
359
+ export declare enum ImageOutputFormats {
360
+ /** Outputs image. */
361
+ IMAGE = 1,
362
+ /** Outputs pdf. */
363
+ PDF = 2
364
+ }
365
+ /**
366
+ * Media chunks an output of getMedia API from platform
367
+ */
368
+ export interface MediaChunk {
369
+ /**
370
+ * Base 64 data for the requested uri
371
+ */
372
+ chunk: string;
373
+ /**
374
+ * chunk sequence number
375
+ */
376
+ chunkSequence: number;
377
+ }
378
+ /**
379
+ * Output of getMedia API from platform
380
+ */
381
+ export interface MediaResult {
382
+ /**
383
+ * error encountered in getMedia API
384
+ */
385
+ error: SdkError;
386
+ /**
387
+ * Media chunk which will be assemebled and converted into a blob
388
+ */
389
+ mediaChunk: MediaChunk;
390
+ }
391
+ /**
392
+ * Helper object to assembled media chunks
393
+ */
394
+ export interface AssembleAttachment {
395
+ /** A number representing the sequence of the attachment in the media chunks. */
396
+ sequence: number;
397
+ /** A Blob object representing the data of the media chunks. */
398
+ file: Blob;
399
+ }
400
+ /**
401
+ * Select an attachment using camera/gallery
402
+ *
403
+ * @param mediaInputs - The input params to customize the media to be selected
404
+ * @param callback - The callback to invoke after fetching the media
405
+ */
406
+ export declare function selectMedia(mediaInputs: MediaInputs, callback: selectMediaCallbackFunctionType): void;
407
+ /**
408
+ * View images using native image viewer
409
+ *
410
+ * @param uriList - list of URIs for images to be viewed - can be content URI or server URL. Supports up to 10 Images in a single call
411
+ * @param callback - returns back error if encountered, returns null in case of success
412
+ */
413
+ export declare function viewImages(uriList: ImageUri[], callback: errorCallbackFunctionType): void;
414
+ /**
415
+ * Barcode configuration supplied to scanBarCode API to customize barcode scanning experience in mobile
416
+ * All properties in BarCodeConfig are optional and have default values in the platform
417
+ */
418
+ export interface BarCodeConfig {
419
+ /**
420
+ * Optional; Lets the developer specify the scan timeout interval in seconds
421
+ * Default value is 30 seconds and max allowed value is 60 seconds
422
+ */
423
+ timeOutIntervalInSec?: number;
424
+ }
425
+ /**
426
+ * @deprecated
427
+ * As of 2.1.0, please use {@link barCode.scanBarCode barCode.scanBarCode(config?: BarCodeConfig): Promise\<string\>} instead.
428
+
429
+ * Scan Barcode/QRcode using camera
430
+ *
431
+ * @remarks
432
+ * Note: For desktop and web, this API is not supported. Callback will be resolved with ErrorCode.NotSupported.
433
+ *
434
+ * @param callback - callback to invoke after scanning the barcode
435
+ * @param config - optional input configuration to customize the barcode scanning experience
436
+ */
437
+ export declare function scanBarCode(callback: scanBarCodeCallbackFunctionType, config?: BarCodeConfig): void;
438
+ export {};