diff --git a/types/m3u8-parser/index.d.ts b/types/m3u8-parser/index.d.ts index d1b81460c4e8a4..a0b0fd0d1c0f22 100644 --- a/types/m3u8-parser/index.d.ts +++ b/types/m3u8-parser/index.d.ts @@ -1,10 +1,15 @@ +export type PreservedStreamEventType = "info" | "warn" | "error"; + export abstract class Stream { - private listeners: Record; - private on(type: string, listener: () => void): void; - private off(type: string, listener: () => void): void; - private trigger(type: string, ...args: unknown[]): void; - private dispose(): void; - private pipe(destination: Stream): void; + listeners: Record; + on(type: PreservedStreamEventType, listener: (data: { message: string }) => void): void; + on(type: string, listener: (...data: unknown[]) => void): void; + off(type: PreservedStreamEventType, listener: (data: { message: string }) => void): boolean; + off(type: string, listener: (...data: unknown[]) => void): boolean; + trigger(type: PreservedStreamEventType, listener: (data: { message: string }) => void): void; + trigger(type: string, listener: (...data: unknown[]) => void): void; + dispose(): void; + pipe(destination: Stream): void; } export interface RawAttributes { diff --git a/types/m3u8-parser/m3u8-parser-tests.ts b/types/m3u8-parser/m3u8-parser-tests.ts index 4f3501d05b0d4f..d758f35cd45ebe 100644 --- a/types/m3u8-parser/m3u8-parser-tests.ts +++ b/types/m3u8-parser/m3u8-parser-tests.ts @@ -2,11 +2,50 @@ import { Manifest, Parser } from "m3u8-parser"; const manifest = "#EXTM3U\n#EXT-X-VERSION:3"; -var parser = new Parser(); +const parser = new Parser(); + +// $ExpectType void +parser.on("info", (args) => { + args.message; // $ExpectType string +}); +// $ExpectType void +parser.on("info", (args) => { + args.message; // $ExpectType string +}); +// $ExpectType void +parser.on("info", (args) => { + args.message; // $ExpectType string +}); +// $ExpectType boolean +parser.off("info", (args) => { + args.message; // $ExpectType string +}); +// $ExpectType boolean +parser.off("info", (args) => { + args.message; // $ExpectType string +}); +// $ExpectType boolean +parser.off("info", (args) => { + args.message; // $ExpectType string +}); +// $ExpectType void +parser.trigger("info", (args) => { + args.message; // $ExpectType string +}); +// $ExpectType void +parser.trigger("info", (args) => { + args.message; // $ExpectType string +}); +// $ExpectType void +parser.trigger("info", (args) => { + args.message; // $ExpectType string +}); parser.push(manifest); parser.end(); +parser.dispose(); + const parsedManifest = parser.manifest.playlists?.[0].contentProtection?.["com.apple.fps.1_0"]?.attributes.resolution; const parser2 = new Parser({ diff --git a/types/office-js-preview/index.d.ts b/types/office-js-preview/index.d.ts index c4be01e3403ca4..2c572bce2917a5 100644 --- a/types/office-js-preview/index.d.ts +++ b/types/office-js-preview/index.d.ts @@ -5931,17 +5931,58 @@ declare namespace Office { * * **Requirement sets**: * - * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#htmlcoercion | HtmlCoercion} (when using `Office.CoercionType.Html`) + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#selection | Selection} * - * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#matrixcoercion | MatrixCoercion} (when using `Office.CoercionType.Matrix`) + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#textcoercion | TextCoercion} * - * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#ooxmlcoercion | OoxmlCoercion} (when using `Office.CoercionType.Ooxml`) + * **Supported applications**: Excel, PowerPoint, Project, Word + * + * In the callback function that is passed to the getSelectedDataAsync method, you can use the properties of the AsyncResult object to return + * the following information. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
PropertyUse
AsyncResult.valueAccess the selected data as a string. If the selection does not contain text, returns an empty string.
AsyncResult.statusDetermine the success or failure of the operation.
AsyncResult.errorAccess an Error object that provides error information if the operation failed.
AsyncResult.asyncContextDefine an item of any type that's returned in the AsyncResult object without being altered.
+ * + * @param coercionType Must be `Office.CoercionType.Text`. + * + * @param options Provides options for customizing what data is returned and how it is formatted. + * + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is a string containing the selected text. + */ + getSelectedDataAsync(coercionType: Office.CoercionType.Text, options?: GetSelectedDataOptions, callback?: (result: AsyncResult) => void): void; + /** + * Reads the data contained in the current selection in the document. + * + * @remarks + * + * **Requirement sets**: * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#selection | Selection} * - * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#tablecoercion | TableCoercion} (when using `Office.CoercionType.Table`) + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#tablecoercion | TableCoercion} * - * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#textcoercion | TextCoercion} (when using `Office.CoercionType.Text`) + * **Supported applications**: Excel, Word * * In the callback function that is passed to the getSelectedDataAsync method, you can use the properties of the AsyncResult object to return * the following information. @@ -5953,7 +5994,93 @@ declare namespace Office { * * * AsyncResult.value - * Always returns undefined because there's no object or data to retrieve. + * Access the selected data as a {@link Office.TableData} object. Returns null if no table is selected. + * + * + * AsyncResult.status + * Determine the success or failure of the operation. + * + * + * AsyncResult.error + * Access an Error object that provides error information if the operation failed. + * + * + * AsyncResult.asyncContext + * Define an item of any type that's returned in the AsyncResult object without being altered. + * + * + * + * @param coercionType Must be `Office.CoercionType.Table`. + * @param options Provides options for customizing what data is returned and how it is formatted. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is a {@link Office.TableData} object containing the data in the current selection. + */ + getSelectedDataAsync(coercionType: Office.CoercionType.Table, options?: GetSelectedDataOptions, callback?: (result: AsyncResult) => void): void; + /** + * Reads the data contained in the current selection in the document. + * + * @remarks + * + * **Requirement sets**: + * + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#selection | Selection} + * + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#matrixcoercion | MatrixCoercion} + * + * **Supported applications**: Excel, Word + * + * In the callback function that is passed to the getSelectedDataAsync method, you can use the properties of the AsyncResult object to return + * the following information. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
PropertyUse
AsyncResult.valueAccess the selected data as an array of arrays. Returns an empty array if no data is selected.
AsyncResult.statusDetermine the success or failure of the operation.
AsyncResult.errorAccess an Error object that provides error information if the operation failed.
AsyncResult.asyncContextDefine an item of any type that's returned in the AsyncResult object without being altered.
+ * + * @param coercionType Must be `Office.CoercionType.Matrix`. + * @param options Provides options for customizing what data is returned and how it is formatted. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is an array of arrays containing the data in the current selection. + */ + getSelectedDataAsync(coercionType: Office.CoercionType.Matrix, options?: GetSelectedDataOptions, callback?: (result: AsyncResult) => void): void; + /** + * Reads the data contained in the current selection in the document. + * + * @remarks + * + * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#selection | Selection} + * + * **Supported application**: PowerPoint + * + * In the callback function that is passed to the getSelectedDataAsync method, you can use the properties of the AsyncResult object to return + * the following information. + * + * + * + * + * + * + * + * + * * * * @@ -5969,6 +6096,31 @@ declare namespace Office { * *
PropertyUse
AsyncResult.valueAccess the selected slides as a {@link Office.SlideRange} object containing the IDs, titles, and indexes of the selected slides.
AsyncResult.status
* + * @param coercionType Must be `Office.CoercionType.SlideRange`. + * @param options Provides options for customizing what data is returned and how it is formatted. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is a {@link Office.SlideRange} object containing the selected slides. + */ + getSelectedDataAsync(coercionType: Office.CoercionType.SlideRange, options?: GetSelectedDataOptions, callback?: (result: AsyncResult) => void): void; + /** + * Reads the data contained in the current selection in the document. + * + * @remarks + * + * **Requirement sets**: + * + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#htmlcoercion | HtmlCoercion} (when using `Office.CoercionType.Html`) + * + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#matrixcoercion | MatrixCoercion} (when using `Office.CoercionType.Matrix`) + * + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#ooxmlcoercion | OoxmlCoercion} (when using `Office.CoercionType.Ooxml`) + * + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#selection | Selection} + * + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#tablecoercion | TableCoercion} (when using `Office.CoercionType.Table`) + * + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#textcoercion | TextCoercion} (when using `Office.CoercionType.Text`) + * * The possible values for the {@link Office.CoercionType} parameter vary by the Office application. * * @@ -6006,10 +6158,37 @@ declare namespace Office { * *
* - * @param coercionType The type of data structure to return. See the Remarks section for each application's supported coercion types. + * In the callback function that is passed to the getSelectedDataAsync method, you can use the properties of the AsyncResult object to return + * the following information. * - * @param options Provides options for customizing what data is returned and how it is formatted. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
PropertyUse
AsyncResult.valueAccess the selected data. The type depends on the coercionType parameter specified in the call.
AsyncResult.statusDetermine the success or failure of the operation.
AsyncResult.errorAccess an Error object that provides error information if the operation failed.
AsyncResult.asyncContextDefine an item of any type that's returned in the AsyncResult object without being altered.
* + * For other coercion types or when the coercion type is not known at compile time, use the generic version of this method + * and specify the type parameter explicitly. + * + * @param coercionType The type of data structure to return. See the Remarks section for each application's supported coercion types. + * @param options Provides options for customizing what data is returned and how it is formatted. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is the data in the current selection. * This is returned in the data structure or format you specified with the coercionType parameter. @@ -6023,17 +6202,55 @@ declare namespace Office { * * **Requirement sets**: * - * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#htmlcoercion | HtmlCoercion} (when using `Office.CoercionType.Html`) + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#selection | Selection} * - * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#matrixcoercion | MatrixCoercion} (when using `Office.CoercionType.Matrix`) + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#textcoercion | TextCoercion} * - * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#ooxmlcoercion | OoxmlCoercion} (when using `Office.CoercionType.Ooxml`) + * **Supported applications**: Excel, PowerPoint, Project, Word + * + * In the callback function that is passed to the getSelectedDataAsync method, you can use the properties of the AsyncResult object to return + * the following information. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
PropertyUse
AsyncResult.valueAccess the selected data as a string. If the selection does not contain text, returns an empty string.
AsyncResult.statusDetermine the success or failure of the operation.
AsyncResult.errorAccess an Error object that provides error information if the operation failed.
AsyncResult.asyncContextDefine an item of any type that's returned in the AsyncResult object without being altered.
+ * + * @param coercionType Must be `Office.CoercionType.Text`. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is a string containing the selected text. + */ + getSelectedDataAsync(coercionType: Office.CoercionType.Text, callback?: (result: AsyncResult) => void): void; + /** + * Reads the data contained in the current selection in the document. + * + * @remarks + * + * **Requirement sets**: * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#selection | Selection} * - * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#tablecoercion | TableCoercion} (when using `Office.CoercionType.Table`) + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#tablecoercion | TableCoercion} * - * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#textcoercion | TextCoercion} (when using `Office.CoercionType.Text`) + * **Supported applications**: Excel, Word * * In the callback function that is passed to the getSelectedDataAsync method, you can use the properties of the AsyncResult object to return * the following information. @@ -6045,7 +6262,51 @@ declare namespace Office { * * * AsyncResult.value - * Always returns undefined because there's no object or data to retrieve. + * Access the selected data as a {@link Office.TableData} object. Returns null if no table is selected. + * + * + * AsyncResult.status + * Determine the success or failure of the operation. + * + * + * AsyncResult.error + * Access an Error object that provides error information if the operation failed. + * + * + * AsyncResult.asyncContext + * Define an item of any type that's returned in the AsyncResult object without being altered. + * + * + * + * @param coercionType Must be `Office.CoercionType.Table`. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is a {@link Office.TableData} object containing the data in the current selection. + */ + getSelectedDataAsync(coercionType: Office.CoercionType.Table, callback?: (result: AsyncResult) => void): void; + /** + * Reads the data contained in the current selection in the document. + * + * @remarks + * + * **Requirement sets**: + * + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#selection | Selection} + * + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#matrixcoercion | MatrixCoercion} + * + * **Supported applications**: Excel, Word + * + * In the callback function that is passed to the getSelectedDataAsync method, you can use the properties of the AsyncResult object to return + * the following information. + * + * + * + * + * + * + * + * + * * * * @@ -6061,6 +6322,70 @@ declare namespace Office { * *
PropertyUse
AsyncResult.valueAccess the selected data as an array of arrays. Returns an empty array if no data is selected.
AsyncResult.status
* + * @param coercionType Must be `Office.CoercionType.Matrix`. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is an array of arrays containing the data in the current selection. + */ + getSelectedDataAsync(coercionType: Office.CoercionType.Matrix, callback?: (result: AsyncResult) => void): void; + /** + * Reads the data contained in the current selection in the document. + * + * @remarks + * + * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#selection | Selection} + * + * **Supported application**: PowerPoint + * + * In the callback function that is passed to the getSelectedDataAsync method, you can use the properties of the AsyncResult object to return + * the following information. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
PropertyUse
AsyncResult.valueAccess the selected slides as a {@link Office.SlideRange} object containing the IDs, titles, and indexes of the selected slides.
AsyncResult.statusDetermine the success or failure of the operation.
AsyncResult.errorAccess an Error object that provides error information if the operation failed.
AsyncResult.asyncContextDefine an item of any type that's returned in the AsyncResult object without being altered.
+ * + * @param coercionType Must be `Office.CoercionType.SlideRange`. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is a {@link Office.SlideRange} object containing the selected slides. + */ + getSelectedDataAsync(coercionType: Office.CoercionType.SlideRange, callback?: (result: AsyncResult) => void): void; + /** + * Reads the data contained in the current selection in the document. + * + * @remarks + * + * **Requirement sets**: + * + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#htmlcoercion | HtmlCoercion} (when using `Office.CoercionType.Html`) + * + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#matrixcoercion | MatrixCoercion} (when using `Office.CoercionType.Matrix`) + * + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#ooxmlcoercion | OoxmlCoercion} (when using `Office.CoercionType.Ooxml`) + * + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#selection | Selection} + * + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#tablecoercion | TableCoercion} (when using `Office.CoercionType.Table`) + * + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#textcoercion | TextCoercion} (when using `Office.CoercionType.Text`) + * * The possible values for the {@link Office.CoercionType} parameter vary by the Office application. * * @@ -6098,6 +6423,35 @@ declare namespace Office { * *
* + * In the callback function that is passed to the getSelectedDataAsync method, you can use the properties of the AsyncResult object to return + * the following information. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
PropertyUse
AsyncResult.valueAccess the selected data. The type depends on the coercionType parameter specified in the call.
AsyncResult.statusDetermine the success or failure of the operation.
AsyncResult.errorAccess an Error object that provides error information if the operation failed.
AsyncResult.asyncContextDefine an item of any type that's returned in the AsyncResult object without being altered.
+ * + * For other coercion types or when the coercion type is not known at compile time, use the generic version of this method + * and specify the type parameter explicitly. + * * @param coercionType The type of data structure to return. See the Remarks section for each application's supported coercion types. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is the data in the current selection. @@ -8593,6 +8947,36 @@ declare namespace Office { */ rows: any[][]; } + /** + * Represents a single slide in a PowerPoint presentation. + * This interface is used as part of the {@link Office.SlideRange} object returned by + * {@link Office.Document.getSelectedDataAsync} when called with {@link Office.CoercionType.SlideRange}. + */ + interface Slide { + /** + * Gets the unique ID of the slide. + */ + id: number; + /** + * Gets the title of the slide. + */ + title: string; + /** + * Gets the 1-based index of the slide within the presentation. + */ + index: number; + } + /** + * Represents the selected slides in a PowerPoint presentation. + * This object is returned when calling {@link Office.Document.getSelectedDataAsync} with {@link Office.CoercionType.SlideRange} in PowerPoint. + * + */ + interface SlideRange { + /** + * Gets an array of the selected slides. + */ + slides: Slide[]; + } /** * Provides methods to manage the task pane of an add-in. * @@ -23341,7 +23725,7 @@ declare namespace Office { * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * - * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read + * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * @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. @@ -23359,7 +23743,7 @@ declare namespace Office { * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * - * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read + * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * @param callback - Optional. When the method completes, the function passed in the `callback` parameter is called with a single parameter, * `asyncResult`, which is an `Office.AsyncResult` object. The `value` property of the result is a `Recurrence` object. @@ -42822,6 +43206,7 @@ declare namespace Excel { /** * Moves cell values, formatting, and formulas from current range to the destination range, replacing the old information in those cells. The destination range will be expanded automatically if it is smaller than the current range. Any cells in the destination range that are outside of the original range's area are not changed. + Note: When a range is moved to a new address using this API, the new range object should be retrieved using the new address. * * @remarks * [Api set: ExcelApi 1.11] diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index c12de76002acdd..64287982bb0bba 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -5921,17 +5921,58 @@ declare namespace Office { * * **Requirement sets**: * - * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#htmlcoercion | HtmlCoercion} (when using `Office.CoercionType.Html`) + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#selection | Selection} * - * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#matrixcoercion | MatrixCoercion} (when using `Office.CoercionType.Matrix`) + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#textcoercion | TextCoercion} * - * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#ooxmlcoercion | OoxmlCoercion} (when using `Office.CoercionType.Ooxml`) + * **Supported applications**: Excel, PowerPoint, Project, Word + * + * In the callback function that is passed to the getSelectedDataAsync method, you can use the properties of the AsyncResult object to return + * the following information. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
PropertyUse
AsyncResult.valueAccess the selected data as a string. If the selection does not contain text, returns an empty string.
AsyncResult.statusDetermine the success or failure of the operation.
AsyncResult.errorAccess an Error object that provides error information if the operation failed.
AsyncResult.asyncContextDefine an item of any type that's returned in the AsyncResult object without being altered.
+ * + * @param coercionType Must be `Office.CoercionType.Text`. + * + * @param options Provides options for customizing what data is returned and how it is formatted. + * + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is a string containing the selected text. + */ + getSelectedDataAsync(coercionType: Office.CoercionType.Text, options?: GetSelectedDataOptions, callback?: (result: AsyncResult) => void): void; + /** + * Reads the data contained in the current selection in the document. + * + * @remarks + * + * **Requirement sets**: * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#selection | Selection} * - * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#tablecoercion | TableCoercion} (when using `Office.CoercionType.Table`) + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#tablecoercion | TableCoercion} * - * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#textcoercion | TextCoercion} (when using `Office.CoercionType.Text`) + * **Supported applications**: Excel, Word * * In the callback function that is passed to the getSelectedDataAsync method, you can use the properties of the AsyncResult object to return * the following information. @@ -5943,7 +5984,93 @@ declare namespace Office { * * * AsyncResult.value - * Always returns undefined because there's no object or data to retrieve. + * Access the selected data as a {@link Office.TableData} object. Returns null if no table is selected. + * + * + * AsyncResult.status + * Determine the success or failure of the operation. + * + * + * AsyncResult.error + * Access an Error object that provides error information if the operation failed. + * + * + * AsyncResult.asyncContext + * Define an item of any type that's returned in the AsyncResult object without being altered. + * + * + * + * @param coercionType Must be `Office.CoercionType.Table`. + * @param options Provides options for customizing what data is returned and how it is formatted. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is a {@link Office.TableData} object containing the data in the current selection. + */ + getSelectedDataAsync(coercionType: Office.CoercionType.Table, options?: GetSelectedDataOptions, callback?: (result: AsyncResult) => void): void; + /** + * Reads the data contained in the current selection in the document. + * + * @remarks + * + * **Requirement sets**: + * + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#selection | Selection} + * + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#matrixcoercion | MatrixCoercion} + * + * **Supported applications**: Excel, Word + * + * In the callback function that is passed to the getSelectedDataAsync method, you can use the properties of the AsyncResult object to return + * the following information. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
PropertyUse
AsyncResult.valueAccess the selected data as an array of arrays. Returns an empty array if no data is selected.
AsyncResult.statusDetermine the success or failure of the operation.
AsyncResult.errorAccess an Error object that provides error information if the operation failed.
AsyncResult.asyncContextDefine an item of any type that's returned in the AsyncResult object without being altered.
+ * + * @param coercionType Must be `Office.CoercionType.Matrix`. + * @param options Provides options for customizing what data is returned and how it is formatted. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is an array of arrays containing the data in the current selection. + */ + getSelectedDataAsync(coercionType: Office.CoercionType.Matrix, options?: GetSelectedDataOptions, callback?: (result: AsyncResult) => void): void; + /** + * Reads the data contained in the current selection in the document. + * + * @remarks + * + * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#selection | Selection} + * + * **Supported application**: PowerPoint + * + * In the callback function that is passed to the getSelectedDataAsync method, you can use the properties of the AsyncResult object to return + * the following information. + * + * + * + * + * + * + * + * + * * * * @@ -5959,6 +6086,31 @@ declare namespace Office { * *
PropertyUse
AsyncResult.valueAccess the selected slides as a {@link Office.SlideRange} object containing the IDs, titles, and indexes of the selected slides.
AsyncResult.status
* + * @param coercionType Must be `Office.CoercionType.SlideRange`. + * @param options Provides options for customizing what data is returned and how it is formatted. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is a {@link Office.SlideRange} object containing the selected slides. + */ + getSelectedDataAsync(coercionType: Office.CoercionType.SlideRange, options?: GetSelectedDataOptions, callback?: (result: AsyncResult) => void): void; + /** + * Reads the data contained in the current selection in the document. + * + * @remarks + * + * **Requirement sets**: + * + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#htmlcoercion | HtmlCoercion} (when using `Office.CoercionType.Html`) + * + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#matrixcoercion | MatrixCoercion} (when using `Office.CoercionType.Matrix`) + * + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#ooxmlcoercion | OoxmlCoercion} (when using `Office.CoercionType.Ooxml`) + * + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#selection | Selection} + * + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#tablecoercion | TableCoercion} (when using `Office.CoercionType.Table`) + * + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#textcoercion | TextCoercion} (when using `Office.CoercionType.Text`) + * * The possible values for the {@link Office.CoercionType} parameter vary by the Office application. * * @@ -5996,10 +6148,37 @@ declare namespace Office { * *
* - * @param coercionType The type of data structure to return. See the Remarks section for each application's supported coercion types. + * In the callback function that is passed to the getSelectedDataAsync method, you can use the properties of the AsyncResult object to return + * the following information. * - * @param options Provides options for customizing what data is returned and how it is formatted. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
PropertyUse
AsyncResult.valueAccess the selected data. The type depends on the coercionType parameter specified in the call.
AsyncResult.statusDetermine the success or failure of the operation.
AsyncResult.errorAccess an Error object that provides error information if the operation failed.
AsyncResult.asyncContextDefine an item of any type that's returned in the AsyncResult object without being altered.
* + * For other coercion types or when the coercion type is not known at compile time, use the generic version of this method + * and specify the type parameter explicitly. + * + * @param coercionType The type of data structure to return. See the Remarks section for each application's supported coercion types. + * @param options Provides options for customizing what data is returned and how it is formatted. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is the data in the current selection. * This is returned in the data structure or format you specified with the coercionType parameter. @@ -6013,17 +6192,55 @@ declare namespace Office { * * **Requirement sets**: * - * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#htmlcoercion | HtmlCoercion} (when using `Office.CoercionType.Html`) + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#selection | Selection} * - * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#matrixcoercion | MatrixCoercion} (when using `Office.CoercionType.Matrix`) + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#textcoercion | TextCoercion} * - * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#ooxmlcoercion | OoxmlCoercion} (when using `Office.CoercionType.Ooxml`) + * **Supported applications**: Excel, PowerPoint, Project, Word + * + * In the callback function that is passed to the getSelectedDataAsync method, you can use the properties of the AsyncResult object to return + * the following information. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
PropertyUse
AsyncResult.valueAccess the selected data as a string. If the selection does not contain text, returns an empty string.
AsyncResult.statusDetermine the success or failure of the operation.
AsyncResult.errorAccess an Error object that provides error information if the operation failed.
AsyncResult.asyncContextDefine an item of any type that's returned in the AsyncResult object without being altered.
+ * + * @param coercionType Must be `Office.CoercionType.Text`. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is a string containing the selected text. + */ + getSelectedDataAsync(coercionType: Office.CoercionType.Text, callback?: (result: AsyncResult) => void): void; + /** + * Reads the data contained in the current selection in the document. + * + * @remarks + * + * **Requirement sets**: * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#selection | Selection} * - * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#tablecoercion | TableCoercion} (when using `Office.CoercionType.Table`) + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#tablecoercion | TableCoercion} * - * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#textcoercion | TextCoercion} (when using `Office.CoercionType.Text`) + * **Supported applications**: Excel, Word * * In the callback function that is passed to the getSelectedDataAsync method, you can use the properties of the AsyncResult object to return * the following information. @@ -6035,7 +6252,51 @@ declare namespace Office { * * * AsyncResult.value - * Always returns undefined because there's no object or data to retrieve. + * Access the selected data as a {@link Office.TableData} object. Returns null if no table is selected. + * + * + * AsyncResult.status + * Determine the success or failure of the operation. + * + * + * AsyncResult.error + * Access an Error object that provides error information if the operation failed. + * + * + * AsyncResult.asyncContext + * Define an item of any type that's returned in the AsyncResult object without being altered. + * + * + * + * @param coercionType Must be `Office.CoercionType.Table`. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is a {@link Office.TableData} object containing the data in the current selection. + */ + getSelectedDataAsync(coercionType: Office.CoercionType.Table, callback?: (result: AsyncResult) => void): void; + /** + * Reads the data contained in the current selection in the document. + * + * @remarks + * + * **Requirement sets**: + * + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#selection | Selection} + * + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#matrixcoercion | MatrixCoercion} + * + * **Supported applications**: Excel, Word + * + * In the callback function that is passed to the getSelectedDataAsync method, you can use the properties of the AsyncResult object to return + * the following information. + * + * + * + * + * + * + * + * + * * * * @@ -6051,6 +6312,70 @@ declare namespace Office { * *
PropertyUse
AsyncResult.valueAccess the selected data as an array of arrays. Returns an empty array if no data is selected.
AsyncResult.status
* + * @param coercionType Must be `Office.CoercionType.Matrix`. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is an array of arrays containing the data in the current selection. + */ + getSelectedDataAsync(coercionType: Office.CoercionType.Matrix, callback?: (result: AsyncResult) => void): void; + /** + * Reads the data contained in the current selection in the document. + * + * @remarks + * + * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#selection | Selection} + * + * **Supported application**: PowerPoint + * + * In the callback function that is passed to the getSelectedDataAsync method, you can use the properties of the AsyncResult object to return + * the following information. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
PropertyUse
AsyncResult.valueAccess the selected slides as a {@link Office.SlideRange} object containing the IDs, titles, and indexes of the selected slides.
AsyncResult.statusDetermine the success or failure of the operation.
AsyncResult.errorAccess an Error object that provides error information if the operation failed.
AsyncResult.asyncContextDefine an item of any type that's returned in the AsyncResult object without being altered.
+ * + * @param coercionType Must be `Office.CoercionType.SlideRange`. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is a {@link Office.SlideRange} object containing the selected slides. + */ + getSelectedDataAsync(coercionType: Office.CoercionType.SlideRange, callback?: (result: AsyncResult) => void): void; + /** + * Reads the data contained in the current selection in the document. + * + * @remarks + * + * **Requirement sets**: + * + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#htmlcoercion | HtmlCoercion} (when using `Office.CoercionType.Html`) + * + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#matrixcoercion | MatrixCoercion} (when using `Office.CoercionType.Matrix`) + * + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#ooxmlcoercion | OoxmlCoercion} (when using `Office.CoercionType.Ooxml`) + * + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#selection | Selection} + * + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#tablecoercion | TableCoercion} (when using `Office.CoercionType.Table`) + * + * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#textcoercion | TextCoercion} (when using `Office.CoercionType.Text`) + * * The possible values for the {@link Office.CoercionType} parameter vary by the Office application. * * @@ -6088,6 +6413,35 @@ declare namespace Office { * *
* + * In the callback function that is passed to the getSelectedDataAsync method, you can use the properties of the AsyncResult object to return + * the following information. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
PropertyUse
AsyncResult.valueAccess the selected data. The type depends on the coercionType parameter specified in the call.
AsyncResult.statusDetermine the success or failure of the operation.
AsyncResult.errorAccess an Error object that provides error information if the operation failed.
AsyncResult.asyncContextDefine an item of any type that's returned in the AsyncResult object without being altered.
+ * + * For other coercion types or when the coercion type is not known at compile time, use the generic version of this method + * and specify the type parameter explicitly. + * * @param coercionType The type of data structure to return. See the Remarks section for each application's supported coercion types. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is the data in the current selection. @@ -8583,6 +8937,36 @@ declare namespace Office { */ rows: any[][]; } + /** + * Represents a single slide in a PowerPoint presentation. + * This interface is used as part of the {@link Office.SlideRange} object returned by + * {@link Office.Document.getSelectedDataAsync} when called with {@link Office.CoercionType.SlideRange}. + */ + interface Slide { + /** + * Gets the unique ID of the slide. + */ + id: number; + /** + * Gets the title of the slide. + */ + title: string; + /** + * Gets the 1-based index of the slide within the presentation. + */ + index: number; + } + /** + * Represents the selected slides in a PowerPoint presentation. + * This object is returned when calling {@link Office.Document.getSelectedDataAsync} with {@link Office.CoercionType.SlideRange} in PowerPoint. + * + */ + interface SlideRange { + /** + * Gets an array of the selected slides. + */ + slides: Slide[]; + } /** * Provides methods to manage the task pane of an add-in. * @@ -22572,7 +22956,7 @@ declare namespace Office { * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * - * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read + * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * @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. @@ -22590,7 +22974,7 @@ declare namespace Office { * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * - * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read + * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * @param callback - Optional. When the method completes, the function passed in the `callback` parameter is called with a single parameter, * `asyncResult`, which is an `Office.AsyncResult` object. The `value` property of the result is a `Recurrence` object. @@ -38317,6 +38701,7 @@ declare namespace Excel { /** * Moves cell values, formatting, and formulas from current range to the destination range, replacing the old information in those cells. The destination range will be expanded automatically if it is smaller than the current range. Any cells in the destination range that are outside of the original range's area are not changed. + Note: When a range is moved to a new address using this API, the new range object should be retrieved using the new address. * * @remarks * [Api set: ExcelApi 1.11]