import { EventEmitter, AfterViewInit, OnDestroy } from '@angular/core'; import { PowerBIService } from '../services/service'; import { ReportsListService } from '../services/reportsList'; import { Report, Page, models } from 'powerbi-client'; /** * Report Viewer component to display a powerbi report using the powerbi javascript api. * * @export * @class ReportViewer * @implements {AfterViewInit} */ export declare class ReportViewer implements AfterViewInit, OnDestroy { private _embedUrl; private _token; private _reportId; private _report; private _service; private _subscription; private _reportsListService; private _pages; private _currentPage; private _pageIndex; private _initialized; private container; /** * Gets or sets the Id of the report * * @memberof ReportViewer */ Id: string; /** * Gets or sets the access token to use to render the report * * @memberof ReportViewer */ Token: string; /** * Gets the current report page. * * @readonly * @type {Page}@memberof ReportViewer */ readonly CurrentPage: Page; /** * Gets the pages in the report. * * @readonly * @type {Array}@memberof ReportViewer */ readonly Pages: Array; /** * Gets the index of the current page. * * @readonly * @type {number}@memberof ReportViewer */ readonly PageIndex: number; /** * Emits a Report object when the report is successfully embeded. * * @memberof ReportViewer */ OnEmbedded: EventEmitter; /** * Emits a Page object when the report page changes. * * @memberof ReportViewer */ OnPageChanged: EventEmitter; /** * Creates an instance of ReportViewer. * @param {PowerBIService} embedService - An instance of the powerbi embed service wrapping the powerbi API. * @param {ReportsListService} reportsListService - An instance of the reports list service providing access tokens for the reports. * @memberof ReportViewer */ constructor(embedService: PowerBIService, reportsListService: ReportsListService); /** * Applies a filter to the report. See * https://microsoft.github.io/PowerBI-JavaScript/interfaces/_src_ifilterable_.ifilterable.html#setfilters for * more information * * @param {models.IFilter} filter - A filter object specifying the filter to apply. * @param {string} target - that target (either page or report). * @memberof ReportViewer */ ApplyFilter(filter: models.IFilter, target: string): void; /** * Clears the filters from a report. See * https://microsoft.github.io/PowerBI-JavaScript/classes/_src_report_.report.html#removefilters and * https://microsoft.github.io/PowerBI-JavaScript/classes/_src_page_.page.html#removefilters for * more detail * * @memberof ReportViewer */ ClearFilters(): void; /** * Initializes the component. Part of the ng component lifecycle. * * @memberof ReportViewer */ ngAfterViewInit(): void; /** * Frees up resources when component is destroyed. Part of the ng component lifecycle. * * @memberof ReportViewer */ ngOnDestroy(): void; /** * Resets the component and removes the current report. * * @param {HTMLElement} element * @memberof ReportViewer */ Reset(element: HTMLElement): void; /** * Updates the report settings. For a full list of configurable settings see the following wiki page * https://github.com/Microsoft/PowerBI-JavaScript/wiki/Settings * * @param {string} settingName - The name of the setting to update. * @param {*} value - The value for the setting. * @memberof ReportViewer */ UpdateSetting(settingName: string, value: any): void; /** * Embeds a report into the target element. * * @private * @param {string} [token] - Access token to use to render the report. * @returns {void} * @memberof ReportViewer */ private Embed(token?); /** * Loads the report for the viewer. * * @private * @returns * @memberof ReportViewer */ private Load(); /** * Validates the required parameters. * * @private * @returns {boolean} - true if validation succeeds, false otherwise. * @memberof ReportViewer */ private ValidateRequiredAttributes(); }