|
1 | | -/*! powerbi-client v2.0.0 | (c) 2016 Microsoft Corporation MIT */ |
| 1 | +/*! powerbi-client v2.1.0 | (c) 2016 Microsoft Corporation MIT */ |
2 | 2 | import { IFilterable } from './ifilterable'; |
3 | 3 | import { IReportNode } from './report'; |
| 4 | +import { Visual } from './visual'; |
4 | 5 | import * as models from 'powerbi-models'; |
5 | 6 | /** |
6 | 7 | * A Page node within a report hierarchy |
@@ -58,6 +59,17 @@ export declare class Page implements IPageNode, IFilterable { |
58 | 59 | * @returns {(Promise<models.IFilter[]>)} |
59 | 60 | */ |
60 | 61 | getFilters(): Promise<models.IFilter[]>; |
| 62 | + /** |
| 63 | + * Gets all the visuals on the page. |
| 64 | + * |
| 65 | + * ```javascript |
| 66 | + * page.getVisuals() |
| 67 | + * .then(visuals => { ... }); |
| 68 | + * ``` |
| 69 | + * |
| 70 | + * @returns {Promise<Visual[]>} |
| 71 | + */ |
| 72 | + getVisuals(): Promise<Visual[]>; |
61 | 73 | /** |
62 | 74 | * Removes all filters from this page of the report. |
63 | 75 | * |
@@ -90,4 +102,22 @@ export declare class Page implements IPageNode, IFilterable { |
90 | 102 | * @returns {Promise<void>} |
91 | 103 | */ |
92 | 104 | setFilters(filters: models.IFilter[]): Promise<void>; |
| 105 | + /** |
| 106 | + * Creates a Visual object given a name for the visual. |
| 107 | + * |
| 108 | + * Normally you would get Visual objects by calling `page.getVisuals()` but in the case |
| 109 | + * that the visual name is known and you want to perform an action on a visual such as setting a filter |
| 110 | + * without having to retrieve it first you can create it directly. |
| 111 | + * |
| 112 | + * Note: Because you are creating the visual manually there is no guarantee that the visual actually exists in the report and the subsequence requests could fail. |
| 113 | + * |
| 114 | + * ```javascript |
| 115 | + * const visual = report.page('ReportSection1').visual('BarChart1'); |
| 116 | + * visual.setFilters(filters); |
| 117 | + * ``` |
| 118 | + * |
| 119 | + * @param {string} name |
| 120 | + * @returns {Visual} |
| 121 | + */ |
| 122 | + visual(name: string): Visual; |
93 | 123 | } |
0 commit comments