utils.d.ts 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. import * as ng from '@angular/compiler/src/expression_parser/ast';
  2. import { RawNGComment, RawNGSpan } from './types';
  3. export declare const NG_PARSE_TEMPLATE_BINDINGS_FAKE_PREFIX = "NgEstreeParser";
  4. export declare function parseNgBinding(input: string): {
  5. ast: ng.AST;
  6. comments: RawNGComment[];
  7. };
  8. export declare function parseNgSimpleBinding(input: string): {
  9. ast: ng.AST;
  10. comments: RawNGComment[];
  11. };
  12. export declare function parseNgAction(input: string): {
  13. ast: ng.AST;
  14. comments: RawNGComment[];
  15. };
  16. export declare function parseNgTemplateBindings(input: string): ng.TemplateBinding[];
  17. export declare function parseNgInterpolation(input: string): {
  18. ast: any;
  19. comments: RawNGComment[];
  20. };
  21. export declare function getNgType(node: (ng.AST | RawNGComment) & {
  22. type?: string;
  23. }): string | undefined;
  24. export declare function fitSpans(span: RawNGSpan, text: string, hasParentParens: boolean): {
  25. outerSpan: RawNGSpan;
  26. innerSpan: RawNGSpan;
  27. hasParens: boolean;
  28. };
  29. export declare function findFrontChar(regex: RegExp, index: number, text: string): number;
  30. export declare function findBackChar(regex: RegExp, index: number, text: string): number;
  31. export declare function toLowerCamelCase(str: string): string;
  32. export declare function getLast<T>(array: T[]): T | undefined;