UNPKG

1.45 kBTypeScriptView Raw
1import { TxtNode, TxtNodeRange, TxtNodeType, TxtParentNode } from "@textlint/ast-node-types";
2/**
3 * Ignore node manager that manager ignored ranges.
4 *
5 */
6export default class IgnoreNodeManager {
7 private _ignoredRangeList;
8 constructor();
9 /**
10 * @returns {(number)[][]}
11 */
12 get ignoredRanges(): TxtNodeRange[];
13 /**
14 * |.......|
15 * ^ ^
16 * Ignored Range
17 *
18 * |........|
19 * ^
20 * index
21 * @param {number} index
22 * @returns {boolean}
23 */
24 isIgnoredIndex(index: number): boolean;
25 /**
26 * @param {[number, number]} aRange
27 * @returns {boolean}
28 * @deprecated This method will be removed
29 */
30 isIgnoredRange(aRange: TxtNodeRange): boolean;
31 /**
32 * @param {Object} node
33 * @returns {boolean}
34 */
35 isIgnored(node: TxtNode | TxtParentNode): boolean;
36 /**
37 * add node to ignore range list
38 * @param {TxtNode} node
39 */
40 ignore(node: TxtNode | TxtParentNode): void;
41 /**
42 * add range to ignore range list
43 * @param {[number, number]} range
44 */
45 ignoreRange(range: TxtNodeRange): void;
46 /**
47 * ignore children node of `node`,
48 * if the children node has the type that is included in `ignoredNodeTypes`.
49 * @param {TxtNode} targetNode
50 * @param {string[]} ignoredNodeTypes
51 */
52 ignoreChildrenByTypes(targetNode: TxtNode | TxtParentNode, ignoredNodeTypes: TxtNodeType[]): void;
53}