Skip to content

Commit 5152173

Browse files
committed
2.0.0
1 parent 4653e9b commit 5152173

16 files changed

+203
-448
lines changed

dist/config.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! powerbi-client v2.0.0-beta.13 | (c) 2016 Microsoft Corporation MIT */
1+
/*! powerbi-client v2.0.0 | (c) 2016 Microsoft Corporation MIT */
22
declare const config: {
33
version: string;
44
type: string;

dist/embed.d.ts

+31-23
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! powerbi-client v2.0.0-beta.13 | (c) 2016 Microsoft Corporation MIT */
1+
/*! powerbi-client v2.0.0 | (c) 2016 Microsoft Corporation MIT */
22
import * as service from './service';
33
import * as models from 'powerbi-models';
44
declare global {
@@ -25,7 +25,7 @@ export interface IEmbedConfiguration {
2525
accessToken?: string;
2626
settings?: models.ISettings;
2727
pageName?: string;
28-
filters?: (models.IBasicFilter | models.IAdvancedFilter)[];
28+
filters?: models.IFilter[];
2929
}
3030
export interface IInternalEmbedConfiguration extends models.ILoadConfiguration {
3131
uniqueId: string;
@@ -53,40 +53,40 @@ export declare abstract class Embed {
5353
private static defaultSettings;
5454
allowedEvents: any[];
5555
/**
56-
* Gets or set the event handler registered for this embed component
56+
* Gets or sets the event handler registered for this embed component.
5757
*
5858
* @type {IInternalEventHandler<any>[]}
5959
*/
6060
eventHandlers: IInternalEventHandler<any>[];
6161
/**
62-
* Gets or sets the Power BI embed service
62+
* Gets or sets the Power BI embed service.
6363
*
6464
* @type {service.Service}
6565
*/
6666
service: service.Service;
6767
/**
68-
* Gets or sets the HTML element containing the Power BI embed component
68+
* Gets or sets the HTML element that contains the Power BI embed component.
6969
*
7070
* @type {HTMLElement}
7171
*/
7272
element: HTMLElement;
7373
/**
74-
* Gets or sets the HTML iframe element that renders the Power BI embed component
74+
* Gets or sets the HTML iframe element that renders the Power BI embed component.
7575
*
7676
* @type {HTMLIFrameElement}
7777
*/
7878
iframe: HTMLIFrameElement;
7979
/**
80-
* Gets or sets the configuration settings for the embed component
80+
* Gets or sets the configuration settings for the Power BI embed component.
8181
*
8282
* @type {IInternalEmbedConfiguration}
8383
*/
8484
config: IInternalEmbedConfiguration;
8585
/**
8686
* Creates an instance of Embed.
8787
*
88-
* Note: there is circular reference between embeds and service
89-
* The service has list of all embeds on the host page, and each embed has reference to the service that created it.
88+
* Note: there is circular reference between embeds and the service, because
89+
* the service has a list of all embeds on the host page, and each embed has a reference to the service that created it.
9090
*
9191
* @param {service.Service} service
9292
* @param {HTMLElement} element
@@ -119,10 +119,9 @@ export declare abstract class Embed {
119119
*/
120120
load(config: models.ILoadConfiguration): Promise<void>;
121121
/**
122-
* Removes event handler(s) from list of handlers.
123-
*
124-
* If reference to existing handle function is specified remove specific handler.
125-
* If handler is not specified, remove all handlers for the event name specified.
122+
* Removes one or more event handlers from the list of handlers.
123+
* If a reference to the existing handle function is specified, remove the specific handler.
124+
* If the handler is not specified, remove all handlers for the event name specified.
126125
*
127126
* ```javascript
128127
* report.off('pageChanged')
@@ -142,7 +141,7 @@ export declare abstract class Embed {
142141
*/
143142
off<T>(eventName: string, handler?: service.IEventHandler<T>): void;
144143
/**
145-
* Adds event handler for specific event.
144+
* Adds an event handler for a specific event.
146145
*
147146
* ```javascript
148147
* report.on('pageChanged', (event) => {
@@ -156,46 +155,55 @@ export declare abstract class Embed {
156155
*/
157156
on<T>(eventName: string, handler: service.IEventHandler<T>): void;
158157
/**
159-
* Get access token from first available location: config, attribute, global.
158+
* Reloads embed using existing configuration.
159+
* E.g. For reports this effectively clears all filters and makes the first page active which simulates resetting a report back to loaded state.
160+
*
161+
* ```javascript
162+
* report.reload();
163+
* ```
164+
*/
165+
reload(): Promise<void>;
166+
/**
167+
* Gets an access token from the first available location: config, attribute, global.
160168
*
161169
* @private
162170
* @param {string} globalAccessToken
163171
* @returns {string}
164172
*/
165173
private getAccessToken(globalAccessToken);
166174
/**
167-
* Get embed url from first available location: options, attribute.
175+
* Gets an embed url from the first available location: options, attribute.
168176
*
169177
* @private
170178
* @returns {string}
171179
*/
172180
private getEmbedUrl();
173181
/**
174-
* Get unique id from first available location: options, attribute.
175-
* If neither is provided generate unique string.
182+
* Gets a unique ID from the first available location: options, attribute.
183+
* If neither is provided generate a unique string.
176184
*
177185
* @private
178186
* @returns {string}
179187
*/
180188
private getUniqueId();
181189
/**
182-
* Get report id from first available location: options, attribute.
190+
* Gets the report ID from the first available location: options, attribute.
183191
*
184192
* @abstract
185193
* @returns {string}
186194
*/
187195
abstract getId(): string;
188196
/**
189-
* Request the browser to make the component's iframe fullscreen.
197+
* Requests the browser to render the component's iframe in fullscreen mode.
190198
*/
191199
fullscreen(): void;
192200
/**
193-
* Exit fullscreen.
201+
* Requests the browser to exit fullscreen mode.
194202
*/
195203
exitFullscreen(): void;
196204
/**
197-
* Return true if iframe is fullscreen,
198-
* otherwise return false
205+
* Returns true if the iframe is rendered in fullscreen mode,
206+
* otherwise returns false.
199207
*
200208
* @private
201209
* @param {HTMLIFrameElement} iframe

dist/factories.d.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
/*! powerbi-client v2.0.0-beta.13 | (c) 2016 Microsoft Corporation MIT */
1+
/*! powerbi-client v2.0.0 | (c) 2016 Microsoft Corporation MIT */
22
/**
33
* TODO: Need to find better place for these factory functions or refactor how we handle dependency injection
44
*/
55
import { IHpmFactory, IWpmpFactory, IRouterFactory } from './service';
66
export { IHpmFactory, IWpmpFactory, IRouterFactory };
7-
/**
8-
* TODO: Need to get sdk version and settings from package.json, Generate config file via gulp task?
9-
*/
107
export declare const hpmFactory: IHpmFactory;
118
export declare const wpmpFactory: IWpmpFactory;
129
export declare const routerFactory: IRouterFactory;

dist/ifilterable.d.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! powerbi-client v2.0.0-beta.13 | (c) 2016 Microsoft Corporation MIT */
1+
/*! powerbi-client v2.0.0 | (c) 2016 Microsoft Corporation MIT */
22
import * as models from 'powerbi-models';
33
/**
44
* Decorates embed components that support filters
@@ -9,20 +9,20 @@ import * as models from 'powerbi-models';
99
*/
1010
export interface IFilterable {
1111
/**
12-
* Gets the filters currently applied to the object
12+
* Gets the filters currently applied to the object.
1313
*
14-
* @returns {(Promise<(models.IBasicFilter | models.IAdvancedFilter)[]>)}
14+
* @returns {(Promise<models.IFilter[]>)}
1515
*/
16-
getFilters(): Promise<(models.IBasicFilter | models.IAdvancedFilter)[]>;
16+
getFilters(): Promise<models.IFilter[]>;
1717
/**
18-
* Replaces all filters on the current object with the specified filter values
18+
* Replaces all filters on the current object with the specified filter values.
1919
*
20-
* @param {((models.IBasicFilter | models.IAdvancedFilter)[])} filters
20+
* @param {(models.IFilter[])} filters
2121
* @returns {Promise<void>}
2222
*/
23-
setFilters(filters: (models.IBasicFilter | models.IAdvancedFilter)[]): Promise<void>;
23+
setFilters(filters: models.IFilter[]): Promise<void>;
2424
/**
25-
* Removes all filters from the current object
25+
* Removes all filters from the current object.
2626
*
2727
* @returns {Promise<void>}
2828
*/

dist/page.d.ts

+9-40
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
/*! powerbi-client v2.0.0-beta.13 | (c) 2016 Microsoft Corporation MIT */
1+
/*! powerbi-client v2.0.0 | (c) 2016 Microsoft Corporation MIT */
22
import { IFilterable } from './ifilterable';
33
import { IReportNode } from './report';
4-
import { Visual } from './visual';
54
import * as models from 'powerbi-models';
65
/**
76
* A Page node within a report hierarchy
@@ -35,8 +34,7 @@ export declare class Page implements IPageNode, IFilterable {
3534
*/
3635
name: string;
3736
/**
38-
* The user defined display name of the report page
39-
* This can be undefined in cases where page is created manually
37+
* The user defined display name of the report page, which is undefined if the page is created manually
4038
*
4139
* @type {string}
4240
*/
@@ -50,29 +48,18 @@ export declare class Page implements IPageNode, IFilterable {
5048
*/
5149
constructor(report: IReportNode, name: string, displayName?: string);
5250
/**
53-
* Gets all page level filters within report
51+
* Gets all page level filters within the report.
5452
*
5553
* ```javascript
5654
* page.getFilters()
5755
* .then(pages => { ... });
5856
* ```
5957
*
60-
* @returns {(Promise<(models.IBasicFilter | models.IAdvancedFilter)[]>)}
58+
* @returns {(Promise<models.IFilter[]>)}
6159
*/
62-
getFilters(): Promise<(models.IBasicFilter | models.IAdvancedFilter)[]>;
60+
getFilters(): Promise<models.IFilter[]>;
6361
/**
64-
* Gets all the visuals on the page.
65-
*
66-
* ```javascript
67-
* page.getVisuals()
68-
* .then(visuals => { ... });
69-
* ```
70-
*
71-
* @returns {Promise<Visual[]>}
72-
*/
73-
getVisuals(): Promise<Visual[]>;
74-
/**
75-
* Remove all filters on this page within the report
62+
* Removes all filters from this page of the report.
7663
*
7764
* ```javascript
7865
* page.removeFilters();
@@ -82,7 +69,7 @@ export declare class Page implements IPageNode, IFilterable {
8269
*/
8370
removeFilters(): Promise<void>;
8471
/**
85-
* Make the current page the active page of the report.
72+
* Makes the current page the active page of the report.
8673
*
8774
* ```javascripot
8875
* page.setActive();
@@ -99,26 +86,8 @@ export declare class Page implements IPageNode, IFilterable {
9986
* .catch(errors => { ... });
10087
* ```
10188
*
102-
* @param {((models.IBasicFilter | models.IAdvancedFilter)[])} filters
89+
* @param {(models.IFilter[])} filters
10390
* @returns {Promise<void>}
10491
*/
105-
setFilters(filters: (models.IBasicFilter | models.IAdvancedFilter)[]): Promise<void>;
106-
/**
107-
* Creates new Visual object given a name of the visual.
108-
*
109-
* Normally you would get Visual objects by calling `page.getVisuals()` but in the case
110-
* that the visual name is known and you want to perform an action on a visaul such as setting a filters
111-
* without having to retrieve it first you can create it directly.
112-
*
113-
* Note: Since you are creating the visual manually there is no guarantee that the visual actually exists in the report and the subsequence requests could fail.
114-
*
115-
* ```javascript
116-
* const visual = report.page('ReportSection1').visual('BarChart1');
117-
* visual.setFilters(filters);
118-
* ```
119-
*
120-
* @param {string} name
121-
* @returns {Visual}
122-
*/
123-
visual(name: string): Visual;
92+
setFilters(filters: models.IFilter[]): Promise<void>;
12493
}

dist/powerbi.d.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! powerbi-client v2.0.0-beta.13 | (c) 2016 Microsoft Corporation MIT */
1+
/*! powerbi-client v2.0.0 | (c) 2016 Microsoft Corporation MIT */
22
import * as service from './service';
33
import * as factories from './factories';
44
import * as models from 'powerbi-models';
@@ -8,7 +8,6 @@ export { Report } from './report';
88
export { Tile } from './tile';
99
export { IEmbedConfiguration, Embed } from './embed';
1010
export { Page } from './page';
11-
export { Visual } from './visual';
1211
declare global {
1312
interface Window {
1413
powerbi: service.Service;

0 commit comments

Comments
 (0)