parse.d.ts 959 B

1234567891011121314151617181920
  1. import type { Documentation } from './Documentation.js';
  2. import type { InternalConfig } from './config.js';
  3. /**
  4. * Takes JavaScript source code and returns an object with the information
  5. * extract from it.
  6. *
  7. * `resolver` is a strategy to find the AST node(s) of the component
  8. * definition(s) inside `src`.
  9. * It is a function that gets passed the program AST node of
  10. * the source as first argument, and a reference to the parser as second argument.
  11. *
  12. * This allows you define your own strategy for finding component definitions.
  13. *
  14. * `handlers` is an array of functions which are passed a reference to the
  15. * component definitions (extracted by `resolver`) so that they can extract
  16. * information from it. They get also passed a reference to a `Documentation`
  17. * object to attach the information to. A reference to the parser is parsed as the
  18. * last argument.
  19. */
  20. export default function parse(code: string, config: InternalConfig): Documentation[];