1- // powerbi-client v2.21.1
1+ // powerbi-client v2.22.2
22// Copyright (c) Microsoft Corporation.
33// Licensed under the MIT License.
44declare module "config" {
@@ -116,6 +116,14 @@ declare module "util" {
116116 * @returns {number }
117117 */
118118 export function getTimeDiffInMilliseconds ( start : Date , end : Date ) : number ;
119+ /**
120+ * Checks if the embed type is for create
121+ *
122+ * @export
123+ * @param {string } embedType
124+ * @returns {boolean }
125+ */
126+ export function isCreate ( embedType : string ) : boolean ;
119127}
120128declare module "embed" {
121129 import * as models from 'powerbi-models' ;
@@ -142,6 +150,7 @@ declare module "embed" {
142150 export type IDashboardEmbedConfiguration = models . IDashboardEmbedConfiguration ;
143151 export type ITileEmbedConfiguration = models . ITileEmbedConfiguration ;
144152 export type IQnaEmbedConfiguration = models . IQnaEmbedConfiguration ;
153+ export type IQuickCreateConfiguration = models . IQuickCreateConfiguration ;
145154 export type ILocaleSettings = models . ILocaleSettings ;
146155 export type IQnaSettings = models . IQnaSettings ;
147156 export type IEmbedSettings = models . ISettings ;
@@ -249,13 +258,6 @@ declare module "embed" {
249258 * @hidden
250259 */
251260 bootstrapConfig : IBootstrapEmbedConfiguration ;
252- /**
253- * Gets or sets the configuration settings for creating report.
254- *
255- * @type {models.IReportCreateConfiguration }
256- * @hidden
257- */
258- createConfig : models . IReportCreateConfiguration ;
259261 /**
260262 * Url used in the load request.
261263 *
@@ -299,19 +301,12 @@ declare module "embed" {
299301 */
300302 constructor ( service : Service , element : HTMLElement , config : IEmbedConfigurationBase , iframe ?: HTMLIFrameElement , phasedRender ?: boolean , isBootstrap ?: boolean ) ;
301303 /**
302- * Sends createReport configuration data.
303- *
304- * ```javascript
305- * createReport({
306- * datasetId: '5dac7a4a-4452-46b3-99f6-a25915e0fe55',
307- * accessToken: 'eyJ0eXA ... TaE2rTSbmg',
308- * ```
304+ * Create is not supported by default
309305 *
310306 * @hidden
311- * @param {models.IReportCreateConfiguration } config
312307 * @returns {Promise<void> }
313308 */
314- createReport ( config : models . IReportCreateConfiguration ) : Promise < void > ;
309+ create ( ) : Promise < void > ;
315310 /**
316311 * Saves Report.
317312 *
@@ -1619,6 +1614,35 @@ declare module "report" {
16191614 * @param zoomLevel zoom level to set
16201615 */
16211616 setZoom ( zoomLevel : number ) : Promise < void > ;
1617+ /**
1618+ * Closes all open context menus and tooltips.
1619+ *
1620+ * ```javascript
1621+ * report.closeAllOverlays()
1622+ * .then(() => {
1623+ * ...
1624+ * });
1625+ * ```
1626+ *
1627+ * @returns {Promise<void> }
1628+ */
1629+ closeAllOverlays ( ) : Promise < void > ;
1630+ /**
1631+ * Clears selected not popped out visuals, if flag is passed, all visuals selections will be cleared.
1632+ *
1633+ * ```javascript
1634+ * report.clearSelectedVisuals()
1635+ * .then(() => {
1636+ * ...
1637+ * });
1638+ * ```
1639+ *
1640+ * @param {Boolean } [clearPopOutState=false]
1641+ * If false / undefined visuals selection will not be cleared if one of visuals
1642+ * is in popped out state (in focus, show as table, spotlight...)
1643+ * @returns {Promise<void> }
1644+ */
1645+ clearSelectedVisuals ( clearPopOutState ?: boolean ) : Promise < void > ;
16221646 }
16231647}
16241648declare module "create" {
@@ -1633,6 +1657,13 @@ declare module "create" {
16331657 * @extends {Embed }
16341658 */
16351659 export class Create extends Embed {
1660+ /**
1661+ * Gets or sets the configuration settings for creating report.
1662+ *
1663+ * @type {IReportCreateConfiguration }
1664+ * @hidden
1665+ */
1666+ createConfig : IReportCreateConfiguration ;
16361667 constructor ( service : Service , element : HTMLElement , config : IEmbedConfiguration | IReportCreateConfiguration , phasedRender ?: boolean , isBootstrap ?: boolean ) ;
16371668 /**
16381669 * Gets the dataset ID from the first available location: createConfig or embed url.
@@ -1678,6 +1709,19 @@ declare module "create" {
16781709 * @hidden
16791710 */
16801711 static findIdFromEmbedUrl ( url : string ) : string ;
1712+ /**
1713+ * Sends create configuration data.
1714+ *
1715+ * ```javascript
1716+ * create ({
1717+ * datasetId: '5dac7a4a-4452-46b3-99f6-a25915e0fe55',
1718+ * accessToken: 'eyJ0eXA ... TaE2rTSbmg',
1719+ * ```
1720+ *
1721+ * @hidden
1722+ * @returns {Promise<void> }
1723+ */
1724+ create ( ) : Promise < void > ;
16811725 }
16821726}
16831727declare module "dashboard" {
@@ -2003,11 +2047,70 @@ declare module "visual" {
20032047 private getFiltersLevelUrl ;
20042048 }
20052049}
2050+ declare module "quickCreate" {
2051+ import { IError , IQuickCreateConfiguration } from 'powerbi-models' ;
2052+ import { Service } from "service" ;
2053+ import { Embed , IEmbedConfigurationBase } from "embed" ;
2054+ /**
2055+ * A Power BI Quick Create component
2056+ *
2057+ * @export
2058+ * @class QuickCreate
2059+ * @extends {Embed }
2060+ */
2061+ export class QuickCreate extends Embed {
2062+ /**
2063+ * Gets or sets the configuration settings for creating report.
2064+ *
2065+ * @type {IQuickCreateConfiguration }
2066+ * @hidden
2067+ */
2068+ createConfig : IQuickCreateConfiguration ;
2069+ constructor ( service : Service , element : HTMLElement , config : IQuickCreateConfiguration , phasedRender ?: boolean , isBootstrap ?: boolean ) ;
2070+ /**
2071+ * Override the getId abstract function
2072+ * QuickCreate does not need any ID
2073+ *
2074+ * @returns {string }
2075+ */
2076+ getId ( ) : string ;
2077+ /**
2078+ * Validate create report configuration.
2079+ */
2080+ validate ( config : IEmbedConfigurationBase ) : IError [ ] ;
2081+ /**
2082+ * Handle config changes.
2083+ *
2084+ * @hidden
2085+ * @returns {void }
2086+ */
2087+ configChanged ( isBootstrap : boolean ) : void ;
2088+ /**
2089+ * @hidden
2090+ * @returns {string }
2091+ */
2092+ getDefaultEmbedUrlEndpoint ( ) : string ;
2093+ /**
2094+ * Sends quickCreate configuration data.
2095+ *
2096+ * ```javascript
2097+ * quickCreate({
2098+ * accessToken: 'eyJ0eXA ... TaE2rTSbmg',
2099+ * datasetCreateConfig: {}})
2100+ * ```
2101+ *
2102+ * @hidden
2103+ * @param {IQuickCreateConfiguration } createConfig
2104+ * @returns {Promise<void> }
2105+ */
2106+ create ( ) : Promise < void > ;
2107+ }
2108+ }
20062109declare module "service" {
20072110 import { WindowPostMessageProxy } from 'window-post-message-proxy' ;
20082111 import { HttpPostMessage } from 'http-post-message' ;
20092112 import { Router , IExtendedRequest , Response as IExtendedResponse } from 'powerbi-router' ;
2010- import { IReportCreateConfiguration } from 'powerbi-models' ;
2113+ import { IQuickCreateConfiguration , IReportCreateConfiguration } from 'powerbi-models' ;
20112114 import { Embed , IBootstrapEmbedConfiguration , IDashboardEmbedConfiguration , IEmbedConfiguration , IEmbedConfigurationBase , IQnaEmbedConfiguration , IReportEmbedConfiguration , ITileEmbedConfiguration , IVisualEmbedConfiguration } from "embed" ;
20122115 export interface IEvent < T > {
20132116 type : string ;
@@ -2063,6 +2166,10 @@ declare module "service" {
20632166 hpm : HttpPostMessage ;
20642167 }
20652168 export type IComponentEmbedConfiguration = IReportEmbedConfiguration | IDashboardEmbedConfiguration | ITileEmbedConfiguration | IVisualEmbedConfiguration | IQnaEmbedConfiguration ;
2169+ /**
2170+ * @hidden
2171+ */
2172+ export type EmbedComponentFactory = ( service : Service , element : HTMLElement , config : IEmbedConfigurationBase , phasedRender ?: boolean , isBootstrap ?: boolean ) => Embed ;
20662173 /**
20672174 * The Power BI Service embed component, which is the entry point to embed all other Power BI components into your application
20682175 *
@@ -2088,7 +2195,7 @@ declare module "service" {
20882195 accessToken : string ;
20892196 /** The Configuration object for the service*/
20902197 private config ;
2091- /** A list of Dashboard, Report and Tile components that have been embedded using this service instance. */
2198+ /** A list of Power BI components that have been embedded using this service instance. */
20922199 private embeds ;
20932200 /** TODO: Look for way to make hpm private without sacrificing ease of maintenance. This should be private but in embed needs to call methods.
20942201 *
@@ -2102,6 +2209,10 @@ declare module "service" {
21022209 wpmp : WindowPostMessageProxy ;
21032210 router : Router ;
21042211 private uniqueSessionId ;
2212+ /**
2213+ * @hidden
2214+ */
2215+ private registeredComponents ;
21052216 /**
21062217 * Creates an instance of a Power BI Service.
21072218 *
@@ -2120,6 +2231,14 @@ declare module "service" {
21202231 * @returns {Embed }
21212232 */
21222233 createReport ( element : HTMLElement , config : IEmbedConfiguration | IReportCreateConfiguration ) : Embed ;
2234+ /**
2235+ * Creates new dataset
2236+ *
2237+ * @param {HTMLElement } element
2238+ * @param {IEmbedConfiguration } [config={}]
2239+ * @returns {Embed }
2240+ */
2241+ quickCreate ( element : HTMLElement , config : IQuickCreateConfiguration ) : Embed ;
21232242 /**
21242243 * TODO: Add a description here
21252244 *
@@ -2175,10 +2294,25 @@ declare module "service" {
21752294 * @private
21762295 * @param {IPowerBiElement } element
21772296 * @param {IEmbedConfigurationBase } config
2297+ * @param {boolean } phasedRender
2298+ * @param {boolean } isBootstrap
21782299 * @returns {Embed }
21792300 * @hidden
21802301 */
21812302 private embedNew ;
2303+ /**
2304+ * Given component type, creates embed component instance
2305+ *
2306+ * @private
2307+ * @param {string } componentType
2308+ * @param {HTMLElement } element
2309+ * @param {IEmbedConfigurationBase } config
2310+ * @param {boolean } phasedRender
2311+ * @param {boolean } isBootstrap
2312+ * @returns {Embed }
2313+ * @hidden
2314+ */
2315+ private createEmbedComponent ;
21822316 /**
21832317 * Given an element that already contains an embed component, load with a new configuration.
21842318 *
@@ -2263,6 +2397,15 @@ declare module "service" {
22632397 * @returns {void }
22642398 */
22652399 setSdkInfo ( type : string , version : string ) : void ;
2400+ /**
2401+ * API for registering external components
2402+ *
2403+ * @hidden
2404+ * @param {string } componentType
2405+ * @param {EmbedComponentFactory } embedComponentFactory
2406+ * @param {string[] } routerEventUrls
2407+ */
2408+ register ( componentType : string , embedComponentFactory : EmbedComponentFactory , routerEventUrls : string [ ] ) : void ;
22662409 }
22672410}
22682411declare module "bookmarksManager" {
@@ -2797,11 +2940,12 @@ declare module "powerbi-client" {
27972940 export { Report } from "report" ;
27982941 export { Dashboard } from "dashboard" ;
27992942 export { Tile } from "tile" ;
2800- export { IEmbedConfiguration , IQnaEmbedConfiguration , IVisualEmbedConfiguration , IReportEmbedConfiguration , IDashboardEmbedConfiguration , ITileEmbedConfiguration , Embed , ILocaleSettings , IEmbedSettings , IQnaSettings , } from "embed" ;
2943+ export { IEmbedConfiguration , IQnaEmbedConfiguration , IVisualEmbedConfiguration , IReportEmbedConfiguration , IDashboardEmbedConfiguration , ITileEmbedConfiguration , IQuickCreateConfiguration , Embed , ILocaleSettings , IEmbedSettings , IQnaSettings , } from "embed" ;
28012944 export { Page } from "page" ;
28022945 export { Qna } from "qna" ;
28032946 export { Visual } from "visual" ;
28042947 export { VisualDescriptor } from "visualDescriptor" ;
2948+ export { QuickCreate } from "quickCreate" ;
28052949 export { BasicFilterBuilder , AdvancedFilterBuilder , TopNFilterBuilder , RelativeDateFilterBuilder , RelativeTimeFilterBuilder } from "FilterBuilders/index" ;
28062950 global {
28072951 interface Window {
0 commit comments