Skip to content

Commit 12ee82c

Browse files
mgblythewbreza
authored andcommitted
Edit pass for jsdco comments (#34)
1 parent 436172d commit 12ee82c

File tree

9 files changed

+86
-90
lines changed

9 files changed

+86
-90
lines changed

src/embed.ts

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -73,35 +73,35 @@ export abstract class Embed {
7373
allowedEvents = [];
7474

7575
/**
76-
* Gets or set the event handler registered for this embed component
76+
* Gets or sets the event handler registered for this embed component.
7777
*
7878
* @type {IInternalEventHandler<any>[]}
7979
*/
8080
eventHandlers: IInternalEventHandler<any>[];
8181

8282
/**
83-
* Gets or sets the Power BI embed service
83+
* Gets or sets the Power BI embed service.
8484
*
8585
* @type {service.Service}
8686
*/
8787
service: service.Service;
8888

8989
/**
90-
* Gets or sets the HTML element containing the Power BI embed component
90+
* Gets or sets the HTML element that contains the Power BI embed component.
9191
*
9292
* @type {HTMLElement}
9393
*/
9494
element: HTMLElement;
9595

9696
/**
97-
* Gets or sets the HTML iframe element that renders the Power BI embed component
97+
* Gets or sets the HTML iframe element that renders the Power BI embed component.
9898
*
9999
* @type {HTMLIFrameElement}
100100
*/
101101
iframe: HTMLIFrameElement;
102102

103103
/**
104-
* Gets or sets the configuration settings for the embed component
104+
* Gets or sets the configuration settings for the Power BI embed component.
105105
*
106106
* @type {IInternalEmbedConfiguration}
107107
*/
@@ -110,8 +110,8 @@ export abstract class Embed {
110110
/**
111111
* Creates an instance of Embed.
112112
*
113-
* Note: there is circular reference between embeds and service
114-
* The service has list of all embeds on the host page, and each embed has reference to the service that created it.
113+
* Note: there is circular reference between embeds and the service, because
114+
* the service has a list of all embeds on the host page, and each embed has a reference to the service that created it.
115115
*
116116
* @param {service.Service} service
117117
* @param {HTMLElement} element
@@ -178,10 +178,9 @@ export abstract class Embed {
178178
}
179179

180180
/**
181-
* Removes event handler(s) from list of handlers.
182-
*
183-
* If reference to existing handle function is specified remove specific handler.
184-
* If handler is not specified, remove all handlers for the event name specified.
181+
* Removes one or more event handlers from the list of handlers.
182+
* If a reference to the existing handle function is specified, remove the specific handler.
183+
* If the handler is not specified, remove all handlers for the event name specified.
185184
*
186185
* ```javascript
187186
* report.off('pageChanged')
@@ -218,7 +217,7 @@ export abstract class Embed {
218217
}
219218

220219
/**
221-
* Adds event handler for specific event.
220+
* Adds an event handler for a specific event.
222221
*
223222
* ```javascript
224223
* report.on('pageChanged', (event) => {
@@ -244,7 +243,7 @@ export abstract class Embed {
244243
}
245244

246245
/**
247-
* Get access token from first available location: config, attribute, global.
246+
* Gets an access token from the first available location: config, attribute, global.
248247
*
249248
* @private
250249
* @param {string} globalAccessToken
@@ -261,7 +260,7 @@ export abstract class Embed {
261260
}
262261

263262
/**
264-
* Get embed url from first available location: options, attribute.
263+
* Gets an embed url from the first available location: options, attribute.
265264
*
266265
* @private
267266
* @returns {string}
@@ -277,8 +276,8 @@ export abstract class Embed {
277276
}
278277

279278
/**
280-
* Get unique id from first available location: options, attribute.
281-
* If neither is provided generate unique string.
279+
* Gets a unique ID from the first available location: options, attribute.
280+
* If neither is provided generate a unique string.
282281
*
283282
* @private
284283
* @returns {string}
@@ -288,23 +287,23 @@ export abstract class Embed {
288287
}
289288

290289
/**
291-
* Get report id from first available location: options, attribute.
290+
* Gets the report ID from the first available location: options, attribute.
292291
*
293292
* @abstract
294293
* @returns {string}
295294
*/
296295
abstract getId(): string;
297296

298297
/**
299-
* Request the browser to make the component's iframe fullscreen.
298+
* Requests the browser to render the component's iframe in fullscreen mode.
300299
*/
301300
fullscreen(): void {
302301
const requestFullScreen = this.iframe.requestFullscreen || this.iframe.msRequestFullscreen || this.iframe.mozRequestFullScreen || this.iframe.webkitRequestFullscreen;
303302
requestFullScreen.call(this.iframe);
304303
}
305304

306305
/**
307-
* Exit fullscreen.
306+
* Requests the browser to exit fullscreen mode.
308307
*/
309308
exitFullscreen(): void {
310309
if (!this.isFullscreen(this.iframe)) {
@@ -317,8 +316,8 @@ export abstract class Embed {
317316

318317

319318
/**
320-
* Return true if iframe is fullscreen,
321-
* otherwise return false
319+
* Returns true if the iframe is rendered in fullscreen mode,
320+
* otherwise returns false.
322321
*
323322
* @private
324323
* @param {HTMLIFrameElement} iframe

src/ifilterable.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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
*
1414
* @returns {(Promise<(models.IBasicFilter | models.IAdvancedFilter)[]>)}
1515
*/
1616
getFilters(): Promise<(models.IBasicFilter | models.IAdvancedFilter)[]>;
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
*
2020
* @param {((models.IBasicFilter | models.IAdvancedFilter)[])} filters
2121
* @returns {Promise<void>}
2222
*/
2323
setFilters(filters: (models.IBasicFilter | models.IAdvancedFilter)[]): 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
*/

src/page.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ export class Page implements IPageNode, IFilterable {
3737
name: string;
3838

3939
/**
40-
* The user defined display name of the report page
41-
* This can be undefined in cases where page is created manually
40+
* The user defined display name of the report page, which is undefined if the page is created manually
4241
*
4342
* @type {string}
4443
*/
@@ -58,7 +57,7 @@ export class Page implements IPageNode, IFilterable {
5857
}
5958

6059
/**
61-
* Gets all page level filters within report
60+
* Gets all page level filters within the report.
6261
*
6362
* ```javascript
6463
* page.getFilters()
@@ -98,7 +97,7 @@ export class Page implements IPageNode, IFilterable {
9897
}
9998

10099
/**
101-
* Remove all filters on this page within the report
100+
* Removes all filters from this page of the report.
102101
*
103102
* ```javascript
104103
* page.removeFilters();
@@ -111,7 +110,7 @@ export class Page implements IPageNode, IFilterable {
111110
}
112111

113112
/**
114-
* Make the current page the active page of the report.
113+
* Makes the current page the active page of the report.
115114
*
116115
* ```javascripot
117116
* page.setActive();
@@ -150,13 +149,13 @@ export class Page implements IPageNode, IFilterable {
150149
}
151150

152151
/**
153-
* Creates new Visual object given a name of the visual.
152+
* Creates a Visual object given a name for the visual.
154153
*
155154
* Normally you would get Visual objects by calling `page.getVisuals()` but in the case
156-
* that the visual name is known and you want to perform an action on a visaul such as setting a filters
155+
* that the visual name is known and you want to perform an action on a visual such as setting a filter
157156
* without having to retrieve it first you can create it directly.
158157
*
159-
* 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.
158+
* 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.
160159
*
161160
* ```javascript
162161
* const visual = report.page('ReportSection1').visual('BarChart1');

src/powerbi.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ declare global {
3434
}
3535

3636
/**
37-
* Make PowerBi available on global object for use in apps without module loading support.
38-
* Save class to allow creating an instance of the service.
39-
* Create instance of class with default config for normal usage.
37+
* Makes Power BI available to the global object for use in applications that don't have module loading support.
38+
*
39+
* Note: create an instance of the class with the default configuration for normal usage, or save the class so that you can create an instance of the service.
4040
*/
4141
var powerbi = new service.Service(factories.hpmFactory, factories.wpmpFactory, factories.routerFactory);
4242
window.powerbi = powerbi;

src/report.ts

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export interface IReportNode {
2020
}
2121

2222
/**
23-
* A Power BI Report embed component
23+
* The Power BI Report embed component
2424
*
2525
* @export
2626
* @class Report
@@ -57,10 +57,10 @@ export class Report extends embed.Embed implements IReportNode, IFilterable {
5757
}
5858

5959
/**
60-
* This adds backwards compatibility for older config which used the reportId query param to specify report id.
61-
* E.g. http://embedded.powerbi.com/appTokenReportEmbed?reportId=854846ed-2106-4dc2-bc58-eb77533bf2f1
60+
* Adds backwards compatibility for the previous load configuration, which used the reportId query parameter to specify the report ID
61+
* (e.g. http://embedded.powerbi.com/appTokenReportEmbed?reportId=854846ed-2106-4dc2-bc58-eb77533bf2f1).
6262
*
63-
* By extracting the id we can ensure id is always explicitly provided as part of the load configuration.
63+
* By extracting the ID we can ensure that the ID is always explicitly provided as part of the load configuration.
6464
*
6565
* @static
6666
* @param {string} url
@@ -79,7 +79,7 @@ export class Report extends embed.Embed implements IReportNode, IFilterable {
7979
}
8080

8181
/**
82-
* Get filters that are applied at the report level
82+
* Gets filters that are applied at the report level.
8383
*
8484
* ```javascript
8585
* // Get filters applied at report level
@@ -100,7 +100,7 @@ export class Report extends embed.Embed implements IReportNode, IFilterable {
100100
}
101101

102102
/**
103-
* Get report id from first available location: options, attribute, embed url.
103+
* Gets the report ID from the first available location: options, attribute, embed url.
104104
*
105105
* @returns {string}
106106
*/
@@ -115,7 +115,7 @@ export class Report extends embed.Embed implements IReportNode, IFilterable {
115115
}
116116

117117
/**
118-
* Get the list of pages within the report
118+
* Gets the list of pages within the report.
119119
*
120120
* ```javascript
121121
* report.getPages()
@@ -139,13 +139,13 @@ export class Report extends embed.Embed implements IReportNode, IFilterable {
139139
}
140140

141141
/**
142-
* Create new Page instance.
142+
* Creates an instance of a Page.
143143
*
144-
* Normally you would get Page objects by calling `report.getPages()` but in the case
144+
* Normally you would get Page objects by calling `report.getPages()`, but in the case
145145
* that the page name is known and you want to perform an action on a page without having to retrieve it
146146
* you can create it directly.
147147
*
148-
* Note: Since you are creating the page manually there is no guarantee that the page actually exists in the report and the subsequence requests could fail.
148+
* Note: Because you are creating the page manually there is no guarantee that the page actually exists in the report, and subsequent requests could fail.
149149
*
150150
* ```javascript
151151
* const page = report.page('ReportSection1');
@@ -161,8 +161,7 @@ export class Report extends embed.Embed implements IReportNode, IFilterable {
161161
}
162162

163163
/**
164-
* Print the active page of the report.
165-
* (Invokes window.print() on embed iframe)
164+
* Prints the active page of the report by invoking `window.print()` on the embed iframe component.
166165
*/
167166
print(): Promise<void> {
168167
return this.service.hpm.post<models.IError[]>('/report/print', null, { uid: this.config.uniqueId }, this.iframe.contentWindow)
@@ -175,7 +174,7 @@ export class Report extends embed.Embed implements IReportNode, IFilterable {
175174
}
176175

177176
/**
178-
* Refreshes data sources for report.
177+
* Refreshes data sources for the report.
179178
*
180179
* ```javascript
181180
* report.refresh();
@@ -192,7 +191,7 @@ export class Report extends embed.Embed implements IReportNode, IFilterable {
192191
}
193192

194193
/**
195-
* Remove all filters at report level
194+
* Removes all filters at the report level.
196195
*
197196
* ```javascript
198197
* report.removeFilters();
@@ -205,7 +204,7 @@ export class Report extends embed.Embed implements IReportNode, IFilterable {
205204
}
206205

207206
/**
208-
* Set the active page
207+
* Sets the active page of the report.
209208
*
210209
* ```javascript
211210
* report.setPage("page2")
@@ -228,7 +227,7 @@ export class Report extends embed.Embed implements IReportNode, IFilterable {
228227
}
229228

230229
/**
231-
* Sets filters
230+
* Sets filters at the report level.
232231
*
233232
* ```javascript
234233
* const filters: [
@@ -252,7 +251,7 @@ export class Report extends embed.Embed implements IReportNode, IFilterable {
252251
}
253252

254253
/**
255-
* Update settings of report (filter pane visibility, page navigation visibility)
254+
* Updates visibility settings for the filter pane and the page navigation pane.
256255
*
257256
* ```javascript
258257
* const newSettings = {

0 commit comments

Comments
 (0)