commentParserToESTree.d.ts 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. export type JsdocTypeLine = {
  2. delimiter: string;
  3. postDelimiter: string;
  4. rawType: string;
  5. initial: string;
  6. type: "JsdocTypeLine";
  7. };
  8. export type JsdocDescriptionLine = {
  9. delimiter: string;
  10. description: string;
  11. postDelimiter: string;
  12. initial: string;
  13. type: "JsdocDescriptionLine";
  14. };
  15. export type JsdocInlineTagNoType = {
  16. format: 'pipe' | 'plain' | 'prefix' | 'space';
  17. namepathOrURL: string;
  18. tag: string;
  19. text: string;
  20. };
  21. export type JsdocInlineTag = JsdocInlineTagNoType & {
  22. type: "JsdocInlineTag";
  23. };
  24. export type JsdocTag = {
  25. delimiter: string;
  26. description: string;
  27. descriptionLines: JsdocDescriptionLine[];
  28. initial: string;
  29. inlineTags: JsdocInlineTag[];
  30. name: string;
  31. postDelimiter: string;
  32. postName: string;
  33. postTag: string;
  34. postType: string;
  35. rawType: string;
  36. parsedType: import('jsdoc-type-pratt-parser').RootResult | null;
  37. tag: string;
  38. type: "JsdocTag";
  39. typeLines: JsdocTypeLine[];
  40. };
  41. export type Integer = number;
  42. export type JsdocBlock = {
  43. delimiter: string;
  44. description: string;
  45. descriptionEndLine?: Integer;
  46. descriptionLines: JsdocDescriptionLine[];
  47. descriptionStartLine?: Integer;
  48. hasPreterminalDescription: 0 | 1;
  49. hasPreterminalTagDescription?: 1;
  50. initial: string;
  51. inlineTags: JsdocInlineTag[];
  52. lastDescriptionLine?: Integer;
  53. endLine: Integer;
  54. lineEnd: string;
  55. postDelimiter: string;
  56. tags: JsdocTag[];
  57. terminal: string;
  58. type: "JsdocBlock";
  59. };
  60. /**
  61. * Converts comment parser AST to ESTree format.
  62. * @param {import('./index.js').JsdocBlockWithInline} jsdoc
  63. * @param {import('jsdoc-type-pratt-parser').ParseMode} mode
  64. * @param {object} opts
  65. * @param {boolean} [opts.throwOnTypeParsingErrors]
  66. * @returns {JsdocBlock}
  67. */
  68. export function commentParserToESTree(jsdoc: import('./index.js').JsdocBlockWithInline, mode: import('jsdoc-type-pratt-parser').ParseMode, { throwOnTypeParsingErrors }?: {
  69. throwOnTypeParsingErrors?: boolean | undefined;
  70. }): JsdocBlock;
  71. export namespace jsdocVisitorKeys {
  72. let JsdocBlock: string[];
  73. let JsdocDescriptionLine: never[];
  74. let JsdocTypeLine: never[];
  75. let JsdocTag: string[];
  76. let JsdocInlineTag: never[];
  77. }
  78. //# sourceMappingURL=commentParserToESTree.d.ts.map