Skip to content

Commit

Permalink
2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmazzola committed Aug 31, 2016
1 parent 4653e9b commit 5152173
Show file tree
Hide file tree
Showing 16 changed files with 203 additions and 448 deletions.
2 changes: 1 addition & 1 deletion dist/config.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! powerbi-client v2.0.0-beta.13 | (c) 2016 Microsoft Corporation MIT */
/*! powerbi-client v2.0.0 | (c) 2016 Microsoft Corporation MIT */
declare const config: {
version: string;
type: string;
Expand Down
54 changes: 31 additions & 23 deletions dist/embed.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! powerbi-client v2.0.0-beta.13 | (c) 2016 Microsoft Corporation MIT */
/*! powerbi-client v2.0.0 | (c) 2016 Microsoft Corporation MIT */
import * as service from './service';
import * as models from 'powerbi-models';
declare global {
Expand All @@ -25,7 +25,7 @@ export interface IEmbedConfiguration {
accessToken?: string;
settings?: models.ISettings;
pageName?: string;
filters?: (models.IBasicFilter | models.IAdvancedFilter)[];
filters?: models.IFilter[];
}
export interface IInternalEmbedConfiguration extends models.ILoadConfiguration {
uniqueId: string;
Expand Down Expand Up @@ -53,40 +53,40 @@ export declare abstract class Embed {
private static defaultSettings;
allowedEvents: any[];
/**
* Gets or set the event handler registered for this embed component
* Gets or sets the event handler registered for this embed component.
*
* @type {IInternalEventHandler<any>[]}
*/
eventHandlers: IInternalEventHandler<any>[];
/**
* Gets or sets the Power BI embed service
* Gets or sets the Power BI embed service.
*
* @type {service.Service}
*/
service: service.Service;
/**
* Gets or sets the HTML element containing the Power BI embed component
* Gets or sets the HTML element that contains the Power BI embed component.
*
* @type {HTMLElement}
*/
element: HTMLElement;
/**
* Gets or sets the HTML iframe element that renders the Power BI embed component
* Gets or sets the HTML iframe element that renders the Power BI embed component.
*
* @type {HTMLIFrameElement}
*/
iframe: HTMLIFrameElement;
/**
* Gets or sets the configuration settings for the embed component
* Gets or sets the configuration settings for the Power BI embed component.
*
* @type {IInternalEmbedConfiguration}
*/
config: IInternalEmbedConfiguration;
/**
* Creates an instance of Embed.
*
* Note: there is circular reference between embeds and service
* The service has list of all embeds on the host page, and each embed has reference to the service that created it.
* Note: there is circular reference between embeds and the service, because
* the service has a list of all embeds on the host page, and each embed has a reference to the service that created it.
*
* @param {service.Service} service
* @param {HTMLElement} element
Expand Down Expand Up @@ -119,10 +119,9 @@ export declare abstract class Embed {
*/
load(config: models.ILoadConfiguration): Promise<void>;
/**
* Removes event handler(s) from list of handlers.
*
* If reference to existing handle function is specified remove specific handler.
* If handler is not specified, remove all handlers for the event name specified.
* Removes one or more event handlers from the list of handlers.
* If a reference to the existing handle function is specified, remove the specific handler.
* If the handler is not specified, remove all handlers for the event name specified.
*
* ```javascript
* report.off('pageChanged')
Expand All @@ -142,7 +141,7 @@ export declare abstract class Embed {
*/
off<T>(eventName: string, handler?: service.IEventHandler<T>): void;
/**
* Adds event handler for specific event.
* Adds an event handler for a specific event.
*
* ```javascript
* report.on('pageChanged', (event) => {
Expand All @@ -156,46 +155,55 @@ export declare abstract class Embed {
*/
on<T>(eventName: string, handler: service.IEventHandler<T>): void;
/**
* Get access token from first available location: config, attribute, global.
* Reloads embed using existing configuration.
* E.g. For reports this effectively clears all filters and makes the first page active which simulates resetting a report back to loaded state.
*
* ```javascript
* report.reload();
* ```
*/
reload(): Promise<void>;
/**
* Gets an access token from the first available location: config, attribute, global.
*
* @private
* @param {string} globalAccessToken
* @returns {string}
*/
private getAccessToken(globalAccessToken);
/**
* Get embed url from first available location: options, attribute.
* Gets an embed url from the first available location: options, attribute.
*
* @private
* @returns {string}
*/
private getEmbedUrl();
/**
* Get unique id from first available location: options, attribute.
* If neither is provided generate unique string.
* Gets a unique ID from the first available location: options, attribute.
* If neither is provided generate a unique string.
*
* @private
* @returns {string}
*/
private getUniqueId();
/**
* Get report id from first available location: options, attribute.
* Gets the report ID from the first available location: options, attribute.
*
* @abstract
* @returns {string}
*/
abstract getId(): string;
/**
* Request the browser to make the component's iframe fullscreen.
* Requests the browser to render the component's iframe in fullscreen mode.
*/
fullscreen(): void;
/**
* Exit fullscreen.
* Requests the browser to exit fullscreen mode.
*/
exitFullscreen(): void;
/**
* Return true if iframe is fullscreen,
* otherwise return false
* Returns true if the iframe is rendered in fullscreen mode,
* otherwise returns false.
*
* @private
* @param {HTMLIFrameElement} iframe
Expand Down
5 changes: 1 addition & 4 deletions dist/factories.d.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
/*! powerbi-client v2.0.0-beta.13 | (c) 2016 Microsoft Corporation MIT */
/*! powerbi-client v2.0.0 | (c) 2016 Microsoft Corporation MIT */
/**
* TODO: Need to find better place for these factory functions or refactor how we handle dependency injection
*/
import { IHpmFactory, IWpmpFactory, IRouterFactory } from './service';
export { IHpmFactory, IWpmpFactory, IRouterFactory };
/**
* TODO: Need to get sdk version and settings from package.json, Generate config file via gulp task?
*/
export declare const hpmFactory: IHpmFactory;
export declare const wpmpFactory: IWpmpFactory;
export declare const routerFactory: IRouterFactory;
16 changes: 8 additions & 8 deletions dist/ifilterable.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! powerbi-client v2.0.0-beta.13 | (c) 2016 Microsoft Corporation MIT */
/*! powerbi-client v2.0.0 | (c) 2016 Microsoft Corporation MIT */
import * as models from 'powerbi-models';
/**
* Decorates embed components that support filters
Expand All @@ -9,20 +9,20 @@ import * as models from 'powerbi-models';
*/
export interface IFilterable {
/**
* Gets the filters currently applied to the object
* Gets the filters currently applied to the object.
*
* @returns {(Promise<(models.IBasicFilter | models.IAdvancedFilter)[]>)}
* @returns {(Promise<models.IFilter[]>)}
*/
getFilters(): Promise<(models.IBasicFilter | models.IAdvancedFilter)[]>;
getFilters(): Promise<models.IFilter[]>;
/**
* Replaces all filters on the current object with the specified filter values
* Replaces all filters on the current object with the specified filter values.
*
* @param {((models.IBasicFilter | models.IAdvancedFilter)[])} filters
* @param {(models.IFilter[])} filters
* @returns {Promise<void>}
*/
setFilters(filters: (models.IBasicFilter | models.IAdvancedFilter)[]): Promise<void>;
setFilters(filters: models.IFilter[]): Promise<void>;
/**
* Removes all filters from the current object
* Removes all filters from the current object.
*
* @returns {Promise<void>}
*/
Expand Down
49 changes: 9 additions & 40 deletions dist/page.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*! powerbi-client v2.0.0-beta.13 | (c) 2016 Microsoft Corporation MIT */
/*! powerbi-client v2.0.0 | (c) 2016 Microsoft Corporation MIT */
import { IFilterable } from './ifilterable';
import { IReportNode } from './report';
import { Visual } from './visual';
import * as models from 'powerbi-models';
/**
* A Page node within a report hierarchy
Expand Down Expand Up @@ -35,8 +34,7 @@ export declare class Page implements IPageNode, IFilterable {
*/
name: string;
/**
* The user defined display name of the report page
* This can be undefined in cases where page is created manually
* The user defined display name of the report page, which is undefined if the page is created manually
*
* @type {string}
*/
Expand All @@ -50,29 +48,18 @@ export declare class Page implements IPageNode, IFilterable {
*/
constructor(report: IReportNode, name: string, displayName?: string);
/**
* Gets all page level filters within report
* Gets all page level filters within the report.
*
* ```javascript
* page.getFilters()
* .then(pages => { ... });
* ```
*
* @returns {(Promise<(models.IBasicFilter | models.IAdvancedFilter)[]>)}
* @returns {(Promise<models.IFilter[]>)}
*/
getFilters(): Promise<(models.IBasicFilter | models.IAdvancedFilter)[]>;
getFilters(): Promise<models.IFilter[]>;
/**
* Gets all the visuals on the page.
*
* ```javascript
* page.getVisuals()
* .then(visuals => { ... });
* ```
*
* @returns {Promise<Visual[]>}
*/
getVisuals(): Promise<Visual[]>;
/**
* Remove all filters on this page within the report
* Removes all filters from this page of the report.
*
* ```javascript
* page.removeFilters();
Expand All @@ -82,7 +69,7 @@ export declare class Page implements IPageNode, IFilterable {
*/
removeFilters(): Promise<void>;
/**
* Make the current page the active page of the report.
* Makes the current page the active page of the report.
*
* ```javascripot
* page.setActive();
Expand All @@ -99,26 +86,8 @@ export declare class Page implements IPageNode, IFilterable {
* .catch(errors => { ... });
* ```
*
* @param {((models.IBasicFilter | models.IAdvancedFilter)[])} filters
* @param {(models.IFilter[])} filters
* @returns {Promise<void>}
*/
setFilters(filters: (models.IBasicFilter | models.IAdvancedFilter)[]): Promise<void>;
/**
* Creates new Visual object given a name of the visual.
*
* Normally you would get Visual objects by calling `page.getVisuals()` but in the case
* that the visual name is known and you want to perform an action on a visaul such as setting a filters
* without having to retrieve it first you can create it directly.
*
* 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.
*
* ```javascript
* const visual = report.page('ReportSection1').visual('BarChart1');
* visual.setFilters(filters);
* ```
*
* @param {string} name
* @returns {Visual}
*/
visual(name: string): Visual;
setFilters(filters: models.IFilter[]): Promise<void>;
}
3 changes: 1 addition & 2 deletions dist/powerbi.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! powerbi-client v2.0.0-beta.13 | (c) 2016 Microsoft Corporation MIT */
/*! powerbi-client v2.0.0 | (c) 2016 Microsoft Corporation MIT */
import * as service from './service';
import * as factories from './factories';
import * as models from 'powerbi-models';
Expand All @@ -8,7 +8,6 @@ export { Report } from './report';
export { Tile } from './tile';
export { IEmbedConfiguration, Embed } from './embed';
export { Page } from './page';
export { Visual } from './visual';
declare global {
interface Window {
powerbi: service.Service;
Expand Down
Loading

0 comments on commit 5152173

Please sign in to comment.