@microsoft/teams-js 2.30.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 (134) hide show
  1. package/dist/esm/_virtual/__polyfill-node.os.js +1 -0
  2. package/dist/esm/_virtual/_polyfill-node.os.js +1 -0
  3. package/dist/esm/node_modules/.pnpm/debug@4.3.5/node_modules/debug/src/node.js +1 -1
  4. package/dist/esm/node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js +1 -0
  5. package/dist/esm/node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js +1 -0
  6. package/dist/esm/packages/teams-js/dts/index.d.ts +2 -0
  7. package/dist/esm/packages/teams-js/dts/internal/VideoFrameTypes.d.ts +78 -0
  8. package/dist/esm/packages/teams-js/dts/internal/appHelpers.d.ts +8 -0
  9. package/dist/esm/packages/teams-js/dts/internal/appIdValidation.d.ts +16 -0
  10. package/dist/esm/packages/teams-js/dts/internal/communication.d.ts +162 -0
  11. package/dist/esm/packages/teams-js/dts/internal/constants.d.ts +146 -0
  12. package/dist/esm/packages/teams-js/dts/internal/deepLinkConstants.d.ts +26 -0
  13. package/dist/esm/packages/teams-js/dts/internal/deepLinkUtilities.d.ts +4 -0
  14. package/dist/esm/packages/teams-js/dts/internal/emailAddressValidation.d.ts +1 -0
  15. package/dist/esm/packages/teams-js/dts/internal/globalVars.d.ts +12 -0
  16. package/dist/esm/packages/teams-js/dts/internal/handlers.d.ts +80 -0
  17. package/dist/esm/packages/teams-js/dts/internal/interfaces.d.ts +47 -0
  18. package/dist/esm/packages/teams-js/dts/internal/internalAPIs.d.ts +61 -0
  19. package/dist/esm/packages/teams-js/dts/internal/marketplaceUtils.d.ts +94 -0
  20. package/dist/esm/packages/teams-js/dts/internal/mediaUtil.d.ts +95 -0
  21. package/dist/esm/packages/teams-js/dts/internal/messageObjects.d.ts +73 -0
  22. package/dist/esm/packages/teams-js/dts/internal/nestedAppAuthUtils.d.ts +105 -0
  23. package/dist/esm/packages/teams-js/dts/internal/profileUtil.d.ts +11 -0
  24. package/dist/esm/packages/teams-js/dts/internal/responseHandler.d.ts +30 -0
  25. package/dist/esm/packages/teams-js/dts/internal/telemetry.d.ts +344 -0
  26. package/dist/esm/packages/teams-js/dts/internal/typeCheckUtilities.d.ts +1 -0
  27. package/dist/esm/packages/teams-js/dts/internal/utils.d.ts +200 -0
  28. package/dist/esm/packages/teams-js/dts/internal/uuidObject.d.ts +11 -0
  29. package/dist/esm/packages/teams-js/dts/internal/validOrigins.d.ts +6 -0
  30. package/dist/esm/packages/teams-js/dts/internal/videoEffectsUtils.d.ts +31 -0
  31. package/dist/esm/packages/teams-js/dts/internal/videoFrameTick.d.ts +10 -0
  32. package/dist/esm/packages/teams-js/dts/internal/videoPerformanceMonitor.d.ts +54 -0
  33. package/dist/esm/packages/teams-js/dts/internal/videoPerformanceStatistics.d.ts +49 -0
  34. package/dist/esm/packages/teams-js/dts/private/appEntity.d.ts +89 -0
  35. package/dist/esm/packages/teams-js/dts/private/constants.d.ts +9 -0
  36. package/dist/esm/packages/teams-js/dts/private/conversations.d.ts +152 -0
  37. package/dist/esm/packages/teams-js/dts/private/copilot.d.ts +39 -0
  38. package/dist/esm/packages/teams-js/dts/private/externalAppAuthentication.d.ts +378 -0
  39. package/dist/esm/packages/teams-js/dts/private/externalAppAuthenticationForCEA.d.ts +75 -0
  40. package/dist/esm/packages/teams-js/dts/private/externalAppCardActions.d.ts +112 -0
  41. package/dist/esm/packages/teams-js/dts/private/externalAppCardActionsForCEA.d.ts +49 -0
  42. package/dist/esm/packages/teams-js/dts/private/externalAppCommands.d.ts +123 -0
  43. package/dist/esm/packages/teams-js/dts/private/files.d.ts +758 -0
  44. package/dist/esm/packages/teams-js/dts/private/hostEntity.d.ts +176 -0
  45. package/dist/esm/packages/teams-js/dts/private/index.d.ts +20 -0
  46. package/dist/esm/packages/teams-js/dts/private/interfaces.d.ts +250 -0
  47. package/dist/esm/packages/teams-js/dts/private/logs.d.ts +25 -0
  48. package/dist/esm/packages/teams-js/dts/private/meetingRoom.d.ts +203 -0
  49. package/dist/esm/packages/teams-js/dts/private/messageChannels.d.ts +107 -0
  50. package/dist/esm/packages/teams-js/dts/private/notifications.d.ts +26 -0
  51. package/dist/esm/packages/teams-js/dts/private/otherAppStateChange.d.ts +81 -0
  52. package/dist/esm/packages/teams-js/dts/private/privateAPIs.d.ts +60 -0
  53. package/dist/esm/packages/teams-js/dts/private/remoteCamera.d.ts +298 -0
  54. package/dist/esm/packages/teams-js/dts/private/teams.d.ts +116 -0
  55. package/dist/esm/packages/teams-js/dts/private/videoEffectsEx.d.ts +244 -0
  56. package/dist/esm/packages/teams-js/dts/public/adaptiveCards.d.ts +6 -0
  57. package/dist/esm/packages/teams-js/dts/public/app.d.ts +592 -0
  58. package/dist/esm/packages/teams-js/dts/public/appId.d.ts +33 -0
  59. package/dist/esm/packages/teams-js/dts/public/appInitialization.d.ts +57 -0
  60. package/dist/esm/packages/teams-js/dts/public/appInstallDialog.d.ts +18 -0
  61. package/dist/esm/packages/teams-js/dts/public/appWindow.d.ts +66 -0
  62. package/dist/esm/packages/teams-js/dts/public/authentication.d.ts +409 -0
  63. package/dist/esm/packages/teams-js/dts/public/barCode.d.ts +53 -0
  64. package/dist/esm/packages/teams-js/dts/public/calendar.d.ts +40 -0
  65. package/dist/esm/packages/teams-js/dts/public/call.d.ts +53 -0
  66. package/dist/esm/packages/teams-js/dts/public/chat.d.ts +66 -0
  67. package/dist/esm/packages/teams-js/dts/public/clipboard.d.ts +34 -0
  68. package/dist/esm/packages/teams-js/dts/public/constants.d.ts +179 -0
  69. package/dist/esm/packages/teams-js/dts/public/dialog.d.ts +286 -0
  70. package/dist/esm/packages/teams-js/dts/public/emailAddress.d.ts +12 -0
  71. package/dist/esm/packages/teams-js/dts/public/geoLocation.d.ts +100 -0
  72. package/dist/esm/packages/teams-js/dts/public/index.d.ts +44 -0
  73. package/dist/esm/packages/teams-js/dts/public/interfaces.d.ts +1133 -0
  74. package/dist/esm/packages/teams-js/dts/public/liveShareHost.d.ts +221 -0
  75. package/dist/esm/packages/teams-js/dts/public/location.d.ts +86 -0
  76. package/dist/esm/packages/teams-js/dts/public/mail.d.ts +95 -0
  77. package/dist/esm/packages/teams-js/dts/public/marketplace.d.ts +321 -0
  78. package/dist/esm/packages/teams-js/dts/public/media.d.ts +440 -0
  79. package/dist/esm/packages/teams-js/dts/public/meeting.d.ts +906 -0
  80. package/dist/esm/packages/teams-js/dts/public/menus.d.ts +188 -0
  81. package/dist/esm/packages/teams-js/dts/public/monetization.d.ts +58 -0
  82. package/dist/esm/packages/teams-js/dts/public/navigation.d.ts +45 -0
  83. package/dist/esm/packages/teams-js/dts/public/nestedAppAuth.d.ts +15 -0
  84. package/dist/esm/packages/teams-js/dts/public/pages.d.ts +574 -0
  85. package/dist/esm/packages/teams-js/dts/public/people.d.ts +75 -0
  86. package/dist/esm/packages/teams-js/dts/public/profile.d.ts +127 -0
  87. package/dist/esm/packages/teams-js/dts/public/publicAPIs.d.ts +218 -0
  88. package/dist/esm/packages/teams-js/dts/public/runtime.d.ts +207 -0
  89. package/dist/esm/packages/teams-js/dts/public/search.d.ts +91 -0
  90. package/dist/esm/packages/teams-js/dts/public/secondaryBrowser.d.ts +32 -0
  91. package/dist/esm/packages/teams-js/dts/public/serializable.interface.d.ts +17 -0
  92. package/dist/esm/packages/teams-js/dts/public/settings.d.ts +101 -0
  93. package/dist/esm/packages/teams-js/dts/public/sharing.d.ts +124 -0
  94. package/dist/esm/packages/teams-js/dts/public/stageView.d.ts +104 -0
  95. package/dist/esm/packages/teams-js/dts/public/tasks.d.ts +62 -0
  96. package/dist/esm/packages/teams-js/dts/public/teamsAPIs.d.ts +77 -0
  97. package/dist/esm/packages/teams-js/dts/public/thirdPartyCloudStorage.d.ts +119 -0
  98. package/dist/esm/packages/teams-js/dts/public/version.d.ts +5 -0
  99. package/dist/esm/packages/teams-js/dts/public/videoEffects.d.ts +213 -0
  100. package/dist/esm/packages/teams-js/dts/public/visualMedia.d.ts +192 -0
  101. package/dist/esm/packages/teams-js/dts/public/webStorage.d.ts +27 -0
  102. package/dist/esm/packages/teams-js/src/index.js +1 -1
  103. package/dist/esm/packages/teams-js/src/internal/appHelpers.js +1 -0
  104. package/dist/esm/packages/teams-js/src/internal/communication.js +1 -1
  105. package/dist/esm/packages/teams-js/src/internal/deepLinkUtilities.js +1 -1
  106. package/dist/esm/packages/teams-js/src/internal/responseHandler.js +1 -0
  107. package/dist/esm/packages/teams-js/src/private/externalAppAuthentication.js +1 -1
  108. package/dist/esm/packages/teams-js/src/private/externalAppAuthenticationForCEA.js +1 -1
  109. package/dist/esm/packages/teams-js/src/private/hostEntity.js +1 -1
  110. package/dist/esm/packages/teams-js/src/private/videoEffectsEx.js +1 -1
  111. package/dist/esm/packages/teams-js/src/public/app.js +1 -1
  112. package/dist/esm/packages/teams-js/src/public/appId.js +1 -1
  113. package/dist/esm/packages/teams-js/src/public/appInitialization.js +1 -1
  114. package/dist/esm/packages/teams-js/src/public/appInstallDialog.js +1 -1
  115. package/dist/esm/packages/teams-js/src/public/authentication.js +1 -1
  116. package/dist/esm/packages/teams-js/src/public/barCode.js +1 -1
  117. package/dist/esm/packages/teams-js/src/public/calendar.js +1 -1
  118. package/dist/esm/packages/teams-js/src/public/call.js +1 -1
  119. package/dist/esm/packages/teams-js/src/public/clipboard.js +1 -1
  120. package/dist/esm/packages/teams-js/src/public/constants.js +1 -1
  121. package/dist/esm/packages/teams-js/src/public/pages.js +1 -1
  122. package/dist/esm/packages/teams-js/src/public/publicAPIs.js +1 -1
  123. package/dist/esm/packages/teams-js/src/public/serializable.interface.js +1 -0
  124. package/dist/esm/packages/teams-js/src/public/settings.js +1 -1
  125. package/dist/esm/packages/teams-js/src/public/tasks.js +1 -1
  126. package/dist/esm/packages/teams-js/src/public/version.js +1 -1
  127. package/dist/esm/packages/teams-js/src/public/webStorage.js +1 -1
  128. package/dist/umd/MicrosoftTeams.d.ts +10740 -10768
  129. package/dist/umd/MicrosoftTeams.js +1571 -1359
  130. package/dist/umd/MicrosoftTeams.js.map +1 -1
  131. package/dist/umd/MicrosoftTeams.min.js +1 -1
  132. package/dist/umd/MicrosoftTeams.min.js.map +1 -1
  133. package/package.json +1 -51
  134. package/dist/esm/node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/browser.js +0 -1
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Interface for objects that can be serialized and passed to the host
3
+ */
4
+ export interface ISerializable {
5
+ /**
6
+ * @returns A serializable representation of the object, used for passing objects to the host.
7
+ */
8
+ serialize(): string | object;
9
+ }
10
+ /**
11
+ * @hidden
12
+ * @internal
13
+ * Used by the communication layer to make sure that an argument being passed to the host is serializable.
14
+ * @param arg The argument to evaluate
15
+ * @returns Whether or not the argument is serializable.
16
+ */
17
+ export declare function isSerializable(arg: unknown): arg is ISerializable;
@@ -0,0 +1,101 @@
1
+ import { pages } from './pages';
2
+ /**
3
+ * @deprecated
4
+ * As of TeamsJS v2.0.0, please use {@link pages.config} namespace instead.
5
+ *
6
+ * Namespace to interact with the settings-specific part of the SDK.
7
+ * This object is usable only on the settings frame.
8
+ */
9
+ /** Register on remove handler function type */
10
+ export type registerOnRemoveHandlerFunctionType = (evt: RemoveEvent) => void;
11
+ /** Register on save handler function type */
12
+ export type registerOnSaveHandlerFunctionType = (evt: SaveEvent) => void;
13
+ /** Set settings on complete function type */
14
+ export type setSettingsOnCompleteFunctionType = (status: boolean, reason?: string) => void;
15
+ /** Get settings callback function type */
16
+ export type getSettingsCallbackFunctionType = (instanceSettings: Settings) => void;
17
+ /**
18
+ * @deprecated
19
+ * As of TeamsJS v2.0.0, please use {@link pages.config} instead.
20
+ * @remarks
21
+ * Renamed to config in pages.Config
22
+ */
23
+ type Settings = pages.InstanceConfig;
24
+ export { Settings };
25
+ /**
26
+ * @deprecated
27
+ * As of TeamsJS v2.0.0, please use {@link pages.config.SaveEvent} instead.
28
+ * @remarks
29
+ * See pages.SaveEvent
30
+ */
31
+ type SaveEvent = pages.config.SaveEvent;
32
+ export { SaveEvent };
33
+ /**
34
+ * @deprecated
35
+ * As of TeamsJS v2.0.0, please use {@link pages.config.RemoveEvent} instead.
36
+ * @remarks
37
+ * See pages.RemoveEvent
38
+ */
39
+ type RemoveEvent = pages.config.RemoveEvent;
40
+ export { RemoveEvent };
41
+ /**
42
+ * @deprecated
43
+ * As of TeamsJS v2.0.0, please use {@link pages.config.SaveParameters} instead.
44
+ * @remarks
45
+ * See pages.SaveParameters
46
+ */
47
+ type SaveParameters = pages.config.SaveParameters;
48
+ export { SaveParameters };
49
+ /**
50
+ * @deprecated
51
+ * As of TeamsJS v2.0.0, please use {@link pages.config.setValidityState pages.config.setValidityState(validityState: boolean): void} instead.
52
+ *
53
+ * Sets the validity state for the settings.
54
+ * The initial value is false, so the user cannot save the settings until this is called with true.
55
+ *
56
+ * @param validityState - Indicates whether the save or remove button is enabled for the user.
57
+ */
58
+ export declare function setValidityState(validityState: boolean): void;
59
+ /**
60
+ * @deprecated
61
+ * As of TeamsJS v2.0.0, please use {@link pages.getConfig pages.getConfig(): Promise\<InstanceConfig\>} instead.
62
+ *
63
+ * Gets the settings for the current instance.
64
+ *
65
+ * @param callback - The callback to invoke when the {@link Settings} object is retrieved.
66
+ */
67
+ export declare function getSettings(callback: getSettingsCallbackFunctionType): void;
68
+ /**
69
+ * @deprecated
70
+ * As of TeamsJS v2.0.0, please use {@link pages.config.setConfig pages.config.setConfig(instanceSettings: Config): Promise\<void\>} instead.
71
+ *
72
+ * Sets the settings for the current instance.
73
+ * This is an asynchronous operation; calls to getSettings are not guaranteed to reflect the changed state.
74
+ *
75
+ * @param - Set the desired settings for this instance.
76
+ */
77
+ export declare function setSettings(instanceSettings: Settings, onComplete?: setSettingsOnCompleteFunctionType): void;
78
+ /**
79
+ * @deprecated
80
+ * As of TeamsJS v2.0.0, please use {@link pages.config.registerOnSaveHandler pages.config.registerOnSaveHandler(handler: registerOnSaveHandlerFunctionType): void} instead.
81
+ *
82
+ * Registers a handler for when the user attempts to save the settings. This handler should be used
83
+ * to create or update the underlying resource powering the content.
84
+ * The object passed to the handler must be used to notify whether to proceed with the save.
85
+ * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
86
+ *
87
+ * @param handler - The handler to invoke when the user selects the save button.
88
+ */
89
+ export declare function registerOnSaveHandler(handler: registerOnSaveHandlerFunctionType): void;
90
+ /**
91
+ * @deprecated
92
+ * As of TeamsJS v2.0.0, please use {@link pages.config.registerOnRemoveHandler pages.config.registerOnRemoveHandler(handler: registerOnRemoveHandlerFunctionType): void} instead.
93
+ *
94
+ * Registers a handler for user attempts to remove content. This handler should be used
95
+ * to remove the underlying resource powering the content.
96
+ * The object passed to the handler must be used to indicate whether to proceed with the removal.
97
+ * Only one handler may be registered at a time. Subsequent registrations will override the first.
98
+ *
99
+ * @param handler - The handler to invoke when the user selects the remove button.
100
+ */
101
+ export declare function registerOnRemoveHandler(handler: registerOnRemoveHandlerFunctionType): void;
@@ -0,0 +1,124 @@
1
+ import { SdkError } from './interfaces';
2
+ /**
3
+ * Namespace to open a share dialog for web content.
4
+ * For more info, see [Share to Teams from personal app or tab](https://learn.microsoft.com/microsoftteams/platform/concepts/build-and-test/share-to-teams-from-personal-app-or-tab)
5
+ */
6
+ export declare namespace sharing {
7
+ /** shareWebContent callback function type */
8
+ export type shareWebContentCallbackFunctionType = (err?: SdkError) => void;
9
+ /** Type of message that can be sent or received by the sharing APIs */
10
+ export const SharingAPIMessages: {
11
+ /**
12
+ * Share web content message.
13
+ * @internal
14
+ */
15
+ shareWebContent: string;
16
+ };
17
+ type ContentType = 'URL';
18
+ /** Represents parameters for base shared content. */
19
+ interface IBaseSharedContent {
20
+ /** Shared content type */
21
+ type: ContentType;
22
+ }
23
+ /** IShareRequestContentType defines share request type. */
24
+ export type IShareRequestContentType = IURLContent;
25
+ /** Represents IShareRequest parameters interface.
26
+ * @typeparam T - The identity type
27
+ */
28
+ export interface IShareRequest<T> {
29
+ /** Content of the share request. */
30
+ content: T[];
31
+ }
32
+ /** Represents IURLContent parameters. */
33
+ export interface IURLContent extends IBaseSharedContent {
34
+ /** Type */
35
+ type: 'URL';
36
+ /**
37
+ * Required URL
38
+ */
39
+ url: string;
40
+ /**
41
+ * Default initial message text
42
+ */
43
+ message?: string;
44
+ /**
45
+ * Show URL preview, defaults to true
46
+ */
47
+ preview?: boolean;
48
+ }
49
+ /**
50
+ * Feature is under development
51
+ * Opens a share dialog for web content
52
+ *
53
+ * @param shareWebContentRequest - web content info
54
+ * @returns Promise that will be fulfilled when the operation has completed
55
+ */
56
+ export function shareWebContent(shareWebContentRequest: IShareRequest<IShareRequestContentType>): Promise<void>;
57
+ /**
58
+ * @deprecated
59
+ * As of TeamsJS v2.0.0, please use {@link sharing.shareWebContent sharing.shareWebContent(shareWebContentRequest: IShareRequest\<IShareRequestContentType\>): Promise\<void\>} instead.
60
+ *
61
+ * Feature is under development
62
+ * Opens a share dialog for web content
63
+ *
64
+ * @param shareWebContentRequest - web content info
65
+ * @param callback - optional callback
66
+ */
67
+ export function shareWebContent(shareWebContentRequest: IShareRequest<IShareRequestContentType>, callback: shareWebContentCallbackFunctionType): void;
68
+ /**
69
+ * Checks if the sharing capability is supported by the host
70
+ * @returns boolean to represent whether the sharing capability is supported
71
+ *
72
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
73
+ */
74
+ export function isSupported(): boolean;
75
+ /**
76
+ * Namespace to get the list of content shared in a Teams meeting
77
+ *
78
+ * @beta
79
+ */
80
+ export namespace history {
81
+ /**
82
+ * Represents the data returned when calling {@link sharing.history.getContent}
83
+ *
84
+ * @beta
85
+ */
86
+ interface IContentResponse {
87
+ /** Id of the app where the content was shared from */
88
+ appId: string;
89
+ /** Title of the shared content */
90
+ title: string;
91
+ /** Reference of the shared content */
92
+ contentReference: string;
93
+ /** Id of the thread where the content was shared. */
94
+ threadId: string;
95
+ /** Id of the user who shared the content. */
96
+ author: string;
97
+ /** Type of the shared content.
98
+ * For sharing to Teams stage scenarios, this value would be `ShareToStage`
99
+ * Other `contentType` values will be added and documented here over time
100
+ */
101
+ contentType: string;
102
+ }
103
+ /**
104
+ * Get the list of content shared in a Teams meeting
105
+ *
106
+ * @throws Error if call capability is not supported
107
+ * @throws Error if returned content details are invalid
108
+ * @returns Promise that will resolve with the {@link IContentResponse} objects array
109
+ *
110
+ * @beta
111
+ */
112
+ function getContent(): Promise<IContentResponse[]>;
113
+ /**
114
+ * Checks if sharing.history capability is supported by the host
115
+ * @returns boolean to represent whether the sharing.history capability is supported
116
+ *
117
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
118
+ *
119
+ * @beta
120
+ */
121
+ function isSupported(): boolean;
122
+ }
123
+ export {};
124
+ }
@@ -0,0 +1,104 @@
1
+ /**
2
+ * Namespace to interact with the stage view specific part of the SDK.
3
+ *
4
+ * @beta
5
+ */
6
+ export declare namespace stageView {
7
+ /**
8
+ * Parameters to open a stage view.
9
+ */
10
+ interface StageViewParams {
11
+ /**
12
+ * The ID of the Teams application to be opened.
13
+ */
14
+ appId: string;
15
+ /**
16
+ * The URL of the content to display.
17
+ */
18
+ contentUrl: string;
19
+ /**
20
+ * The chat or channel ID.
21
+ */
22
+ threadId: string;
23
+ /**
24
+ * The messageId identifies a particular channel meeting within the channel as specified by the threadId above. This should be used only when trying to open the stage view for a channel meeting. It will be a no-op for other scenarios
25
+ */
26
+ messageId?: string;
27
+ /**
28
+ * The title to give the stage view.
29
+ */
30
+ title?: string;
31
+ /**
32
+ * The Teams application website URL.
33
+ */
34
+ websiteUrl?: string;
35
+ /**
36
+ * The entity ID of the Teams application content being opened.
37
+ */
38
+ entityId?: string;
39
+ /**
40
+ * The open mode for stage content.
41
+ * Optional param: if not passed, hosts can choose their default openMode.
42
+ * If a host does not support any specific openMode, It will fallback to StageViewOpenMode.modal.
43
+ */
44
+ openMode?: StageViewOpenMode;
45
+ }
46
+ /**
47
+ * The open mode for stage content.
48
+ */
49
+ enum StageViewOpenMode {
50
+ /**
51
+ * Open the content in a modal.
52
+ */
53
+ modal = "modal",
54
+ /**
55
+ * Open the content in a popped-out window.
56
+ */
57
+ popout = "popout",
58
+ /**
59
+ * Open the content in a popped-out window with chat collaboration.
60
+ */
61
+ popoutWithChat = "popoutWithChat"
62
+ }
63
+ /**
64
+ *
65
+ * Opens a stage view to display a Teams application
66
+ * @beta
67
+ * @param stageViewParams - The parameters to pass into the stage view.
68
+ * @returns Promise that resolves or rejects with an error once the stage view is closed.
69
+ */
70
+ function open(stageViewParams: StageViewParams): Promise<void>;
71
+ /**
72
+ * Checks if stageView capability is supported by the host
73
+ * @beta
74
+ * @returns boolean to represent whether the stageView capability is supported
75
+ *
76
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
77
+ *
78
+ */
79
+ function isSupported(): boolean;
80
+ /**
81
+ * Namespace for actions that can be taken by the stage view itself.
82
+ *
83
+ * @beta
84
+ */
85
+ namespace self {
86
+ /**
87
+ * Closes the current stage view. This function will be a no-op if called from outside of a stage view.
88
+ * @returns Promise that resolves or rejects with an error once the stage view is closed.
89
+ *
90
+ * @beta
91
+ * @throws Error if stageView.self.close is not supported in the current context or if `app.initialize()` has not resolved successfully.
92
+ */
93
+ function close(): Promise<void>;
94
+ /**
95
+ * Checks if stageView.self capability is supported by the host
96
+ * @beta
97
+ * @returns boolean to represent whether the stageView.self capability is supported
98
+ *
99
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
100
+ *
101
+ */
102
+ function isSupported(): boolean;
103
+ }
104
+ }
@@ -0,0 +1,62 @@
1
+ import { IAppWindow } from './appWindow';
2
+ import { TaskInfo } from './interfaces';
3
+ /**
4
+ * @deprecated
5
+ * As of TeamsJS v2.0.0, please use {@link dialog} namespace instead.
6
+ *
7
+ * Namespace to interact with the task module-specific part of the SDK.
8
+ * This object is usable only on the content frame.
9
+ * The tasks namespace will be deprecated. Please use dialog for future developments.
10
+ */
11
+ export declare namespace tasks {
12
+ /**
13
+ * Function type that is used to receive the result when a task module is submitted by
14
+ * calling {@link tasks.submitTask tasks.submitTask(result?: string | object, appIds?: string | string[]): void}
15
+ *
16
+ * @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.
17
+ * @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.
18
+ */
19
+ type startTaskSubmitHandlerFunctionType = (err: string, result: string | object) => void;
20
+ /**
21
+ * @deprecated
22
+ * As of 2.8.0:
23
+ * - For url-based dialogs, please use {@link dialog.url.open dialog.url.open(urlDialogInfo: UrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): void} .
24
+ * - For url-based dialogs with bot interaction, please use {@link dialog.url.bot.open dialog.url.bot.open(botUrlDialogInfo: BotUrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): void}
25
+ * - For Adaptive Card-based dialogs:
26
+ * - In Teams, please continue to use this function until the new functions in {@link dialog.adaptiveCard} have been fully implemented. You can tell at runtime when they are implemented in Teams by checking
27
+ * the return value of the {@link dialog.adaptiveCard.isSupported} function. This documentation line will also be removed once they have been fully implemented in Teams.
28
+ * - In all other hosts, please use {@link dialog.adaptiveCard.open dialog.adaptiveCard.open(cardDialogInfo: CardDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): void}
29
+ *
30
+ * Allows an app to open the task module.
31
+ *
32
+ * @param taskInfo - An object containing the parameters of the task module
33
+ * @param submitHandler - Handler to call when the task module is completed
34
+ */
35
+ function startTask(taskInfo: TaskInfo, submitHandler?: startTaskSubmitHandlerFunctionType): IAppWindow;
36
+ /**
37
+ * @deprecated
38
+ * As of TeamsJS v2.0.0, please use {@link dialog.update.resize dialog.update.resize(dimensions: DialogSize): void} instead.
39
+ *
40
+ * Update height/width task info properties.
41
+ *
42
+ * @param taskInfo - An object containing width and height properties
43
+ */
44
+ function updateTask(taskInfo: TaskInfo): void;
45
+ /**
46
+ * @deprecated
47
+ * As of 2.8.0, please use {@link dialog.url.submit} instead.
48
+ *
49
+ * Submit the task module.
50
+ *
51
+ * @param result - Contains the result to be sent to the bot or the app. Typically a JSON object or a serialized version of it
52
+ * @param appIds - Valid application(s) that can receive the result of the submitted dialogs. Specifying this parameter helps prevent malicious apps from retrieving the dialog result. Multiple app IDs can be specified because a web app from a single underlying domain can power multiple apps across different environments and branding schemes.
53
+ */
54
+ function submitTask(result?: string | object, appIds?: string | string[]): void;
55
+ /**
56
+ * Sets the height and width of the {@link TaskInfo} object to the original height and width, if initially specified,
57
+ * otherwise uses the height and width values corresponding to {@link DialogDimension | TaskModuleDimension.Small}
58
+ * @param taskInfo TaskInfo object from which to extract size info, if specified
59
+ * @returns TaskInfo with height and width specified
60
+ */
61
+ function getDefaultSizeIfNotProvided(taskInfo: TaskInfo): TaskInfo;
62
+ }
@@ -0,0 +1,77 @@
1
+ import { LoadContext } from './interfaces';
2
+ export declare namespace teamsCore {
3
+ /** Ready to unload function type */
4
+ type readyToUnloadFunctionType = () => void;
5
+ /** Register on load handler function type */
6
+ type registerOnLoadHandlerFunctionType = (context: LoadContext) => void;
7
+ /** Register before unload handler function type */
8
+ type registerBeforeUnloadHandlerFunctionType = (readyToUnload: readyToUnloadFunctionType) => boolean;
9
+ /**
10
+ * Enable print capability to support printing page using Ctrl+P and cmd+P
11
+ */
12
+ function enablePrintCapability(): void;
13
+ /**
14
+ * default print handler
15
+ */
16
+ function print(): void;
17
+ /**
18
+ * Registers a handler to be called when the page has been requested to load.
19
+ *
20
+ * @remarks Check out [App Caching in Teams](https://learn.microsoft.com/microsoftteams/platform/tabs/how-to/app-caching)
21
+ * for a more detailed explanation about using this API.
22
+ *
23
+ * @param handler - The handler to invoke when the page is loaded.
24
+ *
25
+ * @beta
26
+ */
27
+ function registerOnLoadHandler(handler: registerOnLoadHandlerFunctionType): void;
28
+ /**
29
+ * @hidden
30
+ * Undocumented helper function with shared code between deprecated version and current version of the registerOnLoadHandler API.
31
+ *
32
+ * @internal
33
+ * Limited to Microsoft-internal use
34
+ *
35
+ * @param apiVersionTag - The tag indicating API version number with name
36
+ * @param handler - The handler to invoke when the page is loaded.
37
+ * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
38
+ *
39
+ * @deprecated
40
+ */
41
+ function registerOnLoadHandlerHelper(apiVersionTag: string, handler: registerOnLoadHandlerFunctionType, versionSpecificHelper?: () => void): void;
42
+ /**
43
+ * Registers a handler to be called before the page is unloaded.
44
+ *
45
+ * @remarks Check out [App Caching in Teams](https://learn.microsoft.com/microsoftteams/platform/tabs/how-to/app-caching)
46
+ * for a more detailed explanation about using this API.
47
+ *
48
+ * @param handler - The handler to invoke before the page is unloaded. If this handler returns true the page should
49
+ * invoke the readyToUnload function provided to it once it's ready to be unloaded.
50
+ *
51
+ * @beta
52
+ */
53
+ function registerBeforeUnloadHandler(handler: registerBeforeUnloadHandlerFunctionType): void;
54
+ /**
55
+ * @hidden
56
+ * Undocumented helper function with shared code between deprecated version and current version of the registerBeforeUnloadHandler API.
57
+ *
58
+ * @internal
59
+ * Limited to Microsoft-internal use
60
+ *
61
+ * @param handler - - The handler to invoke before the page is unloaded. If this handler returns true the page should
62
+ * invoke the readyToUnload function provided to it once it's ready to be unloaded.
63
+ * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
64
+ *
65
+ * @deprecated
66
+ */
67
+ function registerBeforeUnloadHandlerHelper(apiVersionTag: string, handler: registerBeforeUnloadHandlerFunctionType, versionSpecificHelper?: () => void): void;
68
+ /**
69
+ * Checks if teamsCore capability is supported by the host
70
+ *
71
+ * @returns boolean to represent whether the teamsCore capability is supported
72
+ *
73
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
74
+ *
75
+ */
76
+ function isSupported(): boolean;
77
+ }
@@ -0,0 +1,119 @@
1
+ import { SdkError } from './interfaces';
2
+ /**
3
+ * Extended files API 3P storage providers, features like sending Blob from Teams to 3P app on user
4
+ * actions like drag and drop to compose
5
+ * @beta
6
+ */
7
+ export declare namespace thirdPartyCloudStorage {
8
+ /**
9
+ * Interface to assemble file chunks
10
+ * @beta
11
+ */
12
+ interface AssembleAttachment {
13
+ /** A number representing the sequence of the attachment in the file chunks. */
14
+ sequence: number;
15
+ /** A Blob object representing the data of the file chunks. */
16
+ file: Blob;
17
+ }
18
+ /**
19
+ * Object used to represent a file
20
+ * @beta
21
+ *
22
+ */
23
+ interface FilesFor3PStorage extends Blob {
24
+ /**
25
+ * A number that represents the number of milliseconds since the Unix epoch
26
+ */
27
+ lastModified: number;
28
+ /**
29
+ * Name of the file
30
+ */
31
+ name: string;
32
+ /**
33
+ * file type
34
+ */
35
+ type: string;
36
+ /**
37
+ * A string containing the path of the file relative to the ancestor directory the user selected
38
+ */
39
+ webkitRelativePath?: string;
40
+ }
41
+ /**
42
+ * File chunks an output of getDragAndDropFiles API from platform
43
+ * @beta
44
+ */
45
+ interface FileChunk {
46
+ /**
47
+ * Base 64 data for the requested uri
48
+ */
49
+ chunk: string;
50
+ /**
51
+ * chunk sequence number
52
+ */
53
+ chunkSequence: number;
54
+ /**
55
+ * Indicates whether this chunk is the final segment of a file
56
+ */
57
+ endOfFile: boolean;
58
+ }
59
+ /**
60
+ * Output of getDragAndDropFiles API from platform
61
+ * @beta
62
+ */
63
+ interface FileResult {
64
+ /**
65
+ * Error encountered in getDragAndDropFiles API
66
+ */
67
+ error?: SdkError;
68
+ /**
69
+ * File chunk which will be assemebled and converted into a blob
70
+ */
71
+ fileChunk: FileChunk;
72
+ /**
73
+ * File index of the file for which chunk data is getting recieved
74
+ */
75
+ fileIndex: number;
76
+ /**
77
+ * File type/MIME type which is getting recieved
78
+ */
79
+ fileType: string;
80
+ /**
81
+ * Indicates whether this file is the last one in a sequence.
82
+ */
83
+ isLastFile: boolean;
84
+ /**
85
+ * The name of the file.
86
+ */
87
+ fileName: string;
88
+ }
89
+ /**
90
+ * Defines the callback function received from Third Party App
91
+ * @beta
92
+ */
93
+ interface DragAndDropFileCallback {
94
+ /**
95
+ * Definition of the callback which is received from third party app when calling {@link thirdPartyCloudStorage.getDragAndDropFiles}
96
+ * An array of drag and dropped files {@link thirdPartyCloudStorage.FilesFor3PStorage}
97
+ * Error encountered during the API call {@link SdkError}
98
+ */
99
+ (files: FilesFor3PStorage[], error?: SdkError): void;
100
+ }
101
+ /**
102
+ * Get drag-and-drop files using a callback.
103
+ *
104
+ * @param {string} dragAndDropInput - unique id which is a combination of replyToId + threadId of teams chat and channel.
105
+ * Both replyToId and threadId can be fetched from application context.
106
+ * @param {DragAndDropFileCallback} dragAndDropFileCallback - callback
107
+ * A callback function to handle the result of the operation
108
+ * @beta
109
+ */
110
+ function getDragAndDropFiles(dragAndDropInput: string, dragAndDropFileCallback: DragAndDropFileCallback): void;
111
+ /**
112
+ * Checks if the thirdPartyCloudStorage capability is supported by the host
113
+ * @returns boolean to represent whether the thirdPartyCloudStorage capability is supported
114
+ *
115
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
116
+ * @beta
117
+ */
118
+ function isSupported(): boolean;
119
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @hidden
3
+ * Package version.
4
+ */
5
+ export declare const version = "ERROR: This value should be replaced by webpack!";