diff --git a/types/office-js-preview/index.d.ts b/types/office-js-preview/index.d.ts index 2abeb0afd159da..2d623f5c32160b 100644 --- a/types/office-js-preview/index.d.ts +++ b/types/office-js-preview/index.d.ts @@ -26347,7 +26347,6 @@ declare namespace OfficeCore { /////////////////////// Begin Excel APIs /////////////////////// //////////////////////////////////////////////////////////////// - declare namespace Excel { /** * Represents an unknown cell control. @@ -35498,6 +35497,10 @@ declare namespace Excel { * [Api set: ExcelApi 1.5] */ readonly runtime: Runtime; + /** + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + */ + readonly sensitivityLabelsCatalog: SensitivityLabelsCatalog; } interface RunOptions extends OfficeExtension.RunOptions { /** @@ -35548,8 +35551,416 @@ declare namespace Excel { * @param batch - A function that takes in a RequestContext and returns a promise (typically, just the result of "context.sync()"). The context parameter facilitates requests to the Excel application. Since the Office add-in and the Excel application run in two different processes, the RequestContext is required to get access to the Excel object model from the add-in. */ function run(context: OfficeExtension.ClientRequestContext, batch: (context: Excel.RequestContext) => Promise): Promise; - function postprocessBindingDescriptor(response: any): any; - function getDataCommonPostprocess(response: any, callArgs: any): any; + /** + * Represents the labeling capability status of the sensitivity label catalog. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + enum LabelingCapability { + /** + * No valid license is available for sensitivity labeling. + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + noLicense = "NoLicense", + /** + * Sensitivity labeling is disabled for the user or tenant. + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + labelingDisabled = "LabelingDisabled", + /** + * No labeling policy was found for the user. + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + labelingPolicyNotFound = "LabelingPolicyNotFound", + /** + * Sensitivity labeling is fully enabled. + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + labelingEnabled = "LabelingEnabled" + } + /** + * Represents the sensitivity label on the workbook. + * + * @remarks + * [Api set: ExcelApi 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 workbook for the user. + If there's no sensitivity label on the current workbook, 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: ExcelApi BETA (PREVIEW ONLY)] + * @beta + * @returns The current `SensitivityLabelDetails` object. + */ + getCurrentOrNullObject(): Excel.SensitivityLabelDetails; + /** + * Tries to update to the provided sensitivity label on the workbook for the user. + * + * @remarks + * [Api set: ExcelApi 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 `Excel.SensitivityLabel` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.SensitivityLabelData`) that contains shallow copies of any loaded child properties from the original object. + */ + toJSON(): { + [key: string]: string; + }; + } + /** + * Represents the properties of available sensitivity labels in Excel. + * + * @remarks + * [Api set: ExcelApi 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 sublabels of the sensitivity label. Returns `null` if a label doesn't have any sublabels. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly children: SensitivityLabelDetailsCollection | null; + /** + * Gets the color of the sensitivity label. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly color: string; + /** + * Gets the unique identifier (GUID) of the sensitivity label. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly id: string; + /** + * Gets a value indicating whether the label is enabled. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly isEnabled: boolean; + /** + * Gets the name of the sensitivity label. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly name: string; + /** + * Gets the priority of the sensitivity label, with 0 as lowest priority. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly order: number; + /** + * Gets a value indicating the protection type provided by this label. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly protectionType: Excel.SensitivityLabelProtectionType | "NoProtection" | "AdminDefined" | "UserDefined"; + /** + * Gets the unique identifier (GUID) of the tenant which the sensitivity label is belonged. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly siteId: string; + /** + * Gets the description of the sensitivity label. + * + * @remarks + * [Api set: ExcelApi 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?: Excel.Interfaces.SensitivityLabelDetailsLoadOptions): Excel.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[]): Excel.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?: { + select?: string; + expand?: string; + }): Excel.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 `Excel.SensitivityLabelDetails` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.SensitivityLabelDetailsData`) that contains shallow copies of any loaded child properties from the original object. + */ + toJSON(): Excel.Interfaces.SensitivityLabelDetailsData; + } + /** + * Represents the collection of {@link Excel.SensitivityLabelDetails} objects. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + 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: Excel.SensitivityLabelDetails[]; + /** + * Gets the first `SensitivityLabelDetails` object in this collection. Throws an `ItemNotFound` error if this collection is empty. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + * @returns A new `SensitivityLabelDetails` object. + */ + getFirst(): Excel.SensitivityLabelDetails; + /** + * Gets the first `SensitivityLabelDetails` object in this collection. If this collection is empty, 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: ExcelApi BETA (PREVIEW ONLY)] + * @beta + * @returns The new `SensitivityLabelDetails` object. + */ + getFirstOrNullObject(): OfficeExtension.ClientResult; + /** + * 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?: Excel.Interfaces.SensitivityLabelDetailsCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.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[]): Excel.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): Excel.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 `Excel.SensitivityLabelDetailsCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.SensitivityLabelDetailsCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ + toJSON(): Excel.Interfaces.SensitivityLabelDetailsCollectionData; + } + /** + * Represents the protection type. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + enum SensitivityLabelProtectionType { + /** + * No protection is applied by this label. + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + noProtection = "NoProtection", + /** + * Protection is defined by an administrator. + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + adminDefined = "AdminDefined", + /** + * Protection is defined by the user. + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + userDefined = "UserDefined" + } + /** + * Represents the result of updating the sensitivity label on the workbook. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + enum SensitivityLabelUpdateResult { + /** + * The sensitivity label was successfully updated. + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + success = "Success", + /** + * The update failed due to an unspecified error. + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + unspecifiedFailure = "UnspecifiedFailure", + /** + * The specified sensitivity label could not be found. + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + labelNotFound = "LabelNotFound", + /** + * The document is read-only and cannot be modified. + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + documentReadOnly = "DocumentReadOnly", + /** + * The user does not have sufficient permissions to update the label. + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + insufficientPermission = "InsufficientPermission", + /** + * The label update failed due to unsupported Double Key Encryption (DKE). + * @remarks + * [Api set: ExcelApi 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: ExcelApi 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: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + userNotFound = "UserNotFound", + /** + * The label update failed due to unsupported User Defined Permissions (UDP). + * @remarks + * [Api set: ExcelApi 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: ExcelApi 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: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + crossTenant = "CrossTenant" + } + /** + * Provides methods to check the status of the catalog of sensitivity labels in Excel and retrieve all available sensitivity labels if the catalog is enabled. + * + * @remarks + * [Api set: ExcelApi 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 Excel. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly getLabelingCapability: Excel.LabelingCapability | "NoLicense" | "LabelingDisabled" | "LabelingPolicyNotFound" | "LabelingEnabled"; + /** + * Gets sensitivity labels that are available to the current user. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + * @returns The current `SensitivityLabelDetailsCollection` object. + */ + getLabels(): Excel.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?: Excel.Interfaces.SensitivityLabelsCatalogLoadOptions): Excel.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[]): Excel.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; + }): Excel.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 `Excel.SensitivityLabelsCatalog` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.SensitivityLabelsCatalogData`) that contains shallow copies of any loaded child properties from the original object. + */ + toJSON(): Excel.Interfaces.SensitivityLabelsCatalogData; + } /** * Provides information about the ranges that raised the `onCalculationBusy` event, which triggers when the calculation is in progress in a worksheet. * @@ -40829,6 +41240,14 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ readonly worksheets: Excel.WorksheetCollection; + /** + * Returns the sensitivity label of the workbook. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly sensitivityLabel: Excel.SensitivityLabel; /** * Specifies if the workbook is in AutoSave mode. * @@ -62217,6 +62636,55 @@ declare namespace Excel { */ toJSON(): Excel.Interfaces.SlicerItemCollectionData; } + /** + * Provides information about the `LinkedEntityCellValue` that was requested given a specified `LinkedEntityId`. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + interface LinkedEntityCellValueLoadedEventArgs { + /** + * Any error encountered during the request to load the `LinkedEntityCellValue`. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + error?: string; + /** + * Gets the `LinkedEntityId` of the requested `LinkedEntityCellValue`. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + id: LinkedEntityId; + /** + * Gets the `LinkedEntityCellValue` of the requested `LinkedEntityId`. If the load operation failed, this property is `null`. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + linkedEntityCellValue?: LinkedEntityCellValue; + /** + * Gets the source of the event. See `Excel.EventSource` for details. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + source: Excel.EventSource | "Local" | "Remote"; + /** + * Gets the type of the event. See `Excel.EventType` for details. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + type: "LinkedEntityDataDomainLinkedEntityCellValueLoaded"; + } /** * Represents a specific category or field of information that shares some common characteristics or attributes. A data domain is linked to a data provider, that acts as the data source for `LinkedEntityCellValue` objects in the workbook. @@ -62517,6 +62985,17 @@ declare namespace Excel { * @returns The linked entity data domain with the given `id`. If there are multiple linked entity data domains with the same `id`, the one defined by this Office Add-in will be returned. */ getItemOrNullObject(id: string): Excel.LinkedEntityDataDomain; + /** + * Submits a request to load the `LinkedEntityCellValue` object with the specified `LinkedEntityId`. + If found, the `LinkedEntityCellValue` object will be returned through the `LinkedEntityCellValueLoaded` event. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + * + * @param id A specific `LinkedEntityId` + */ + loadLinkedEntityCellValue(id: LinkedEntityId): void; /** * Refreshes all `LinkedEntityCellValue` objects of all linked entity data domains in this collection. The refresh request can fail if the data providers are busy or temporarily inaccessible. @@ -62545,6 +63024,16 @@ declare namespace Excel { * @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): Excel.LinkedEntityDataDomainCollection; + /** + * Occurs when the request to load a `LinkedEntityCellValue` is completed. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * + * @eventproperty + * @beta + */ + readonly onLinkedEntityCellValueLoaded: OfficeExtension.EventHandlers; /** * Occurs when a new linked entity data domain is added to the workbook. * @@ -74893,6 +75382,10 @@ declare namespace Excel { */ $skip?: number; } + /** An interface for updating data on the `SensitivityLabelDetailsCollection` object, for use in `sensitivityLabelDetailsCollection.set({ ... })`. */ + interface SensitivityLabelDetailsCollectionUpdateData { + items?: Excel.Interfaces.SensitivityLabelDetailsData[]; + } /** An interface for updating data on the `AllowEditRange` object, for use in `allowEditRange.set({ ... })`. */ interface AllowEditRangeUpdateData { /** @@ -80546,6 +81039,96 @@ declare namespace Excel { interface PaneCollectionUpdateData { items?: Excel.Interfaces.PaneData[]; } + /** An interface describing the data returned by calling `sensitivityLabelDetails.toJSON()`. */ + interface SensitivityLabelDetailsData { + /** + * Gets the sublabels of the sensitivity label. Returns `null` if a label doesn't have any sublabels. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + children?: SensitivityLabelDetailsCollection | null; + /** + * Gets the color of the sensitivity label. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + color?: string; + /** + * Gets the unique identifier (GUID) of the sensitivity label. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + id?: string; + /** + * Gets a value indicating whether the label is enabled. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + isEnabled?: boolean; + /** + * Gets the name of the sensitivity label. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + name?: string; + /** + * Gets the priority of the sensitivity label, with 0 as lowest priority. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + order?: number; + /** + * Gets a value indicating the protection type provided by this label. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + protectionType?: Excel.SensitivityLabelProtectionType | "NoProtection" | "AdminDefined" | "UserDefined"; + /** + * Gets the unique identifier (GUID) of the tenant which the sensitivity label is belonged. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + siteId?: string; + /** + * Gets the description of the sensitivity label. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + tooltip?: string; + } + /** An interface describing the data returned by calling `sensitivityLabelDetailsCollection.toJSON()`. */ + interface SensitivityLabelDetailsCollectionData { + items?: Excel.Interfaces.SensitivityLabelDetailsData[]; + } + /** An interface describing the data returned by calling `sensitivityLabelsCatalog.toJSON()`. */ + interface SensitivityLabelsCatalogData { + /** + * Gets whether the catalog of sensitivity labels is enabled in Excel. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + getLabelingCapability?: Excel.LabelingCapability | "NoLicense" | "LabelingDisabled" | "LabelingPolicyNotFound" | "LabelingEnabled"; + } /** An interface describing the data returned by calling `allowEditRange.toJSON()`. */ interface AllowEditRangeData { /** @@ -88338,6 +88921,197 @@ declare namespace Excel { */ value?: T; } + /** + * Represents the properties of available sensitivity labels in Excel. + * + * @remarks + * [Api set: ExcelApi 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 sublabels of the sensitivity label. Returns `null` if a label doesn't have any sublabels. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + children?: boolean; + /** + * Gets the color of the sensitivity label. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + color?: boolean; + /** + * Gets the unique identifier (GUID) of the sensitivity label. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + id?: boolean; + /** + * Gets a value indicating whether the label is enabled. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + isEnabled?: boolean; + /** + * Gets the name of the sensitivity label. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + name?: boolean; + /** + * Gets the priority of the sensitivity label, with 0 as lowest priority. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + order?: boolean; + /** + * Gets a value indicating the protection type provided by this label. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + protectionType?: boolean; + /** + * Gets the unique identifier (GUID) of the tenant which the sensitivity label is belonged. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + siteId?: boolean; + /** + * Gets the description of the sensitivity label. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + tooltip?: boolean; + } + /** + * Represents the collection of {@link Excel.SensitivityLabelDetails} objects. + * + * @remarks + * [Api set: ExcelApi 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 sublabels of the sensitivity label. Returns `null` if a label doesn't have any sublabels. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + children?: boolean; + /** + * For EACH ITEM in the collection: Gets the color of the sensitivity label. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + color?: boolean; + /** + * For EACH ITEM in the collection: Gets the unique identifier (GUID) of the sensitivity label. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + id?: boolean; + /** + * For EACH ITEM in the collection: Gets a value indicating whether the label is enabled. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + isEnabled?: boolean; + /** + * For EACH ITEM in the collection: Gets the name of the sensitivity label. + * + * @remarks + * [Api set: ExcelApi 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: ExcelApi 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: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + protectionType?: boolean; + /** + * For EACH ITEM in the collection: Gets the unique identifier (GUID) of the tenant which the sensitivity label is belonged. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + siteId?: boolean; + /** + * For EACH ITEM in the collection: Gets the description of the sensitivity label. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + tooltip?: boolean; + } + /** + * Provides methods to check the status of the catalog of sensitivity labels in Excel and retrieve all available sensitivity labels if the catalog is enabled. + * + * @remarks + * [Api set: ExcelApi 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 Excel. + * + * @remarks + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + getLabelingCapability?: boolean; + } /** * Represents an `AllowEditRange` object found in a worksheet. This object works with worksheet protection properties. When worksheet protection is enabled, an `AllowEditRange` object can be used to allow editing of a specific range, while maintaining protection on the rest of the worksheet. @@ -108033,6 +108807,14 @@ declare namespace Word { * [Api set: WordApiDesktop 1.4] */ readonly selection: Word.Selection; + /** + * Returns the sensitivity label of the document. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly sensitivityLabel: Word.SensitivityLabel; /** * Gets the `RangeScopedCollection` object that represents all the sentences in the document. * @@ -116630,6 +117412,318 @@ declare namespace Word { */ toJSON(): Word.Interfaces.SectionCollectionData; } + /** + * Represents the sensitivity label on the document. + * + * @remarks + * [Api set: WordApi 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 document for the user. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + getCurrentOrNullObject(): Word.SensitivityLabelDetails; + /** + * Try to update to the provided sensitivity label on the document for the user. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + * + * @param LabelId The label information that needs to be set on the document. + * @param Justification Optional. The justification of changing the label. + */ + tryToUpdate(LabelId: string, Justification?: string): OfficeExtension.ClientResult; + /** + * 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[]): Word.SensitivityLabel; + /** + * 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; + }): Word.SensitivityLabel; + /** + * Track the object for automatic adjustment based on surrounding changes in the document. This call is a shorthand for {@link https://learn.microsoft.com/javascript/api/office/officeextension.clientrequestcontext#office-officeextension-clientrequestcontext-trackedobjects-member | context.trackedObjects.add(thisObject)}. If you're using this object across `.sync` calls and outside the sequential execution of a ".run" batch, and get an "InvalidObjectPath" error when setting a property or invoking a method on the object, you need to add the object to the tracked object collection when the object was first created. If this object is part of a collection, you should also track the parent collection. + */ + track(): Word.SensitivityLabel; + /** + * Release the memory associated with this object, if it has previously been tracked. This call is shorthand for {@link https://learn.microsoft.com/javascript/api/office/officeextension.clientrequestcontext#office-officeextension-clientrequestcontext-trackedobjects-member | context.trackedObjects.remove(thisObject)}. Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You'll need to call `context.sync()` before the memory release takes effect. + */ + untrack(): Word.SensitivityLabel; + /** + * 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 `Word.SensitivityLabel` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Word.Interfaces.SensitivityLabelData`) that contains shallow copies of any loaded child properties from the original object. + */ + toJSON(): { + [key: string]: string; + }; + } + /** + * Provides methods to check the status of the catalog of sensitivity labels in Word and retrieve all available sensitivity labels if the catalog is enabled. + * + * @remarks + * [Api set: WordApi 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 the labeling capability status of the sensitivity label catalog in Word. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly getLabelingCapability: Word.LabelingCapability | "NoLicense" | "LabelingDisabled" | "LabelingPolicyNotFound" | "LabelingEnabled"; + /** + * Gets all the sensitivity labels that are enabled in Word. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + getLabels(): Word.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?: Word.Interfaces.SensitivityLabelsCatalogLoadOptions): Word.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[]): Word.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; + }): Word.SensitivityLabelsCatalog; + /** + * Create a new instance of the `Word.SensitivityLabelsCatalog` object. + */ + static newObject(context: OfficeExtension.ClientRequestContext): Word.SensitivityLabelsCatalog; + /** + * Track the object for automatic adjustment based on surrounding changes in the document. This call is a shorthand for {@link https://learn.microsoft.com/javascript/api/office/officeextension.clientrequestcontext#office-officeextension-clientrequestcontext-trackedobjects-member | context.trackedObjects.add(thisObject)}. If you're using this object across `.sync` calls and outside the sequential execution of a ".run" batch, and get an "InvalidObjectPath" error when setting a property or invoking a method on the object, you need to add the object to the tracked object collection when the object was first created. If this object is part of a collection, you should also track the parent collection. + */ + track(): Word.SensitivityLabelsCatalog; + /** + * Release the memory associated with this object, if it has previously been tracked. This call is shorthand for {@link https://learn.microsoft.com/javascript/api/office/officeextension.clientrequestcontext#office-officeextension-clientrequestcontext-trackedobjects-member | context.trackedObjects.remove(thisObject)}. Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You'll need to call `context.sync()` before the memory release takes effect. + */ + untrack(): Word.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 `Word.SensitivityLabelsCatalog` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Word.Interfaces.SensitivityLabelsCatalogData`) that contains shallow copies of any loaded child properties from the original object. + */ + toJSON(): Word.Interfaces.SensitivityLabelsCatalogData; + } + /** + * Represents the collection of {@link Word.SensitivityLabelDetails} objects. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + 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: Word.SensitivityLabelDetails[]; + /** + * Gets the first `SensitivityLabelDetails` object in this collection. Throws an `ItemNotFound` error if this collection is empty. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + getFirst(): Word.SensitivityLabelDetails; + /** + * Gets the first `SensitivityLabelDetails` object in this collection. If this collection is empty, 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: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + getFirstOrNullObject(): Word.SensitivityLabelDetails; + /** + * Gets a `SensitivityLabelDetails` object by its index in the collection. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + * + * @param index A number that identifies the index location of a `SensitivityLabelDetails` object. + */ + getItem(index: number): Word.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?: Word.Interfaces.SensitivityLabelDetailsCollectionLoadOptions & Word.Interfaces.CollectionLoadOptions): Word.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[]): Word.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): Word.SensitivityLabelDetailsCollection; + /** + * Track the object for automatic adjustment based on surrounding changes in the document. This call is a shorthand for {@link https://learn.microsoft.com/javascript/api/office/officeextension.clientrequestcontext#office-officeextension-clientrequestcontext-trackedobjects-member | context.trackedObjects.add(thisObject)}. If you're using this object across `.sync` calls and outside the sequential execution of a ".run" batch, and get an "InvalidObjectPath" error when setting a property or invoking a method on the object, you need to add the object to the tracked object collection when the object was first created. If this object is part of a collection, you should also track the parent collection. + */ + track(): Word.SensitivityLabelDetailsCollection; + /** + * Release the memory associated with this object, if it has previously been tracked. This call is shorthand for {@link https://learn.microsoft.com/javascript/api/office/officeextension.clientrequestcontext#office-officeextension-clientrequestcontext-trackedobjects-member | context.trackedObjects.remove(thisObject)}. Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You'll need to call `context.sync()` before the memory release takes effect. + */ + untrack(): Word.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 `Word.SensitivityLabelDetailsCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Word.Interfaces.SensitivityLabelDetailsCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ + toJSON(): Word.Interfaces.SensitivityLabelDetailsCollectionData; + } + /** + * Represents the properties of available sensitivity labels in Word. + * + * @remarks + * [Api set: WordApi 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; + /** + * The sublabels of the sensitivity label. Returns null if a label doesn't have any sublabels. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly children: Word.SensitivityLabelDetailsCollection; + /** + * The color of the sensitivity label. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly color: string; + /** + * The unique identifier (GUID) of the sensitivity label. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly id: string; + /** + * Gets a value indicating whether the label is enabled. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly isEnabled: boolean; + /** + * The name of the sensitivity label. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly name: string; + /** + * The order of the sensitivity label. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly order: number; + /** + * Gets a value indicating the protection type provided by this label. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly protectionType: Word.SensitivityLabelProtectionType | "NoProtection" | "AdminDefined" | "UserDefined"; + /** + * The unique identifier (GUID) of the tenant which the sensitivity label is belonged. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly siteId: string; + /** + * The description of the sensitivity label. + * + * @remarks + * [Api set: WordApi 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?: Word.Interfaces.SensitivityLabelDetailsLoadOptions): Word.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[]): Word.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?: { + select?: string; + expand?: string; + }): Word.SensitivityLabelDetails; + /** + * Track the object for automatic adjustment based on surrounding changes in the document. This call is a shorthand for {@link https://learn.microsoft.com/javascript/api/office/officeextension.clientrequestcontext#office-officeextension-clientrequestcontext-trackedobjects-member | context.trackedObjects.add(thisObject)}. If you're using this object across `.sync` calls and outside the sequential execution of a ".run" batch, and get an "InvalidObjectPath" error when setting a property or invoking a method on the object, you need to add the object to the tracked object collection when the object was first created. If this object is part of a collection, you should also track the parent collection. + */ + track(): Word.SensitivityLabelDetails; + /** + * Release the memory associated with this object, if it has previously been tracked. This call is shorthand for {@link https://learn.microsoft.com/javascript/api/office/officeextension.clientrequestcontext#office-officeextension-clientrequestcontext-trackedobjects-member | context.trackedObjects.remove(thisObject)}. Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You'll need to call `context.sync()` before the memory release takes effect. + */ + untrack(): Word.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 `Word.SensitivityLabelDetails` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Word.Interfaces.SensitivityLabelDetailsData`) that contains shallow copies of any loaded child properties from the original object. + */ + toJSON(): Word.Interfaces.SensitivityLabelDetailsData; + } /** * Represents a setting of the add-in. * @@ -148787,6 +149881,159 @@ declare namespace Word { */ owners = "Owners", } + /** + * Represents the result of updating the sensitivity label on the document. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + enum SensitivityLabelUpdateResult { + /** + * The sensitivity label was successfully updated. + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + success = "Success", + /** + * The update failed due to an unspecified error. + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + unspecifiedFailure = "UnspecifiedFailure", + /** + * The specified sensitivity label could not be found. + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + labelNotFound = "LabelNotFound", + /** + * The document is read-only and cannot be modified. + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + documentReadOnly = "DocumentReadOnly", + /** + * The user does not have sufficient permissions to update the label. + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + insufficientPermission = "InsufficientPermission", + /** + * The label update failed due to unsupported Double Key Encryption (DKE). + * @remarks + * [Api set: WordApi 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: WordApi 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: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + userNotFound = "UserNotFound", + /** + * The label update failed due to unsupported Universal Data Protection (UDP). + * @remarks + * [Api set: WordApi 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: WordApi 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: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + crossTenant = "CrossTenant", + } + /** + * Represents the labeling capability status of the sensitivity label catalog. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + enum LabelingCapability { + /** + * No valid license is available for sensitivity labeling. + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + noLicense = "NoLicense", + /** + * Sensitivity labeling is disabled for the user or tenant. + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + labelingDisabled = "LabelingDisabled", + /** + * No labeling policy was found for the user. + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + labelingPolicyNotFound = "LabelingPolicyNotFound", + /** + * Sensitivity labeling is fully enabled. + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + labelingEnabled = "LabelingEnabled", + } + /** + * Specifies the type of protection applied by a sensitivity label. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + enum SensitivityLabelProtectionType { + /** + * The label applies no protection. + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + noProtection = "NoProtection", + /** + * The label applies admin-defined protection. + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + adminDefined = "AdminDefined", + /** + * The label applies user-defined protection. + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + userDefined = "UserDefined", + } enum ErrorCodes { accessDenied = "AccessDenied", generalException = "GeneralException", @@ -151525,6 +152772,10 @@ declare namespace Word { interface SectionCollectionUpdateData { items?: Word.Interfaces.SectionData[]; } + /** An interface for updating data on the `SensitivityLabelDetailsCollection` object, for use in `sensitivityLabelDetailsCollection.set({ ... })`. */ + interface SensitivityLabelDetailsCollectionUpdateData { + items?: Word.Interfaces.SensitivityLabelDetailsData[]; + } /** An interface for updating data on the `Setting` object, for use in `setting.set({ ... })`. */ interface SettingUpdateData { /** @@ -158990,6 +160241,96 @@ declare namespace Word { interface SectionCollectionData { items?: Word.Interfaces.SectionData[]; } + /** An interface describing the data returned by calling `sensitivityLabelsCatalog.toJSON()`. */ + interface SensitivityLabelsCatalogData { + /** + * Gets the labeling capability status of the sensitivity label catalog in Word. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + getLabelingCapability?: Word.LabelingCapability | "NoLicense" | "LabelingDisabled" | "LabelingPolicyNotFound" | "LabelingEnabled"; + } + /** An interface describing the data returned by calling `sensitivityLabelDetailsCollection.toJSON()`. */ + interface SensitivityLabelDetailsCollectionData { + items?: Word.Interfaces.SensitivityLabelDetailsData[]; + } + /** An interface describing the data returned by calling `sensitivityLabelDetails.toJSON()`. */ + interface SensitivityLabelDetailsData { + /** + * The sublabels of the sensitivity label. Returns null if a label doesn't have any sublabels. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + children?: Word.Interfaces.SensitivityLabelDetailsData[]; + /** + * The color of the sensitivity label. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + color?: string; + /** + * The unique identifier (GUID) of the sensitivity label. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + id?: string; + /** + * Gets a value indicating whether the label is enabled. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + isEnabled?: boolean; + /** + * The name of the sensitivity label. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + name?: string; + /** + * The order of the sensitivity label. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + order?: number; + /** + * Gets a value indicating the protection type provided by this label. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + protectionType?: Word.SensitivityLabelProtectionType | "NoProtection" | "AdminDefined" | "UserDefined"; + /** + * The unique identifier (GUID) of the tenant which the sensitivity label is belonged. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + siteId?: string; + /** + * The description of the sensitivity label. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + tooltip?: string; + } /** An interface describing the data returned by calling `setting.toJSON()`. */ interface SettingData { /** @@ -170270,6 +171611,181 @@ declare namespace Word { */ protectedForForms?: boolean; } + /** + * Provides methods to check the status of the catalog of sensitivity labels in Word and retrieve all available sensitivity labels if the catalog is enabled. + * + * @remarks + * [Api set: WordApi 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 the labeling capability status of the sensitivity label catalog in Word. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + getLabelingCapability?: boolean; + } + /** + * Represents the collection of {@link Word.SensitivityLabelDetails} objects. + * + * @remarks + * [Api set: WordApi 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: The color of the sensitivity label. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + color?: boolean; + /** + * For EACH ITEM in the collection: The unique identifier (GUID) of the sensitivity label. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + id?: boolean; + /** + * For EACH ITEM in the collection: Gets a value indicating whether the label is enabled. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + isEnabled?: boolean; + /** + * For EACH ITEM in the collection: The name of the sensitivity label. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + name?: boolean; + /** + * For EACH ITEM in the collection: The order of the sensitivity label. + * + * @remarks + * [Api set: WordApi 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: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + protectionType?: boolean; + /** + * For EACH ITEM in the collection: The unique identifier (GUID) of the tenant which the sensitivity label is belonged. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + siteId?: boolean; + /** + * For EACH ITEM in the collection: The description of the sensitivity label. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + tooltip?: boolean; + } + /** + * Represents the properties of available sensitivity labels in Word. + * + * @remarks + * [Api set: WordApi 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; + /** + * The color of the sensitivity label. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + color?: boolean; + /** + * The unique identifier (GUID) of the sensitivity label. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + id?: boolean; + /** + * Gets a value indicating whether the label is enabled. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + isEnabled?: boolean; + /** + * The name of the sensitivity label. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + name?: boolean; + /** + * The order of the sensitivity label. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + order?: boolean; + /** + * Gets a value indicating the protection type provided by this label. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + protectionType?: boolean; + /** + * The unique identifier (GUID) of the tenant which the sensitivity label is belonged. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + siteId?: boolean; + /** + * The description of the sensitivity label. + * + * @remarks + * [Api set: WordApi BETA (PREVIEW ONLY)] + * @beta + */ + tooltip?: boolean; + } /** * Represents a setting of the add-in. * @@ -177583,6 +179099,7 @@ declare namespace Word { constructor(url?: string); readonly document: Document; readonly application: Application; + readonly sensitivityLabelsCatalog: SensitivityLabelsCatalog; } /** * Executes a batch script that performs actions on the Word object model, using the RequestContext of previously created API objects.