From c197f5664c8a0af634590d51968754dbfd515df7 Mon Sep 17 00:00:00 2001 From: Alexey Date: Wed, 7 May 2025 18:07:01 +0200 Subject: [PATCH 1/2] Improved deprecation annotations to improve IDE awareness --- CHANGELOG.md | 8 ++++++++ package.json | 2 +- src/visuals-api.d.ts | 47 +++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 55 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aefea4d..14309b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,14 @@ # Change Log - Power BI Custom Visuals API +## 5.11.1 +* Improved deprecation annotations to improve IDE awareness: + * in `DataViewMatrixNode` interface: + * Introduced explicit `value` property to mark it as deprecated. + * Applied JSDoc @deprecated tag to `levelSourceIndex` for clarity. + * for a `DataViewValueColumn` marked properties related to `aggregates` as deprecated. + ## 5.11.0 * Removes storageService. + ## 5.10.0 * `sourceFieldParameters` : New DataViewMetadataColumn property indicates that the current field is the result of a field parameter. diff --git a/package.json b/package.json index c08a0b8..ed680b0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "powerbi-visuals-api", - "version": "5.11.0", + "version": "5.11.1", "description": "Power BI Custom Visuals API type definitions for typescript", "types": "index", "main": "index.js", diff --git a/src/visuals-api.d.ts b/src/visuals-api.d.ts index fbf06cf..e45699e 100644 --- a/src/visuals-api.d.ts +++ b/src/visuals-api.d.ts @@ -564,6 +564,44 @@ declare module powerbi { // NOTE: The following is needed for backwards compatibility and should be deprecated. Callers should use // DataViewMetadataColumn.aggregates instead. export interface DataViewValueColumn extends DataViewColumnAggregates { + /** @deprecated Callers should use DataViewMetadataColumn.aggregates instead. */ + subtotal?: PrimitiveValue; + + /** @deprecated Callers should use DataViewMetadataColumn.aggregates instead. */ + max?: PrimitiveValue; + + /** @deprecated Callers should use DataViewMetadataColumn.aggregates instead. */ + min?: PrimitiveValue; + + /** @deprecated Callers should use DataViewMetadataColumn.aggregates instead. */ + average?: PrimitiveValue; + + /** @deprecated Callers should use DataViewMetadataColumn.aggregates instead. */ + median?: PrimitiveValue; + + /** @deprecated Callers should use DataViewMetadataColumn.aggregates instead. */ + count?: number; + + /** @deprecated Callers should use DataViewMetadataColumn.aggregates instead. */ + percentiles?: DataViewColumnPercentileAggregate[]; + + /** + * @deprecated Callers should use DataViewMetadataColumn.aggregates instead. + * Represents a single value evaluation, similar to a total. + */ + single?: PrimitiveValue; + + /** + * @deprecated Callers should use DataViewMetadataColumn.aggregates instead. + * Client-computed maximum value for a column. + */ + maxLocal?: PrimitiveValue; + + /** + * @deprecated Callers should use DataViewMetadataColumn.aggregates instead. + * Client-computed maximum value for a column. + */ + minLocal?: PrimitiveValue; } export interface DataViewCategoryColumn extends DataViewCategoricalColumn { @@ -669,6 +707,13 @@ declare module powerbi { children?: DataViewMatrixNode[]; + /** + * @deprecated This property is deprecated in DataViewMatrixNode. + * Use `levelValues` instead. + * If this node represents a composite group node in matrix, this property will be undefined. + */ + value?: PrimitiveValue; + /* If this DataViewMatrixNode represents the inner-most dimension of row groups (i.e. a leaf node), then this property will contain the values at the * matrix intersection under the group. The valueSourceIndex property will contain the position of the column in the select statement to which the * value belongs. @@ -680,7 +725,7 @@ declare module powerbi { /** * Indicates the source metadata index on the node's level. Its value is 0 if omitted. * - * DEPRECATED: This property is deprecated and exists for backward-compatibility only. + * @deprecated This property is deprecated and exists for backward-compatibility only. * New visuals code should consume the new property levelSourceIndex on DataViewMatrixGroupValue instead. */ levelSourceIndex?: number; From 5ad8bb3d5d6bcb5eb323e40c4ec1978ad49bc6be Mon Sep 17 00:00:00 2001 From: Alexey Date: Thu, 8 May 2025 00:13:15 +0200 Subject: [PATCH 2/2] Merged DataViewValueColumn interfaces for a correct deprecation of properties extended from DataViewColumnAggregates --- src/visuals-api.d.ts | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/visuals-api.d.ts b/src/visuals-api.d.ts index e45699e..3fe6e24 100644 --- a/src/visuals-api.d.ts +++ b/src/visuals-api.d.ts @@ -559,29 +559,28 @@ declare module powerbi { values: PrimitiveValue[]; highlights?: PrimitiveValue[]; identity?: visuals.CustomVisualOpaqueIdentity; - } - // NOTE: The following is needed for backwards compatibility and should be deprecated. Callers should use - // DataViewMetadataColumn.aggregates instead. - export interface DataViewValueColumn extends DataViewColumnAggregates { + // NOTE: The following is needed for backwards compatibility and should be deprecated. + // Callers should use DataViewMetadataColumn.aggregates instead. + // The values below extend from 'DataViewColumnAggregates'. /** @deprecated Callers should use DataViewMetadataColumn.aggregates instead. */ subtotal?: PrimitiveValue; - + /** @deprecated Callers should use DataViewMetadataColumn.aggregates instead. */ max?: PrimitiveValue; - + /** @deprecated Callers should use DataViewMetadataColumn.aggregates instead. */ min?: PrimitiveValue; - + /** @deprecated Callers should use DataViewMetadataColumn.aggregates instead. */ average?: PrimitiveValue; - + /** @deprecated Callers should use DataViewMetadataColumn.aggregates instead. */ median?: PrimitiveValue; - + /** @deprecated Callers should use DataViewMetadataColumn.aggregates instead. */ count?: number; - + /** @deprecated Callers should use DataViewMetadataColumn.aggregates instead. */ percentiles?: DataViewColumnPercentileAggregate[];