html-validate 7.15.0 → 7.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"test-utils.js","sources":["../../../src/transform/test-utils.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAqDA;;;;;;;AAOG;SACa,aAAa,CAC5B,EAAe,EACf,QAAgB,EAChB,KAA8D,EAAA;IAE9D,MAAM,IAAI,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AAChD,IAAA,MAAM,MAAM,GAAW;QACtB,QAAQ;AACR,QAAA,IAAI,EAAE,CAAC;AACP,QAAA,MAAM,EAAE,CAAC;AACT,QAAA,MAAM,EAAE,CAAC;QACT,IAAI;KACJ,CAAC;IACF,OAAO,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAC3C,CAAC;AAED;;;;;;;AAOG;SACa,eAAe,CAC9B,EAAe,EACf,IAAY,EACZ,KAA8D,EAAA;AAE9D,IAAA,MAAM,MAAM,GAAW;AACtB,QAAA,QAAQ,EAAE,QAAQ;AAClB,QAAA,IAAI,EAAE,CAAC;AACP,QAAA,MAAM,EAAE,CAAC;AACT,QAAA,MAAM,EAAE,CAAC;QACT,IAAI;KACJ,CAAC;IACF,OAAO,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAC3C,CAAC;AAED;;;;;;;AAOG;SACa,eAAe,CAC9B,EAAe,EACf,MAAc,EACd,KAA8D,EAAA;IAE9D,MAAM,YAAY,GAAG,CAAC,MAAc,KAAuB,CAAC,MAAM,CAAC,CAAC;AACpE,IAAA,MAAM,OAAO,GAAqB;AACjC,QAAA,QAAQ,6BAA6B,MAAM,IAAI;QAC/C,KAAK,EAAE,KAAK,IAAI,YAAY;KAC5B,CAAC;AACF,IAAA,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CA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,11 @@
1
+ // This file is read by tools that parse documentation comments conforming to the TSDoc standard.
2
+ // It should be published with your NPM package. It should not be tracked by Git.
3
+ {
4
+ "tsdocVersion": "0.12",
5
+ "toolPackages": [
6
+ {
7
+ "packageName": "@microsoft/api-extractor",
8
+ "packageVersion": "7.34.4"
9
+ }
10
+ ]
11
+ }
@@ -206,7 +206,15 @@ export declare class Config {
206
206
  private loadPlugins;
207
207
  private loadConfigurations;
208
208
  private extendMeta;
209
- /* Excluded from this release type: resolve */
209
+ /**
210
+ * Resolve all configuration and return a [[ResolvedConfig]] instance.
211
+ *
212
+ * A resolved configuration will merge all extended configs and load all
213
+ * plugins and transformers, and normalize the rest of the configuration.
214
+ *
215
+ * @public
216
+ */
217
+ resolve(): ResolvedConfig;
210
218
  /* Excluded from this release type: resolveData */
211
219
  private precompileTransformers;
212
220
  /**
@@ -523,6 +531,8 @@ export declare class DOMNode {
523
531
  isRootElement(): boolean;
524
532
  /**
525
533
  * Tests if two nodes are the same (references the same object).
534
+ *
535
+ * @since v4.11.0
526
536
  */
527
537
  isSameNode(otherNode: DOMNode): boolean;
528
538
  /**
@@ -1274,9 +1284,27 @@ export declare class MetaTable {
1274
1284
  private schema;
1275
1285
  /* Excluded from this release type: __constructor */
1276
1286
  /* Excluded from this release type: init */
1277
- /* Excluded from this release type: extendValidationSchema */
1278
- /* Excluded from this release type: loadFromObject */
1279
- /* Excluded from this release type: loadFromFile */
1287
+ /**
1288
+ * Extend validation schema.
1289
+ *
1290
+ * @public
1291
+ */
1292
+ extendValidationSchema(patch: SchemaValidationPatch): void;
1293
+ /**
1294
+ * Load metadata table from object.
1295
+ *
1296
+ * @public
1297
+ * @param obj - Object with metadata to load
1298
+ * @param filename - Optional filename used when presenting validation error
1299
+ */
1300
+ loadFromObject(obj: unknown, filename?: string | null): void;
1301
+ /**
1302
+ * Load metadata table from filename
1303
+ *
1304
+ * @public
1305
+ * @param filename - Filename to load
1306
+ */
1307
+ loadFromFile(filename: string): void;
1280
1308
  /**
1281
1309
  * Get [[MetaElement]] for the given tag. If no specific metadata is present
1282
1310
  * the global metadata is returned or null if no global is present.
@@ -1346,7 +1374,102 @@ export declare enum NodeType {
1346
1374
 
1347
1375
  /* Excluded from this release type: ParseEndEvent */
1348
1376
 
1349
- /* Excluded from this release type: Parser */
1377
+ /**
1378
+ * Parse HTML document into a DOM tree.
1379
+ *
1380
+ * @public
1381
+ */
1382
+ export declare class Parser {
1383
+ private readonly event;
1384
+ private readonly metaTable;
1385
+ private currentNamespace;
1386
+ private dom;
1387
+ /**
1388
+ * Create a new parser instance.
1389
+ *
1390
+ * @public
1391
+ * @param config - Configuration
1392
+ */
1393
+ constructor(config: ResolvedConfig);
1394
+ /**
1395
+ * Parse HTML markup.
1396
+ *
1397
+ * @public
1398
+ * @param source - HTML markup.
1399
+ * @returns DOM tree representing the HTML markup.
1400
+ */
1401
+ parseHtml(source: string | Source): HtmlElement;
1402
+ /**
1403
+ * Detect optional end tag.
1404
+ *
1405
+ * Some tags have optional end tags (e.g. <ul><li>foo<li>bar</ul> is
1406
+ * valid). The parser handles this by checking if the element on top of the
1407
+ * stack when is allowed to omit.
1408
+ */
1409
+ private closeOptional;
1410
+ /* Excluded from this release type: consume */
1411
+ /* Excluded from this release type: consumeTag */
1412
+ /* Excluded from this release type: closeElement */
1413
+ private processElement;
1414
+ /* Excluded from this release type: discardForeignBody */
1415
+ /* Excluded from this release type: consumeAttribute */
1416
+ /**
1417
+ * Takes attribute key token an returns location.
1418
+ */
1419
+ private getAttributeKeyLocation;
1420
+ /**
1421
+ * Take attribute value token and return a new location referring to only the
1422
+ * value.
1423
+ *
1424
+ * foo="bar" foo='bar' foo=bar foo foo=""
1425
+ * ^^^ ^^^ ^^^ (null) (null)
1426
+ */
1427
+ private getAttributeValueLocation;
1428
+ /**
1429
+ * Take attribute key and value token an returns a new location referring to
1430
+ * an aggregate location covering key, quotes if present and value.
1431
+ */
1432
+ private getAttributeLocation;
1433
+ /* Excluded from this release type: consumeDirective */
1434
+ /* Excluded from this release type: consumeConditional */
1435
+ /* Excluded from this release type: consumeComment */
1436
+ /* Excluded from this release type: consumeDoctype */
1437
+ /* Excluded from this release type: consumeUntil */
1438
+ /* Excluded from this release type: consumeUntilMatchingTag */
1439
+ private next;
1440
+ /**
1441
+ * Listen on events.
1442
+ *
1443
+ * @public
1444
+ * @param event - Event name.
1445
+ * @param listener - Event callback.
1446
+ * @returns A function to unregister the listener.
1447
+ */
1448
+ on<K extends keyof ListenEventMap>(event: K, listener: (event: string, data: ListenEventMap[K]) => void): () => void;
1449
+ on(event: string, listener: EventCallback): () => void;
1450
+ /**
1451
+ * Listen on single event. The listener is automatically unregistered once the
1452
+ * event has been received.
1453
+ *
1454
+ * @public
1455
+ * @param event - Event name.
1456
+ * @param listener - Event callback.
1457
+ * @returns A function to unregister the listener.
1458
+ */
1459
+ once<K extends keyof ListenEventMap>(event: K, listener: (event: string, data: ListenEventMap[K]) => void): () => void;
1460
+ once(event: string, listener: EventCallback): () => void;
1461
+ /* Excluded from this release type: defer */
1462
+ /* Excluded from this release type: trigger */
1463
+ /* Excluded from this release type: getEventHandler */
1464
+ /**
1465
+ * Appends a text node to the current element on the stack.
1466
+ */
1467
+ private appendText;
1468
+ /**
1469
+ * Trigger close events for any still open elements.
1470
+ */
1471
+ private closeTree;
1472
+ }
1350
1473
 
1351
1474
  /**
1352
1475
  * @public
@@ -301,7 +301,15 @@ export declare class Config {
301
301
  private loadPlugins;
302
302
  private loadConfigurations;
303
303
  private extendMeta;
304
- /* Excluded from this release type: resolve */
304
+ /**
305
+ * Resolve all configuration and return a [[ResolvedConfig]] instance.
306
+ *
307
+ * A resolved configuration will merge all extended configs and load all
308
+ * plugins and transformers, and normalize the rest of the configuration.
309
+ *
310
+ * @public
311
+ */
312
+ resolve(): ResolvedConfig;
305
313
  /* Excluded from this release type: resolveData */
306
314
  private precompileTransformers;
307
315
  /**
@@ -618,6 +626,8 @@ export declare class DOMNode {
618
626
  isRootElement(): boolean;
619
627
  /**
620
628
  * Tests if two nodes are the same (references the same object).
629
+ *
630
+ * @since v4.11.0
621
631
  */
622
632
  isSameNode(otherNode: DOMNode): boolean;
623
633
  /**
@@ -1467,9 +1477,27 @@ export declare class MetaTable {
1467
1477
  private schema;
1468
1478
  /* Excluded from this release type: __constructor */
1469
1479
  /* Excluded from this release type: init */
1470
- /* Excluded from this release type: extendValidationSchema */
1471
- /* Excluded from this release type: loadFromObject */
1472
- /* Excluded from this release type: loadFromFile */
1480
+ /**
1481
+ * Extend validation schema.
1482
+ *
1483
+ * @public
1484
+ */
1485
+ extendValidationSchema(patch: SchemaValidationPatch): void;
1486
+ /**
1487
+ * Load metadata table from object.
1488
+ *
1489
+ * @public
1490
+ * @param obj - Object with metadata to load
1491
+ * @param filename - Optional filename used when presenting validation error
1492
+ */
1493
+ loadFromObject(obj: unknown, filename?: string | null): void;
1494
+ /**
1495
+ * Load metadata table from filename
1496
+ *
1497
+ * @public
1498
+ * @param filename - Filename to load
1499
+ */
1500
+ loadFromFile(filename: string): void;
1473
1501
  /**
1474
1502
  * Get [[MetaElement]] for the given tag. If no specific metadata is present
1475
1503
  * the global metadata is returned or null if no global is present.
@@ -1539,7 +1567,102 @@ export declare enum NodeType {
1539
1567
 
1540
1568
  /* Excluded from this release type: ParseEndEvent */
1541
1569
 
1542
- /* Excluded from this release type: Parser */
1570
+ /**
1571
+ * Parse HTML document into a DOM tree.
1572
+ *
1573
+ * @public
1574
+ */
1575
+ export declare class Parser {
1576
+ private readonly event;
1577
+ private readonly metaTable;
1578
+ private currentNamespace;
1579
+ private dom;
1580
+ /**
1581
+ * Create a new parser instance.
1582
+ *
1583
+ * @public
1584
+ * @param config - Configuration
1585
+ */
1586
+ constructor(config: ResolvedConfig);
1587
+ /**
1588
+ * Parse HTML markup.
1589
+ *
1590
+ * @public
1591
+ * @param source - HTML markup.
1592
+ * @returns DOM tree representing the HTML markup.
1593
+ */
1594
+ parseHtml(source: string | Source): HtmlElement;
1595
+ /**
1596
+ * Detect optional end tag.
1597
+ *
1598
+ * Some tags have optional end tags (e.g. <ul><li>foo<li>bar</ul> is
1599
+ * valid). The parser handles this by checking if the element on top of the
1600
+ * stack when is allowed to omit.
1601
+ */
1602
+ private closeOptional;
1603
+ /* Excluded from this release type: consume */
1604
+ /* Excluded from this release type: consumeTag */
1605
+ /* Excluded from this release type: closeElement */
1606
+ private processElement;
1607
+ /* Excluded from this release type: discardForeignBody */
1608
+ /* Excluded from this release type: consumeAttribute */
1609
+ /**
1610
+ * Takes attribute key token an returns location.
1611
+ */
1612
+ private getAttributeKeyLocation;
1613
+ /**
1614
+ * Take attribute value token and return a new location referring to only the
1615
+ * value.
1616
+ *
1617
+ * foo="bar" foo='bar' foo=bar foo foo=""
1618
+ * ^^^ ^^^ ^^^ (null) (null)
1619
+ */
1620
+ private getAttributeValueLocation;
1621
+ /**
1622
+ * Take attribute key and value token an returns a new location referring to
1623
+ * an aggregate location covering key, quotes if present and value.
1624
+ */
1625
+ private getAttributeLocation;
1626
+ /* Excluded from this release type: consumeDirective */
1627
+ /* Excluded from this release type: consumeConditional */
1628
+ /* Excluded from this release type: consumeComment */
1629
+ /* Excluded from this release type: consumeDoctype */
1630
+ /* Excluded from this release type: consumeUntil */
1631
+ /* Excluded from this release type: consumeUntilMatchingTag */
1632
+ private next;
1633
+ /**
1634
+ * Listen on events.
1635
+ *
1636
+ * @public
1637
+ * @param event - Event name.
1638
+ * @param listener - Event callback.
1639
+ * @returns A function to unregister the listener.
1640
+ */
1641
+ on<K extends keyof ListenEventMap>(event: K, listener: (event: string, data: ListenEventMap[K]) => void): () => void;
1642
+ on(event: string, listener: EventCallback): () => void;
1643
+ /**
1644
+ * Listen on single event. The listener is automatically unregistered once the
1645
+ * event has been received.
1646
+ *
1647
+ * @public
1648
+ * @param event - Event name.
1649
+ * @param listener - Event callback.
1650
+ * @returns A function to unregister the listener.
1651
+ */
1652
+ once<K extends keyof ListenEventMap>(event: K, listener: (event: string, data: ListenEventMap[K]) => void): () => void;
1653
+ once(event: string, listener: EventCallback): () => void;
1654
+ /* Excluded from this release type: defer */
1655
+ /* Excluded from this release type: trigger */
1656
+ /* Excluded from this release type: getEventHandler */
1657
+ /**
1658
+ * Appends a text node to the current element on the stack.
1659
+ */
1660
+ private appendText;
1661
+ /**
1662
+ * Trigger close events for any still open elements.
1663
+ */
1664
+ private closeTree;
1665
+ }
1543
1666
 
1544
1667
  /**
1545
1668
  * @public