mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Add type definitions for Power BI Custom Visuals API (powerbi-visuals-tools) (#25021)
* Added Power BI Custom Visuals API types * Added UT * Fix header of index.d.ts * Code review Update header Remove empty VisualPermissions enumeration Enable some rules Added disable-next-line for no-unnecessary-generics * Remove empty interfaces
This commit is contained in:
parent
b05072819b
commit
9617a7fb65
1346
types/powerbi-visuals-tools/index.d.ts
vendored
Normal file
1346
types/powerbi-visuals-tools/index.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
110
types/powerbi-visuals-tools/powerbi-visuals-tools-tests.ts
Normal file
110
types/powerbi-visuals-tools/powerbi-visuals-tools-tests.ts
Normal file
@ -0,0 +1,110 @@
|
||||
import powerbi from './index';
|
||||
|
||||
import IVisualPlugin = powerbi.visuals.plugins.IVisualPlugin;
|
||||
import IVisual = powerbi.extensibility.visual.IVisual;
|
||||
|
||||
const visualPlugin: IVisualPlugin = {
|
||||
name: 'string',
|
||||
create: (options?: powerbi.extensibility.VisualConstructorOptions) => {
|
||||
const value: IVisual = {
|
||||
update: (options: powerbi.extensibility.VisualUpdateOptions) => {}
|
||||
};
|
||||
return value;
|
||||
},
|
||||
class: 'string',
|
||||
custom: true,
|
||||
apiVersion: "1.11.0",
|
||||
displayName: "string"
|
||||
};
|
||||
|
||||
import ISelectionIdBuilder = powerbi.visuals.ISelectionIdBuilder;
|
||||
import ISelectionId = powerbi.visuals.ISelectionId;
|
||||
|
||||
const selectionBuilder: ISelectionIdBuilder = {
|
||||
withCategory: (categoryColumn: powerbi.DataViewCategoryColumn, index: number): ISelectionIdBuilder => {
|
||||
return selectionBuilder;
|
||||
},
|
||||
withSeries: (ser: powerbi.DataViewValueColumns, val: powerbi.DataViewValueColumn | powerbi.DataViewValueColumnGroup): ISelectionIdBuilder => {
|
||||
return selectionBuilder;
|
||||
},
|
||||
withMeasure: (measure: string): ISelectionIdBuilder => {
|
||||
return selectionBuilder;
|
||||
},
|
||||
createSelectionId: (): ISelectionId => {
|
||||
const selection: ISelectionId = {
|
||||
equals: (sel: ISelectionId) => false,
|
||||
includes: (sel: ISelectionId, ignoreHL: boolean) => false,
|
||||
getKey: () => "string",
|
||||
getSelector: () => {
|
||||
const selector: powerbi.data.Selector = {
|
||||
};
|
||||
return selector;
|
||||
},
|
||||
getSelectorsByColumn: () => {
|
||||
const selector: powerbi.data.SelectorsByColumn = {
|
||||
};
|
||||
return selector;
|
||||
},
|
||||
hasIdentity: () => false
|
||||
};
|
||||
return selection;
|
||||
}
|
||||
};
|
||||
|
||||
import DataView = powerbi.DataView;
|
||||
import DataViewMetadata = powerbi.DataViewMetadata;
|
||||
import DataViewCategorical = powerbi.DataViewCategorical;
|
||||
import DataViewSingle = powerbi.DataViewSingle;
|
||||
import DataViewTree = powerbi.DataViewTree;
|
||||
import DataViewTable = powerbi.DataViewTable;
|
||||
import DataViewMatrix = powerbi.DataViewMatrix;
|
||||
import DataViewScriptResultData = powerbi.DataViewScriptResultData;
|
||||
|
||||
const dataView: DataView = {
|
||||
metadata: {
|
||||
columns: [
|
||||
],
|
||||
objects: undefined,
|
||||
dataReduction: undefined,
|
||||
segment: {
|
||||
}
|
||||
},
|
||||
categorical: {
|
||||
categories: [
|
||||
{
|
||||
identity: [
|
||||
{
|
||||
expr: {},
|
||||
key: "string",
|
||||
kind: powerbi.DataRepetitionKind.ScopeIdentity
|
||||
}
|
||||
],
|
||||
identityFields: [],
|
||||
objects: undefined,
|
||||
source: {
|
||||
displayName: "string",
|
||||
format: "string",
|
||||
groupName: "string",
|
||||
objects: undefined,
|
||||
aggregates: {
|
||||
average: true
|
||||
},
|
||||
isMeasure: false,
|
||||
queryName: "string",
|
||||
sort: powerbi.SortDirection.Ascending || powerbi.SortDirection.Descending,
|
||||
index: 0,
|
||||
type: {
|
||||
text: true
|
||||
},
|
||||
sortOrder: 0,
|
||||
kpi: {
|
||||
graphic: "string",
|
||||
normalizedFiveStateKpiRange: false
|
||||
}
|
||||
},
|
||||
values: []
|
||||
}
|
||||
],
|
||||
values: undefined
|
||||
}
|
||||
};
|
||||
24
types/powerbi-visuals-tools/tsconfig.json
Normal file
24
types/powerbi-visuals-tools/tsconfig.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"powerbi-visuals-tools-tests.ts"
|
||||
]
|
||||
}
|
||||
9
types/powerbi-visuals-tools/tslint.json
Normal file
9
types/powerbi-visuals-tools/tslint.json
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"no-relative-import-in-test": false,
|
||||
"interface-name": false,
|
||||
"no-mergeable-namespace": false,
|
||||
"no-const-enum": false
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user