73bcce88
luigser
COMPONENTS
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
|
## Objects
<dl>
<dt><a href="#hydrolysis">hydrolysis</a> : <code>object</code></dt>
<dd><p>Static analysis for Polymer.</p>
</dd>
</dl>
## Functions
<dl>
<dt><a href="#isSiblingOrAunt">isSiblingOrAunt()</a> ⇒ <code>boolean</code></dt>
<dd><p>Returns true if <code>patha</code> is a sibling or aunt of <code>pathb</code>.</p>
</dd>
<dt><a href="#redirectSibling">redirectSibling()</a> ⇒ <code>string</code></dt>
<dd><p>Change <code>localPath</code> from a sibling of <code>basePath</code> to be a child of
<code>basePath</code> joined with <code>redirect</code>.</p>
</dd>
</dl>
<a name="hydrolysis"></a>
## hydrolysis : <code>object</code>
Static analysis for Polymer.
**Kind**: global namespace
* [hydrolysis](#hydrolysis) : <code>object</code>
* [.Analyzer](#hydrolysis.Analyzer)
* [new Analyzer(attachAST, [loader])](#new_hydrolysis.Analyzer_new)
* _instance_
* [.elements](#hydrolysis.Analyzer#elements) : <code>Array.<ElementDescriptor></code>
* [.elementsByTagName](#hydrolysis.Analyzer#elementsByTagName) : <code>Object.<string, ElementDescriptor></code>
* [.features](#hydrolysis.Analyzer#features) : <code>Array.<FeatureDescriptor></code>
* [.behaviors](#hydrolysis.Analyzer#behaviors) : <code>Array.<BehaviorDescriptor></code>
* [.html](#hydrolysis.Analyzer#html) : <code>Object.<string, AnalyzedDocument></code>
* [.parsedDocuments](#hydrolysis.Analyzer#parsedDocuments) : <code>Object</code>
* [._getDependencies(href, [found], [transitive])](#hydrolysis.Analyzer#_getDependencies) ⇒ <code>Array.<string></code>
* [.metadataTree(href)](#hydrolysis.Analyzer#metadataTree) ⇒ <code>Promise</code>
* [.nodeWalkDocuments(predicate)](#hydrolysis.Analyzer#nodeWalkDocuments) ⇒ <code>Object</code>
* [.annotate()](#hydrolysis.Analyzer#annotate)
* [.clean()](#hydrolysis.Analyzer#clean)
* _static_
* [.analyze(href, [options])](#hydrolysis.Analyzer.analyze) ⇒ <code>Promise.<Analyzer></code>
* [.FileLoader](#hydrolysis.FileLoader)
* [new FileLoader()](#new_hydrolysis.FileLoader_new)
* [.addResolver(resolver)](#hydrolysis.FileLoader#addResolver)
* [.request(url)](#hydrolysis.FileLoader#request) ⇒ <code>Promise.<string></code>
* [.FSResolver](#hydrolysis.FSResolver)
* [new FSResolver(config)](#new_hydrolysis.FSResolver_new)
* [.NoopResolver](#hydrolysis.NoopResolver)
* [new NoopResolver(config)](#new_hydrolysis.NoopResolver_new)
* [.accept(uri, deferred)](#hydrolysis.NoopResolver#accept) ⇒ <code>boolean</code>
* [.XHRResolver](#hydrolysis.XHRResolver)
* [new XHRResolver(config)](#new_hydrolysis.XHRResolver_new)
* [.DocumentAST](#hydrolysis.DocumentAST) : <code>Object</code>
* [.ElementDescriptor](#hydrolysis.ElementDescriptor) : <code>Object</code>
* [.FeatureDescriptor](#hydrolysis.FeatureDescriptor) : <code>Object</code>
* [.BehaviorDescriptor](#hydrolysis.BehaviorDescriptor) : <code>Object</code>
* [.DocumentDescriptor](#hydrolysis.DocumentDescriptor) : <code>Object</code>
* [.AnalyzedDocument](#hydrolysis.AnalyzedDocument) : <code>Object</code>
* [.LoadOptions](#hydrolysis.LoadOptions) : <code>Object</code>
* [.Resolver](#hydrolysis.Resolver) : <code>Object</code>
<a name="hydrolysis.Analyzer"></a>
### hydrolysis.Analyzer
**Kind**: static class of <code>[hydrolysis](#hydrolysis)</code>
* [.Analyzer](#hydrolysis.Analyzer)
* [new Analyzer(attachAST, [loader])](#new_hydrolysis.Analyzer_new)
* _instance_
* [.elements](#hydrolysis.Analyzer#elements) : <code>Array.<ElementDescriptor></code>
* [.elementsByTagName](#hydrolysis.Analyzer#elementsByTagName) : <code>Object.<string, ElementDescriptor></code>
* [.features](#hydrolysis.Analyzer#features) : <code>Array.<FeatureDescriptor></code>
* [.behaviors](#hydrolysis.Analyzer#behaviors) : <code>Array.<BehaviorDescriptor></code>
* [.html](#hydrolysis.Analyzer#html) : <code>Object.<string, AnalyzedDocument></code>
* [.parsedDocuments](#hydrolysis.Analyzer#parsedDocuments) : <code>Object</code>
* [._getDependencies(href, [found], [transitive])](#hydrolysis.Analyzer#_getDependencies) ⇒ <code>Array.<string></code>
* [.metadataTree(href)](#hydrolysis.Analyzer#metadataTree) ⇒ <code>Promise</code>
* [.nodeWalkDocuments(predicate)](#hydrolysis.Analyzer#nodeWalkDocuments) ⇒ <code>Object</code>
* [.annotate()](#hydrolysis.Analyzer#annotate)
* [.clean()](#hydrolysis.Analyzer#clean)
* _static_
* [.analyze(href, [options])](#hydrolysis.Analyzer.analyze) ⇒ <code>Promise.<Analyzer></code>
<a name="new_hydrolysis.Analyzer_new"></a>
#### new Analyzer(attachAST, [loader])
A database of Polymer metadata defined in HTML
| Param | Type | Description |
| --- | --- | --- |
| attachAST | <code>boolean</code> | If true, attach a parse5 compliant AST |
| [loader] | <code>FileLoader</code> | An optional `FileLoader` used to load external resources |
<a name="hydrolysis.Analyzer#elements"></a>
#### analyzer.elements : <code>Array.<ElementDescriptor></code>
A list of all elements the `Analyzer` has metadata for.
**Kind**: instance property of <code>[Analyzer](#hydrolysis.Analyzer)</code>
<a name="hydrolysis.Analyzer#elementsByTagName"></a>
#### analyzer.elementsByTagName : <code>Object.<string, ElementDescriptor></code>
A view into `elements`, keyed by tag name.
**Kind**: instance property of <code>[Analyzer](#hydrolysis.Analyzer)</code>
<a name="hydrolysis.Analyzer#features"></a>
#### analyzer.features : <code>Array.<FeatureDescriptor></code>
A list of API features added to `Polymer.Base` encountered by the
analyzer.
**Kind**: instance property of <code>[Analyzer](#hydrolysis.Analyzer)</code>
<a name="hydrolysis.Analyzer#behaviors"></a>
#### analyzer.behaviors : <code>Array.<BehaviorDescriptor></code>
The behaviors collected by the analysis pass.
**Kind**: instance property of <code>[Analyzer](#hydrolysis.Analyzer)</code>
<a name="hydrolysis.Analyzer#html"></a>
#### analyzer.html : <code>Object.<string, AnalyzedDocument></code>
A map, keyed by absolute path, of Document metadata.
**Kind**: instance property of <code>[Analyzer](#hydrolysis.Analyzer)</code>
<a name="hydrolysis.Analyzer#parsedDocuments"></a>
#### analyzer.parsedDocuments : <code>Object</code>
A map, keyed by path, of HTML document ASTs.
**Kind**: instance property of <code>[Analyzer](#hydrolysis.Analyzer)</code>
<a name="hydrolysis.Analyzer#_getDependencies"></a>
#### analyzer._getDependencies(href, [found], [transitive]) ⇒ <code>Array.<string></code>
List all the html dependencies for the document at `href`.
**Kind**: instance method of <code>[Analyzer](#hydrolysis.Analyzer)</code>
**Returns**: <code>Array.<string></code> - A list of all the html dependencies.
| Param | Type | Description |
| --- | --- | --- |
| href | <code>string</code> | The href to get dependencies for. |
| [found] | <code>Object.<string, boolean></code> | An object keyed by URL of the already resolved dependencies. |
| [transitive] | <code>boolean</code> | Whether to load transitive dependencies. Defaults to true. |
<a name="hydrolysis.Analyzer#metadataTree"></a>
#### analyzer.metadataTree(href) ⇒ <code>Promise</code>
Returns a promise that resolves to a POJO representation of the import
tree, in a format that maintains the ordering of the HTML imports spec.
**Kind**: instance method of <code>[Analyzer](#hydrolysis.Analyzer)</code>
| Param | Type | Description |
| --- | --- | --- |
| href | <code>string</code> | the import to get metadata for. |
<a name="hydrolysis.Analyzer#nodeWalkDocuments"></a>
#### analyzer.nodeWalkDocuments(predicate) ⇒ <code>Object</code>
Calls `dom5.nodeWalk` on each document that `Anayzler` has laoded.
**Kind**: instance method of <code>[Analyzer](#hydrolysis.Analyzer)</code>
| Param | Type | Description |
| --- | --- | --- |
| predicate | <code>Object</code> | A dom5 predicate. |
<a name="hydrolysis.Analyzer#annotate"></a>
#### analyzer.annotate()
Annotates all loaded metadata with its documentation.
**Kind**: instance method of <code>[Analyzer](#hydrolysis.Analyzer)</code>
<a name="hydrolysis.Analyzer#clean"></a>
#### analyzer.clean()
Removes redundant properties from the collected descriptors.
**Kind**: instance method of <code>[Analyzer](#hydrolysis.Analyzer)</code>
<a name="hydrolysis.Analyzer.analyze"></a>
#### Analyzer.analyze(href, [options]) ⇒ <code>Promise.<Analyzer></code>
Shorthand for transitively loading and processing all imports beginning at
`href`.
In order to properly filter paths, `href` _must_ be an absolute URI.
**Kind**: static method of <code>[Analyzer](#hydrolysis.Analyzer)</code>
**Returns**: <code>Promise.<Analyzer></code> - A promise that will resolve once `href` and its
dependencies have been loaded and analyzed.
| Param | Type | Description |
| --- | --- | --- |
| href | <code>string</code> | The root import to begin loading from. |
| [options] | <code>LoadOptions</code> | Any additional options for the load. |
<a name="hydrolysis.FileLoader"></a>
### hydrolysis.FileLoader
**Kind**: static class of <code>[hydrolysis](#hydrolysis)</code>
* [.FileLoader](#hydrolysis.FileLoader)
* [new FileLoader()](#new_hydrolysis.FileLoader_new)
* [.addResolver(resolver)](#hydrolysis.FileLoader#addResolver)
* [.request(url)](#hydrolysis.FileLoader#request) ⇒ <code>Promise.<string></code>
<a name="new_hydrolysis.FileLoader_new"></a>
#### new FileLoader()
A FileLoader lets you resolve URLs with a set of potential resolvers.
<a name="hydrolysis.FileLoader#addResolver"></a>
#### fileLoader.addResolver(resolver)
Add an instance of a Resolver class to the list of url resolvers
Ordering of resolvers is most to least recently added
The first resolver to "accept" the url wins.
**Kind**: instance method of <code>[FileLoader](#hydrolysis.FileLoader)</code>
| Param | Type | Description |
| --- | --- | --- |
| resolver | <code>Resolver</code> | The resolver to add. |
<a name="hydrolysis.FileLoader#request"></a>
#### fileLoader.request(url) ⇒ <code>Promise.<string></code>
Return a promise for an absolute url
Url requests are deduplicated by the loader, returning the same Promise for
identical urls
**Kind**: instance method of <code>[FileLoader](#hydrolysis.FileLoader)</code>
**Returns**: <code>Promise.<string></code> - A promise that resolves to the contents of the URL.
| Param | Type | Description |
| --- | --- | --- |
| url | <code>string</code> | The absolute url to request. |
<a name="hydrolysis.FSResolver"></a>
### hydrolysis.FSResolver
**Kind**: static class of <code>[hydrolysis](#hydrolysis)</code>
<a name="new_hydrolysis.FSResolver_new"></a>
#### new FSResolver(config)
Resolves requests via the file system.
| Param | Type | Description |
| --- | --- | --- |
| config | <code>Object</code> | configuration options. |
| config.host | <code>string</code> | Hostname to match for absolute urls. Matches "/" by default |
| config.basePath | <code>string</code> | Prefix directory for components in url. Defaults to "/". |
| config.root | <code>string</code> | Filesystem root to search. Defaults to the current working directory. |
| config.redirect | <code>string</code> | Where to redirect lookups to siblings. |
<a name="hydrolysis.NoopResolver"></a>
### hydrolysis.NoopResolver
**Kind**: static class of <code>[hydrolysis](#hydrolysis)</code>
* [.NoopResolver](#hydrolysis.NoopResolver)
* [new NoopResolver(config)](#new_hydrolysis.NoopResolver_new)
* [.accept(uri, deferred)](#hydrolysis.NoopResolver#accept) ⇒ <code>boolean</code>
<a name="new_hydrolysis.NoopResolver_new"></a>
#### new NoopResolver(config)
A resolver that resolves to null any uri matching config.
| Param | Type | Description |
| --- | --- | --- |
| config | <code>string</code> | The url to `accept`. |
<a name="hydrolysis.NoopResolver#accept"></a>
#### noopResolver.accept(uri, deferred) ⇒ <code>boolean</code>
**Kind**: instance method of <code>[NoopResolver](#hydrolysis.NoopResolver)</code>
**Returns**: <code>boolean</code> - Whether the URI is handled by this resolver.
| Param | Type | Description |
| --- | --- | --- |
| uri | <code>string</code> | The absolute URI being requested. |
| deferred | <code>Deferred</code> | The deferred promise that should be resolved if this resolver handles the URI. |
<a name="hydrolysis.XHRResolver"></a>
### hydrolysis.XHRResolver
**Kind**: static class of <code>[hydrolysis](#hydrolysis)</code>
<a name="new_hydrolysis.XHRResolver_new"></a>
#### new XHRResolver(config)
Construct a resolver that requests resources over XHR.
| Param | Type | Description |
| --- | --- | --- |
| config | <code>Object</code> | configuration arguments. |
| config.responseType | <code>string</code> | Type of object to be returned by the XHR. Defaults to 'text', accepts 'document', 'arraybuffer', and 'json'. |
<a name="hydrolysis.DocumentAST"></a>
### hydrolysis.DocumentAST : <code>Object</code>
Parse5's representation of a parsed html document
**Kind**: static typedef of <code>[hydrolysis](#hydrolysis)</code>
<a name="hydrolysis.ElementDescriptor"></a>
### hydrolysis.ElementDescriptor : <code>Object</code>
The metadata for a single polymer element
**Kind**: static typedef of <code>[hydrolysis](#hydrolysis)</code>
<a name="hydrolysis.FeatureDescriptor"></a>
### hydrolysis.FeatureDescriptor : <code>Object</code>
The metadata for a Polymer feature.
**Kind**: static typedef of <code>[hydrolysis](#hydrolysis)</code>
<a name="hydrolysis.BehaviorDescriptor"></a>
### hydrolysis.BehaviorDescriptor : <code>Object</code>
The metadata for a Polymer behavior mixin.
**Kind**: static typedef of <code>[hydrolysis](#hydrolysis)</code>
<a name="hydrolysis.DocumentDescriptor"></a>
### hydrolysis.DocumentDescriptor : <code>Object</code>
The metadata for all features and elements defined in one document
**Kind**: static typedef of <code>[hydrolysis](#hydrolysis)</code>
**Properties**
| Name | Type | Description |
| --- | --- | --- |
| elements | <code>Array.<ElementDescriptor></code> | The elements from the document |
| features | <code>Array.<FeatureDescriptor></code> | The features from the document |
| behaviors | <code>Array.<FeatureDescriptor></code> | The behaviors from the document |
<a name="hydrolysis.AnalyzedDocument"></a>
### hydrolysis.AnalyzedDocument : <code>Object</code>
The metadata of an entire HTML document, in promises.
**Kind**: static typedef of <code>[hydrolysis](#hydrolysis)</code>
**Properties**
| Name | Type | Description |
| --- | --- | --- |
| href | <code>string</code> | The url of the document. |
| htmlLoaded | <code>Promise.<ParsedImport></code> | The parsed representation of the doc. Use the `ast` property to get the full `parse5` ast |
| depsLoaded | <code>Promise.<Array.<string>></code> | Resolves to the list of this Document's transitive import dependencies |
| depHrefs | <code>Array.<string></code> | The direct dependencies of the document. |
| metadataLoaded | <code>Promise.<DocumentDescriptor></code> | Resolves to the list of this Document's import dependencies |
<a name="hydrolysis.LoadOptions"></a>
### hydrolysis.LoadOptions : <code>Object</code>
Options for `Analyzer.analzye`
**Kind**: static typedef of <code>[hydrolysis](#hydrolysis)</code>
**Properties**
| Name | Type | Description |
| --- | --- | --- |
| noAnnotations | <code>boolean</code> | Whether `annotate()` should be skipped. |
| clean | <code>boolean</code> | Whether the generated descriptors should be cleaned of redundant data. |
| filter | <code>function</code> | A predicate function that indicates which files should be ignored by the loader. By default all files not located under the dirname of `href` will be ignored. |
<a name="hydrolysis.Resolver"></a>
### hydrolysis.Resolver : <code>Object</code>
An object that knows how to resolve resources.
**Kind**: static typedef of <code>[hydrolysis](#hydrolysis)</code>
**Properties**
| Name | Type | Description |
| --- | --- | --- |
| accept | <code>function</code> | Attempt to resolve `deferred` with the contents the specified URL. Returns false if the Resolver is unable to resolve the URL. |
<a name="isSiblingOrAunt"></a>
## isSiblingOrAunt() ⇒ <code>boolean</code>
Returns true if `patha` is a sibling or aunt of `pathb`.
**Kind**: global function
<a name="redirectSibling"></a>
## redirectSibling() ⇒ <code>string</code>
Change `localPath` from a sibling of `basePath` to be a child of
`basePath` joined with `redirect`.
**Kind**: global function
|