docblock.d.ts 485 B

1234567891011121314
  1. /**
  2. * Helper functions to work with docblock comments.
  3. */
  4. import type { NodePath } from '@babel/traverse';
  5. /**
  6. * Given a path, this function returns the closest preceding docblock if it
  7. * exists.
  8. */
  9. export declare function getDocblock(path: NodePath, trailing?: boolean): string | null;
  10. /**
  11. * Given a string, this functions returns an object with doclet names as keys
  12. * and their "content" as values.
  13. */
  14. export declare function getDoclets(str: string): Record<string, string>;