@@ -11,13 +11,21 @@ declare global {
1111 msRequestFullscreen : Function ;
1212 }
1313}
14+ /**
15+ * Configuration settings for Power BI embed components
16+ *
17+ * @export
18+ * @interface IEmbedConfiguration
19+ */
1420export interface IEmbedConfiguration {
1521 type ?: string ;
1622 id ?: string ;
1723 uniqueId ?: string ;
1824 embedUrl ?: string ;
1925 accessToken ?: string ;
2026 settings ?: models . ISettings ;
27+ pageName ?: string ;
28+ filters ?: ( models . IBasicFilter | models . IAdvancedFilter ) [ ] ;
2129}
2230export interface IInternalEmbedConfiguration extends models . ILoadConfiguration {
2331 uniqueId : string ;
@@ -28,6 +36,13 @@ export interface IInternalEventHandler<T> {
2836 test ( event : service . IEvent < T > ) : boolean ;
2937 handle ( event : service . ICustomEvent < T > ) : void ;
3038}
39+ /**
40+ * Base class for all Power BI embed components
41+ *
42+ * @export
43+ * @abstract
44+ * @class Embed
45+ */
3146export declare abstract class Embed {
3247 static allowedEvents : string [ ] ;
3348 static accessTokenAttribute : string ;
@@ -37,14 +52,45 @@ export declare abstract class Embed {
3752 static type : string ;
3853 private static defaultSettings ;
3954 allowedEvents : any [ ] ;
55+ /**
56+ * Gets or set the event handler registered for this embed component
57+ *
58+ * @type {IInternalEventHandler<any>[] }
59+ */
4060 eventHandlers : IInternalEventHandler < any > [ ] ;
61+ /**
62+ * Gets or sets the Power BI embed service
63+ *
64+ * @type {service.Service }
65+ */
4166 service : service . Service ;
67+ /**
68+ * Gets or sets the HTML element containing the Power BI embed component
69+ *
70+ * @type {HTMLElement }
71+ */
4272 element : HTMLElement ;
73+ /**
74+ * Gets or sets the HTML iframe element that renders the Power BI embed component
75+ *
76+ * @type {HTMLIFrameElement }
77+ */
4378 iframe : HTMLIFrameElement ;
79+ /**
80+ * Gets or sets the configuration settings for the embed component
81+ *
82+ * @type {IInternalEmbedConfiguration }
83+ */
4484 config : IInternalEmbedConfiguration ;
4585 /**
86+ * Creates an instance of Embed.
87+ *
4688 * Note: there is circular reference between embeds and service
4789 * The service has list of all embeds on the host page, and each embed has reference to the service that created it.
90+ *
91+ * @param {service.Service } service
92+ * @param {HTMLElement } element
93+ * @param {IEmbedConfiguration } config
4894 */
4995 constructor ( service : service . Service , element : HTMLElement , config : IEmbedConfiguration ) ;
5096 /**
@@ -67,6 +113,9 @@ export declare abstract class Embed {
67113 * })
68114 * .catch(error => { ... });
69115 * ```
116+ *
117+ * @param {models.ILoadConfiguration } config
118+ * @returns {Promise<void> }
70119 */
71120 load ( config : models . ILoadConfiguration ) : Promise < void > ;
72121 /**
@@ -86,6 +135,10 @@ export declare abstract class Embed {
86135 *
87136 * report.off('pageChanged', logHandler);
88137 * ```
138+ *
139+ * @template T
140+ * @param {string } eventName
141+ * @param {service.IEventHandler<T> } [handler]
89142 */
90143 off < T > ( eventName : string , handler ?: service . IEventHandler < T > ) : void ;
91144 /**
@@ -96,23 +149,40 @@ export declare abstract class Embed {
96149 * console.log('PageChanged: ', event.page.name);
97150 * });
98151 * ```
152+ *
153+ * @template T
154+ * @param {string } eventName
155+ * @param {service.IEventHandler<T> } handler
99156 */
100157 on < T > ( eventName : string , handler : service . IEventHandler < T > ) : void ;
101158 /**
102159 * Get access token from first available location: config, attribute, global.
160+ *
161+ * @private
162+ * @param {string } globalAccessToken
163+ * @returns {string }
103164 */
104165 private getAccessToken ( globalAccessToken ) ;
105166 /**
106167 * Get embed url from first available location: options, attribute.
168+ *
169+ * @private
170+ * @returns {string }
107171 */
108172 private getEmbedUrl ( ) ;
109173 /**
110174 * Get unique id from first available location: options, attribute.
111175 * If neither is provided generate unique string.
176+ *
177+ * @private
178+ * @returns {string }
112179 */
113180 private getUniqueId ( ) ;
114181 /**
115182 * Get report id from first available location: options, attribute.
183+ *
184+ * @abstract
185+ * @returns {string }
116186 */
117187 abstract getId ( ) : string ;
118188 /**
@@ -126,6 +196,10 @@ export declare abstract class Embed {
126196 /**
127197 * Return true if iframe is fullscreen,
128198 * otherwise return false
199+ *
200+ * @private
201+ * @param {HTMLIFrameElement } iframe
202+ * @returns {boolean }
129203 */
130204 private isFullscreen ( iframe ) ;
131205}
0 commit comments