[office-js][office-js-preview] (Outlook) Clarify cursor position for prependAsync and setAsync calls (#65665)

* Clarify cursor position after prependAsync and setAsync calls

* Apply suggestions from review
This commit is contained in:
Sam Ramon
2023-06-06 15:40:49 -07:00
committed by GitHub
parent d37359ad71
commit 529c00be74
2 changed files with 180 additions and 108 deletions

View File

@@ -12269,10 +12269,6 @@ declare namespace Office {
*
* This method returns the entire current body in the format specified by `coercionType`.
*
* When working with HTML-formatted bodies, it is important to note that the `Body.getAsync` and `Body.setAsync` methods are not idempotent.
* The value returned from the `getAsync` method will not necessarily be exactly the same as the value that was passed in the `setAsync` method previously.
* The client may modify the value passed to `setAsync` in order to make it render efficiently with its rendering engine.
*
* @remarks
* [Api set: Mailbox 1.3]
*
@@ -12280,6 +12276,10 @@ declare namespace Office {
*
* **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read
*
* **Important**: When working with HTML-formatted bodies, it's important to note that the value returned by the `Body.getAsync` method won't necessarily
* be the exact same value that was previously passed in the `Body.setAsync` method. The client may modify the value passed to `setAsync` to make it
* render efficiently with its rendering engine.
*
* @param coercionType - The format for the returned body.
* @param options - An object literal that contains one or more of the following properties:-
* `asyncContext`: Developers can provide any object they wish to access in the callback function.
@@ -12292,10 +12292,6 @@ declare namespace Office {
*
* This method returns the entire current body in the format specified by `coercionType`.
*
* When working with HTML-formatted bodies, it is important to note that the `Body.getAsync` and `Body.setAsync` methods are not idempotent.
* The value returned from the `getAsync` method will not necessarily be exactly the same as the value that was passed in the `setAsync` method previously.
* The client may modify the value passed to `setAsync` in order to make it render efficiently with its rendering engine.
*
* @remarks
* [Api set: Mailbox 1.3]
*
@@ -12303,6 +12299,10 @@ declare namespace Office {
*
* **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read
*
* **Important**: When working with HTML-formatted bodies, it's important to note that the value returned by the `Body.getAsync` method won't necessarily
* be the exact same value that was previously passed in the `Body.setAsync` method. The client may modify the value passed to `setAsync` to make it
* render efficiently with its rendering engine.
*
* @param coercionType - The format for the returned body.
* @param callback - Optional. When the method completes, the function passed in the `callback` parameter is called with a single parameter
* of type Office.AsyncResult. The body is provided in the requested format in the `asyncResult.value` property.
@@ -12343,18 +12343,6 @@ declare namespace Office {
/**
* Adds the specified content to the beginning of the item body.
*
* The `prependAsync` method inserts the specified string at the beginning of the item body.
* After insertion, the cursor is returned to its original place, relative to the inserted content.
*
* When working with HTML-formatted bodies, it's important to note that the client may modify the value passed to `prependAsync` in order to
* make it render efficiently with its rendering engine. This means that the value returned from a subsequent call to the `Body.getAsync` method
* (introduced in Mailbox 1.3) will not necessarily exactly contain the value that was passed in the `prependAsync` method previously.
*
* When including links in HTML markup, you can disable online link preview by setting the `id` attribute on the anchor (\<a\>) to "LPNoLP"
* (see the **Examples** section for a sample).
*
* **Recommended**: Call `getTypeAsync` then pass the returned value to the `options.coercionType` parameter.
*
* @remarks
* [Api set: Mailbox 1.1]
*
@@ -12362,6 +12350,25 @@ declare namespace Office {
*
* **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose
*
* **Important**:
*
* - After the content is prepended, the position of the cursor depends on which client the add-in is running.
*
* - **Windows, Web**: The cursor position remains the same in the pre-existing content of the body. For example, if the cursor was positioned at the beginning
* of the body prior to the `prependAsync` call, it will appear between the prepended content and the pre-existing content of the body after the call.
*
* - **Mac**: The cursor position isn't preserved. The cursor disappears after the `prependAsync` call and only reappears when the user selects something in the
* body of the mail item.
*
* - When working with HTML-formatted bodies, it's important to note that the client may modify the value passed to `prependAsync` to
* make it render efficiently with its rendering engine. This means that the value returned from a subsequent call to the `Body.getAsync` method
* (introduced in Mailbox 1.3) won't necessarily contain the exact value that was passed in the previous `prependAsync` call.
*
* - When including links in HTML markup, you can disable online link preview by setting the `id` attribute on the anchor (\<a\>) to "LPNoLP"
* (see the **Examples** section for a sample).
*
* **Recommended**: Call `getTypeAsync`, then pass the returned value to the `options.coercionType` parameter.
*
* **Errors**:
*
* - `DataExceedsMaximumSize`: The data parameter is longer than 1,000,000 characters.
@@ -12377,18 +12384,6 @@ declare namespace Office {
/**
* Adds the specified content to the beginning of the item body.
*
* The `prependAsync` method inserts the specified string at the beginning of the item body.
* After insertion, the cursor is returned to its original place, relative to the inserted content.
*
* When working with HTML-formatted bodies, it's important to note that the client may modify the value passed to `prependAsync` in order to
* make it render efficiently with its rendering engine. This means that the value returned from a subsequent call to the `Body.getAsync` method
* (introduced in Mailbox 1.3) will not necessarily exactly contain the value that was passed in the `prependAsync` method previously.
*
* When including links in HTML markup, you can disable online link preview by setting the `id` attribute on the anchor (\<a\>) to "LPNoLP"
* (see the **Examples** section for a sample).
*
* **Recommended**: Call `getTypeAsync` then pass the returned value to the `options.coercionType` parameter.
*
* @remarks
* [Api set: Mailbox 1.1]
*
@@ -12396,6 +12391,25 @@ declare namespace Office {
*
* **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose
*
* **Important**:
*
* - After the content is prepended, the position of the cursor depends on which client the add-in is running.
*
* - **Windows, Web**: The cursor position remains the same in the pre-existing content of the body. For example, if the cursor was positioned at the beginning
* of the body prior to the `prependAsync` call, it will appear between the prepended content and the pre-existing content of the body after the call.
*
* - **Mac**: The cursor position isn't preserved. The cursor disappears after the `prependAsync` call and only reappears when the user selects something in the
* body of the mail item.
*
* - When working with HTML-formatted bodies, it's important to note that the client may modify the value passed to `prependAsync` to
* make it render efficiently with its rendering engine. This means that the value returned from a subsequent call to the `Body.getAsync` method
* (introduced in Mailbox 1.3) won't necessarily contain the exact value that was passed in the previous `prependAsync` call.
*
* - When including links in HTML markup, you can disable online link preview by setting the `id` attribute on the anchor (\<a\>) to "LPNoLP"
* (see the **Examples** section for a sample).
*
* **Recommended**: Call `getTypeAsync`, then pass the returned value to the `options.coercionType` parameter.
*
* **Errors**:
*
* - `DataExceedsMaximumSize`: The data parameter is longer than 1,000,000 characters.
@@ -12487,17 +12501,6 @@ declare namespace Office {
/**
* Replaces the entire body with the specified text.
*
* When working with HTML-formatted bodies, it is important to note that the `Body.getAsync` and `Body.setAsync` methods are not idempotent.
* The value returned from the `getAsync` method will not necessarily be exactly the same as the value that was passed in the `setAsync` method
* previously. The client may modify the value passed to `setAsync` in order to make it render efficiently with its rendering engine.
*
* When including links in HTML markup, you can disable online link preview by setting the `id` attribute on the anchor (\<a\>) to "LPNoLP"
* (see the **Examples** section for a sample).
*
* **Recommended**: Call `getTypeAsync` then pass the returned value to the `options.coercionType` parameter.
*
* **Important**: In Outlook on Windows and on Mac, the add-in user won't be able to revert this action with the **Undo** command.
*
* @remarks
* [Api set: Mailbox 1.3]
*
@@ -12505,6 +12508,28 @@ declare namespace Office {
*
* **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose
*
* **Important**:
*
* - After the body is replaced with the specified content, the position of the cursor depends on which client the add-in is running.
*
* - **Windows**: The cursor appears at the beginning of the body of the mail item.
*
* - **Mac**: The cursor position isn't preserved. The cursor disappears after the `prependAsync` call and only reappears when the user selects something in the
* body of the mail item.
*
* - **Web**: The cursor appears at the end of the body of the mail item.
*
* - When working with HTML-formatted bodies, it's important to note that the value returned by the `Body.getAsync` method won't necessarily
* be the exact same value that was previously passed in the `Body.setAsync` method. The client may modify the value passed to `setAsync` to make it
* render efficiently with its rendering engine.
*
* - When including links in HTML markup, you can disable online link preview by setting the `id` attribute on the anchor (\<a\>) to "LPNoLP"
* (see the **Examples** section for a sample).
*
* - In Outlook on Windows and on Mac, the add-in user isn't able to revert this action with the **Undo** command.
*
* **Recommended**: Call `getTypeAsync`, then pass the returned value to the `options.coercionType` parameter.
*
* **Errors**:
*
* - `DataExceedsMaximumSize`: The data parameter is longer than 1,000,000 characters.
@@ -12522,17 +12547,6 @@ declare namespace Office {
/**
* Replaces the entire body with the specified text.
*
* When working with HTML-formatted bodies, it is important to note that the `Body.getAsync` and `Body.setAsync` methods are not idempotent.
* The value returned from the `getAsync` method will not necessarily be exactly the same as the value that was passed in the `setAsync` method
* previously. The client may modify the value passed to `setAsync` in order to make it render efficiently with its rendering engine.
*
* When including links in HTML markup, you can disable online link preview by setting the `id` attribute on the anchor (\<a\>) to "LPNoLP"
* (see the **Examples** section for a sample).
*
* **Recommended**: Call `getTypeAsync` then pass the returned value to the `options.coercionType` parameter.
*
* **Important**: In Outlook on Windows and on Mac, the add-in user won't be able to revert this action with the **Undo** command.
*
* @remarks
* [Api set: Mailbox 1.3]
*
@@ -12540,6 +12554,28 @@ declare namespace Office {
*
* **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose
*
* **Important**:
*
* - After the body is replaced with the specified content, the position of the cursor depends on which client the add-in is running.
*
* - **Windows**: The cursor appears at the beginning of the body of the mail item.
*
* - **Mac**: The cursor position isn't preserved. The cursor disappears after the `prependAsync` call and only reappears when the user selects something in the
* body of the mail item.
*
* - **Web**: The cursor appears at the end of the body of the mail item.
*
* - When working with HTML-formatted bodies, it's important to note that the value returned by the `Body.getAsync` method won't necessarily
* be the exact same value that was previously passed in the `Body.setAsync` method. The client may modify the value passed to `setAsync` to make it
* render efficiently with its rendering engine.
*
* - When including links in HTML markup, you can disable online link preview by setting the `id` attribute on the anchor (\<a\>) to "LPNoLP"
* (see the **Examples** section for a sample).
*
* - In Outlook on Windows and on Mac, the add-in user isn't able to revert this action with the **Undo** command.
*
* **Recommended**: Call `getTypeAsync`, then pass the returned value to the `options.coercionType` parameter.
*
* **Errors**:
*
* - `DataExceedsMaximumSize`: The data parameter is longer than 1,000,000 characters.

View File

@@ -12140,10 +12140,6 @@ declare namespace Office {
*
* This method returns the entire current body in the format specified by `coercionType`.
*
* When working with HTML-formatted bodies, it is important to note that the `Body.getAsync` and `Body.setAsync` methods are not idempotent.
* The value returned from the `getAsync` method will not necessarily be exactly the same as the value that was passed in the `setAsync` method previously.
* The client may modify the value passed to `setAsync` in order to make it render efficiently with its rendering engine.
*
* @remarks
* [Api set: Mailbox 1.3]
*
@@ -12151,6 +12147,10 @@ declare namespace Office {
*
* **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read
*
* **Important**: When working with HTML-formatted bodies, it's important to note that the value returned by the `Body.getAsync` method won't necessarily
* be the exact same value that was previously passed in the `Body.setAsync` method. The client may modify the value passed to `setAsync` to make it
* render efficiently with its rendering engine.
*
* @param coercionType - The format for the returned body.
* @param options - An object literal that contains one or more of the following properties:-
* `asyncContext`: Developers can provide any object they wish to access in the callback function.
@@ -12163,10 +12163,6 @@ declare namespace Office {
*
* This method returns the entire current body in the format specified by `coercionType`.
*
* When working with HTML-formatted bodies, it is important to note that the `Body.getAsync` and `Body.setAsync` methods are not idempotent.
* The value returned from the `getAsync` method will not necessarily be exactly the same as the value that was passed in the `setAsync` method previously.
* The client may modify the value passed to `setAsync` in order to make it render efficiently with its rendering engine.
*
* @remarks
* [Api set: Mailbox 1.3]
*
@@ -12174,6 +12170,10 @@ declare namespace Office {
*
* **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read
*
* **Important**: When working with HTML-formatted bodies, it's important to note that the value returned by the `Body.getAsync` method won't necessarily
* be the exact same value that was previously passed in the `Body.setAsync` method. The client may modify the value passed to `setAsync` to make it
* render efficiently with its rendering engine.
*
* @param coercionType - The format for the returned body.
* @param callback - Optional. When the method completes, the function passed in the `callback` parameter is called with a single parameter
* of type Office.AsyncResult. The body is provided in the requested format in the `asyncResult.value` property.
@@ -12214,18 +12214,6 @@ declare namespace Office {
/**
* Adds the specified content to the beginning of the item body.
*
* The `prependAsync` method inserts the specified string at the beginning of the item body.
* After insertion, the cursor is returned to its original place, relative to the inserted content.
*
* When working with HTML-formatted bodies, it's important to note that the client may modify the value passed to `prependAsync` in order to
* make it render efficiently with its rendering engine. This means that the value returned from a subsequent call to the `Body.getAsync` method
* (introduced in Mailbox 1.3) will not necessarily exactly contain the value that was passed in the `prependAsync` method previously.
*
* When including links in HTML markup, you can disable online link preview by setting the `id` attribute on the anchor (\<a\>) to "LPNoLP"
* (see the **Examples** section for a sample).
*
* **Recommended**: Call `getTypeAsync` then pass the returned value to the `options.coercionType` parameter.
*
* @remarks
* [Api set: Mailbox 1.1]
*
@@ -12233,6 +12221,25 @@ declare namespace Office {
*
* **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose
*
* **Important**:
*
* - After the content is prepended, the position of the cursor depends on which client the add-in is running.
*
* - **Windows, Web**: The cursor position remains the same in the pre-existing content of the body. For example, if the cursor was positioned at the beginning
* of the body prior to the `prependAsync` call, it will appear between the prepended content and the pre-existing content of the body after the call.
*
* - **Mac**: The cursor position isn't preserved. The cursor disappears after the `prependAsync` call and only reappears when the user selects something in the
* body of the mail item.
*
* - When working with HTML-formatted bodies, it's important to note that the client may modify the value passed to `prependAsync` to
* make it render efficiently with its rendering engine. This means that the value returned from a subsequent call to the `Body.getAsync` method
* (introduced in Mailbox 1.3) won't necessarily contain the exact value that was passed in the previous `prependAsync` call.
*
* - When including links in HTML markup, you can disable online link preview by setting the `id` attribute on the anchor (\<a\>) to "LPNoLP"
* (see the **Examples** section for a sample).
*
* **Recommended**: Call `getTypeAsync`, then pass the returned value to the `options.coercionType` parameter.
*
* **Errors**:
*
* - `DataExceedsMaximumSize`: The data parameter is longer than 1,000,000 characters.
@@ -12248,18 +12255,6 @@ declare namespace Office {
/**
* Adds the specified content to the beginning of the item body.
*
* The `prependAsync` method inserts the specified string at the beginning of the item body.
* After insertion, the cursor is returned to its original place, relative to the inserted content.
*
* When working with HTML-formatted bodies, it's important to note that the client may modify the value passed to `prependAsync` in order to
* make it render efficiently with its rendering engine. This means that the value returned from a subsequent call to the `Body.getAsync` method
* (introduced in Mailbox 1.3) will not necessarily exactly contain the value that was passed in the `prependAsync` method previously.
*
* When including links in HTML markup, you can disable online link preview by setting the `id` attribute on the anchor (\<a\>) to "LPNoLP"
* (see the **Examples** section for a sample).
*
* **Recommended**: Call `getTypeAsync` then pass the returned value to the `options.coercionType` parameter.
*
* @remarks
* [Api set: Mailbox 1.1]
*
@@ -12267,6 +12262,25 @@ declare namespace Office {
*
* **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose
*
* **Important**:
*
* - After the content is prepended, the position of the cursor depends on which client the add-in is running.
*
* - **Windows, Web**: The cursor position remains the same in the pre-existing content of the body. For example, if the cursor was positioned at the beginning
* of the body prior to the `prependAsync` call, it will appear between the prepended content and the pre-existing content of the body after the call.
*
* - **Mac**: The cursor position isn't preserved. The cursor disappears after the `prependAsync` call and only reappears when the user selects something in the
* body of the mail item.
*
* - When working with HTML-formatted bodies, it's important to note that the client may modify the value passed to `prependAsync` to
* make it render efficiently with its rendering engine. This means that the value returned from a subsequent call to the `Body.getAsync` method
* (introduced in Mailbox 1.3) won't necessarily contain the exact value that was passed in the previous `prependAsync` call.
*
* - When including links in HTML markup, you can disable online link preview by setting the `id` attribute on the anchor (\<a\>) to "LPNoLP"
* (see the **Examples** section for a sample).
*
* **Recommended**: Call `getTypeAsync`, then pass the returned value to the `options.coercionType` parameter.
*
* **Errors**:
*
* - `DataExceedsMaximumSize`: The data parameter is longer than 1,000,000 characters.
@@ -12358,17 +12372,6 @@ declare namespace Office {
/**
* Replaces the entire body with the specified text.
*
* When working with HTML-formatted bodies, it is important to note that the `Body.getAsync` and `Body.setAsync` methods are not idempotent.
* The value returned from the `getAsync` method will not necessarily be exactly the same as the value that was passed in the `setAsync` method
* previously. The client may modify the value passed to `setAsync` in order to make it render efficiently with its rendering engine.
*
* When including links in HTML markup, you can disable online link preview by setting the `id` attribute on the anchor (\<a\>) to "LPNoLP"
* (see the **Examples** section for a sample).
*
* **Recommended**: Call `getTypeAsync` then pass the returned value to the `options.coercionType` parameter.
*
* **Important**: In Outlook on Windows and on Mac, the add-in user won't be able to revert this action with the **Undo** command.
*
* @remarks
* [Api set: Mailbox 1.3]
*
@@ -12376,6 +12379,28 @@ declare namespace Office {
*
* **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose
*
* **Important**:
*
* - After the body is replaced with the specified content, the position of the cursor depends on which client the add-in is running.
*
* - **Windows**: The cursor appears at the beginning of the body of the mail item.
*
* - **Mac**: The cursor position isn't preserved. The cursor disappears after the `prependAsync` call and only reappears when the user selects something in the
* body of the mail item.
*
* - **Web**: The cursor appears at the end of the body of the mail item.
*
* - When working with HTML-formatted bodies, it's important to note that the value returned by the `Body.getAsync` method won't necessarily
* be the exact same value that was previously passed in the `Body.setAsync` method. The client may modify the value passed to `setAsync` to make it
* render efficiently with its rendering engine.
*
* - When including links in HTML markup, you can disable online link preview by setting the `id` attribute on the anchor (\<a\>) to "LPNoLP"
* (see the **Examples** section for a sample).
*
* - In Outlook on Windows and on Mac, the add-in user isn't able to revert this action with the **Undo** command.
*
* **Recommended**: Call `getTypeAsync`, then pass the returned value to the `options.coercionType` parameter.
*
* **Errors**:
*
* - `DataExceedsMaximumSize`: The data parameter is longer than 1,000,000 characters.
@@ -12393,17 +12418,6 @@ declare namespace Office {
/**
* Replaces the entire body with the specified text.
*
* When working with HTML-formatted bodies, it is important to note that the `Body.getAsync` and `Body.setAsync` methods are not idempotent.
* The value returned from the `getAsync` method will not necessarily be exactly the same as the value that was passed in the `setAsync` method
* previously. The client may modify the value passed to `setAsync` in order to make it render efficiently with its rendering engine.
*
* When including links in HTML markup, you can disable online link preview by setting the `id` attribute on the anchor (\<a\>) to "LPNoLP"
* (see the **Examples** section for a sample).
*
* **Recommended**: Call `getTypeAsync` then pass the returned value to the `options.coercionType` parameter.
*
* **Important**: In Outlook on Windows and on Mac, the add-in user won't be able to revert this action with the **Undo** command.
*
* @remarks
* [Api set: Mailbox 1.3]
*
@@ -12411,6 +12425,28 @@ declare namespace Office {
*
* **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose
*
* **Important**:
*
* - After the body is replaced with the specified content, the position of the cursor depends on which client the add-in is running.
*
* - **Windows**: The cursor appears at the beginning of the body of the mail item.
*
* - **Mac**: The cursor position isn't preserved. The cursor disappears after the `prependAsync` call and only reappears when the user selects something in the
* body of the mail item.
*
* - **Web**: The cursor appears at the end of the body of the mail item.
*
* - When working with HTML-formatted bodies, it's important to note that the value returned by the `Body.getAsync` method won't necessarily
* be the exact same value that was previously passed in the `Body.setAsync` method. The client may modify the value passed to `setAsync` to make it
* render efficiently with its rendering engine.
*
* - When including links in HTML markup, you can disable online link preview by setting the `id` attribute on the anchor (\<a\>) to "LPNoLP"
* (see the **Examples** section for a sample).
*
* - In Outlook on Windows and on Mac, the add-in user isn't able to revert this action with the **Undo** command.
*
* **Recommended**: Call `getTypeAsync`, then pass the returned value to the `options.coercionType` parameter.
*
* **Errors**:
*
* - `DataExceedsMaximumSize`: The data parameter is longer than 1,000,000 characters.