selectorPropertyBase.d.ts 1.6 KB

12345678910111213141516171819202122232425262728
  1. import { CssSelector } from '@angular/compiler';
  2. import { IOptions, RuleFailure } from 'tslint';
  3. import { AbstractRule } from 'tslint/lib/rules';
  4. import { SourceFile } from 'typescript';
  5. export declare const OPTION_STYLE_CAMEL_CASE = "camelCase";
  6. export declare const OPTION_STYLE_KEBAB_CASE = "kebab-case";
  7. export declare const OPTION_TYPE_ATTRIBUTE = "attribute";
  8. export declare const OPTION_TYPE_ATTRS = "attrs";
  9. export declare const OPTION_TYPE_ELEMENT = "element";
  10. export declare type SelectorStyle = typeof OPTION_STYLE_CAMEL_CASE | typeof OPTION_STYLE_KEBAB_CASE;
  11. export declare type SelectorType = typeof OPTION_TYPE_ATTRIBUTE | typeof OPTION_TYPE_ELEMENT;
  12. export declare type SelectorTypeInternal = typeof OPTION_TYPE_ATTRS | typeof OPTION_TYPE_ELEMENT;
  13. export declare abstract class SelectorPropertyBase extends AbstractRule {
  14. abstract readonly handleType: string;
  15. internalTypes: ReadonlyArray<SelectorType>;
  16. prefixes: ReadonlyArray<string>;
  17. style: SelectorStyle;
  18. types: ReadonlyArray<SelectorTypeInternal>;
  19. constructor(options: IOptions);
  20. abstract getPrefixFailure(prefixes: ReadonlyArray<string>): string;
  21. abstract getStyleFailure(style: SelectorStyle): string;
  22. abstract getTypeFailure(types: ReadonlyArray<SelectorType>): string;
  23. getValidSelectors(selectors: CssSelector[]): ReadonlyArray<string>;
  24. validatePrefixes(selectors: ReadonlyArray<string>): boolean;
  25. validateStyle(selectors: ReadonlyArray<string>): boolean;
  26. validateTypes(selectors: ReadonlyArray<string>): boolean;
  27. apply(sourceFile: SourceFile): RuleFailure[];
  28. }