From d32e39281f4f82b9a15f08f1ad5891e3935e93e5 Mon Sep 17 00:00:00 2001 From: Sherein Dabbah Date: Tue, 21 Jun 2022 00:44:22 +0300 Subject: [PATCH 1/5] Create two apis files and add formatting model interfaces --- src/formatting-model-api.d.ts | 582 +++++++++++++++++++++++++++++ index.d.ts => src/visuals-api.d.ts | 39 +- 2 files changed, 616 insertions(+), 5 deletions(-) create mode 100644 src/formatting-model-api.d.ts rename index.d.ts => src/visuals-api.d.ts (97%) diff --git a/src/formatting-model-api.d.ts b/src/formatting-model-api.d.ts new file mode 100644 index 0000000..a79cfc1 --- /dev/null +++ b/src/formatting-model-api.d.ts @@ -0,0 +1,582 @@ +/** + * Formatting Pane Model Interfaces + */ + +declare module powerbi { + export namespace visuals { + export type FormattingModelWarnings = { [cardUid: string]: IVisualWarning }; + + export interface FormattingModel { + cards: (FormattingCard | FormattingCardPlaceholder)[]; + modelUnavailableImageName?: string; + modelUnavailableMessageKey?: string; + modelUnavailableLearnMoreLink?: string; + // this is used for displaying messages in formatting pane, with an action to usually open some dialog. + formattingModelMessage?: FormattingModelMessage; + warnings?: FormattingModelWarnings; + } + + export interface FormattingModelMessage { + messageKey: string; + action?: FormattingModelMessageAction; + } + + export interface FormattingModelMessageAction { + key: string; + fn: () => void; + } + + export interface FormattingWarning { + warningMessage?: IVisualErrorMessage; + } + + export interface FormattingCard extends VisualFormattingUid, VisualFormattingDisplayName, FormattingWarning { + disabled?: boolean; + /** card disabled reason */ + disabledReason?: string; + /** This is top-level card On/Off property */ + topLevelToggle?: EnabledSlice; + groups: (FormattingGroup | FormattingGroupPlaceholder)[]; + /** This contains the list of descriptors for revert to default, note the descriptors of all the slices ever possible in the card must be added */ + revertToDefaultDescriptors?: FormattingDescriptor[]; + /** if true, this card should be populated into the analytics pane */ + analyticsPane?: boolean; + } + + export interface FormattingGroup extends VisualFormattingUid, VisualFormattingDisplayName { + disabled?: boolean; + /** card disabled reason */ + disabledReason?: string; + /** This is top-level card On/Off property */ + topLevelToggle?: EnabledSlice; + slices?: (FormattingSlice | FormattingSlicePlaceholder)[]; + container?: FormattingContainer; + containerDisabled?: boolean; + /** Allows slices in the same group as containers. Slices are outside of the container's context */ + sliceWithContainer?: boolean; + /** + * If delaySaveSlices is true, then this group's slices' value changes won't be saved to the visual until a + * signal action is taken. E.g., for an Analytics Pane forecast, the forecast parameter values shouldn't be + * saved to the visual until the Apply button is clicked. Note that this applies to all slices in the group. + */ + delaySaveSlices?: boolean; + collapsible?: boolean; + /** defaulted to true, if false, we will keep the group enabled even though it's parent card has topLevelToggle value set to false */ + inheritDisabled?: boolean; + } + + export interface FormattingContainer extends VisualFormattingUid, VisualFormattingDisplayName { + containerItems: FormattingContainerItem[]; + /** + * Whether this container allows editing, including add/remove container items, and + * edit of indivisual container item's value itself. + */ + isEditable?: boolean; + } + + export interface FormattingContainerItem extends VisualFormattingUid { + displayName: string; + disabled?: boolean; + slices?: FormattingSlice[]; + groups?: Omit[]; + } + + export type FormattingSlice = SimpleVisualFormattingSlice | CompositeVisualFormattingSlice; + + export interface BaseVisualFormattingSlice extends VisualFormattingUid { + control: TControl; + disabled?: boolean; + suppressUndoRedoRegister?: boolean; + } + + /** Slice display name is required for composite slices */ + export interface CompositeVisualFormattingSlice extends BaseVisualFormattingSlice, VisualFormattingDisplayName, VisualFormattingInfoIconText { + } + + /** Slice display name is optional for simple slices */ + export interface SimpleVisualFormattingSlice extends BaseVisualFormattingSlice, Partial, VisualFormattingInfoIconText { + // Properties added here to add comments + /** Only set if needed to override the capabilities */ + displayName?: string; + /** Only set if needed to override the capabilities */ + description?: string; + } + + export interface EnabledSlice extends BaseVisualFormattingSlice>> { + suppressDisplayName: boolean; + } + + export interface VisualFormattingUid { + /** A unique Identifier */ + uid: string; + } + + export interface VisualFormattingDisplayName { + displayName: string; + description?: string; + /** + * It will be used as an alternate name for the formatting card (will be only used for searching purposes) + */ + aliasName?: string; + suppressDisplayName?: boolean; + } + + export interface VisualFormattingInfoIconText { + /** Only set if needed to display info icon with tooltip for the slice */ + infoIconText?: string; + } + + export interface FormattingDescriptor extends DataViewObjectPropertyIdentifier { + selector?: data.Selector; + /** (Optional) Set the required type for particular property that support variant types. */ + propertyTypes?: ValueTypeDescriptor; + instanceKind?: VisualEnumerationInstanceKinds; + /** (Optional) Allows visuals to specify an alternate selector to be used when the value is a constant, + * as opposed to a data-bound expression. This selector may be used to place the object at a higher scope, + * such as the static scope, to avoid repeating the same constant value on each instance of a scope.*/ + altConstantValueSelector?: data.Selector; + } + + export const enum FormattingPlaceholderType { + Card = 'card', + Group = 'group', + Slice = 'slice', + } + + export interface FormattingPlaceholder { + type: FormattingPlaceholderType; + source: string; + name: string; + /** Whether a default value should be returned if the placeholder isn't able to be resolved normally */ + suppressDefaultValue?: boolean; + } + + export interface FormattingCardPlaceholder extends FormattingPlaceholder { + type: FormattingPlaceholderType.Card; + + /** if true, this card should be populated into the analytics pane. */ + analyticsPane?: boolean; + } + + export interface FormattingGroupPlaceholder extends FormattingPlaceholder { + type: FormattingPlaceholderType.Group; + } + + export interface FormattingSlicePlaceholder extends FormattingPlaceholder { + type: FormattingPlaceholderType.Slice; + } + + export const enum FormattingPlaceholderSource { + Host = 'host', + Visual = 'visual', + } + + // Host placeholders are placeholders that use data provided by the host (Minerva, aka Visual Container properties) + + export const enum HostFormattingCardPlaceholderName { + Actions = 'actions', + } + + // No placeholders of these types yet + export type HostFormattingGroupPlaceholderName = never; + export type HostFormattingSlicePlaceholderName = never; + + export interface HostFormattingPlaceholder extends FormattingPlaceholder { + source: FormattingPlaceholderSource.Host; + } + + export interface HostFormattingCardPlaceholder extends HostFormattingPlaceholder { + type: FormattingPlaceholderType.Card; + name: HostFormattingCardPlaceholderName; + } + + export interface HostFormattingGroupPlaceholder extends HostFormattingPlaceholder { + type: FormattingPlaceholderType.Group; + name: HostFormattingGroupPlaceholderName; + } + + export interface HostFormattingSlicePlaceholder extends HostFormattingPlaceholder { + type: FormattingPlaceholderType.Slice; + name: HostFormattingSlicePlaceholderName; + } + + // Visual placeholders that use data provided by the visual + + export type VisualFormattingCardPlaceholderName = never; + export type VisualFormattingGroupPlaceholderName = never; + export const enum VisualFormattingSlicePlaceholderName { + DataVolume = 'dataVolume', + Responsive = 'responsive', + } + + export interface VisualFormattingPlaceholder extends FormattingPlaceholder { + source: FormattingPlaceholderSource.Visual; + } + + export interface VisualFormattingCardPlaceholder extends VisualFormattingPlaceholder { + type: FormattingPlaceholderType.Card; + name: VisualFormattingCardPlaceholderName; + } + + export interface VisualFormattingGroupPlaceholder extends VisualFormattingPlaceholder { + type: FormattingPlaceholderType.Group; + name: VisualFormattingGroupPlaceholderName; + } + + export interface VisualFormattingSlicePlaceholder extends VisualFormattingPlaceholder { + type: FormattingPlaceholderType.Slice; + name: VisualFormattingSlicePlaceholderName; + } + + /** + * Handles resolving the type of placeholder that's expected to be return. + * If you give it a slice placeholder, you should get a slice back, etc + */ + export interface ResolvedFormattingPlaceholder { + item: TFormattingPlaceholder extends FormattingCardPlaceholder + ? FormattingCard + : TFormattingPlaceholder extends FormattingGroupPlaceholder + ? FormattingGroup + : TFormattingPlaceholder extends FormattingSlicePlaceholder + ? FormattingSlice + : never; + revertToDefaultDescriptors?: FormattingDescriptor[]; + } + + + /** + * Takes in a group of controls (ex. Simple or Composite). + * Creates a dictionary where the key is the control name. + * The value is an object with property `type` typed to match to the control name, + * as well as a `properties` property that is set to the properties of the control. + * + * Note that this returns a dictionary containing all the controls included in `TControlGroupType` + */ + type AllControls = { + [ControlName in keyof TControlGroupType]: { + type: ControlName; + properties: TControlGroupType[ControlName]; + } + }; + + /** + * Returns an object with property `type` typed to match the control name, + * and property `properties` containing the properties for the control. + * + * This indexes into the dictionary generated by `AllControls` to return a union of all possible controls instead of a dictionary. + */ + export type FormattingControls = AllControls[keyof TControlGroupType]; + + export type FormattingComponentType = SimpleComponentType & CompositeComponentType; + + /** Generates a union of all possible types of the controls in the given Component Group */ + export type ControlType = { [ControlName in keyof TComponentGroupType]: TComponentGroupType[ControlName] }[keyof TComponentGroupType]; + /** Defines an interface where the value of a `CompositeComponent`'s properties must be a `SimpleComponent`. */ + type CompositeComponentPropertyType = { [key: string]: ControlType | undefined }; + + export type FormattingSimpleControl = FormattingControls; + export type FormattingCompositeControl = FormattingControls; + + export type FormattingControl = FormattingSimpleControl | FormattingCompositeControl; + + export const enum FormattingComponent { + AlignmentGroup = "AlignmentGroup", + ColorPicker = "ColorPicker", + ConditionalFormattingControl = "ConditionalFormattingControl", + DatePicker = "DatePicker", + Dropdown = "Dropdown", + DurationPicker = "DurationPicker", + EmptyControl = "EmptyControl", + ErrorRangeControl = "ErrorRangeControl", + FieldPicker = "FieldPicker", + FlagsSelection = "FlagsSelection", + FontControl = "FontControl", + FontPicker = "FontPicker", + GradientBar = "GradientBar", + ImageUpload = "ImageUpload", + Link = "Link", + ListEditor = "ListEditor", + MarginPadding = "MarginPadding", + NumUpDown = "NumUpDown", + ReadOnlyText = "ReadOnlyText", + SeriesDialogLink = "SeriesDialogLink", + ShapeMapSelector = "ShapeMapSelector", + Slider = "Slider", + TextArea = "TextArea", + TextInput = "TextInput", + ToggleSwitch = "ToggleSwitch", + } + + export type SimpleComponentType = { + AlignmentGroup: AlignmentGroup; + ColorPicker: ColorPicker; + ConditionalFormattingControl: ConditionalFormattingControl; + DatePicker: DatePicker; + Dropdown: Dropdown; + DurationPicker: DurationPicker; + ErrorRangeControl: ErrorRangeControl; + EmptyControl: EmptyControl; + FieldPicker: FieldPicker; + FlagsSelection: FlagsSelection; + FontPicker: FontPicker; + GradientBar: GradientBar; + ImageUpload: ImageUpload; + Link: Link; + ListEditor: ListEditor; + NumUpDown: NumUpDown; + ReadOnlyText: ReadOnlyText; + SeriesDialogLink: SeriesDialogLink; + ShapeMapSelector: ShapeMapSelector; + Slider: Slider; + TextArea: TextArea; + TextInput: TextInput; + ToggleSwitch: ToggleSwitch; + }; + + export type CompositeComponentType = { + FontControl: FontControl; + MarginPadding: MarginPadding; + }; + + export interface SimpleComponentBase { + descriptor: FormattingDescriptor; + value: T; + } + + export const enum ValidatorType { + Min = 0, + Max = 1, + Required = 2, + } + + export interface Validator { + type: ValidatorType; + } + + export interface MinValidator extends Validator { + type: ValidatorType.Min; + value: T; + } + + export interface MaxValidator extends Validator { + type: ValidatorType.Max; + value: T; + } + + export interface RequiredValidator extends Validator { + type: ValidatorType.Required; + } + + interface ColorPicker extends SimpleComponentBase { + defaultColor?: ThemeColorData; + isNoFillItemSupported?: boolean; + } + interface MarginPadding extends CompositeComponentPropertyType { + left: NumUpDown; + right: NumUpDown; + top: NumUpDown; + bottom: NumUpDown; + } + + export interface NumUpDownFormat extends NumUpDownValidators { + unitSymbol?: string; + unitSymbolAfterInput?: boolean; + } + + interface NumUpDownValidators { + minValue?: MinValidator; + maxValue?: MaxValidator; + required?: RequiredValidator; + } + + interface NumUpDown extends SimpleComponentBase { + options?: NumUpDownFormat; + placeholderText?: string; + } + + interface NumUpDownWithoutUnit extends NumUpDown { + options?: NumUpDownValidators; + } + + interface FieldPicker extends SimpleComponentBase { + validators: powerbi.explore.directives.ValidationInfo; + allowMultipleValues?: boolean; + } + + /** Error-range settings. Value is intentionally undefined as it can only be data-bound */ + interface ErrorRangeControl extends SimpleComponentBase { + validators: powerbi.explore.directives.ValidationInfo; + + // Other aspects of the Error Range settings the Visual can customize (e.g. allow relative values, allow 1-sided bounds, .. etc) + } + + interface FontControl extends CompositeComponentPropertyType { + fontFamily: FontPicker; + fontSize: NumUpDownWithoutUnit; + bold?: ToggleButton; + italic?: ToggleButton; + underline?: ToggleButton; + } + + interface FontPicker extends SimpleComponentBase { } + + interface ToggleButton extends SimpleComponentBase { } + + interface ToggleSwitch extends SimpleComponentBase { } + + interface TextValidators { + required?: RequiredValidator; + } + interface TextInput extends SimpleComponentBase { + placeholder: string; + validators?: TextValidators; + } + + interface TextArea extends TextInput { } + + export const enum AlignmentGroupMode { + Horizonal = 'horizontalAlignment', + Vertical = 'verticalAlignment', + } + + interface AlignmentGroup extends SimpleComponentBase { + mode: AlignmentGroupMode; + supportsNoSelection?: boolean; + } + + interface Slider extends NumUpDown { } + + // ideally we would set type here to number, but the old formatting pane always converts enum members to string + // values before binding - so using string here to keep it consistent for the flags control + interface ItemFlagsSelection extends SimpleComponentBase { + items: IEnumMember[]; + } + interface AutoFlagsSelection extends SimpleComponentBase { } + + type FlagsSelection = ItemFlagsSelection | AutoFlagsSelection; + + type Dropdown = ItemDropdown | AutoDropdown; + + interface ItemDropdown extends SimpleComponentBase { + items: IEnumMember[]; + } + + /** + * Automatically generates items based on the property's type + */ + interface AutoDropdown extends SimpleComponentBase { + /** Values to add should be merged with the items */ + mergeValues?: IEnumMember[]; + /** Values to filter the list of items by */ + filterValues?: EnumMemberValue[]; + } + + export interface ListEditorValue { + items: ListItemEditorValue[]; + selectedItem: ListItemEditorValue; + } + + export interface ListItemEditorValue extends IEnumMember { + update?: ListEditorItemUpdateType; + oldDisplayName?: data.DisplayNameGetter; + } + + export const enum ListEditorItemUpdateType { + New = "New", + Removed = "Removed", + DisplayNameUpdated = "DisplayNameUpdated", + } + + interface ListEditor extends SimpleComponentBase { } + + interface ImageUpload extends SimpleComponentBase { } + + interface DurationPicker extends SimpleComponentBase { + /** These are specfic to this control */ + validators?: { + min?: string; + max?: string; + integer?: boolean; + }; + } + + /** This will be used for showing only "fx" button without any other content */ + interface EmptyControl extends SimpleComponentBase { } + + interface GradientBar extends SimpleComponentBase { } + + interface ShapeMapSelector extends SimpleComponentBase { + isAzMapReferenceSelector?: boolean; + } + + interface DatePicker extends SimpleComponentBase { + placeholder: string; + validators?: { + max?: MaxValidator; + min?: MinValidator; + }; + } + + interface ReadOnlyText extends SimpleComponentBase { } + + interface ConditionalFormattingControl extends SimpleComponentBase { + displayName: string; + } + + interface Link extends SimpleComponentBase<() => (any | void)> { + ariaLabel?: string; + } + + interface SeriesDialogLink extends Link { + type: FormattingComponent.SeriesDialogLink; + warningIcon?: boolean; + resetToDefaultDescriptors?: FormattingDescriptor[]; + } + } +} + +declare namespace powerbi { + export interface ThemeColorData { + value: string; + id?: number; + shade?: number; + } +} + +declare namespace powerbi { + export interface ValidationRequiredInfo { + required?: boolean; + } + + export interface ValidationNumericInfo { + decimal?: boolean; + integer?: boolean; + min?: number | Date | string; + max?: number | Date | string; + } +} + +declare namespace powerbi.explore.directives { + type ValidationAllInfo = powerbi.ValidationRequiredInfo & powerbi.ValidationNumericInfo; + export interface ValidationInfo extends ValidationAllInfo { + url?: boolean; + field?: FieldValidationInfo; + } + + export interface FieldValidationInfo { + kind: data.FieldKind; + // For more than 1 type to validate on, we can use Variant type descriptor + type?: ValueTypeDescriptor; + } +} + +declare module powerbi { + export interface IVisualErrorMessage { + message: string; + title: string; + detail: string; + } + export interface IVisualWarning { + code: string; + } +} diff --git a/index.d.ts b/src/visuals-api.d.ts similarity index 97% rename from index.d.ts rename to src/visuals-api.d.ts index 63bfea4..ae9b849 100644 --- a/index.d.ts +++ b/src/visuals-api.d.ts @@ -7,6 +7,10 @@ declare namespace powerbi { /** Indicates that the role can be bound to either Grouping or Measure. */ GroupingOrMeasure = 2, } + export const enum VisualDataRoleKindPreference { + Measure, + Grouping, + } const enum VisualDataChangeOperationKind { Create = 0, Append = 1, @@ -88,6 +92,13 @@ declare namespace powerbi { /** removing existing filter. */ remove = 1, } + export const enum VisualObjectCategoryOptions { + /** The configuration affects visual's formatting - look & feel, colors, axes, labels etc.*/ + Formatting = 1, + + /** The configuration controls an analytical visual aid - forcasts, trendlines, reference lines and shapes etc.*/ + Analytics = 2, + } const enum DialogAction { Close = 0, OK = 1, @@ -796,6 +807,13 @@ declare module powerbi.data { export interface ISQConstantExpr extends ISQExpr { } + export const enum FieldKind { + /** Indicates the field references a column, which evaluates to a distinct set of values (e.g., Year, Name, SalesQuantity, etc.). */ + Column, + + /** Indicates the field references a measure, which evaluates to a single value (e.g., SalesYTD, Sum(Sales), etc.). */ + Measure, + } } @@ -1002,7 +1020,6 @@ declare module powerbi { } } - declare module powerbi { import SemanticFilter = data.ISemanticFilter; @@ -1249,6 +1266,18 @@ declare module powerbi { /** Properties used for formatting (e.g., Conditional Formatting). */ formattingProperties?: string[]; } + + export namespace VisualObjectRepetition { + export interface VisualObjectRepetitionMetadata { + propertyId: DataViewObjectPropertyIdentifier; + selector: Selector; + allowOverrideSubtotalMatching?: boolean; + altStaticSelector?: Selector; + propertyDescriptor: any; // Actual type DataViewObjectPropertyDescriptor + /** For property pane usage. Display name for the Container in which to add a slice for this repetition */ + containerName?: string; + } + } } @@ -1447,7 +1476,6 @@ declare module powerbi.extensibility { } } - declare module powerbi { /** * Represents a return type for privilege status query methods @@ -1479,7 +1507,7 @@ declare module powerbi.extensibility { /** * Provides an access to local storage for read / write access */ - interface ILocalVisualStorageService { + interface ILocalVisualStorageService { /** * Returns the availability status of the service. * @@ -1610,6 +1638,9 @@ declare module powerbi.extensibility.visual { /** Gets the set of objects that the visual is currently displaying. */ enumerateObjectInstances?(options: EnumerateVisualObjectInstancesOptions): VisualObjectInstanceEnumeration; + + /** Gets the settings to display in the formatting pane */ + getFormattingModel?(): any; } export interface IVisualHost extends extensibility.IVisualHost { @@ -1704,5 +1735,3 @@ declare module powerbi.extensibility.visual { isLicenseInfoAvailable: boolean; } } - -export default powerbi; From 9e00af23790cb5f70988145a3913730d847b97c2 Mon Sep 17 00:00:00 2001 From: Sherein Dabbah Date: Tue, 21 Jun 2022 00:47:19 +0300 Subject: [PATCH 2/5] Bump to version 5.0.0 Export powerbi module Update changelog --- CHANGELOG.md | 3 +++ index.d.ts | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 index.d.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 667d3d7..e1e9fa4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Change Log - Power BI Custom Visuals API +# 5.0.0 +* Add new formatting pane `FormattingModel` interfaces + # 4.6.0 * Adds `privileges` into schema for capabilities.json diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..b262a66 --- /dev/null +++ b/index.d.ts @@ -0,0 +1,7 @@ +// Powerbi visuals APIs +/// + +// Powerbi formatting pane APIs +/// + +export default powerbi; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index b97287c..c2fa501 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "powerbi-visuals-api", - "version": "4.6.0", + "version": "5.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "powerbi-visuals-api", - "version": "4.6.0", + "version": "5.0.0", "license": "MIT", "dependencies": { "semver": "^7.3.5" diff --git a/package.json b/package.json index 3f40585..60bb2d6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "powerbi-visuals-api", - "version": "4.6.0", + "version": "5.0.0", "description": "Power BI Custom Visuals API type definitions for typescript", "types": "index", "main": "index.js", From f6823a949b150565df19fe35ec2257452322f199 Mon Sep 17 00:00:00 2001 From: Sherein Dabbah Date: Tue, 21 Jun 2022 11:30:54 +0300 Subject: [PATCH 3/5] Revert index.d.ts file from commit "Bump to version 5.0.0" This reverts commit 9e00af23790cb5f70988145a3913730d847b97c2. --- index.d.ts | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 index.d.ts diff --git a/index.d.ts b/index.d.ts deleted file mode 100644 index b262a66..0000000 --- a/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Powerbi visuals APIs -/// - -// Powerbi formatting pane APIs -/// - -export default powerbi; \ No newline at end of file From c5639a166fdc2a6c59da40309f53413de8e6b8d5 Mon Sep 17 00:00:00 2001 From: Sherein Dabbah Date: Wed, 22 Jun 2022 09:37:32 +0300 Subject: [PATCH 4/5] Add index.d.ts --- index.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 index.d.ts diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..783ff74 --- /dev/null +++ b/index.d.ts @@ -0,0 +1,7 @@ +// Powerbi visuals APIs +/// + +// Powerbi formatting pane APIs +/// + +export default powerbi; \ No newline at end of file From 6489d74a8089e1d8280b83cfc7b712d66b7bd0e6 Mon Sep 17 00:00:00 2001 From: Sherein Dabbah Date: Wed, 6 Jul 2022 09:18:10 +0300 Subject: [PATCH 5/5] PR fixes --- src/formatting-model-api.d.ts | 13 ------------- src/visuals-api.d.ts | 5 +---- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/src/formatting-model-api.d.ts b/src/formatting-model-api.d.ts index a79cfc1..8b979c5 100644 --- a/src/formatting-model-api.d.ts +++ b/src/formatting-model-api.d.ts @@ -18,12 +18,6 @@ declare module powerbi { export interface FormattingModelMessage { messageKey: string; - action?: FormattingModelMessageAction; - } - - export interface FormattingModelMessageAction { - key: string; - fn: () => void; } export interface FormattingWarning { @@ -228,10 +222,6 @@ declare module powerbi { name: VisualFormattingSlicePlaceholderName; } - /** - * Handles resolving the type of placeholder that's expected to be return. - * If you give it a slice placeholder, you should get a slice back, etc - */ export interface ResolvedFormattingPlaceholder { item: TFormattingPlaceholder extends FormattingCardPlaceholder ? FormattingCard @@ -445,9 +435,6 @@ declare module powerbi { } interface Slider extends NumUpDown { } - - // ideally we would set type here to number, but the old formatting pane always converts enum members to string - // values before binding - so using string here to keep it consistent for the flags control interface ItemFlagsSelection extends SimpleComponentBase { items: IEnumMember[]; } diff --git a/src/visuals-api.d.ts b/src/visuals-api.d.ts index ae9b849..4106d9c 100644 --- a/src/visuals-api.d.ts +++ b/src/visuals-api.d.ts @@ -1636,11 +1636,8 @@ declare module powerbi.extensibility.visual { /** Notifies the visual that it is being destroyed, and to do any cleanup necessary (such as unsubscribing event handlers). */ destroy?(): void; - /** Gets the set of objects that the visual is currently displaying. */ - enumerateObjectInstances?(options: EnumerateVisualObjectInstancesOptions): VisualObjectInstanceEnumeration; - /** Gets the settings to display in the formatting pane */ - getFormattingModel?(): any; + getFormattingModel?(): visuals.FormattingModel | undefined; } export interface IVisualHost extends extensibility.IVisualHost {