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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. package/README.md +4 -4
  2. package/dist/esm/_virtual/__polyfill-node.os.js +1 -0
  3. package/dist/esm/_virtual/_polyfill-node.os.js +1 -0
  4. package/dist/esm/node_modules/.pnpm/debug@4.3.5/node_modules/debug/src/node.js +1 -1
  5. package/dist/esm/node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js +1 -0
  6. package/dist/esm/node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js +1 -0
  7. package/dist/esm/packages/teams-js/dts/index.d.ts +2 -0
  8. package/dist/esm/packages/teams-js/dts/internal/VideoFrameTypes.d.ts +78 -0
  9. package/dist/esm/packages/teams-js/dts/internal/appHelpers.d.ts +8 -0
  10. package/dist/esm/packages/teams-js/dts/internal/appIdValidation.d.ts +16 -0
  11. package/dist/esm/packages/teams-js/dts/internal/communication.d.ts +162 -0
  12. package/dist/esm/packages/teams-js/dts/internal/constants.d.ts +146 -0
  13. package/dist/esm/packages/teams-js/dts/internal/deepLinkConstants.d.ts +26 -0
  14. package/dist/esm/packages/teams-js/dts/internal/deepLinkUtilities.d.ts +4 -0
  15. package/dist/esm/packages/teams-js/dts/internal/emailAddressValidation.d.ts +1 -0
  16. package/dist/esm/packages/teams-js/dts/internal/globalVars.d.ts +12 -0
  17. package/dist/esm/packages/teams-js/dts/internal/handlers.d.ts +80 -0
  18. package/dist/esm/packages/teams-js/dts/internal/interfaces.d.ts +47 -0
  19. package/dist/esm/packages/teams-js/dts/internal/internalAPIs.d.ts +61 -0
  20. package/dist/esm/packages/teams-js/dts/internal/marketplaceUtils.d.ts +94 -0
  21. package/dist/esm/packages/teams-js/dts/internal/mediaUtil.d.ts +95 -0
  22. package/dist/esm/packages/teams-js/dts/internal/messageObjects.d.ts +73 -0
  23. package/dist/esm/packages/teams-js/dts/internal/nestedAppAuthUtils.d.ts +105 -0
  24. package/dist/esm/packages/teams-js/dts/internal/profileUtil.d.ts +11 -0
  25. package/dist/esm/packages/teams-js/dts/internal/responseHandler.d.ts +30 -0
  26. package/dist/esm/packages/teams-js/dts/internal/telemetry.d.ts +344 -0
  27. package/dist/esm/packages/teams-js/dts/internal/typeCheckUtilities.d.ts +1 -0
  28. package/dist/esm/packages/teams-js/dts/internal/utils.d.ts +200 -0
  29. package/dist/esm/packages/teams-js/dts/internal/uuidObject.d.ts +11 -0
  30. package/dist/esm/packages/teams-js/dts/internal/validOrigins.d.ts +6 -0
  31. package/dist/esm/packages/teams-js/dts/internal/videoEffectsUtils.d.ts +31 -0
  32. package/dist/esm/packages/teams-js/dts/internal/videoFrameTick.d.ts +10 -0
  33. package/dist/esm/packages/teams-js/dts/internal/videoPerformanceMonitor.d.ts +54 -0
  34. package/dist/esm/packages/teams-js/dts/internal/videoPerformanceStatistics.d.ts +49 -0
  35. package/dist/esm/packages/teams-js/dts/private/appEntity.d.ts +89 -0
  36. package/dist/esm/packages/teams-js/dts/private/constants.d.ts +9 -0
  37. package/dist/esm/packages/teams-js/dts/private/conversations.d.ts +152 -0
  38. package/dist/esm/packages/teams-js/dts/private/copilot.d.ts +39 -0
  39. package/dist/esm/packages/teams-js/dts/private/externalAppAuthentication.d.ts +378 -0
  40. package/dist/esm/packages/teams-js/dts/private/externalAppAuthenticationForCEA.d.ts +75 -0
  41. package/dist/esm/packages/teams-js/dts/private/externalAppCardActions.d.ts +112 -0
  42. package/dist/esm/packages/teams-js/dts/private/externalAppCardActionsForCEA.d.ts +49 -0
  43. package/dist/esm/packages/teams-js/dts/private/externalAppCommands.d.ts +123 -0
  44. package/dist/esm/packages/teams-js/dts/private/files.d.ts +758 -0
  45. package/dist/esm/packages/teams-js/dts/private/hostEntity.d.ts +176 -0
  46. package/dist/esm/packages/teams-js/dts/private/index.d.ts +20 -0
  47. package/dist/esm/packages/teams-js/dts/private/interfaces.d.ts +250 -0
  48. package/dist/esm/packages/teams-js/dts/private/logs.d.ts +25 -0
  49. package/dist/esm/packages/teams-js/dts/private/meetingRoom.d.ts +203 -0
  50. package/dist/esm/packages/teams-js/dts/private/messageChannels.d.ts +107 -0
  51. package/dist/esm/packages/teams-js/dts/private/notifications.d.ts +26 -0
  52. package/dist/esm/packages/teams-js/dts/private/otherAppStateChange.d.ts +81 -0
  53. package/dist/esm/packages/teams-js/dts/private/privateAPIs.d.ts +60 -0
  54. package/dist/esm/packages/teams-js/dts/private/remoteCamera.d.ts +298 -0
  55. package/dist/esm/packages/teams-js/dts/private/teams.d.ts +116 -0
  56. package/dist/esm/packages/teams-js/dts/private/videoEffectsEx.d.ts +244 -0
  57. package/dist/esm/packages/teams-js/dts/public/adaptiveCards.d.ts +6 -0
  58. package/dist/esm/packages/teams-js/dts/public/app.d.ts +592 -0
  59. package/dist/esm/packages/teams-js/dts/public/appId.d.ts +33 -0
  60. package/dist/esm/packages/teams-js/dts/public/appInitialization.d.ts +57 -0
  61. package/dist/esm/packages/teams-js/dts/public/appInstallDialog.d.ts +18 -0
  62. package/dist/esm/packages/teams-js/dts/public/appWindow.d.ts +66 -0
  63. package/dist/esm/packages/teams-js/dts/public/authentication.d.ts +409 -0
  64. package/dist/esm/packages/teams-js/dts/public/barCode.d.ts +53 -0
  65. package/dist/esm/packages/teams-js/dts/public/calendar.d.ts +40 -0
  66. package/dist/esm/packages/teams-js/dts/public/call.d.ts +53 -0
  67. package/dist/esm/packages/teams-js/dts/public/chat.d.ts +66 -0
  68. package/dist/esm/packages/teams-js/dts/public/clipboard.d.ts +34 -0
  69. package/dist/esm/packages/teams-js/dts/public/constants.d.ts +179 -0
  70. package/dist/esm/packages/teams-js/dts/public/dialog.d.ts +286 -0
  71. package/dist/esm/packages/teams-js/dts/public/emailAddress.d.ts +12 -0
  72. package/dist/esm/packages/teams-js/dts/public/geoLocation.d.ts +100 -0
  73. package/dist/esm/packages/teams-js/dts/public/index.d.ts +44 -0
  74. package/dist/esm/packages/teams-js/dts/public/interfaces.d.ts +1133 -0
  75. package/dist/esm/packages/teams-js/dts/public/liveShareHost.d.ts +221 -0
  76. package/dist/esm/packages/teams-js/dts/public/location.d.ts +86 -0
  77. package/dist/esm/packages/teams-js/dts/public/mail.d.ts +95 -0
  78. package/dist/esm/packages/teams-js/dts/public/marketplace.d.ts +321 -0
  79. package/dist/esm/packages/teams-js/dts/public/media.d.ts +440 -0
  80. package/dist/esm/packages/teams-js/dts/public/meeting.d.ts +906 -0
  81. package/dist/esm/packages/teams-js/dts/public/menus.d.ts +188 -0
  82. package/dist/esm/packages/teams-js/dts/public/monetization.d.ts +58 -0
  83. package/dist/esm/packages/teams-js/dts/public/navigation.d.ts +45 -0
  84. package/dist/esm/packages/teams-js/dts/public/nestedAppAuth.d.ts +15 -0
  85. package/dist/esm/packages/teams-js/dts/public/pages.d.ts +574 -0
  86. package/dist/esm/packages/teams-js/dts/public/people.d.ts +75 -0
  87. package/dist/esm/packages/teams-js/dts/public/profile.d.ts +127 -0
  88. package/dist/esm/packages/teams-js/dts/public/publicAPIs.d.ts +218 -0
  89. package/dist/esm/packages/teams-js/dts/public/runtime.d.ts +207 -0
  90. package/dist/esm/packages/teams-js/dts/public/search.d.ts +91 -0
  91. package/dist/esm/packages/teams-js/dts/public/secondaryBrowser.d.ts +32 -0
  92. package/dist/esm/packages/teams-js/dts/public/serializable.interface.d.ts +17 -0
  93. package/dist/esm/packages/teams-js/dts/public/settings.d.ts +101 -0
  94. package/dist/esm/packages/teams-js/dts/public/sharing.d.ts +124 -0
  95. package/dist/esm/packages/teams-js/dts/public/stageView.d.ts +104 -0
  96. package/dist/esm/packages/teams-js/dts/public/tasks.d.ts +62 -0
  97. package/dist/esm/packages/teams-js/dts/public/teamsAPIs.d.ts +77 -0
  98. package/dist/esm/packages/teams-js/dts/public/thirdPartyCloudStorage.d.ts +119 -0
  99. package/dist/esm/packages/teams-js/dts/public/version.d.ts +5 -0
  100. package/dist/esm/packages/teams-js/dts/public/videoEffects.d.ts +213 -0
  101. package/dist/esm/packages/teams-js/dts/public/visualMedia.d.ts +192 -0
  102. package/dist/esm/packages/teams-js/dts/public/webStorage.d.ts +27 -0
  103. package/dist/esm/packages/teams-js/src/artifactsForCDN/validDomains.json.js +1 -1
  104. package/dist/esm/packages/teams-js/src/index.js +1 -1
  105. package/dist/esm/packages/teams-js/src/internal/appHelpers.js +1 -0
  106. package/dist/esm/packages/teams-js/src/internal/communication.js +1 -1
  107. package/dist/esm/packages/teams-js/src/internal/deepLinkUtilities.js +1 -1
  108. package/dist/esm/packages/teams-js/src/internal/responseHandler.js +1 -0
  109. package/dist/esm/packages/teams-js/src/private/externalAppAuthentication.js +1 -1
  110. package/dist/esm/packages/teams-js/src/private/externalAppAuthenticationForCEA.js +1 -1
  111. package/dist/esm/packages/teams-js/src/private/hostEntity.js +1 -1
  112. package/dist/esm/packages/teams-js/src/private/videoEffectsEx.js +1 -1
  113. package/dist/esm/packages/teams-js/src/public/app.js +1 -1
  114. package/dist/esm/packages/teams-js/src/public/appId.js +1 -1
  115. package/dist/esm/packages/teams-js/src/public/appInitialization.js +1 -1
  116. package/dist/esm/packages/teams-js/src/public/appInstallDialog.js +1 -1
  117. package/dist/esm/packages/teams-js/src/public/authentication.js +1 -1
  118. package/dist/esm/packages/teams-js/src/public/barCode.js +1 -1
  119. package/dist/esm/packages/teams-js/src/public/calendar.js +1 -1
  120. package/dist/esm/packages/teams-js/src/public/call.js +1 -1
  121. package/dist/esm/packages/teams-js/src/public/clipboard.js +1 -1
  122. package/dist/esm/packages/teams-js/src/public/constants.js +1 -1
  123. package/dist/esm/packages/teams-js/src/public/pages.js +1 -1
  124. package/dist/esm/packages/teams-js/src/public/publicAPIs.js +1 -1
  125. package/dist/esm/packages/teams-js/src/public/serializable.interface.js +1 -0
  126. package/dist/esm/packages/teams-js/src/public/settings.js +1 -1
  127. package/dist/esm/packages/teams-js/src/public/tasks.js +1 -1
  128. package/dist/esm/packages/teams-js/src/public/version.js +1 -1
  129. package/dist/esm/packages/teams-js/src/public/webStorage.js +1 -1
  130. package/dist/umd/MicrosoftTeams.d.ts +10740 -10768
  131. package/dist/umd/MicrosoftTeams.js +1572 -1360
  132. package/dist/umd/MicrosoftTeams.js.map +1 -1
  133. package/dist/umd/MicrosoftTeams.min.js +1 -1
  134. package/dist/umd/MicrosoftTeams.min.js.map +1 -1
  135. package/package.json +1 -1
  136. package/dist/esm/node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/browser.js +0 -1
@@ -0,0 +1,221 @@
1
+ /**
2
+ * APIs involving Live Share, a framework for building real-time collaborative apps.
3
+ * For more information, visit https://aka.ms/teamsliveshare
4
+ *
5
+ * @see LiveShareHost
6
+ */
7
+ export declare namespace liveShare {
8
+ /**
9
+ * @hidden
10
+ * The meeting roles of a user.
11
+ * Used in Live Share for its role verification feature.
12
+ * For more information, visit https://learn.microsoft.com/microsoftteams/platform/apps-in-teams-meetings/teams-live-share-capabilities?tabs=javascript#role-verification-for-live-data-structures
13
+ */
14
+ enum UserMeetingRole {
15
+ /**
16
+ * Guest role.
17
+ */
18
+ guest = "Guest",
19
+ /**
20
+ * Attendee role.
21
+ */
22
+ attendee = "Attendee",
23
+ /**
24
+ * Presenter role.
25
+ */
26
+ presenter = "Presenter",
27
+ /**
28
+ * Organizer role.
29
+ */
30
+ organizer = "Organizer"
31
+ }
32
+ /**
33
+ * @hidden
34
+ * State of the current Live Share session's Fluid container.
35
+ * This is used internally by the `LiveShareClient` when joining a Live Share session.
36
+ */
37
+ enum ContainerState {
38
+ /**
39
+ * The call to `LiveShareHost.setContainerId()` successfully created the container mapping
40
+ * for the current Live Share session.
41
+ */
42
+ added = "Added",
43
+ /**
44
+ * A container mapping for the current Live Share session already exists.
45
+ * This indicates to Live Share that a new container does not need be created.
46
+ */
47
+ alreadyExists = "AlreadyExists",
48
+ /**
49
+ * The call to `LiveShareHost.setContainerId()` failed to create the container mapping.
50
+ * This happens when another client has already set the container ID for the session.
51
+ */
52
+ conflict = "Conflict",
53
+ /**
54
+ * A container mapping for the current Live Share session does not yet exist.
55
+ * This indicates to Live Share that a new container should be created.
56
+ */
57
+ notFound = "NotFound"
58
+ }
59
+ /**
60
+ * @hidden
61
+ * Returned from `LiveShareHost.getFluidContainerId()` and `LiveShareHost.setFluidContainerId`.
62
+ * This response specifies the container mapping information for the current Live Share session.
63
+ */
64
+ interface IFluidContainerInfo {
65
+ /**
66
+ * State of the containerId mapping.
67
+ */
68
+ containerState: ContainerState;
69
+ /**
70
+ * ID of the container to join for the meeting. Undefined if the container hasn't been
71
+ * created yet.
72
+ */
73
+ containerId: string | undefined;
74
+ /**
75
+ * If true, the local client should create the container and then save the created containers
76
+ * ID to the mapping service.
77
+ */
78
+ shouldCreate: boolean;
79
+ /**
80
+ * If `containerId` is undefined and `shouldCreate` is false, the container isn't ready
81
+ * but another client is creating it. In this case, the local client should wait the specified
82
+ * amount of time before calling `LiveShareHost.getFluidContainerId()` again.
83
+ */
84
+ retryAfter: number;
85
+ }
86
+ /**
87
+ * @hidden
88
+ * Returned from `LiveShareHost.getNtpTime()` to specify the global timestamp for the current
89
+ * Live Share session.
90
+ */
91
+ interface INtpTimeInfo {
92
+ /**
93
+ * ISO 8601 formatted server time. For example: '2019-09-07T15:50-04:00'
94
+ */
95
+ ntpTime: string;
96
+ /**
97
+ * Server time expressed as the number of milliseconds since the ECMAScript epoch.
98
+ */
99
+ ntpTimeInUTC: number;
100
+ }
101
+ /**
102
+ * @hidden
103
+ * Returned from `LiveShareHost.getFluidTenantInfo()` to specify the Fluid service to use for the
104
+ * current Live Share session.
105
+ */
106
+ interface IFluidTenantInfo {
107
+ /**
108
+ * The Fluid Tenant ID Live Share should use.
109
+ */
110
+ tenantId: string;
111
+ /**
112
+ * The Fluid service endpoint Live Share should use.
113
+ */
114
+ serviceEndpoint: string;
115
+ }
116
+ /**
117
+ * @hidden
118
+ * Returned from `LiveShareHost.getClientInfo()` to specify the client info for a
119
+ * particular client in a Live Share session.
120
+ */
121
+ interface IClientInfo {
122
+ /**
123
+ * The host user's `userId` associated with a given `clientId`
124
+ */
125
+ userId: string;
126
+ /**
127
+ * User's meeting roles associated with a given `clientId`
128
+ */
129
+ roles: UserMeetingRole[];
130
+ /**
131
+ * The user's display name associated with a given `clientId`.
132
+ * If this returns as `undefined`, the user may need to update their host client.
133
+ */
134
+ displayName?: string;
135
+ }
136
+ /**
137
+ * Checks if the interactive capability is supported by the host
138
+ * @returns boolean to represent whether the interactive capability is supported
139
+ *
140
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
141
+ */
142
+ function isSupported(): boolean;
143
+ }
144
+ /**
145
+ * Live Share host implementation for connecting to real-time collaborative sessions.
146
+ * Designed for use with the `LiveShareClient` class in the `@microsoft/live-share` package.
147
+ * Learn more at https://aka.ms/teamsliveshare
148
+ *
149
+ * @remarks
150
+ * The `LiveShareClient` class from Live Share uses the hidden API's to join/manage the session.
151
+ * To create a new `LiveShareHost` instance use the static `LiveShareHost.create()` function.
152
+ */
153
+ export declare class LiveShareHost {
154
+ /**
155
+ * @hidden
156
+ * Returns the Fluid Tenant connection info for user's current context.
157
+ */
158
+ getFluidTenantInfo(): Promise<liveShare.IFluidTenantInfo>;
159
+ /**
160
+ * @hidden
161
+ * Returns the fluid access token for mapped container Id.
162
+ *
163
+ * @param containerId Fluid's container Id for the request. Undefined for new containers.
164
+ * @returns token for connecting to Fluid's session.
165
+ */
166
+ getFluidToken(containerId?: string): Promise<string>;
167
+ /**
168
+ * @hidden
169
+ * Returns the ID of the fluid container associated with the user's current context.
170
+ */
171
+ getFluidContainerId(): Promise<liveShare.IFluidContainerInfo>;
172
+ /**
173
+ * @hidden
174
+ * Sets the ID of the fluid container associated with the current context.
175
+ *
176
+ * @remarks
177
+ * If this returns false, the client should delete the container they created and then call
178
+ * `getFluidContainerId()` to get the ID of the container being used.
179
+ * @param containerId ID of the fluid container the client created.
180
+ * @returns A data structure with a `containerState` indicating the success or failure of the request.
181
+ */
182
+ setFluidContainerId(containerId: string): Promise<liveShare.IFluidContainerInfo>;
183
+ /**
184
+ * @hidden
185
+ * Returns the shared clock server's current time.
186
+ */
187
+ getNtpTime(): Promise<liveShare.INtpTimeInfo>;
188
+ /**
189
+ * @hidden
190
+ * Associates the fluid client ID with a set of user roles.
191
+ *
192
+ * @param clientId The ID for the current user's Fluid client. Changes on reconnects.
193
+ * @returns The roles for the current user.
194
+ */
195
+ registerClientId(clientId: string): Promise<liveShare.UserMeetingRole[]>;
196
+ /**
197
+ * @hidden
198
+ * Returns the roles associated with a client ID.
199
+ *
200
+ * @param clientId The Client ID the message was received from.
201
+ * @returns The roles for a given client. Returns `undefined` if the client ID hasn't been registered yet.
202
+ */
203
+ getClientRoles(clientId: string): Promise<liveShare.UserMeetingRole[] | undefined>;
204
+ /**
205
+ * @hidden
206
+ * Returns the `IClientInfo` associated with a client ID.
207
+ *
208
+ * @param clientId The Client ID the message was received from.
209
+ * @returns The info for a given client. Returns `undefined` if the client ID hasn't been registered yet.
210
+ */
211
+ getClientInfo(clientId: string): Promise<liveShare.IClientInfo | undefined>;
212
+ /**
213
+ * Factories a new `LiveShareHost` instance for use with the `LiveShareClient` class
214
+ * in the `@microsoft/live-share` package.
215
+ *
216
+ * @remarks
217
+ * `app.initialize()` must first be called before using this API.
218
+ * This API can only be called from `meetingStage` or `sidePanel` contexts.
219
+ */
220
+ static create(): LiveShareHost;
221
+ }
@@ -0,0 +1,86 @@
1
+ import { SdkError } from './interfaces';
2
+ /**
3
+ * @deprecated
4
+ * As of 2.1.0, please use geoLocation namespace.
5
+ *
6
+ * Namespace to interact with the location module-specific part of the SDK.
7
+ */
8
+ export declare namespace location {
9
+ /** Get location callback function type */
10
+ type getLocationCallbackFunctionType = (error: SdkError, location: Location) => void;
11
+ /** Show location callback function type */
12
+ type showLocationCallbackFunctionType = (error: SdkError, status: boolean) => void;
13
+ /**
14
+ * @deprecated
15
+ * Data Structure to set the location properties in getLocation call.
16
+ */
17
+ interface LocationProps {
18
+ /**
19
+ whether user can alter location or not
20
+ if false, user will be shown current location
21
+ and wouldn't be allowed to alter it
22
+ */
23
+ allowChooseLocation: boolean;
24
+ /**
25
+ whether selected location should be shown to user on map or not.
26
+ If allowChooseLocation is true, this parameter will be ignored by platform.
27
+ If allowChooseLocation is false, and this parameter is not provided, default
28
+ value will be false.
29
+ */
30
+ showMap?: boolean;
31
+ }
32
+ /**
33
+ * @deprecated
34
+ * Data struture to represent the location information
35
+ */
36
+ interface Location {
37
+ /**
38
+ Latitude of the location
39
+ */
40
+ latitude: number;
41
+ /**
42
+ Longitude of the location
43
+ */
44
+ longitude: number;
45
+ /**
46
+ Accuracy of the coordinates captured
47
+ */
48
+ accuracy?: number;
49
+ /**
50
+ Time stamp when the location was captured
51
+ */
52
+ timestamp?: number;
53
+ }
54
+ /**
55
+ * @deprecated
56
+ * As of 2.1.0, please use one of the following functions:
57
+ * - {@link geoLocation.getCurrentLocation geoLocation.getCurrentLocation(): Promise\<Location\>} to get the current location.
58
+ * - {@link geoLocation.map.chooseLocation geoLocation.map.chooseLocation(): Promise\<Location\>} to choose location on map.
59
+ *
60
+ * Fetches user location
61
+ * @param props {@link LocationProps} - Specifying how the location request is handled
62
+ * @param callback - Callback to invoke when current user location is fetched
63
+ */
64
+ function getLocation(props: LocationProps, callback: getLocationCallbackFunctionType): void;
65
+ /**
66
+ * @deprecated
67
+ * As of 2.1.0, please use {@link geoLocation.map.showLocation geoLocation.map.showLocation(location: Location): Promise\<void\>} instead.
68
+ *
69
+ * Shows the location on map corresponding to the given coordinates
70
+ *
71
+ * @param location - Location to be shown on the map
72
+ * @param callback - Callback to invoke when the location is opened on map
73
+ */
74
+ function showLocation(location: Location, callback: showLocationCallbackFunctionType): void;
75
+ /**
76
+ * @deprecated
77
+ * As of 2.1.0, please use geoLocation namespace, and use {@link geoLocation.isSupported geoLocation.isSupported: boolean} to check if geoLocation is supported.
78
+ *
79
+ * Checks if Location capability is supported by the host
80
+ *
81
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
82
+ *
83
+ * @returns boolean to represent whether Location is supported
84
+ */
85
+ function isSupported(): boolean;
86
+ }
@@ -0,0 +1,95 @@
1
+ /**
2
+ * Used to interact with mail capability, including opening and composing mail.
3
+ */
4
+ export declare namespace mail {
5
+ /**
6
+ * Opens a mail message in the host.
7
+ *
8
+ * @param openMailItemParams - Object that specifies the ID of the mail message.
9
+ */
10
+ export function openMailItem(openMailItemParams: OpenMailItemParams): Promise<void>;
11
+ /**
12
+ * Compose a new email in the user's mailbox.
13
+ *
14
+ * @param composeMailParams - Object that specifies the type of mail item to compose and the details of the mail item.
15
+ *
16
+ */
17
+ export function composeMail(composeMailParams: ComposeMailParams): Promise<void>;
18
+ /**
19
+ * Checks if the mail capability is supported by the host
20
+ * @returns boolean to represent whether the mail capability is supported
21
+ *
22
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
23
+ */
24
+ export function isSupported(): boolean;
25
+ /** Defines the parameters used to open a mail item in the user's mailbox */
26
+ export interface OpenMailItemParams {
27
+ /** An unique base64-encoded string id that represents the itemId or messageId. */
28
+ itemId: string;
29
+ }
30
+ /** Defines compose mail types. */
31
+ export enum ComposeMailType {
32
+ /** Compose a new mail message. */
33
+ New = "new",
34
+ /** Compose a reply to the sender of an existing mail message. */
35
+ Reply = "reply",
36
+ /** Compose a reply to all recipients of an existing mail message. */
37
+ ReplyAll = "replyAll",
38
+ /** Compose a new mail message with the content of an existing mail message forwarded to a new recipient. */
39
+ Forward = "forward"
40
+ }
41
+ /**
42
+ * Foundational interface for all other mail compose interfaces
43
+ * Used for holding the type of mail item being composed
44
+ *
45
+ * @typeParam T - the identity type.
46
+ * @see {@link mail.ComposeMailType}
47
+ */
48
+ interface ComposeMailBase<T extends ComposeMailType> {
49
+ /** Type of the mail item being composed. */
50
+ type: T;
51
+ }
52
+ /**
53
+ * Parameters supplied when composing a new mail item
54
+ */
55
+ export interface ComposeNewParams extends ComposeMailBase<ComposeMailType.New> {
56
+ /**
57
+ * The To: recipients for the message
58
+ */
59
+ toRecipients?: string[];
60
+ /**
61
+ * The Cc: recipients for the message
62
+ */
63
+ ccRecipients?: string[];
64
+ /**
65
+ * The Bcc: recipients for the message
66
+ */
67
+ bccRecipients?: string[];
68
+ /**
69
+ * The subject of the message
70
+ */
71
+ subject?: string;
72
+ /**
73
+ * The body of the message
74
+ */
75
+ message?: string;
76
+ }
77
+ /**
78
+ * Parameters supplied when composing a reply to or forward of a message
79
+ *
80
+ * @see {@link ComposeMailType}
81
+ */
82
+ export interface ComposeReplyOrForwardParams<T extends ComposeMailType> extends ComposeMailBase<T> {
83
+ /** An unique base64-encoded string id that represents the mail message. */
84
+ itemid: string;
85
+ }
86
+ /**
87
+ * Parameters supplied to {@link composeMail} when composing a new mail item
88
+ *
89
+ * @see {@link ComposeNewParams}
90
+ * @see {@link ComposeReplyOrForwardParams}
91
+ * @see {@link ComposeMailType}
92
+ */
93
+ export type ComposeMailParams = ComposeNewParams | ComposeReplyOrForwardParams<ComposeMailType.Reply> | ComposeReplyOrForwardParams<ComposeMailType.ReplyAll> | ComposeReplyOrForwardParams<ComposeMailType.Forward>;
94
+ export {};
95
+ }