IIdentifierNamesGenerator.ts 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import { TNodeWithLexicalScope } from '../../../types/node/TNodeWithLexicalScope';
  2. export interface IIdentifierNamesGenerator {
  3. /**
  4. * @param {TNodeWithLexicalScope} lexicalScopeNode
  5. * @param {number} nameLength
  6. * @returns {string}
  7. */
  8. generate (lexicalScopeNode: TNodeWithLexicalScope, nameLength?: number): string;
  9. /**
  10. * @param {number} nameLength
  11. * @returns {string}
  12. */
  13. generateForGlobalScope (nameLength?: number): string;
  14. /**
  15. * @param {TNodeWithLexicalScope} lexicalScopeNode
  16. * @param {number} nameLength
  17. * @returns {string}
  18. */
  19. generateForLexicalScope (lexicalScopeNode: TNodeWithLexicalScope, nameLength?: number): string;
  20. /**
  21. * @param {number} nameLength
  22. * @returns {string}
  23. */
  24. generateWithPrefix (nameLength?: number): string;
  25. /**
  26. * @param {string} identifierName
  27. * @returns {boolean}
  28. */
  29. isValidIdentifierName (identifierName: string): boolean;
  30. /**
  31. * @param {string} identifierName
  32. * @param {TNodeWithLexicalScope[]} lexicalScopeNodes
  33. * @returns {boolean}
  34. */
  35. isValidIdentifierNameInLexicalScopes (identifierName: string, lexicalScopeNodes: TNodeWithLexicalScope[]): boolean;
  36. /**
  37. * @param {string} identifierName
  38. */
  39. preserveName (identifierName: string): void;
  40. /**
  41. * @param {string} identifierName
  42. * @param {TNodeWithLexicalScope} lexicalScope
  43. */
  44. preserveNameForLexicalScope (identifierName: string, lexicalScope: TNodeWithLexicalScope): void;
  45. }