1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | import * as ts from "typescript";
|
18 | import { Fix, IOptions, Replacement, RuleFailure } from "../rule/rule";
|
19 | import { SyntaxWalker } from "./syntaxWalker";
|
20 | import { IWalker } from "./walker";
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 | export declare class RuleWalker extends SyntaxWalker implements IWalker {
|
28 | private readonly sourceFile;
|
29 | private readonly limit;
|
30 | private readonly options?;
|
31 | private readonly failures;
|
32 | private readonly ruleName;
|
33 | constructor(sourceFile: ts.SourceFile, options: IOptions);
|
34 | getSourceFile(): ts.SourceFile;
|
35 | getLineAndCharacterOfPosition(position: number): ts.LineAndCharacter;
|
36 | getFailures(): RuleFailure[];
|
37 | getLimit(): number;
|
38 | getOptions(): any;
|
39 | hasOption(option: string): boolean;
|
40 | /** @deprecated Prefer `addFailureAt` and its variants. */
|
41 | createFailure(start: number, width: number, failure: string, fix?: Fix): RuleFailure;
|
42 | /** @deprecated Prefer `addFailureAt` and its variants. */
|
43 | addFailure(failure: RuleFailure): void;
|
44 | /** Add a failure with any arbitrary span. Prefer `addFailureAtNode` if possible. */
|
45 | addFailureAt(start: number, width: number, failure: string, fix?: Fix): void;
|
46 | /** Like `addFailureAt` but uses start and end instead of start and width. */
|
47 | addFailureFromStartToEnd(start: number, end: number, failure: string, fix?: Fix): void;
|
48 | /** Add a failure using a node's span. */
|
49 | addFailureAtNode(node: ts.Node, failure: string, fix?: Fix): void;
|
50 | createReplacement(start: number, length: number, text: string): Replacement;
|
51 | appendText(start: number, text: string): Replacement;
|
52 | deleteText(start: number, length: number): Replacement;
|
53 | deleteFromTo(start: number, end: number): Replacement;
|
54 | getRuleName(): string;
|
55 | }
|