html-validate 7.8.0 → 7.10.0
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.
- package/dist/cjs/browser.d.ts +1 -1
- package/dist/cjs/browser.js +2 -1
- package/dist/cjs/browser.js.map +1 -1
- package/dist/cjs/cli.js +1 -0
- package/dist/cjs/cli.js.map +1 -1
- package/dist/cjs/core.d.ts +31 -24
- package/dist/cjs/core.js +297 -111
- package/dist/cjs/core.js.map +1 -1
- package/dist/cjs/elements.js +824 -315
- package/dist/cjs/elements.js.map +1 -1
- package/dist/cjs/html-validate.js +1 -1
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +2 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/jest-lib.js +1 -0
- package/dist/cjs/jest-lib.js.map +1 -1
- package/dist/cjs/jest.js +2 -2
- package/dist/es/browser.d.ts +1 -1
- package/dist/es/browser.js +2 -2
- package/dist/es/cli.js +2 -1
- package/dist/es/cli.js.map +1 -1
- package/dist/es/core.d.ts +31 -24
- package/dist/es/core.js +297 -112
- package/dist/es/core.js.map +1 -1
- package/dist/es/elements.js +824 -316
- package/dist/es/elements.js.map +1 -1
- package/dist/es/html-validate.js +3 -3
- package/dist/es/index.d.ts +1 -1
- package/dist/es/index.js +2 -2
- package/dist/es/jest-lib.js +2 -1
- package/dist/es/jest-lib.js.map +1 -1
- package/dist/es/jest.js +2 -2
- package/dist/es/rules-helper.js +1 -1
- package/package.json +8 -8
package/dist/es/core.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SchemaObject, ErrorObject } from 'ajv';
|
|
2
2
|
|
|
3
3
|
/** @internal */
|
|
4
|
-
|
|
4
|
+
type EventCallback = (event: string, data: any) => void;
|
|
5
5
|
/**
|
|
6
6
|
* @internal
|
|
7
7
|
*/
|
|
@@ -127,13 +127,13 @@ interface EOFToken extends BaseToken {
|
|
|
127
127
|
type: TokenType.EOF;
|
|
128
128
|
data: [];
|
|
129
129
|
}
|
|
130
|
-
|
|
130
|
+
type Token = UnicodeBOMToken | WhitespaceToken | DoctypeOpenToken | DoctypeValueToken | DoctypeCloseToken | TagOpenToken | TagCloseToken | AttrNameToken | AttrValueToken | TextToken | TemplatingToken | ScriptToken | StyleToken | CommentToken | ConditionalToken | DirectiveToken | EOFToken;
|
|
131
131
|
|
|
132
|
-
|
|
132
|
+
type TokenStream = IterableIterator<Token>;
|
|
133
133
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
134
|
+
type RuleSeverity = "off" | "warn" | "error" | number;
|
|
135
|
+
type RuleOptions = string | number | Record<string, any>;
|
|
136
|
+
type RuleConfig = Record<string, RuleSeverity | [RuleSeverity] | [RuleSeverity, RuleOptions]>;
|
|
137
137
|
interface TransformMap {
|
|
138
138
|
[key: string]: string;
|
|
139
139
|
}
|
|
@@ -492,7 +492,7 @@ interface TagStartEvent extends Event {
|
|
|
492
492
|
* @public
|
|
493
493
|
* @deprecated Use TagStartEvent instead
|
|
494
494
|
*/
|
|
495
|
-
|
|
495
|
+
type TagOpenEvent = TagStartEvent;
|
|
496
496
|
/**
|
|
497
497
|
* Event emitted when end tags `</..>` are encountered.
|
|
498
498
|
*
|
|
@@ -513,7 +513,7 @@ interface TagEndEvent extends Event {
|
|
|
513
513
|
* @public
|
|
514
514
|
* @deprecated Use TagEndEvent instead
|
|
515
515
|
*/
|
|
516
|
-
|
|
516
|
+
type TagCloseEvent = TagEndEvent;
|
|
517
517
|
/**
|
|
518
518
|
* Event emitted when a tag is ready (i.e. all the attributes has been
|
|
519
519
|
* parsed). The children of the element will not yet be finished.
|
|
@@ -833,7 +833,7 @@ interface AttributeData {
|
|
|
833
833
|
/**
|
|
834
834
|
* @public
|
|
835
835
|
*/
|
|
836
|
-
|
|
836
|
+
type ProcessAttributeCallback = (this: unknown, attr: AttributeData) => Iterable<AttributeData>;
|
|
837
837
|
/**
|
|
838
838
|
* @public
|
|
839
839
|
*/
|
|
@@ -843,7 +843,7 @@ interface ProcessElementContext {
|
|
|
843
843
|
/**
|
|
844
844
|
* @public
|
|
845
845
|
*/
|
|
846
|
-
|
|
846
|
+
type ProcessElementCallback = (this: ProcessElementContext, node: HtmlElement) => void;
|
|
847
847
|
/**
|
|
848
848
|
* @public
|
|
849
849
|
*/
|
|
@@ -1102,7 +1102,7 @@ declare class TemplateExtractor {
|
|
|
1102
1102
|
/**
|
|
1103
1103
|
* @public
|
|
1104
1104
|
*/
|
|
1105
|
-
|
|
1105
|
+
type Transformer = (this: TransformContext, source: Source) => Iterable<Source>;
|
|
1106
1106
|
|
|
1107
1107
|
interface SchemaValidationPatch {
|
|
1108
1108
|
properties?: Record<string, unknown>;
|
|
@@ -1188,6 +1188,13 @@ interface Plugin {
|
|
|
1188
1188
|
elementSchema?: SchemaValidationPatch | null;
|
|
1189
1189
|
}
|
|
1190
1190
|
|
|
1191
|
+
/**
|
|
1192
|
+
* Helper function to assist IDE with completion and type-checking.
|
|
1193
|
+
*
|
|
1194
|
+
* @public
|
|
1195
|
+
*/
|
|
1196
|
+
declare function definePlugin(plugin: Plugin): Plugin;
|
|
1197
|
+
|
|
1191
1198
|
/**
|
|
1192
1199
|
* @public
|
|
1193
1200
|
*/
|
|
@@ -1273,7 +1280,7 @@ declare enum NodeType {
|
|
|
1273
1280
|
interface DOMNodeCache {
|
|
1274
1281
|
}
|
|
1275
1282
|
|
|
1276
|
-
|
|
1283
|
+
type DOMInternalID = number;
|
|
1277
1284
|
declare const TEXT_CONTENT: unique symbol;
|
|
1278
1285
|
declare module "./cache" {
|
|
1279
1286
|
interface DOMNodeCache {
|
|
@@ -1665,13 +1672,13 @@ declare class TextNode extends DOMNode {
|
|
|
1665
1672
|
interface PermittedGroup {
|
|
1666
1673
|
exclude?: string | string[];
|
|
1667
1674
|
}
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
+
type CategoryOrTag = string;
|
|
1676
|
+
type PropertyExpression = string | [string, any];
|
|
1677
|
+
type PermittedEntry = CategoryOrTag | PermittedGroup | Array<CategoryOrTag | PermittedGroup>;
|
|
1678
|
+
type Permitted = PermittedEntry[];
|
|
1679
|
+
type PermittedOrder = string[];
|
|
1680
|
+
type RequiredAncestors = string[];
|
|
1681
|
+
type RequiredContent = string[];
|
|
1675
1682
|
declare enum TextContent {
|
|
1676
1683
|
NONE = "none",
|
|
1677
1684
|
DEFAULT = "default",
|
|
@@ -1685,7 +1692,7 @@ declare enum TextContent {
|
|
|
1685
1692
|
*
|
|
1686
1693
|
* @public
|
|
1687
1694
|
*/
|
|
1688
|
-
|
|
1695
|
+
type MetaAttributeAllowedCallback = (node: HtmlElement) => string | null | undefined;
|
|
1689
1696
|
/**
|
|
1690
1697
|
* @public
|
|
1691
1698
|
*/
|
|
@@ -1698,7 +1705,7 @@ interface MetaAttribute {
|
|
|
1698
1705
|
omit?: boolean;
|
|
1699
1706
|
required?: boolean;
|
|
1700
1707
|
}
|
|
1701
|
-
|
|
1708
|
+
type PermittedAttribute = Record<string, MetaAttribute | Array<string | RegExp> | null>;
|
|
1702
1709
|
interface DeprecatedElement {
|
|
1703
1710
|
message?: string;
|
|
1704
1711
|
documentation?: string;
|
|
@@ -1739,7 +1746,7 @@ interface MetaData {
|
|
|
1739
1746
|
* Properties listed here can be used to reverse search elements with the given
|
|
1740
1747
|
* property enabled. See [[MetaTable.getTagsWithProperty]].
|
|
1741
1748
|
*/
|
|
1742
|
-
|
|
1749
|
+
type MetaLookupableProperty = "metadata" | "flow" | "sectioning" | "heading" | "phrasing" | "embedded" | "interactive" | "deprecated" | "foreign" | "void" | "transparent" | "scriptSupporting" | "form" | "labelable";
|
|
1743
1750
|
/**
|
|
1744
1751
|
* Properties listed here can be copied (loaded) onto another element using
|
|
1745
1752
|
* [[HtmlElement.loadMeta]].
|
|
@@ -2370,7 +2377,7 @@ declare class FileSystemConfigLoader extends ConfigLoader {
|
|
|
2370
2377
|
/**
|
|
2371
2378
|
* @public
|
|
2372
2379
|
*/
|
|
2373
|
-
|
|
2380
|
+
type Formatter = (results: Result[]) => string;
|
|
2374
2381
|
|
|
2375
2382
|
interface AvailableFormatters {
|
|
2376
2383
|
checkstyle: Formatter;
|
|
@@ -2389,4 +2396,4 @@ interface AvailableFormatters {
|
|
|
2389
2396
|
declare function getFormatter(name: keyof AvailableFormatters): Formatter;
|
|
2390
2397
|
declare function getFormatter(name: string): Formatter | null;
|
|
2391
2398
|
|
|
2392
|
-
export {
|
|
2399
|
+
export { Event as $, AttributeData as A, Message as B, Config as C, DynamicValue as D, EventDump as E, Result as F, DeferredMessage as G, HtmlValidate as H, TransformContext as I, Transformer as J, TemplateExtractor as K, Location as L, MetaData as M, NodeClosed as N, Plugin as O, ProcessAttributeCallback as P, SchemaValidationPatch as Q, Rule as R, Severity as S, TextNode as T, UserError as U, definePlugin as V, WrappedError as W, Parser as X, ruleExists as Y, EventHandler as Z, EventCallback as _, ConfigData as a, ConfigReadyEvent as a0, SourceReadyEvent as a1, TokenEvent as a2, TagStartEvent as a3, TagOpenEvent as a4, TagEndEvent as a5, TagCloseEvent as a6, TagReadyEvent as a7, ElementReadyEvent as a8, AttributeEvent as a9, WhitespaceEvent as aa, ConditionalEvent as ab, DirectiveEvent as ac, DoctypeEvent as ad, DOMLoadEvent as ae, DOMReadyEvent as af, TriggerEventMap as ag, ListenEventMap as ah, FileSystemConfigLoader as ai, Formatter as aj, getFormatter as ak, compatibilityCheck as al, CompatibilityOptions as am, ConfigError as b, ConfigLoader as c, StaticConfigLoader as d, HtmlElement as e, CSSStyleDeclaration as f, TokenDump as g, SchemaValidationError as h, NestedError as i, MetaDataTable as j, MetaElement as k, MetaAttribute as l, MetaAttributeAllowedCallback as m, MetaTable as n, MetaCopyableProperty as o, presets as p, RuleConstructor as q, RuleDocumentation as r, Source as s, SourceHooks as t, ProcessElementCallback as u, version as v, ProcessElementContext as w, sliceLocation as x, Report as y, Reporter as z };
|