html-validate 7.14.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.
- package/browser.d.ts +1 -0
- package/browser.js +1 -0
- package/dist/cjs/browser.d.ts +1 -4
- package/dist/cjs/browser.js +13 -1
- package/dist/cjs/browser.js.map +1 -1
- package/dist/cjs/cli.js +5 -5
- package/dist/cjs/cli.js.map +1 -1
- package/dist/cjs/core.js +193 -122
- package/dist/cjs/core.js.map +1 -1
- package/dist/cjs/elements.js +1 -1
- package/dist/cjs/html-validate.js +1 -1
- package/dist/cjs/index.d.ts +1 -89
- package/dist/cjs/index.js +13 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/jest-lib.js +17 -12
- package/dist/cjs/jest-lib.js.map +1 -1
- package/dist/cjs/jest.d.ts +1 -42
- package/dist/cjs/jest.js.map +1 -1
- package/dist/cjs/meta-helper.js +3 -0
- package/dist/cjs/meta-helper.js.map +1 -1
- package/dist/cjs/rules-helper.js +3 -3
- package/dist/cjs/rules-helper.js.map +1 -1
- package/dist/cjs/test-utils.d.ts +1 -30
- package/dist/cjs/test-utils.js +3 -0
- package/dist/cjs/test-utils.js.map +1 -1
- package/dist/cjs/tsdoc-metadata.json +11 -0
- package/dist/es/browser.d.ts +1 -4
- package/dist/es/browser.js +2 -2
- package/dist/es/cli.js +4 -4
- package/dist/es/cli.js.map +1 -1
- package/dist/es/core.js +172 -105
- package/dist/es/core.js.map +1 -1
- package/dist/es/elements.js +1 -1
- package/dist/es/html-validate.js +2 -2
- package/dist/es/index.d.ts +1 -89
- package/dist/es/index.js +2 -2
- package/dist/es/jest-lib.js +18 -13
- package/dist/es/jest-lib.js.map +1 -1
- package/dist/es/jest.d.ts +1 -42
- package/dist/es/jest.js.map +1 -1
- package/dist/es/meta-helper.js +3 -0
- package/dist/es/meta-helper.js.map +1 -1
- package/dist/es/rules-helper.js +4 -4
- package/dist/es/rules-helper.js.map +1 -1
- package/dist/es/test-utils.d.ts +1 -30
- package/dist/es/test-utils.js +3 -0
- package/dist/es/test-utils.js.map +1 -1
- package/dist/tsdoc-metadata.json +11 -0
- package/dist/{es/core.d.ts → types/browser.d.ts} +2435 -2615
- package/dist/{cjs/core.d.ts → types/index.d.ts} +2628 -2615
- package/dist/types/jest.d.ts +44 -0
- package/dist/types/test-utils.d.ts +40 -0
- package/jest.d.ts +1 -2
- package/package.json +33 -27
- package/test-utils.d.ts +1 -2
- package/dist/cjs/meta-helper.d.ts +0 -28
- package/dist/cjs/rules-helper.d.ts +0 -54
- package/dist/es/meta-helper.d.ts +0 -28
- package/dist/es/rules-helper.d.ts +0 -54
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export { }
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
import { type ConfigData } from "./index"
|
|
6
|
+
import { type Message } from "./index"
|
|
7
|
+
declare global {
|
|
8
|
+
namespace jest {
|
|
9
|
+
interface Matchers<R, T = {}> {
|
|
10
|
+
toBeValid(): R;
|
|
11
|
+
toBeInvalid(): R;
|
|
12
|
+
toHaveError(error: Partial<Message>): R;
|
|
13
|
+
toHaveError(ruleId: string, message: string, context?: any): R;
|
|
14
|
+
toHaveErrors(errors: Array<[string, string] | Record<string, unknown>>): R;
|
|
15
|
+
/**
|
|
16
|
+
* Validate string or HTMLElement.
|
|
17
|
+
*
|
|
18
|
+
* Test passes if result is valid.
|
|
19
|
+
*
|
|
20
|
+
* @param config - Optional HTML-Validate configuration object.
|
|
21
|
+
* @param filename - Optional filename used when matching transformer and
|
|
22
|
+
* loading configuration.
|
|
23
|
+
*/
|
|
24
|
+
toHTMLValidate(): R;
|
|
25
|
+
toHTMLValidate(filename: string): R;
|
|
26
|
+
toHTMLValidate(config: ConfigData): R;
|
|
27
|
+
toHTMLValidate(config: ConfigData, filename: string): R;
|
|
28
|
+
toHTMLValidate(error: Partial<Message>): R;
|
|
29
|
+
toHTMLValidate(error: Partial<Message>, filename: string): R;
|
|
30
|
+
toHTMLValidate(error: Partial<Message>, config: ConfigData): R;
|
|
31
|
+
toHTMLValidate(error: Partial<Message>, config: ConfigData, filename: string): R;
|
|
32
|
+
/**
|
|
33
|
+
* Writes out the given [[Report]] using codeframe formatter and compares
|
|
34
|
+
* with snapshot.
|
|
35
|
+
*/
|
|
36
|
+
toMatchCodeframe(snapshot?: string): R;
|
|
37
|
+
/**
|
|
38
|
+
* Writes out the given [[Report]] using codeframe formatter and compares
|
|
39
|
+
* with inline snapshot.
|
|
40
|
+
*/
|
|
41
|
+
toMatchInlineCodeframe(snapshot?: string): R;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Source } from 'html-validate';
|
|
2
|
+
import { TransformContext } from 'html-validate';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
declare type Transformer_2 = (this: TransformContext, source: Source) => Iterable<Source>;
|
|
8
|
+
export { Transformer_2 as Transformer }
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Helper function to call a transformer function in test-cases.
|
|
12
|
+
*
|
|
13
|
+
* @public
|
|
14
|
+
* @param fn - Transformer function to call.
|
|
15
|
+
* @param filename - Filename to read data from. Must be readable.
|
|
16
|
+
* @param chain - If set this function is called when chaining transformers. Default is pass-thru.
|
|
17
|
+
*/
|
|
18
|
+
export declare function transformFile(fn: Transformer_2, filename: string, chain?: (source: Source, filename: string) => Iterable<Source>): Source[];
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Helper function to call a transformer function in test-cases.
|
|
22
|
+
*
|
|
23
|
+
* @public
|
|
24
|
+
* @param fn - Transformer function to call.
|
|
25
|
+
* @param data - Source to transform.
|
|
26
|
+
* @param chain - If set this function is called when chaining transformers. Default is pass-thru.
|
|
27
|
+
*/
|
|
28
|
+
export declare function transformSource(fn: Transformer_2, source: Source, chain?: (source: Source, filename: string) => Iterable<Source>): Source[];
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Helper function to call a transformer function in test-cases.
|
|
32
|
+
*
|
|
33
|
+
* @public
|
|
34
|
+
* @param fn - Transformer function to call.
|
|
35
|
+
* @param data - String to transform.
|
|
36
|
+
* @param chain - If set this function is called when chaining transformers. Default is pass-thru.
|
|
37
|
+
*/
|
|
38
|
+
export declare function transformString(fn: Transformer_2, data: string, chain?: (source: Source, filename: string) => Iterable<Source>): Source[];
|
|
39
|
+
|
|
40
|
+
export { }
|
package/jest.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export * from "./dist/cjs/jest";
|
|
1
|
+
export * from "./dist/types/jest";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "html-validate",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.15.1",
|
|
4
4
|
"description": "Offline html5 validator",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"html",
|
|
@@ -25,19 +25,29 @@
|
|
|
25
25
|
"exports": {
|
|
26
26
|
".": {
|
|
27
27
|
"require": "./dist/cjs/index.js",
|
|
28
|
-
"import": "./dist/es/index.js"
|
|
28
|
+
"import": "./dist/es/index.js",
|
|
29
|
+
"types": "./dist/types/index.d.ts"
|
|
29
30
|
},
|
|
30
31
|
"./browser": {
|
|
31
32
|
"require": "./dist/cjs/browser.js",
|
|
32
|
-
"import": "./dist/es/browser.js"
|
|
33
|
+
"import": "./dist/es/browser.js",
|
|
34
|
+
"types": "./dist/types/browser.d.ts"
|
|
33
35
|
},
|
|
34
36
|
"./dist/cjs/*": "./dist/cjs/*",
|
|
35
37
|
"./dist/es/*": "./dist/es/*",
|
|
36
38
|
"./dist/schema/*": "./dist/schema/*",
|
|
37
39
|
"./elements/*": "./elements/*",
|
|
38
|
-
"./jest":
|
|
40
|
+
"./jest": {
|
|
41
|
+
"require": "./dist/cjs/jest.js",
|
|
42
|
+
"import": "./dist/es/jest.js",
|
|
43
|
+
"types": "./dist/types/jest.d.ts"
|
|
44
|
+
},
|
|
39
45
|
"./package.json": "./package.json",
|
|
40
|
-
"./test-utils":
|
|
46
|
+
"./test-utils": {
|
|
47
|
+
"require": "./dist/cjs/test-utils.js",
|
|
48
|
+
"import": "./dist/es/test-utils.js",
|
|
49
|
+
"types": "./dist/types/test-utils.d.ts"
|
|
50
|
+
}
|
|
41
51
|
},
|
|
42
52
|
"main": "dist/cjs/index.js",
|
|
43
53
|
"module": "dist/es/index.js",
|
|
@@ -51,23 +61,19 @@
|
|
|
51
61
|
"elements",
|
|
52
62
|
"browser.{js,d.ts}",
|
|
53
63
|
"jest.{js,d.ts}",
|
|
54
|
-
"test-utils.{js,d.ts}"
|
|
55
|
-
"!dist/types/**",
|
|
56
|
-
"!tsconfig.json",
|
|
57
|
-
"!**/*.snap",
|
|
58
|
-
"!**/*.spec.{js,ts,d.ts}"
|
|
64
|
+
"test-utils.{js,d.ts}"
|
|
59
65
|
],
|
|
60
66
|
"workspaces": [
|
|
61
67
|
"docs"
|
|
62
68
|
],
|
|
63
69
|
"scripts": {
|
|
64
70
|
"prebuild": "run-s codegen prebuild:*",
|
|
65
|
-
"build": "run-s build
|
|
71
|
+
"build": "run-s build:cjs build:esm build:script",
|
|
66
72
|
"postbuild": "bash scripts/pkg",
|
|
67
73
|
"prebuild:tsc": "tsc",
|
|
68
74
|
"build:cjs": "rollup --config rollup.cjs.config.mjs",
|
|
69
|
-
"build:dts": "rollup --config rollup.dts.config.mjs",
|
|
70
75
|
"build:esm": "rollup --config rollup.esm.config.mjs",
|
|
76
|
+
"build:script": "node build.mjs",
|
|
71
77
|
"clean": "rm -rf dist public",
|
|
72
78
|
"codegen": "node scripts/codegen",
|
|
73
79
|
"compatibility": "scripts/compatibility.sh",
|
|
@@ -165,43 +171,43 @@
|
|
|
165
171
|
"semver": "^7.0.0"
|
|
166
172
|
},
|
|
167
173
|
"devDependencies": {
|
|
168
|
-
"@html-validate/commitlint-config": "3.0.
|
|
169
|
-
"@html-validate/eslint-config": "5.
|
|
170
|
-
"@html-validate/eslint-config-jest": "5.
|
|
171
|
-
"@html-validate/eslint-config-typescript": "5.
|
|
172
|
-
"@html-validate/eslint-config-typescript-typeinfo": "5.
|
|
174
|
+
"@html-validate/commitlint-config": "3.0.13",
|
|
175
|
+
"@html-validate/eslint-config": "5.7.3",
|
|
176
|
+
"@html-validate/eslint-config-jest": "5.7.0",
|
|
177
|
+
"@html-validate/eslint-config-typescript": "5.7.3",
|
|
178
|
+
"@html-validate/eslint-config-typescript-typeinfo": "5.7.0",
|
|
173
179
|
"@html-validate/jest-config": "3.6.3",
|
|
174
|
-
"@html-validate/prettier-config": "2.3.
|
|
180
|
+
"@html-validate/prettier-config": "2.3.9",
|
|
175
181
|
"@html-validate/release-scripts": "4.0.6",
|
|
182
|
+
"@microsoft/api-extractor": "7.34.4",
|
|
176
183
|
"@rollup/plugin-json": "6.0.0",
|
|
177
|
-
"@rollup/plugin-node-resolve": "15.0.
|
|
184
|
+
"@rollup/plugin-node-resolve": "15.0.2",
|
|
178
185
|
"@rollup/plugin-replace": "5.0.2",
|
|
179
|
-
"@rollup/plugin-typescript": "11.
|
|
186
|
+
"@rollup/plugin-typescript": "11.1.0",
|
|
180
187
|
"@rollup/plugin-virtual": "3.0.1",
|
|
181
188
|
"@types/babar": "0.2.1",
|
|
182
189
|
"@types/babel__code-frame": "7.0.3",
|
|
183
190
|
"@types/estree": "1.0.0",
|
|
184
191
|
"@types/jest": "29.5.0",
|
|
185
192
|
"@types/minimist": "1.2.2",
|
|
186
|
-
"@types/node": "14.18.
|
|
187
|
-
"@types/prompts": "2.4.
|
|
193
|
+
"@types/node": "14.18.42",
|
|
194
|
+
"@types/prompts": "2.4.4",
|
|
188
195
|
"@types/semver": "7.3.13",
|
|
189
196
|
"@types/stream-buffers": "3.0.4",
|
|
190
197
|
"babar": "0.2.3",
|
|
191
198
|
"husky": "8.0.3",
|
|
199
|
+
"is-ci": "3.0.1",
|
|
192
200
|
"jest": "29.5.0",
|
|
193
201
|
"jest-diff": "29.5.0",
|
|
194
202
|
"jest-environment-jsdom": "29.5.0",
|
|
195
203
|
"jest-snapshot": "29.5.0",
|
|
196
|
-
"memfs": "3.
|
|
204
|
+
"memfs": "3.5.0",
|
|
197
205
|
"npm-pkg-lint": "1.11.2",
|
|
198
206
|
"npm-run-all": "4.1.5",
|
|
199
207
|
"rollup": "3.20.2",
|
|
200
|
-
"rollup-plugin-copy": "3.4.0",
|
|
201
|
-
"rollup-plugin-dts": "5.3.0",
|
|
202
208
|
"stream-buffers": "3.0.2",
|
|
203
|
-
"ts-jest": "29.0
|
|
204
|
-
"typescript": "5.0.
|
|
209
|
+
"ts-jest": "29.1.0",
|
|
210
|
+
"typescript": "5.0.4"
|
|
205
211
|
},
|
|
206
212
|
"peerDependencies": {
|
|
207
213
|
"jest": "^25.1 || ^26 || ^27.1 || ^28.1.3 || ^29.0.3",
|
package/test-utils.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export * from "./dist/cjs/test-utils";
|
|
1
|
+
export * from "./dist/types/test-utils";
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { k as MetaDataTable, n as MetaAttributeAllowedCallback } from './core.js';
|
|
2
|
-
import './rules-helper.js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Helper function to assist IDE with completion and type-checking.
|
|
6
|
-
*
|
|
7
|
-
* @public
|
|
8
|
-
*/
|
|
9
|
-
declare function defineMetadata(metatable: MetaDataTable): MetaDataTable;
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Helpers when writing element metadata.
|
|
13
|
-
*
|
|
14
|
-
* @public
|
|
15
|
-
*/
|
|
16
|
-
interface MetadataHelper {
|
|
17
|
-
/** Returns an error if another attribute is omitted, i.e. it requires another attribute to be present to pass. */
|
|
18
|
-
allowedIfAttributeIsPresent(this: void, ...attr: string[]): MetaAttributeAllowedCallback;
|
|
19
|
-
/** Returns an error if another attribute is present, i.e. it requires another attribute to be omitted to pass. */
|
|
20
|
-
allowedIfAttributeIsAbsent(this: void, ...attr: string[]): MetaAttributeAllowedCallback;
|
|
21
|
-
/** Returns an error if another attribute does not have one of the listed values */
|
|
22
|
-
allowedIfAttributeHasValue(this: void, attr: string, value: string[], options?: {
|
|
23
|
-
defaultValue?: string | null;
|
|
24
|
-
}): MetaAttributeAllowedCallback;
|
|
25
|
-
}
|
|
26
|
-
declare const metadataHelper: MetadataHelper;
|
|
27
|
-
|
|
28
|
-
export { defineMetadata as d, metadataHelper as m };
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { f as HtmlElement } from './core.js';
|
|
2
|
-
|
|
3
|
-
interface IncludeExcludeOptions {
|
|
4
|
-
include: string[] | null;
|
|
5
|
-
exclude: string[] | null;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
declare function keywordPatternMatcher(list: string[], keyword: string): boolean;
|
|
11
|
-
|
|
12
|
-
declare const HTML_CACHE_KEY: unique symbol;
|
|
13
|
-
declare const A11Y_CACHE_KEY: unique symbol;
|
|
14
|
-
declare const IGNORE_HIDDEN_ROOT_HTML_CACHE_KEY: unique symbol;
|
|
15
|
-
declare const IGNORE_HIDDEN_ROOT_A11Y_CACHE_KEY: unique symbol;
|
|
16
|
-
/**
|
|
17
|
-
* @public
|
|
18
|
-
*/
|
|
19
|
-
declare enum TextClassification {
|
|
20
|
-
EMPTY_TEXT = 0,
|
|
21
|
-
DYNAMIC_TEXT = 1,
|
|
22
|
-
STATIC_TEXT = 2
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* @public
|
|
26
|
-
*/
|
|
27
|
-
interface TextClassificationOptions {
|
|
28
|
-
/** If `true` only accessible text is considered (default false) */
|
|
29
|
-
accessible?: boolean;
|
|
30
|
-
/** If `true` the `hidden` and `aria-hidden` attribute is ignored on the root
|
|
31
|
-
* (and parents) elements (default false) */
|
|
32
|
-
ignoreHiddenRoot?: boolean;
|
|
33
|
-
}
|
|
34
|
-
declare module "../../dom/cache" {
|
|
35
|
-
interface DOMNodeCache {
|
|
36
|
-
[HTML_CACHE_KEY]: TextClassification;
|
|
37
|
-
[A11Y_CACHE_KEY]: TextClassification;
|
|
38
|
-
[IGNORE_HIDDEN_ROOT_HTML_CACHE_KEY]: TextClassification;
|
|
39
|
-
[IGNORE_HIDDEN_ROOT_A11Y_CACHE_KEY]: TextClassification;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Checks text content of an element.
|
|
44
|
-
*
|
|
45
|
-
* Any text is considered including text from descendant elements. Whitespace is
|
|
46
|
-
* ignored.
|
|
47
|
-
*
|
|
48
|
-
* If any text is dynamic `TextClassification.DYNAMIC_TEXT` is returned.
|
|
49
|
-
*
|
|
50
|
-
* @public
|
|
51
|
-
*/
|
|
52
|
-
declare function classifyNodeText(node: HtmlElement, options?: TextClassificationOptions): TextClassification;
|
|
53
|
-
|
|
54
|
-
export { IncludeExcludeOptions as I, TextClassification as T, classifyNodeText as c, keywordPatternMatcher as k };
|
package/dist/es/meta-helper.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { k as MetaDataTable, n as MetaAttributeAllowedCallback } from './core.js';
|
|
2
|
-
import './rules-helper.js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Helper function to assist IDE with completion and type-checking.
|
|
6
|
-
*
|
|
7
|
-
* @public
|
|
8
|
-
*/
|
|
9
|
-
declare function defineMetadata(metatable: MetaDataTable): MetaDataTable;
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Helpers when writing element metadata.
|
|
13
|
-
*
|
|
14
|
-
* @public
|
|
15
|
-
*/
|
|
16
|
-
interface MetadataHelper {
|
|
17
|
-
/** Returns an error if another attribute is omitted, i.e. it requires another attribute to be present to pass. */
|
|
18
|
-
allowedIfAttributeIsPresent(this: void, ...attr: string[]): MetaAttributeAllowedCallback;
|
|
19
|
-
/** Returns an error if another attribute is present, i.e. it requires another attribute to be omitted to pass. */
|
|
20
|
-
allowedIfAttributeIsAbsent(this: void, ...attr: string[]): MetaAttributeAllowedCallback;
|
|
21
|
-
/** Returns an error if another attribute does not have one of the listed values */
|
|
22
|
-
allowedIfAttributeHasValue(this: void, attr: string, value: string[], options?: {
|
|
23
|
-
defaultValue?: string | null;
|
|
24
|
-
}): MetaAttributeAllowedCallback;
|
|
25
|
-
}
|
|
26
|
-
declare const metadataHelper: MetadataHelper;
|
|
27
|
-
|
|
28
|
-
export { defineMetadata as d, metadataHelper as m };
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { f as HtmlElement } from './core.js';
|
|
2
|
-
|
|
3
|
-
interface IncludeExcludeOptions {
|
|
4
|
-
include: string[] | null;
|
|
5
|
-
exclude: string[] | null;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
declare function keywordPatternMatcher(list: string[], keyword: string): boolean;
|
|
11
|
-
|
|
12
|
-
declare const HTML_CACHE_KEY: unique symbol;
|
|
13
|
-
declare const A11Y_CACHE_KEY: unique symbol;
|
|
14
|
-
declare const IGNORE_HIDDEN_ROOT_HTML_CACHE_KEY: unique symbol;
|
|
15
|
-
declare const IGNORE_HIDDEN_ROOT_A11Y_CACHE_KEY: unique symbol;
|
|
16
|
-
/**
|
|
17
|
-
* @public
|
|
18
|
-
*/
|
|
19
|
-
declare enum TextClassification {
|
|
20
|
-
EMPTY_TEXT = 0,
|
|
21
|
-
DYNAMIC_TEXT = 1,
|
|
22
|
-
STATIC_TEXT = 2
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* @public
|
|
26
|
-
*/
|
|
27
|
-
interface TextClassificationOptions {
|
|
28
|
-
/** If `true` only accessible text is considered (default false) */
|
|
29
|
-
accessible?: boolean;
|
|
30
|
-
/** If `true` the `hidden` and `aria-hidden` attribute is ignored on the root
|
|
31
|
-
* (and parents) elements (default false) */
|
|
32
|
-
ignoreHiddenRoot?: boolean;
|
|
33
|
-
}
|
|
34
|
-
declare module "../../dom/cache" {
|
|
35
|
-
interface DOMNodeCache {
|
|
36
|
-
[HTML_CACHE_KEY]: TextClassification;
|
|
37
|
-
[A11Y_CACHE_KEY]: TextClassification;
|
|
38
|
-
[IGNORE_HIDDEN_ROOT_HTML_CACHE_KEY]: TextClassification;
|
|
39
|
-
[IGNORE_HIDDEN_ROOT_A11Y_CACHE_KEY]: TextClassification;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Checks text content of an element.
|
|
44
|
-
*
|
|
45
|
-
* Any text is considered including text from descendant elements. Whitespace is
|
|
46
|
-
* ignored.
|
|
47
|
-
*
|
|
48
|
-
* If any text is dynamic `TextClassification.DYNAMIC_TEXT` is returned.
|
|
49
|
-
*
|
|
50
|
-
* @public
|
|
51
|
-
*/
|
|
52
|
-
declare function classifyNodeText(node: HtmlElement, options?: TextClassificationOptions): TextClassification;
|
|
53
|
-
|
|
54
|
-
export { IncludeExcludeOptions as I, TextClassification as T, classifyNodeText as c, keywordPatternMatcher as k };
|