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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
@@ -1,91 +1,81 @@
1
1
  /**
2
- * Allows your application to interact with the host M365 application's search box.
3
- * By integrating your application with the host's search box, users can search
4
- * your app using the same search box they use elsewhere in Teams, Outlook, or Office.
2
+ * This interface contains information pertaining to the contents of the host M365 application's search box
5
3
  *
6
- * This functionality is in Beta.
7
4
  * @beta
8
5
  */
9
- export declare namespace search {
10
- /**
11
- * This interface contains information pertaining to the contents of the host M365 application's search box
12
- *
13
- * @beta
14
- */
15
- interface SearchQuery {
16
- /** The current search term in the host search experience */
17
- searchTerm: string;
18
- /** Timestamp sequence value to ensure messages are processed in correct order / combine them. */
19
- timestamp: number;
20
- }
21
- /**
22
- * This type will store the SearchQuery and allow other logic to be made inside the handler.
23
- *
24
- * @beta
25
- */
26
- type SearchQueryHandler = (query: SearchQuery) => void;
27
- /**
28
- * Allows the caller to register for various events fired by the host search experience.
29
- * Calling this function indicates that your application intends to plug into the host's search box and handle search events,
30
- * when the user is actively using your page/tab.
31
- *
32
- * The host may visually update its search box, e.g. with the name or icon of your application.
33
- *
34
- * Your application should *not* re-render inside of these callbacks, there may be a large number
35
- * of onChangeHandler calls if the user is typing rapidly in the search box.
36
- *
37
- * @param onClosedHandler - This handler will be called when the user exits or cancels their search.
38
- * Should be used to return your application to its most recent, non-search state. The value of {@link SearchQuery.searchTerm}
39
- * will be whatever the last query was before ending search.
40
- *
41
- * @param onExecuteHandler - The handler will be called when the user executes their
42
- * search (by pressing Enter for example). Should be used to display the full list of search results.
43
- * The value of {@link SearchQuery.searchTerm} is the complete query the user entered in the search box.
44
- *
45
- * @param onChangeHandler - This optional handler will be called when the user first starts using the
46
- * host's search box and as the user types their query. Can be used to put your application into a
47
- * word-wheeling state or to display suggestions as the user is typing.
48
- *
49
- * This handler will be called with an empty {@link SearchQuery.searchTerm} when search is beginning, and subsequently,
50
- * with the current contents of the search box.
51
- * @example
52
- * ``` ts
53
- * search.registerHandlers(
54
- query => {
55
- console.log('Update your application to handle the search experience being closed. Last query: ${query.searchTerm}');
56
- },
57
- query => {
58
- console.log(`Update your application to handle an executed search result: ${query.searchTerm}`);
59
- },
60
- query => {
61
- console.log(`Update your application with the changed search query: ${query.searchTerm}`);
62
- },
63
- );
64
- * ```
65
- *
66
- * @beta
67
- */
68
- function registerHandlers(onClosedHandler: SearchQueryHandler, onExecuteHandler: SearchQueryHandler, onChangeHandler?: SearchQueryHandler): void;
69
- /**
70
- * Allows the caller to unregister for all events fired by the host search experience. Calling
71
- * this function will cause your app to stop appearing in the set of search scopes in the hosts
72
- *
73
- * @beta
74
- */
75
- function unregisterHandlers(): void;
76
- /**
77
- * Checks if search capability is supported by the host
78
- * @returns boolean to represent whether the search capability is supported
79
- *
80
- * @throws Error if {@link app.initialize} has not successfully completed
81
- *
82
- * @beta
83
- */
84
- function isSupported(): boolean;
85
- /**
86
- * Clear the host M365 application's search box
87
- *
88
- * @beta
89
- */
90
- function closeSearch(): Promise<void>;
6
+ export interface SearchQuery {
7
+ /** The current search term in the host search experience */
8
+ searchTerm: string;
9
+ /** Timestamp sequence value to ensure messages are processed in correct order / combine them. */
10
+ timestamp: number;
91
11
  }
12
+ /**
13
+ * This type will store the SearchQuery and allow other logic to be made inside the handler.
14
+ *
15
+ * @beta
16
+ */
17
+ export type SearchQueryHandler = (query: SearchQuery) => void;
18
+ /**
19
+ * Allows the caller to register for various events fired by the host search experience.
20
+ * Calling this function indicates that your application intends to plug into the host's search box and handle search events,
21
+ * when the user is actively using your page/tab.
22
+ *
23
+ * The host may visually update its search box, e.g. with the name or icon of your application.
24
+ *
25
+ * Your application should *not* re-render inside of these callbacks, there may be a large number
26
+ * of onChangeHandler calls if the user is typing rapidly in the search box.
27
+ *
28
+ * @param onClosedHandler - This handler will be called when the user exits or cancels their search.
29
+ * Should be used to return your application to its most recent, non-search state. The value of {@link SearchQuery.searchTerm}
30
+ * will be whatever the last query was before ending search.
31
+ *
32
+ * @param onExecuteHandler - The handler will be called when the user executes their
33
+ * search (by pressing Enter for example). Should be used to display the full list of search results.
34
+ * The value of {@link SearchQuery.searchTerm} is the complete query the user entered in the search box.
35
+ *
36
+ * @param onChangeHandler - This optional handler will be called when the user first starts using the
37
+ * host's search box and as the user types their query. Can be used to put your application into a
38
+ * word-wheeling state or to display suggestions as the user is typing.
39
+ *
40
+ * This handler will be called with an empty {@link SearchQuery.searchTerm} when search is beginning, and subsequently,
41
+ * with the current contents of the search box.
42
+ * @example
43
+ * ``` ts
44
+ * search.registerHandlers(
45
+ query => {
46
+ console.log('Update your application to handle the search experience being closed. Last query: ${query.searchTerm}');
47
+ },
48
+ query => {
49
+ console.log(`Update your application to handle an executed search result: ${query.searchTerm}`);
50
+ },
51
+ query => {
52
+ console.log(`Update your application with the changed search query: ${query.searchTerm}`);
53
+ },
54
+ );
55
+ * ```
56
+ *
57
+ * @beta
58
+ */
59
+ export declare function registerHandlers(onClosedHandler: SearchQueryHandler, onExecuteHandler: SearchQueryHandler, onChangeHandler?: SearchQueryHandler): void;
60
+ /**
61
+ * Allows the caller to unregister for all events fired by the host search experience. Calling
62
+ * this function will cause your app to stop appearing in the set of search scopes in the hosts
63
+ *
64
+ * @beta
65
+ */
66
+ export declare function unregisterHandlers(): void;
67
+ /**
68
+ * Checks if search capability is supported by the host
69
+ * @returns boolean to represent whether the search capability is supported
70
+ *
71
+ * @throws Error if {@link app.initialize} has not successfully completed
72
+ *
73
+ * @beta
74
+ */
75
+ export declare function isSupported(): boolean;
76
+ /**
77
+ * Clear the host M365 application's search box
78
+ *
79
+ * @beta
80
+ */
81
+ export declare function closeSearch(): Promise<void>;
@@ -1,32 +1,30 @@
1
1
  /**
2
- * Namespace to power up the in-app browser experiences in the host app.
2
+ * Module to power up the in-app browser experiences in the host app.
3
3
  * For e.g., opening a URL in the host app inside a browser
4
4
  *
5
5
  * @beta
6
6
  */
7
- export declare namespace secondaryBrowser {
8
- /**
9
- * Open a URL in the secondary browser.
10
- *
11
- * On mobile, this is the in-app browser.
12
- *
13
- * On web and desktop, please use the `window.open()` method or other native external browser methods.
14
- *
15
- * @param url Url to open in the browser
16
- * @returns Promise that successfully resolves if the URL opens in the secondaryBrowser
17
- * or throws an error {@link SdkError} incase of failure before starting navigation
18
- *
19
- * @remarks Any error that happens after navigation begins is handled by the platform browser component and not returned from this function.
20
- * @beta
21
- */
22
- function open(url: URL): Promise<void>;
23
- /**
24
- * Checks if secondaryBrowser capability is supported by the host
25
- * @returns boolean to represent whether secondaryBrowser is supported
26
- *
27
- * @throws Error if {@linkcode app.initialize} has not successfully completed
28
- *
29
- * @beta
30
- */
31
- function isSupported(): boolean;
32
- }
7
+ /**
8
+ * Open a URL in the secondary browser.
9
+ *
10
+ * On mobile, this is the in-app browser.
11
+ *
12
+ * On web and desktop, please use the `window.open()` method or other native external browser methods.
13
+ *
14
+ * @param url Url to open in the browser
15
+ * @returns Promise that successfully resolves if the URL opens in the secondaryBrowser
16
+ * or throws an error {@link SdkError} incase of failure before starting navigation
17
+ *
18
+ * @remarks Any error that happens after navigation begins is handled by the platform browser component and not returned from this function.
19
+ * @beta
20
+ */
21
+ export declare function open(url: URL): Promise<void>;
22
+ /**
23
+ * Checks if secondaryBrowser capability is supported by the host
24
+ * @returns boolean to represent whether secondaryBrowser is supported
25
+ *
26
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
27
+ *
28
+ * @beta
29
+ */
30
+ export declare function isSupported(): boolean;
@@ -4,59 +4,57 @@ import { TaskInfo } from './interfaces';
4
4
  * @deprecated
5
5
  * As of TeamsJS v2.0.0, please use {@link dialog} namespace instead.
6
6
  *
7
- * Namespace to interact with the task module-specific part of the SDK.
7
+ * Module to interact with the task module-specific part of the SDK.
8
8
  * This object is usable only on the content frame.
9
- * The tasks namespace will be deprecated. Please use dialog for future developments.
9
+ * The tasks module will be deprecated. Please use dialog for future developments.
10
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
- }
11
+ /**
12
+ * Function type that is used to receive the result when a task module is submitted by
13
+ * calling {@link tasks.submitTask tasks.submitTask(result?: string | object, appIds?: string | string[]): void}
14
+ *
15
+ * @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.
16
+ * @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.
17
+ */
18
+ export type startTaskSubmitHandlerFunctionType = (err: string, result: string | object) => void;
19
+ /**
20
+ * @deprecated
21
+ * As of 2.8.0:
22
+ * - For url-based dialogs, please use {@link dialog.url.open dialog.url.open(urlDialogInfo: UrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): void} .
23
+ * - 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}
24
+ * - For Adaptive Card-based dialogs:
25
+ * - 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
26
+ * 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.
27
+ * - In all other hosts, please use {@link dialog.adaptiveCard.open dialog.adaptiveCard.open(cardDialogInfo: CardDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): void}
28
+ *
29
+ * Allows an app to open the task module.
30
+ *
31
+ * @param taskInfo - An object containing the parameters of the task module
32
+ * @param submitHandler - Handler to call when the task module is completed
33
+ */
34
+ export declare function startTask(taskInfo: TaskInfo, submitHandler?: startTaskSubmitHandlerFunctionType): IAppWindow;
35
+ /**
36
+ * @deprecated
37
+ * As of TeamsJS v2.0.0, please use {@link dialog.update.resize dialog.update.resize(dimensions: DialogSize): void} instead.
38
+ *
39
+ * Update height/width task info properties.
40
+ *
41
+ * @param taskInfo - An object containing width and height properties
42
+ */
43
+ export declare function updateTask(taskInfo: TaskInfo): void;
44
+ /**
45
+ * @deprecated
46
+ * As of 2.8.0, please use {@link dialog.url.submit} instead.
47
+ *
48
+ * Submit the task module.
49
+ *
50
+ * @param result - Contains the result to be sent to the bot or the app. Typically a JSON object or a serialized version of it
51
+ * @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.
52
+ */
53
+ export declare function submitTask(result?: string | object, appIds?: string | string[]): void;
54
+ /**
55
+ * Sets the height and width of the {@link TaskInfo} object to the original height and width, if initially specified,
56
+ * otherwise uses the height and width values corresponding to {@link DialogDimension | TaskModuleDimension.Small}
57
+ * @param taskInfo TaskInfo object from which to extract size info, if specified
58
+ * @returns TaskInfo with height and width specified
59
+ */
60
+ export declare function getDefaultSizeIfNotProvided(taskInfo: TaskInfo): TaskInfo;
@@ -1,77 +1,75 @@
1
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
- }
2
+ /** Ready to unload function type */
3
+ export type readyToUnloadFunctionType = () => void;
4
+ /** Register on load handler function type */
5
+ export type registerOnLoadHandlerFunctionType = (context: LoadContext) => void;
6
+ /** Register before unload handler function type */
7
+ export type registerBeforeUnloadHandlerFunctionType = (readyToUnload: readyToUnloadFunctionType) => boolean;
8
+ /**
9
+ * Enable print capability to support printing page using Ctrl+P and cmd+P
10
+ */
11
+ export declare function enablePrintCapability(): void;
12
+ /**
13
+ * default print handler
14
+ */
15
+ export declare function print(): void;
16
+ /**
17
+ * Registers a handler to be called when the page has been requested to load.
18
+ *
19
+ * @remarks Check out [App Caching in Teams](https://learn.microsoft.com/microsoftteams/platform/tabs/how-to/app-caching)
20
+ * for a more detailed explanation about using this API.
21
+ *
22
+ * @param handler - The handler to invoke when the page is loaded.
23
+ *
24
+ * @beta
25
+ */
26
+ export declare function registerOnLoadHandler(handler: registerOnLoadHandlerFunctionType): void;
27
+ /**
28
+ * @hidden
29
+ * Undocumented helper function with shared code between deprecated version and current version of the registerOnLoadHandler API.
30
+ *
31
+ * @internal
32
+ * Limited to Microsoft-internal use
33
+ *
34
+ * @param apiVersionTag - The tag indicating API version number with name
35
+ * @param handler - The handler to invoke when the page is loaded.
36
+ * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
37
+ *
38
+ * @deprecated
39
+ */
40
+ export declare function registerOnLoadHandlerHelper(apiVersionTag: string, handler: registerOnLoadHandlerFunctionType, versionSpecificHelper?: () => void): void;
41
+ /**
42
+ * Registers a handler to be called before the page is unloaded.
43
+ *
44
+ * @remarks Check out [App Caching in Teams](https://learn.microsoft.com/microsoftteams/platform/tabs/how-to/app-caching)
45
+ * for a more detailed explanation about using this API.
46
+ *
47
+ * @param handler - The handler to invoke before the page is unloaded. If this handler returns true the page should
48
+ * invoke the readyToUnload function provided to it once it's ready to be unloaded.
49
+ *
50
+ * @beta
51
+ */
52
+ export declare function registerBeforeUnloadHandler(handler: registerBeforeUnloadHandlerFunctionType): void;
53
+ /**
54
+ * @hidden
55
+ * Undocumented helper function with shared code between deprecated version and current version of the registerBeforeUnloadHandler API.
56
+ *
57
+ * @internal
58
+ * Limited to Microsoft-internal use
59
+ *
60
+ * @param handler - - The handler to invoke before the page is unloaded. If this handler returns true the page should
61
+ * invoke the readyToUnload function provided to it once it's ready to be unloaded.
62
+ * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
63
+ *
64
+ * @deprecated
65
+ */
66
+ export declare function registerBeforeUnloadHandlerHelper(apiVersionTag: string, handler: registerBeforeUnloadHandlerFunctionType, versionSpecificHelper?: () => void): void;
67
+ /**
68
+ * Checks if teamsCore capability is supported by the host
69
+ *
70
+ * @returns boolean to represent whether the teamsCore capability is supported
71
+ *
72
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
73
+ *
74
+ */
75
+ export declare function isSupported(): boolean;