UNPKG

2.99 kBTypeScriptView Raw
1import * as compiler from '@angular/compiler';
2import * as Lint from 'tslint';
3import * as ts from 'typescript';
4import { ComponentMetadata, DirectiveMetadata, InjectableMetadata, ModuleMetadata, PipeMetadata, StyleMetadata } from './metadata';
5import { MetadataReader } from './metadataReader';
6import { CssAstVisitorCtrl } from './styles/basicCssAstVisitor';
7import { CssAst } from './styles/cssAst';
8import { RecursiveAngularExpressionVisitorCtr, TemplateAstVisitorCtr } from './templates/basicTemplateAstVisitor';
9export interface NgWalkerConfig {
10 cssVisitorCtrl?: CssAstVisitorCtrl;
11 expressionVisitorCtrl?: RecursiveAngularExpressionVisitorCtr;
12 templateVisitorCtrl?: TemplateAstVisitorCtr;
13}
14export declare class NgWalker extends Lint.RuleWalker {
15 protected _originalOptions: Lint.IOptions;
16 private _config?;
17 protected _metadataReader?: MetadataReader;
18 constructor(sourceFile: ts.SourceFile, _originalOptions: Lint.IOptions, _config?: NgWalkerConfig, _metadataReader?: MetadataReader);
19 visitClassDeclaration(declaration: ts.ClassDeclaration): void;
20 visitMethodDeclaration(method: ts.MethodDeclaration): void;
21 visitPropertyDeclaration(prop: ts.PropertyDeclaration): void;
22 protected visitMethodDecorator(decorator: ts.Decorator): void;
23 protected visitPropertyDecorator(decorator: ts.Decorator): void;
24 protected visitNgComponent(metadata: ComponentMetadata): void;
25 protected visitClassDecorator(decorator: ts.Decorator): void;
26 protected visitNgModule(metadata: ModuleMetadata): void;
27 protected visitNgDirective(metadata: DirectiveMetadata): void;
28 protected visitNgPipe(metadata: PipeMetadata): void;
29 protected visitNgInjectable(metadata: InjectableMetadata): void;
30 protected visitNgInput(property: ts.PropertyDeclaration, input: ts.Decorator, args: string[]): void;
31 protected visitNgOutput(property: ts.PropertyDeclaration, output: ts.Decorator, args: string[]): void;
32 protected visitNgHostBinding(property: ts.PropertyDeclaration, decorator: ts.Decorator, args: string[]): void;
33 protected visitNgHostListener(method: ts.MethodDeclaration, decorator: ts.Decorator, args: string[]): void;
34 protected visitNgContentChild(property: ts.PropertyDeclaration, input: ts.Decorator, args: string[]): void;
35 protected visitNgContentChildren(property: ts.PropertyDeclaration, input: ts.Decorator, args: string[]): void;
36 protected visitNgViewChild(property: ts.PropertyDeclaration, input: ts.Decorator, args: string[]): void;
37 protected visitNgViewChildren(property: ts.PropertyDeclaration, input: ts.Decorator, args: string[]): void;
38 protected visitNgTemplateHelper(roots: compiler.TemplateAst[], context: ComponentMetadata, baseStart: number): void;
39 protected visitNgStyleHelper(style: CssAst, context: ComponentMetadata, styleMetadata: StyleMetadata, baseStart: number): void;
40 protected getContextSourceFile(path: string, content: string): ts.SourceFile;
41 private hasClassName;
42}