jsdoccomment.d.ts 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. export type Token = import('eslint').AST.Token | import('estree').Comment | {
  2. type: import('eslint').AST.TokenType | "Line" | "Block" | "Shebang";
  3. range: [number, number];
  4. value: string;
  5. };
  6. export type ESLintOrTSNode = import('eslint').Rule.Node | import('@typescript-eslint/types').TSESTree.Node;
  7. export type int = number;
  8. /**
  9. * Reduces the provided node to the appropriate node for evaluating
  10. * JSDoc comment status.
  11. *
  12. * @param {import('eslint').Rule.Node} node An AST node.
  13. * @param {import('eslint').SourceCode} sourceCode The ESLint SourceCode.
  14. * @returns {import('eslint').Rule.Node} The AST node that
  15. * can be evaluated for appropriate JSDoc comments.
  16. */
  17. export function getReducedASTNode(node: import('eslint').Rule.Node, sourceCode: import('eslint').SourceCode): import('eslint').Rule.Node;
  18. /**
  19. * Retrieves the JSDoc comment for a given node.
  20. *
  21. * @param {import('eslint').SourceCode} sourceCode The ESLint SourceCode
  22. * @param {import('eslint').Rule.Node} node The AST node to get
  23. * the comment for.
  24. * @param {{maxLines: int, minLines: int, [name: string]: any}} settings The
  25. * settings in context
  26. * @returns {Token|null} The Block comment
  27. * token containing the JSDoc comment for the given node or
  28. * null if not found.
  29. * @public
  30. */
  31. export function getJSDocComment(sourceCode: import('eslint').SourceCode, node: import('eslint').Rule.Node, settings: {
  32. [name: string]: any;
  33. maxLines: int;
  34. minLines: int;
  35. }): Token | null;
  36. /**
  37. * @param {(import('estree').Comment|import('eslint').Rule.Node) & {
  38. * declaration?: any,
  39. * decorators?: any[],
  40. * parent?: import('eslint').Rule.Node & {
  41. * decorators?: any[]
  42. * }
  43. * }} node
  44. * @returns {import('@typescript-eslint/types').TSESTree.Decorator|undefined}
  45. */
  46. export function getDecorator(node: (import('estree').Comment | import('eslint').Rule.Node) & {
  47. declaration?: any;
  48. decorators?: any[];
  49. parent?: import('eslint').Rule.Node & {
  50. decorators?: any[];
  51. };
  52. }): import('@typescript-eslint/types').TSESTree.Decorator | undefined;
  53. /**
  54. * Checks for the presence of a JSDoc comment for the given node and returns it.
  55. *
  56. * @param {import('eslint').Rule.Node} astNode The AST node to get
  57. * the comment for.
  58. * @param {import('eslint').SourceCode} sourceCode
  59. * @param {{maxLines: int, minLines: int, [name: string]: any}} settings
  60. * @returns {Token|null} The Block comment token containing the JSDoc comment
  61. * for the given node or null if not found.
  62. * @private
  63. */
  64. export function findJSDocComment(astNode: import('eslint').Rule.Node, sourceCode: import('eslint').SourceCode, settings: {
  65. [name: string]: any;
  66. maxLines: int;
  67. minLines: int;
  68. }): Token | null;
  69. //# sourceMappingURL=jsdoccomment.d.ts.map