From 6827cd63a3b39195011f3ccb9865baf2bd0e3b5d Mon Sep 17 00:00:00 2001 From: David Chesnut Date: Fri, 8 May 2026 11:39:23 -0700 Subject: [PATCH] [office-js-preview]Add PowerPoint sensitivity label APIs (#74970) --- types/office-js-preview/index.d.ts | 920 +++++++++++++++++++++++++---- 1 file changed, 815 insertions(+), 105 deletions(-) diff --git a/types/office-js-preview/index.d.ts b/types/office-js-preview/index.d.ts index 261d8526edae21..9d6d24e4705e9d 100644 --- a/types/office-js-preview/index.d.ts +++ b/types/office-js-preview/index.d.ts @@ -187967,6 +187967,65 @@ declare namespace PowerPoint { [key: string]: string; }; } + /** + * Provides methods to check the status of the catalog of sensitivity labels in PowerPoint + and retrieve all available sensitivity labels if the catalog is enabled. + * + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + class SensitivityLabelsCatalog extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; + /** + * Gets whether the catalog of sensitivity labels is enabled in PowerPoint. + * + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly getLabelingCapability: PowerPoint.LabelingCapability | "NoLicense" | "LabelingDisabled" | "LabelingPolicyNotFound" | "LabelingEnabled"; + /** + * Gets sensitivity labels that are available to the current user. + * + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + * @returns The current object. + */ + getLabels(): PowerPoint.SensitivityLabelDetailsCollection; + /** + * Queues up a command to load the specified properties of the object. You must call `context.sync()` before reading the properties. + * + * @param options Provides options for which properties of the object to load. + */ + load(options?: PowerPoint.Interfaces.SensitivityLabelsCatalogLoadOptions): PowerPoint.SensitivityLabelsCatalog; + /** + * Queues up a command to load the specified properties of the object. You must call `context.sync()` before reading the properties. + * + * @param propertyNames A comma-delimited string or an array of strings that specify the properties to load. + */ + load(propertyNames?: string | string[]): PowerPoint.SensitivityLabelsCatalog; + /** + * Queues up a command to load the specified properties of the object. You must call `context.sync()` before reading the properties. + * + * @param propertyNamesAndPaths `propertyNamesAndPaths.select` is a comma-delimited string that specifies the properties to load, and `propertyNamesAndPaths.expand` is a comma-delimited string that specifies the navigation properties to load. + */ + load(propertyNamesAndPaths?: { + select?: string; + expand?: string; + }): PowerPoint.SensitivityLabelsCatalog; + /** + * Create a new instance of the `PowerPoint.SensitivityLabelsCatalog` object. + */ + static newObject(context: OfficeExtension.ClientRequestContext): PowerPoint.SensitivityLabelsCatalog; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that's passed to it.) + * Whereas the original `PowerPoint.SensitivityLabelsCatalog` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `PowerPoint.Interfaces.SensitivityLabelsCatalogData`) that contains shallow copies of any loaded child properties from the original object. + */ + toJSON(): PowerPoint.Interfaces.SensitivityLabelsCatalogData; + } /** * The `Presentation` object is the top-level object with one or more slides that contain the contents of the presentation. To learn more about the PowerPoint object model, @@ -188006,6 +188065,14 @@ declare namespace PowerPoint { * [Api set: PowerPointApi 1.7] */ readonly properties: PowerPoint.DocumentProperties; + /** + * Returns the sensitivity label of the presentation. + * + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly sensitivityLabel: PowerPoint.SensitivityLabel; /** * Returns the collection of `SlideMaster` objects that are in the presentation. * @@ -196789,6 +196856,43 @@ declare namespace PowerPoint { */ targetSlideId?: string; } + /** + * Indicates the labeling capability. + * + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + enum LabelingCapability { + /** + * Represents there's no valid licenses. + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + noLicense = "NoLicense", + /** + * Represents labeling being disabled. + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + labelingDisabled = "LabelingDisabled", + /** + * Represents labeling policy not found. + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + labelingPolicyNotFound = "LabelingPolicyNotFound", + /** + * Represents labeling being enabled. + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + labelingEnabled = "LabelingEnabled", + } /** * Represents the page setup information for the presentation. * @@ -196840,217 +196944,560 @@ declare namespace PowerPoint { toJSON(): PowerPoint.Interfaces.PageSetupData; } /** - * Represents the collection of slides in the presentation. + * Represents the collection of {@link PowerPoint.SensitivityLabelDetails} objects. * * @remarks - * [Api set: PowerPointApi 1.2] + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta */ - class SlideCollection extends OfficeExtension.ClientObject { + class SensitivityLabelDetailsCollection extends OfficeExtension.ClientObject { /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ context: RequestContext; /** Gets the loaded child items in this collection. */ - readonly items: PowerPoint.Slide[]; - /** - * Adds a new slide to the collection. - * - * @remarks - * [Api set: PowerPointApi 1.3] - * - * @param options Optional. Options for configuring the properties of the new slide. - */ - add(options?: PowerPoint.AddSlideOptions): void; - /** - * Exports one or more slides found in this collection to their own presentation file, returned as Base64-encoded data. - Throws an `InvalidArgument` exception if provided slide IDs or `Slide` objects are not found in this collection. - * - * @remarks - * [Api set: PowerPointApi 1.10] - * - * @param values An array of slide IDs or `Slide` objects. - * @returns A Base64-encoded string. - */ - exportAsBase64Presentation(values: Array): OfficeExtension.ClientResult; + readonly items: PowerPoint.SensitivityLabelDetails[]; /** - * Gets the number of slides in the collection. + * Gets the number of {@link PowerPoint.SensitivityLabelDetails} objects in this collection. * * @remarks - * [Api set: PowerPointApi 1.2] - * @returns The number of slides in the collection. + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + * @returns The number of `SensitivityLabelDetails` objects. */ getCount(): OfficeExtension.ClientResult; /** - * Gets a slide using its unique ID. + * Gets the specified `SensitivityLabelDetails` object in this collection. Throws an `ItemNotFound` error if an item with the specified ID isn't found. * * @remarks - * [Api set: PowerPointApi 1.2] + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta * - * @param key The ID of the slide. - * @returns The slide with the unique ID. If such a slide doesn't exist, an error is thrown. + * @param id The ID of the sensitivity label. + * @returns The specified `SensitivityLabelDetails` object. */ - getItem(key: string): PowerPoint.Slide; + getItem(id: string): PowerPoint.SensitivityLabelDetails; /** - * Gets a slide using its zero-based index in the collection. Slides are stored in the same order as they - are shown in the presentation. + * Gets the `SensitivityLabelDetails` object at the specified index in this collection. Throws an `IndexOutOfRange` error if the index is out of range. * * @remarks - * [Api set: PowerPointApi 1.2] + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta * - * @param index The index of the slide in the collection. - * @returns The slide at the given index. An error is thrown if index is out of range. + * @param index The index of the item to retrieve. Zero-indexed. + * @returns The `SensitivityLabelDetails` object at the specified index. */ - getItemAt(index: number): PowerPoint.Slide; + getItemAt(index: number): PowerPoint.SensitivityLabelDetails; /** - * Gets a slide using its unique ID. If such a slide doesn't exist, an object with an `isNullObject` property set to true is returned. For further information, see - {@link https://learn.microsoft.com/office/dev/add-ins/develop/application-specific-api-model#ornullobject-methods-and-properties | *OrNullObject methods and properties}. + * Gets the specified `SensitivityLabelDetails` object in this collection. If an item with the specified ID isn't found, then this method will return an object with its `isNullObject` property set to `true`. For further information, see {@link https://learn.microsoft.com/office/dev/add-ins/develop/application-specific-api-model#ornullobject-methods-and-properties | *OrNullObject methods and properties}. * * @remarks - * [Api set: PowerPointApi 1.2] + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta * - * @param id The ID of the slide. - * @returns The slide with the unique ID. + * @param id The ID of the sensitivity label. + * @returns The specified `SensitivityLabelDetails` object. */ - getItemOrNullObject(id: string): PowerPoint.Slide; + getItemOrNullObject(id: string): PowerPoint.SensitivityLabelDetails; /** * Queues up a command to load the specified properties of the object. You must call `context.sync()` before reading the properties. * * @param options Provides options for which properties of the object to load. */ - load(options?: PowerPoint.Interfaces.SlideCollectionLoadOptions & PowerPoint.Interfaces.CollectionLoadOptions): PowerPoint.SlideCollection; + load(options?: PowerPoint.Interfaces.SensitivityLabelDetailsCollectionLoadOptions & PowerPoint.Interfaces.CollectionLoadOptions): PowerPoint.SensitivityLabelDetailsCollection; /** * Queues up a command to load the specified properties of the object. You must call `context.sync()` before reading the properties. * * @param propertyNames A comma-delimited string or an array of strings that specify the properties to load. */ - load(propertyNames?: string | string[]): PowerPoint.SlideCollection; + load(propertyNames?: string | string[]): PowerPoint.SensitivityLabelDetailsCollection; /** * Queues up a command to load the specified properties of the object. You must call `context.sync()` before reading the properties. * * @param propertyNamesAndPaths `propertyNamesAndPaths.select` is a comma-delimited string that specifies the properties to load, and `propertyNamesAndPaths.expand` is a comma-delimited string that specifies the navigation properties to load. */ - load(propertyNamesAndPaths?: OfficeExtension.LoadOption): PowerPoint.SlideCollection; + load(propertyNamesAndPaths?: OfficeExtension.LoadOption): PowerPoint.SensitivityLabelDetailsCollection; /** * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that's passed to it.) - * Whereas the original `PowerPoint.SlideCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `PowerPoint.Interfaces.SlideCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + * Whereas the original `PowerPoint.SensitivityLabelDetailsCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `PowerPoint.Interfaces.SensitivityLabelDetailsCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. */ - toJSON(): PowerPoint.Interfaces.SlideCollectionData; + toJSON(): PowerPoint.Interfaces.SensitivityLabelDetailsCollectionData; } /** - * Represents a collection of slides in the presentation. + * Represents the protection type. * * @remarks - * [Api set: PowerPointApi 1.5] + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta */ - class SlideScopedCollection extends OfficeExtension.ClientObject { + enum SensitivityLabelProtectionType { + /** + * No protection is applied by this label. + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + noProtection = "NoProtection", + /** + * Protection is defined by an administrator. + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + adminDefined = "AdminDefined", + /** + * Protection is defined by the user. + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + userDefined = "UserDefined", + } + /** + * Represents the properties of available sensitivity labels in PowerPoint. + * + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + class SensitivityLabelDetails extends OfficeExtension.ClientObject { /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ context: RequestContext; - /** Gets the loaded child items in this collection. */ - readonly items: PowerPoint.Slide[]; /** - * Exports all slides in this collection to their own presentation file, returned as Base64-encoded data. + * Gets the sublabels of the sensitivity label. * * @remarks - * [Api set: PowerPointApi 1.10] - * @returns A Base64-encoded string. + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta */ - exportAsBase64Presentation(): OfficeExtension.ClientResult; + readonly children: PowerPoint.SensitivityLabelDetailsCollection; /** - * Gets the number of slides in the collection. + * Gets the color of the sensitivity label. * * @remarks - * [Api set: PowerPointApi 1.5] - * @returns The number of slides in the collection. + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta */ - getCount(): OfficeExtension.ClientResult; + readonly color: string; /** - * Gets a slide using its unique ID. + * Gets the unique ID of the sensitivity label. * * @remarks - * [Api set: PowerPointApi 1.5] + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly id: string; + /** + * Gets a value indicating whether the label is enabled. * - * @param key The ID of the slide. - * @returns The slide with the unique ID. If such a slide doesn't exist, an error is thrown. + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta */ - getItem(key: string): PowerPoint.Slide; + readonly isEnabled: boolean; /** - * Gets a slide using its zero-based index in the collection. + * Gets the name of the sensitivity label. * * @remarks - * [Api set: PowerPointApi 1.5] + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly name: string; + /** + * Gets the priority of the sensitivity label, with 0 as lowest priority. * - * @param index The index of the slide in the collection. - * @returns The slide at the given index. An error is thrown if index is out of range. + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta */ - getItemAt(index: number): PowerPoint.Slide; + readonly order: number; /** - * Gets a slide using its unique ID. If such a slide doesn't exist, an object with an `isNullObject` property set to true is returned. For further information, see - {@link https://learn.microsoft.com/office/dev/add-ins/develop/application-specific-api-model#ornullobject-methods-and-properties | *OrNullObject methods and properties}. + * Gets a value indicating the protection type provided by this label. * * @remarks - * [Api set: PowerPointApi 1.5] + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly protectionType: PowerPoint.SensitivityLabelProtectionType | "NoProtection" | "AdminDefined" | "UserDefined"; + /** + * Gets the unique ID of the tenant which the sensitivity label is belonged. * - * @param id The ID of the slide. - * @returns The slide with the unique ID. + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta */ - getItemOrNullObject(id: string): PowerPoint.Slide; + readonly siteId: string; + /** + * Gets the description of the sensitivity label. + * + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly tooltip: string; /** * Queues up a command to load the specified properties of the object. You must call `context.sync()` before reading the properties. * * @param options Provides options for which properties of the object to load. */ - load(options?: PowerPoint.Interfaces.SlideScopedCollectionLoadOptions & PowerPoint.Interfaces.CollectionLoadOptions): PowerPoint.SlideScopedCollection; + load(options?: PowerPoint.Interfaces.SensitivityLabelDetailsLoadOptions): PowerPoint.SensitivityLabelDetails; /** * Queues up a command to load the specified properties of the object. You must call `context.sync()` before reading the properties. * * @param propertyNames A comma-delimited string or an array of strings that specify the properties to load. */ - load(propertyNames?: string | string[]): PowerPoint.SlideScopedCollection; + load(propertyNames?: string | string[]): PowerPoint.SensitivityLabelDetails; /** * Queues up a command to load the specified properties of the object. You must call `context.sync()` before reading the properties. * * @param propertyNamesAndPaths `propertyNamesAndPaths.select` is a comma-delimited string that specifies the properties to load, and `propertyNamesAndPaths.expand` is a comma-delimited string that specifies the navigation properties to load. */ - load(propertyNamesAndPaths?: OfficeExtension.LoadOption): PowerPoint.SlideScopedCollection; + load(propertyNamesAndPaths?: { + select?: string; + expand?: string; + }): PowerPoint.SensitivityLabelDetails; /** * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that's passed to it.) - * Whereas the original `PowerPoint.SlideScopedCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `PowerPoint.Interfaces.SlideScopedCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + * Whereas the original `PowerPoint.SensitivityLabelDetails` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `PowerPoint.Interfaces.SensitivityLabelDetailsData`) that contains shallow copies of any loaded child properties from the original object. */ - toJSON(): PowerPoint.Interfaces.SlideScopedCollectionData; + toJSON(): PowerPoint.Interfaces.SensitivityLabelDetailsData; } /** - * Provides information about the slide selection changed event. + * Represents the result of updating the sensitivity label on the presentation. * * @remarks * [Api set: PowerPointApi BETA (PREVIEW ONLY)] * @beta */ - interface SlideSelectionChangedEventArgs { + enum SensitivityLabelUpdateResult { /** - * Gets the array of IDs of the currently selected slides. - * + * The sensitivity label was successfully updated. * @remarks * [Api set: PowerPointApi BETA (PREVIEW ONLY)] * @beta */ - slideIds: string[]; - } - /** - * Represents the collection of Slide Masters in the presentation. - * - * @remarks - * [Api set: PowerPointApi 1.3] - */ - class SlideMasterCollection extends OfficeExtension.ClientObject { - /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ - context: RequestContext; - /** Gets the loaded child items in this collection. */ - readonly items: PowerPoint.SlideMaster[]; + success = "Success", /** - * Gets the number of Slide Masters in the collection. - * + * The update failed due to an unspecified error. * @remarks - * [Api set: PowerPointApi 1.3] - * @returns The number of Slide Masters in the collection. - */ + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + unspecifiedFailure = "UnspecifiedFailure", + /** + * The specified sensitivity label could not be found. + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + labelNotFound = "LabelNotFound", + /** + * The presentation is read-only and cannot be modified. + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + documentReadOnly = "DocumentReadOnly", + /** + * The user does not have sufficient permissions to update the label. + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + insufficientPermission = "InsufficientPermission", + /** + * The label update failed due to unsupported Double Key Encryption (DKE). + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + unsupportedDoubleKeyEncryption = "UnsupportedDoubleKeyEncryption", + /** + * The label update failed because native labeling is not enabled for the user or installed SKU. + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + labelingDisabled = "LabelingDisabled", + /** + * The label update failed because the user's identity is not valid for applying a label. + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + userNotFound = "UserNotFound", + /** + * The label update failed due to unsupported User Defined Permissions (UDP). + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + unsupportedUdp = "UnsupportedUdp", + /** + * The label update failed because the specified label is a parent label, which cannot be applied. + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + parentLabelNotSupported = "ParentLabelNotSupported", + /** + * The label update failed because the document doesn't belong to the same tenant as the user. + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + crossTenant = "CrossTenant", + } + /** + * Represents the sensitivity label on the presentation. + * + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + class SensitivityLabel extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; + /** + * Gets the current label information that exists on the presentation for the user. + If there's no sensitivity label on the current presentation, an object with an `isNullObject` property set to `true` is returned. + For further information, see {@link https://learn.microsoft.com/office/dev/add-ins/develop/application-specific-api-model#ornullobject-methods-and-properties | *OrNullObject methods and properties}. + * + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + * @returns The current `SensitivityLabelDetails` object. + */ + getCurrentOrNullObject(): PowerPoint.SensitivityLabelDetails; + /** + * Tries to update to the provided sensitivity label on the presentation for the user. + * + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + * + * @param labelId The ID of the label to apply. + * @returns The `SensitivityLabelUpdateResult` object. + */ + tryToUpdate(labelId: string): OfficeExtension.ClientResult; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that's passed to it.) + * Whereas the original `PowerPoint.SensitivityLabel` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `PowerPoint.Interfaces.SensitivityLabelData`) that contains shallow copies of any loaded child properties from the original object. + */ + toJSON(): { + [key: string]: string; + }; + } + /** + * Represents the collection of slides in the presentation. + * + * @remarks + * [Api set: PowerPointApi 1.2] + */ + class SlideCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; + /** Gets the loaded child items in this collection. */ + readonly items: PowerPoint.Slide[]; + /** + * Adds a new slide to the collection. + * + * @remarks + * [Api set: PowerPointApi 1.3] + * + * @param options Optional. Options for configuring the properties of the new slide. + */ + add(options?: PowerPoint.AddSlideOptions): void; + /** + * Exports one or more slides found in this collection to their own presentation file, returned as Base64-encoded data. + Throws an `InvalidArgument` exception if provided slide IDs or `Slide` objects are not found in this collection. + * + * @remarks + * [Api set: PowerPointApi 1.10] + * + * @param values An array of slide IDs or `Slide` objects. + * @returns A Base64-encoded string. + */ + exportAsBase64Presentation(values: Array): OfficeExtension.ClientResult; + /** + * Gets the number of slides in the collection. + * + * @remarks + * [Api set: PowerPointApi 1.2] + * @returns The number of slides in the collection. + */ + getCount(): OfficeExtension.ClientResult; + /** + * Gets a slide using its unique ID. + * + * @remarks + * [Api set: PowerPointApi 1.2] + * + * @param key The ID of the slide. + * @returns The slide with the unique ID. If such a slide doesn't exist, an error is thrown. + */ + getItem(key: string): PowerPoint.Slide; + /** + * Gets a slide using its zero-based index in the collection. Slides are stored in the same order as they + are shown in the presentation. + * + * @remarks + * [Api set: PowerPointApi 1.2] + * + * @param index The index of the slide in the collection. + * @returns The slide at the given index. An error is thrown if index is out of range. + */ + getItemAt(index: number): PowerPoint.Slide; + /** + * Gets a slide using its unique ID. If such a slide doesn't exist, an object with an `isNullObject` property set to true is returned. For further information, see + {@link https://learn.microsoft.com/office/dev/add-ins/develop/application-specific-api-model#ornullobject-methods-and-properties | *OrNullObject methods and properties}. + * + * @remarks + * [Api set: PowerPointApi 1.2] + * + * @param id The ID of the slide. + * @returns The slide with the unique ID. + */ + getItemOrNullObject(id: string): PowerPoint.Slide; + /** + * Queues up a command to load the specified properties of the object. You must call `context.sync()` before reading the properties. + * + * @param options Provides options for which properties of the object to load. + */ + load(options?: PowerPoint.Interfaces.SlideCollectionLoadOptions & PowerPoint.Interfaces.CollectionLoadOptions): PowerPoint.SlideCollection; + /** + * Queues up a command to load the specified properties of the object. You must call `context.sync()` before reading the properties. + * + * @param propertyNames A comma-delimited string or an array of strings that specify the properties to load. + */ + load(propertyNames?: string | string[]): PowerPoint.SlideCollection; + /** + * Queues up a command to load the specified properties of the object. You must call `context.sync()` before reading the properties. + * + * @param propertyNamesAndPaths `propertyNamesAndPaths.select` is a comma-delimited string that specifies the properties to load, and `propertyNamesAndPaths.expand` is a comma-delimited string that specifies the navigation properties to load. + */ + load(propertyNamesAndPaths?: OfficeExtension.LoadOption): PowerPoint.SlideCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that's passed to it.) + * Whereas the original `PowerPoint.SlideCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `PowerPoint.Interfaces.SlideCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ + toJSON(): PowerPoint.Interfaces.SlideCollectionData; + } + /** + * Represents a collection of slides in the presentation. + * + * @remarks + * [Api set: PowerPointApi 1.5] + */ + class SlideScopedCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; + /** Gets the loaded child items in this collection. */ + readonly items: PowerPoint.Slide[]; + /** + * Exports all slides in this collection to their own presentation file, returned as Base64-encoded data. + * + * @remarks + * [Api set: PowerPointApi 1.10] + * @returns A Base64-encoded string. + */ + exportAsBase64Presentation(): OfficeExtension.ClientResult; + /** + * Gets the number of slides in the collection. + * + * @remarks + * [Api set: PowerPointApi 1.5] + * @returns The number of slides in the collection. + */ + getCount(): OfficeExtension.ClientResult; + /** + * Gets a slide using its unique ID. + * + * @remarks + * [Api set: PowerPointApi 1.5] + * + * @param key The ID of the slide. + * @returns The slide with the unique ID. If such a slide doesn't exist, an error is thrown. + */ + getItem(key: string): PowerPoint.Slide; + /** + * Gets a slide using its zero-based index in the collection. + * + * @remarks + * [Api set: PowerPointApi 1.5] + * + * @param index The index of the slide in the collection. + * @returns The slide at the given index. An error is thrown if index is out of range. + */ + getItemAt(index: number): PowerPoint.Slide; + /** + * Gets a slide using its unique ID. If such a slide doesn't exist, an object with an `isNullObject` property set to true is returned. For further information, see + {@link https://learn.microsoft.com/office/dev/add-ins/develop/application-specific-api-model#ornullobject-methods-and-properties | *OrNullObject methods and properties}. + * + * @remarks + * [Api set: PowerPointApi 1.5] + * + * @param id The ID of the slide. + * @returns The slide with the unique ID. + */ + getItemOrNullObject(id: string): PowerPoint.Slide; + /** + * Queues up a command to load the specified properties of the object. You must call `context.sync()` before reading the properties. + * + * @param options Provides options for which properties of the object to load. + */ + load(options?: PowerPoint.Interfaces.SlideScopedCollectionLoadOptions & PowerPoint.Interfaces.CollectionLoadOptions): PowerPoint.SlideScopedCollection; + /** + * Queues up a command to load the specified properties of the object. You must call `context.sync()` before reading the properties. + * + * @param propertyNames A comma-delimited string or an array of strings that specify the properties to load. + */ + load(propertyNames?: string | string[]): PowerPoint.SlideScopedCollection; + /** + * Queues up a command to load the specified properties of the object. You must call `context.sync()` before reading the properties. + * + * @param propertyNamesAndPaths `propertyNamesAndPaths.select` is a comma-delimited string that specifies the properties to load, and `propertyNamesAndPaths.expand` is a comma-delimited string that specifies the navigation properties to load. + */ + load(propertyNamesAndPaths?: OfficeExtension.LoadOption): PowerPoint.SlideScopedCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that's passed to it.) + * Whereas the original `PowerPoint.SlideScopedCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `PowerPoint.Interfaces.SlideScopedCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ + toJSON(): PowerPoint.Interfaces.SlideScopedCollectionData; + } + /** + * Provides information about the slide selection changed event. + * + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + interface SlideSelectionChangedEventArgs { + /** + * Gets the array of IDs of the currently selected slides. + * + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + slideIds: string[]; + } + /** + * Represents the collection of Slide Masters in the presentation. + * + * @remarks + * [Api set: PowerPointApi 1.3] + */ + class SlideMasterCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; + /** Gets the loaded child items in this collection. */ + readonly items: PowerPoint.SlideMaster[]; + /** + * Gets the number of Slide Masters in the collection. + * + * @remarks + * [Api set: PowerPointApi 1.3] + * @returns The number of Slide Masters in the collection. + */ getCount(): OfficeExtension.ClientResult; /** * Gets a Slide Master using its unique ID. @@ -197967,6 +198414,10 @@ declare namespace PowerPoint { */ slideWidth?: number; } + /** An interface for updating data on the `SensitivityLabelDetailsCollection` object, for use in `sensitivityLabelDetailsCollection.set({ ... })`. */ + interface SensitivityLabelDetailsCollectionUpdateData { + items?: PowerPoint.Interfaces.SensitivityLabelDetailsData[]; + } /** An interface for updating data on the `SlideCollection` object, for use in `slideCollection.set({ ... })`. */ interface SlideCollectionUpdateData { items?: PowerPoint.Interfaces.SlideData[]; @@ -197979,6 +198430,17 @@ declare namespace PowerPoint { interface SlideMasterCollectionUpdateData { items?: PowerPoint.Interfaces.SlideMasterData[]; } + /** An interface describing the data returned by calling `sensitivityLabelsCatalog.toJSON()`. */ + interface SensitivityLabelsCatalogData { + /** + * Gets whether the catalog of sensitivity labels is enabled in PowerPoint. + * + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + getLabelingCapability?: PowerPoint.LabelingCapability | "NoLicense" | "LabelingDisabled" | "LabelingPolicyNotFound" | "LabelingEnabled"; + } /** An interface describing the data returned by calling `presentation.toJSON()`. */ interface PresentationData { /** @@ -199168,6 +199630,77 @@ declare namespace PowerPoint { */ slideWidth?: number; } + /** An interface describing the data returned by calling `sensitivityLabelDetailsCollection.toJSON()`. */ + interface SensitivityLabelDetailsCollectionData { + items?: PowerPoint.Interfaces.SensitivityLabelDetailsData[]; + } + /** An interface describing the data returned by calling `sensitivityLabelDetails.toJSON()`. */ + interface SensitivityLabelDetailsData { + /** + * Gets the color of the sensitivity label. + * + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + color?: string; + /** + * Gets the unique ID of the sensitivity label. + * + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + id?: string; + /** + * Gets a value indicating whether the label is enabled. + * + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + isEnabled?: boolean; + /** + * Gets the name of the sensitivity label. + * + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + name?: string; + /** + * Gets the priority of the sensitivity label, with 0 as lowest priority. + * + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + order?: number; + /** + * Gets a value indicating the protection type provided by this label. + * + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + protectionType?: PowerPoint.SensitivityLabelProtectionType | "NoProtection" | "AdminDefined" | "UserDefined"; + /** + * Gets the unique ID of the tenant which the sensitivity label is belonged. + * + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + siteId?: string; + /** + * Gets the description of the sensitivity label. + * + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + tooltip?: string; + } /** An interface describing the data returned by calling `slideCollection.toJSON()`. */ interface SlideCollectionData { items?: PowerPoint.Interfaces.SlideData[]; @@ -199180,6 +199713,28 @@ declare namespace PowerPoint { interface SlideMasterCollectionData { items?: PowerPoint.Interfaces.SlideMasterData[]; } + /** + * Provides methods to check the status of the catalog of sensitivity labels in PowerPoint + and retrieve all available sensitivity labels if the catalog is enabled. + * + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + interface SensitivityLabelsCatalogLoadOptions { + /** + Specifying `$all` for the load options loads all the scalar properties (such as `Range.address`) but not the navigational properties (such as `Range.format.fill.color`). + */ + $all?: boolean; + /** + * Gets whether the catalog of sensitivity labels is enabled in PowerPoint. + * + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + getLabelingCapability?: boolean; + } /** * The `Presentation` object is the top-level object with one or more slides that contain the contents of the presentation. To learn more about the PowerPoint object model, @@ -201698,6 +202253,160 @@ declare namespace PowerPoint { */ slideWidth?: boolean; } + /** + * Represents the collection of {@link PowerPoint.SensitivityLabelDetails} objects. + * + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + interface SensitivityLabelDetailsCollectionLoadOptions { + /** + Specifying `$all` for the load options loads all the scalar properties (such as `Range.address`) but not the navigational properties (such as `Range.format.fill.color`). + */ + $all?: boolean; + /** + * For EACH ITEM in the collection: Gets the color of the sensitivity label. + * + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + color?: boolean; + /** + * For EACH ITEM in the collection: Gets the unique ID of the sensitivity label. + * + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + id?: boolean; + /** + * For EACH ITEM in the collection: Gets a value indicating whether the label is enabled. + * + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + isEnabled?: boolean; + /** + * For EACH ITEM in the collection: Gets the name of the sensitivity label. + * + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + name?: boolean; + /** + * For EACH ITEM in the collection: Gets the priority of the sensitivity label, with 0 as lowest priority. + * + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + order?: boolean; + /** + * For EACH ITEM in the collection: Gets a value indicating the protection type provided by this label. + * + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + protectionType?: boolean; + /** + * For EACH ITEM in the collection: Gets the unique ID of the tenant which the sensitivity label is belonged. + * + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + siteId?: boolean; + /** + * For EACH ITEM in the collection: Gets the description of the sensitivity label. + * + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + tooltip?: boolean; + } + /** + * Represents the properties of available sensitivity labels in PowerPoint. + * + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + interface SensitivityLabelDetailsLoadOptions { + /** + Specifying `$all` for the load options loads all the scalar properties (such as `Range.address`) but not the navigational properties (such as `Range.format.fill.color`). + */ + $all?: boolean; + /** + * Gets the color of the sensitivity label. + * + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + color?: boolean; + /** + * Gets the unique ID of the sensitivity label. + * + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + id?: boolean; + /** + * Gets a value indicating whether the label is enabled. + * + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + isEnabled?: boolean; + /** + * Gets the name of the sensitivity label. + * + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + name?: boolean; + /** + * Gets the priority of the sensitivity label, with 0 as lowest priority. + * + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + order?: boolean; + /** + * Gets a value indicating the protection type provided by this label. + * + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + protectionType?: boolean; + /** + * Gets the unique ID of the tenant which the sensitivity label is belonged. + * + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + siteId?: boolean; + /** + * Gets the description of the sensitivity label. + * + * @remarks + * [Api set: PowerPointApi BETA (PREVIEW ONLY)] + * @beta + */ + tooltip?: boolean; + } /** * Represents the collection of slides in the presentation. * @@ -201835,6 +202544,7 @@ declare namespace PowerPoint { constructor(url?: string); readonly presentation: Presentation; readonly application: Application; + readonly sensitivityLabelsCatalog: any; } /** * Executes a batch script that performs actions on the PowerPoint object model, using a new RequestContext. When the promise is resolved, any tracked objects that were automatically allocated during execution will be released.