1
- // powerbi-client v2.21.1
1
+ // powerbi-client v2.22.2
2
2
// Copyright (c) Microsoft Corporation.
3
3
// Licensed under the MIT License.
4
4
declare module "config" {
@@ -116,6 +116,14 @@ declare module "util" {
116
116
* @returns {number }
117
117
*/
118
118
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 ;
119
127
}
120
128
declare module "embed" {
121
129
import * as models from 'powerbi-models' ;
@@ -142,6 +150,7 @@ declare module "embed" {
142
150
export type IDashboardEmbedConfiguration = models . IDashboardEmbedConfiguration ;
143
151
export type ITileEmbedConfiguration = models . ITileEmbedConfiguration ;
144
152
export type IQnaEmbedConfiguration = models . IQnaEmbedConfiguration ;
153
+ export type IQuickCreateConfiguration = models . IQuickCreateConfiguration ;
145
154
export type ILocaleSettings = models . ILocaleSettings ;
146
155
export type IQnaSettings = models . IQnaSettings ;
147
156
export type IEmbedSettings = models . ISettings ;
@@ -249,13 +258,6 @@ declare module "embed" {
249
258
* @hidden
250
259
*/
251
260
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 ;
259
261
/**
260
262
* Url used in the load request.
261
263
*
@@ -299,19 +301,12 @@ declare module "embed" {
299
301
*/
300
302
constructor ( service : Service , element : HTMLElement , config : IEmbedConfigurationBase , iframe ?: HTMLIFrameElement , phasedRender ?: boolean , isBootstrap ?: boolean ) ;
301
303
/**
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
309
305
*
310
306
* @hidden
311
- * @param {models.IReportCreateConfiguration } config
312
307
* @returns {Promise<void> }
313
308
*/
314
- createReport ( config : models . IReportCreateConfiguration ) : Promise < void > ;
309
+ create ( ) : Promise < void > ;
315
310
/**
316
311
* Saves Report.
317
312
*
@@ -1619,6 +1614,35 @@ declare module "report" {
1619
1614
* @param zoomLevel zoom level to set
1620
1615
*/
1621
1616
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 > ;
1622
1646
}
1623
1647
}
1624
1648
declare module "create" {
@@ -1633,6 +1657,13 @@ declare module "create" {
1633
1657
* @extends {Embed }
1634
1658
*/
1635
1659
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 ;
1636
1667
constructor ( service : Service , element : HTMLElement , config : IEmbedConfiguration | IReportCreateConfiguration , phasedRender ?: boolean , isBootstrap ?: boolean ) ;
1637
1668
/**
1638
1669
* Gets the dataset ID from the first available location: createConfig or embed url.
@@ -1678,6 +1709,19 @@ declare module "create" {
1678
1709
* @hidden
1679
1710
*/
1680
1711
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 > ;
1681
1725
}
1682
1726
}
1683
1727
declare module "dashboard" {
@@ -2003,11 +2047,70 @@ declare module "visual" {
2003
2047
private getFiltersLevelUrl ;
2004
2048
}
2005
2049
}
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
+ }
2006
2109
declare module "service" {
2007
2110
import { WindowPostMessageProxy } from 'window-post-message-proxy' ;
2008
2111
import { HttpPostMessage } from 'http-post-message' ;
2009
2112
import { Router , IExtendedRequest , Response as IExtendedResponse } from 'powerbi-router' ;
2010
- import { IReportCreateConfiguration } from 'powerbi-models' ;
2113
+ import { IQuickCreateConfiguration , IReportCreateConfiguration } from 'powerbi-models' ;
2011
2114
import { Embed , IBootstrapEmbedConfiguration , IDashboardEmbedConfiguration , IEmbedConfiguration , IEmbedConfigurationBase , IQnaEmbedConfiguration , IReportEmbedConfiguration , ITileEmbedConfiguration , IVisualEmbedConfiguration } from "embed" ;
2012
2115
export interface IEvent < T > {
2013
2116
type : string ;
@@ -2063,6 +2166,10 @@ declare module "service" {
2063
2166
hpm : HttpPostMessage ;
2064
2167
}
2065
2168
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 ;
2066
2173
/**
2067
2174
* The Power BI Service embed component, which is the entry point to embed all other Power BI components into your application
2068
2175
*
@@ -2088,7 +2195,7 @@ declare module "service" {
2088
2195
accessToken : string ;
2089
2196
/** The Configuration object for the service*/
2090
2197
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. */
2092
2199
private embeds ;
2093
2200
/** TODO: Look for way to make hpm private without sacrificing ease of maintenance. This should be private but in embed needs to call methods.
2094
2201
*
@@ -2102,6 +2209,10 @@ declare module "service" {
2102
2209
wpmp : WindowPostMessageProxy ;
2103
2210
router : Router ;
2104
2211
private uniqueSessionId ;
2212
+ /**
2213
+ * @hidden
2214
+ */
2215
+ private registeredComponents ;
2105
2216
/**
2106
2217
* Creates an instance of a Power BI Service.
2107
2218
*
@@ -2120,6 +2231,14 @@ declare module "service" {
2120
2231
* @returns {Embed }
2121
2232
*/
2122
2233
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 ;
2123
2242
/**
2124
2243
* TODO: Add a description here
2125
2244
*
@@ -2175,10 +2294,25 @@ declare module "service" {
2175
2294
* @private
2176
2295
* @param {IPowerBiElement } element
2177
2296
* @param {IEmbedConfigurationBase } config
2297
+ * @param {boolean } phasedRender
2298
+ * @param {boolean } isBootstrap
2178
2299
* @returns {Embed }
2179
2300
* @hidden
2180
2301
*/
2181
2302
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 ;
2182
2316
/**
2183
2317
* Given an element that already contains an embed component, load with a new configuration.
2184
2318
*
@@ -2263,6 +2397,15 @@ declare module "service" {
2263
2397
* @returns {void }
2264
2398
*/
2265
2399
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 ;
2266
2409
}
2267
2410
}
2268
2411
declare module "bookmarksManager" {
@@ -2797,11 +2940,12 @@ declare module "powerbi-client" {
2797
2940
export { Report } from "report" ;
2798
2941
export { Dashboard } from "dashboard" ;
2799
2942
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" ;
2801
2944
export { Page } from "page" ;
2802
2945
export { Qna } from "qna" ;
2803
2946
export { Visual } from "visual" ;
2804
2947
export { VisualDescriptor } from "visualDescriptor" ;
2948
+ export { QuickCreate } from "quickCreate" ;
2805
2949
export { BasicFilterBuilder , AdvancedFilterBuilder , TopNFilterBuilder , RelativeDateFilterBuilder , RelativeTimeFilterBuilder } from "FilterBuilders/index" ;
2806
2950
global {
2807
2951
interface Window {
0 commit comments