@@ -11,13 +11,21 @@ declare global {
11
11
msRequestFullscreen : Function ;
12
12
}
13
13
}
14
+ /**
15
+ * Configuration settings for Power BI embed components
16
+ *
17
+ * @export
18
+ * @interface IEmbedConfiguration
19
+ */
14
20
export interface IEmbedConfiguration {
15
21
type ?: string ;
16
22
id ?: string ;
17
23
uniqueId ?: string ;
18
24
embedUrl ?: string ;
19
25
accessToken ?: string ;
20
26
settings ?: models . ISettings ;
27
+ pageName ?: string ;
28
+ filters ?: ( models . IBasicFilter | models . IAdvancedFilter ) [ ] ;
21
29
}
22
30
export interface IInternalEmbedConfiguration extends models . ILoadConfiguration {
23
31
uniqueId : string ;
@@ -28,6 +36,13 @@ export interface IInternalEventHandler<T> {
28
36
test ( event : service . IEvent < T > ) : boolean ;
29
37
handle ( event : service . ICustomEvent < T > ) : void ;
30
38
}
39
+ /**
40
+ * Base class for all Power BI embed components
41
+ *
42
+ * @export
43
+ * @abstract
44
+ * @class Embed
45
+ */
31
46
export declare abstract class Embed {
32
47
static allowedEvents : string [ ] ;
33
48
static accessTokenAttribute : string ;
@@ -37,14 +52,45 @@ export declare abstract class Embed {
37
52
static type : string ;
38
53
private static defaultSettings ;
39
54
allowedEvents : any [ ] ;
55
+ /**
56
+ * Gets or set the event handler registered for this embed component
57
+ *
58
+ * @type {IInternalEventHandler<any>[] }
59
+ */
40
60
eventHandlers : IInternalEventHandler < any > [ ] ;
61
+ /**
62
+ * Gets or sets the Power BI embed service
63
+ *
64
+ * @type {service.Service }
65
+ */
41
66
service : service . Service ;
67
+ /**
68
+ * Gets or sets the HTML element containing the Power BI embed component
69
+ *
70
+ * @type {HTMLElement }
71
+ */
42
72
element : HTMLElement ;
73
+ /**
74
+ * Gets or sets the HTML iframe element that renders the Power BI embed component
75
+ *
76
+ * @type {HTMLIFrameElement }
77
+ */
43
78
iframe : HTMLIFrameElement ;
79
+ /**
80
+ * Gets or sets the configuration settings for the embed component
81
+ *
82
+ * @type {IInternalEmbedConfiguration }
83
+ */
44
84
config : IInternalEmbedConfiguration ;
45
85
/**
86
+ * Creates an instance of Embed.
87
+ *
46
88
* Note: there is circular reference between embeds and service
47
89
* 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
48
94
*/
49
95
constructor ( service : service . Service , element : HTMLElement , config : IEmbedConfiguration ) ;
50
96
/**
@@ -67,6 +113,9 @@ export declare abstract class Embed {
67
113
* })
68
114
* .catch(error => { ... });
69
115
* ```
116
+ *
117
+ * @param {models.ILoadConfiguration } config
118
+ * @returns {Promise<void> }
70
119
*/
71
120
load ( config : models . ILoadConfiguration ) : Promise < void > ;
72
121
/**
@@ -86,6 +135,10 @@ export declare abstract class Embed {
86
135
*
87
136
* report.off('pageChanged', logHandler);
88
137
* ```
138
+ *
139
+ * @template T
140
+ * @param {string } eventName
141
+ * @param {service.IEventHandler<T> } [handler]
89
142
*/
90
143
off < T > ( eventName : string , handler ?: service . IEventHandler < T > ) : void ;
91
144
/**
@@ -96,23 +149,40 @@ export declare abstract class Embed {
96
149
* console.log('PageChanged: ', event.page.name);
97
150
* });
98
151
* ```
152
+ *
153
+ * @template T
154
+ * @param {string } eventName
155
+ * @param {service.IEventHandler<T> } handler
99
156
*/
100
157
on < T > ( eventName : string , handler : service . IEventHandler < T > ) : void ;
101
158
/**
102
159
* Get access token from first available location: config, attribute, global.
160
+ *
161
+ * @private
162
+ * @param {string } globalAccessToken
163
+ * @returns {string }
103
164
*/
104
165
private getAccessToken ( globalAccessToken ) ;
105
166
/**
106
167
* Get embed url from first available location: options, attribute.
168
+ *
169
+ * @private
170
+ * @returns {string }
107
171
*/
108
172
private getEmbedUrl ( ) ;
109
173
/**
110
174
* Get unique id from first available location: options, attribute.
111
175
* If neither is provided generate unique string.
176
+ *
177
+ * @private
178
+ * @returns {string }
112
179
*/
113
180
private getUniqueId ( ) ;
114
181
/**
115
182
* Get report id from first available location: options, attribute.
183
+ *
184
+ * @abstract
185
+ * @returns {string }
116
186
*/
117
187
abstract getId ( ) : string ;
118
188
/**
@@ -126,6 +196,10 @@ export declare abstract class Embed {
126
196
/**
127
197
* Return true if iframe is fullscreen,
128
198
* otherwise return false
199
+ *
200
+ * @private
201
+ * @param {HTMLIFrameElement } iframe
202
+ * @returns {boolean }
129
203
*/
130
204
private isFullscreen ( iframe ) ;
131
205
}
0 commit comments