html-validate 7.7.1 → 7.8.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 +4 -2
- package/dist/cjs/browser.js +11 -7
- package/dist/cjs/browser.js.map +1 -1
- package/dist/cjs/cli.js +2 -0
- package/dist/cjs/cli.js.map +1 -1
- package/dist/cjs/core.d.ts +26 -67
- package/dist/cjs/core.js +189 -2388
- package/dist/cjs/core.js.map +1 -1
- package/dist/cjs/elements.js +3704 -0
- package/dist/cjs/elements.js.map +1 -0
- package/dist/cjs/html-validate.js +3 -0
- package/dist/cjs/html-validate.js.map +1 -1
- package/dist/cjs/index.d.ts +5 -3
- package/dist/cjs/index.js +11 -7
- 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.d.ts +1 -1
- package/dist/cjs/jest.js +3 -0
- package/dist/cjs/jest.js.map +1 -1
- package/dist/cjs/meta-helper.d.ts +27 -0
- package/dist/cjs/meta-helper.js +64 -0
- package/dist/cjs/meta-helper.js.map +1 -0
- package/dist/cjs/rules-helper.d.ts +45 -0
- package/dist/cjs/rules-helper.js +408 -0
- package/dist/cjs/rules-helper.js.map +1 -0
- package/dist/cjs/test-utils.d.ts +1 -1
- package/dist/es/browser.d.ts +4 -2
- package/dist/es/browser.js +4 -2
- package/dist/es/browser.js.map +1 -1
- package/dist/es/cli.js +3 -1
- package/dist/es/cli.js.map +1 -1
- package/dist/es/core.d.ts +26 -67
- package/dist/es/core.js +156 -2357
- package/dist/es/core.js.map +1 -1
- package/dist/es/elements.js +3701 -0
- package/dist/es/elements.js.map +1 -0
- package/dist/es/html-validate.js +3 -1
- package/dist/es/html-validate.js.map +1 -1
- package/dist/es/index.d.ts +5 -3
- package/dist/es/index.js +4 -2
- package/dist/es/index.js.map +1 -1
- package/dist/es/jest-lib.js +2 -1
- package/dist/es/jest-lib.js.map +1 -1
- package/dist/es/jest.d.ts +1 -1
- package/dist/es/jest.js +3 -1
- package/dist/es/jest.js.map +1 -1
- package/dist/es/meta-helper.d.ts +27 -0
- package/dist/es/meta-helper.js +61 -0
- package/dist/es/meta-helper.js.map +1 -0
- package/dist/es/rules-helper.d.ts +45 -0
- package/dist/es/rules-helper.js +398 -0
- package/dist/es/rules-helper.js.map +1 -0
- package/dist/es/test-utils.d.ts +1 -1
- package/elements/html5.js +1 -2119
- package/package.json +9 -8
- package/elements/README.md +0 -49
- package/elements/entities.json +0 -1724
package/dist/es/core.d.ts
CHANGED
|
@@ -944,6 +944,23 @@ interface Location {
|
|
|
944
944
|
*/
|
|
945
945
|
readonly size: number;
|
|
946
946
|
}
|
|
947
|
+
/**
|
|
948
|
+
* Calculate a new location by offsetting this location.
|
|
949
|
+
*
|
|
950
|
+
* If the references text with newlines the wrap parameter must be set to
|
|
951
|
+
* properly calculate line and column information. If not given the text is
|
|
952
|
+
* assumed to contain no newlines.
|
|
953
|
+
*
|
|
954
|
+
* @public
|
|
955
|
+
* @param location - Source location
|
|
956
|
+
* @param begin - Start location. Default is 0.
|
|
957
|
+
* @param end - End location. Default is size of location. Negative values are
|
|
958
|
+
* counted from end, e.g. `-2` means `size - 2`.
|
|
959
|
+
* @param wrap - If given, line/column is wrapped for each newline occuring
|
|
960
|
+
* before location end.
|
|
961
|
+
*/
|
|
962
|
+
declare function sliceLocation(location: Location, begin: number, end?: number, wrap?: string): Location;
|
|
963
|
+
declare function sliceLocation(location: Location | null | undefined, begin: number, end?: number, wrap?: string): Location | null;
|
|
947
964
|
|
|
948
965
|
/**
|
|
949
966
|
* @public
|
|
@@ -1745,30 +1762,6 @@ interface ElementTable {
|
|
|
1745
1762
|
[tagName: string]: MetaElement;
|
|
1746
1763
|
}
|
|
1747
1764
|
|
|
1748
|
-
/**
|
|
1749
|
-
* Helper function to assist IDE with completion and type-checking.
|
|
1750
|
-
*
|
|
1751
|
-
* @public
|
|
1752
|
-
*/
|
|
1753
|
-
declare function defineMetadata(metatable: MetaDataTable): MetaDataTable;
|
|
1754
|
-
|
|
1755
|
-
/**
|
|
1756
|
-
* Helpers when writing element metadata.
|
|
1757
|
-
*
|
|
1758
|
-
* @public
|
|
1759
|
-
*/
|
|
1760
|
-
interface MetadataHelper {
|
|
1761
|
-
/** Returns an error if another attribute is omitted, i.e. it requires another attribute to be present to pass. */
|
|
1762
|
-
allowedIfAttributeIsPresent(...attr: string[]): MetaAttributeAllowedCallback;
|
|
1763
|
-
/** Returns an error if another attribute is present, i.e. it requires another attribute to be omitted to pass. */
|
|
1764
|
-
allowedIfAttributeIsAbsent(...attr: string[]): MetaAttributeAllowedCallback;
|
|
1765
|
-
/** Returns an error if another attribute does not have one of the listed values */
|
|
1766
|
-
allowedIfAttributeHasValue(attr: string, value: string[], options?: {
|
|
1767
|
-
defaultValue?: string | null;
|
|
1768
|
-
}): MetaAttributeAllowedCallback;
|
|
1769
|
-
}
|
|
1770
|
-
declare const metadataHelper: MetadataHelper;
|
|
1771
|
-
|
|
1772
1765
|
/**
|
|
1773
1766
|
* @public
|
|
1774
1767
|
*/
|
|
@@ -2282,48 +2275,6 @@ declare class StaticConfigLoader extends ConfigLoader {
|
|
|
2282
2275
|
/** @public */
|
|
2283
2276
|
declare const version: string;
|
|
2284
2277
|
|
|
2285
|
-
declare const HTML_CACHE_KEY: unique symbol;
|
|
2286
|
-
declare const A11Y_CACHE_KEY: unique symbol;
|
|
2287
|
-
declare const IGNORE_HIDDEN_ROOT_HTML_CACHE_KEY: unique symbol;
|
|
2288
|
-
declare const IGNORE_HIDDEN_ROOT_A11Y_CACHE_KEY: unique symbol;
|
|
2289
|
-
/**
|
|
2290
|
-
* @public
|
|
2291
|
-
*/
|
|
2292
|
-
declare enum TextClassification {
|
|
2293
|
-
EMPTY_TEXT = 0,
|
|
2294
|
-
DYNAMIC_TEXT = 1,
|
|
2295
|
-
STATIC_TEXT = 2
|
|
2296
|
-
}
|
|
2297
|
-
/**
|
|
2298
|
-
* @public
|
|
2299
|
-
*/
|
|
2300
|
-
interface TextClassificationOptions {
|
|
2301
|
-
/** If `true` only accessible text is considered (default false) */
|
|
2302
|
-
accessible?: boolean;
|
|
2303
|
-
/** If `true` the `hidden` and `aria-hidden` attribute is ignored on the root
|
|
2304
|
-
* (and parents) elements (default false) */
|
|
2305
|
-
ignoreHiddenRoot?: boolean;
|
|
2306
|
-
}
|
|
2307
|
-
declare module "../../dom/cache" {
|
|
2308
|
-
interface DOMNodeCache {
|
|
2309
|
-
[HTML_CACHE_KEY]: TextClassification;
|
|
2310
|
-
[A11Y_CACHE_KEY]: TextClassification;
|
|
2311
|
-
[IGNORE_HIDDEN_ROOT_HTML_CACHE_KEY]: TextClassification;
|
|
2312
|
-
[IGNORE_HIDDEN_ROOT_A11Y_CACHE_KEY]: TextClassification;
|
|
2313
|
-
}
|
|
2314
|
-
}
|
|
2315
|
-
/**
|
|
2316
|
-
* Checks text content of an element.
|
|
2317
|
-
*
|
|
2318
|
-
* Any text is considered including text from descendant elements. Whitespace is
|
|
2319
|
-
* ignored.
|
|
2320
|
-
*
|
|
2321
|
-
* If any text is dynamic `TextClassification.DYNAMIC_TEXT` is returned.
|
|
2322
|
-
*
|
|
2323
|
-
* @public
|
|
2324
|
-
*/
|
|
2325
|
-
declare function classifyNodeText(node: HtmlElement, options?: TextClassificationOptions): TextClassification;
|
|
2326
|
-
|
|
2327
2278
|
/**
|
|
2328
2279
|
* @public
|
|
2329
2280
|
*/
|
|
@@ -2421,6 +2372,13 @@ declare class FileSystemConfigLoader extends ConfigLoader {
|
|
|
2421
2372
|
*/
|
|
2422
2373
|
declare type Formatter = (results: Result[]) => string;
|
|
2423
2374
|
|
|
2375
|
+
interface AvailableFormatters {
|
|
2376
|
+
checkstyle: Formatter;
|
|
2377
|
+
codeframe: Formatter;
|
|
2378
|
+
json: Formatter;
|
|
2379
|
+
stylish: Formatter;
|
|
2380
|
+
text: Formatter;
|
|
2381
|
+
}
|
|
2424
2382
|
/**
|
|
2425
2383
|
* Get formatter function by name.
|
|
2426
2384
|
*
|
|
@@ -2428,6 +2386,7 @@ declare type Formatter = (results: Result[]) => string;
|
|
|
2428
2386
|
* @param name - Name of formatter.
|
|
2429
2387
|
* @returns Formatter function or null if it doesn't exist.
|
|
2430
2388
|
*/
|
|
2389
|
+
declare function getFormatter(name: keyof AvailableFormatters): Formatter;
|
|
2431
2390
|
declare function getFormatter(name: string): Formatter | null;
|
|
2432
2391
|
|
|
2433
|
-
export {
|
|
2392
|
+
export { ConfigReadyEvent 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, Parser as V, WrappedError as W, ruleExists as X, EventHandler as Y, EventCallback as Z, Event as _, ConfigData as a, SourceReadyEvent as a0, TokenEvent as a1, TagStartEvent as a2, TagOpenEvent as a3, TagEndEvent as a4, TagCloseEvent as a5, TagReadyEvent as a6, ElementReadyEvent as a7, AttributeEvent as a8, WhitespaceEvent as a9, ConditionalEvent as aa, DirectiveEvent as ab, DoctypeEvent as ac, DOMLoadEvent as ad, DOMReadyEvent as ae, TriggerEventMap as af, ListenEventMap as ag, FileSystemConfigLoader as ah, Formatter as ai, getFormatter as aj, compatibilityCheck as ak, CompatibilityOptions as al, 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 };
|