description.d.ts 943 B

1234567891011121314151617181920
  1. import { Line, BlockMarkers, Markers } from '../../primitives.js';
  2. import { Tokenizer } from './index.js';
  3. /**
  4. * Walks over provided lines joining description token into a single string.
  5. * */
  6. export type Joiner = (lines: Line[], markers?: BlockMarkers) => string;
  7. /**
  8. * Shortcut for standard Joiners
  9. * compact - strip surrounding whitespace and concat lines using a single string
  10. * preserve - preserves original whitespace and line breaks as is
  11. */
  12. export type Spacing = 'compact' | 'preserve' | Joiner;
  13. /**
  14. * Makes no changes to `spec.lines[].tokens` but joins them into `spec.description`
  15. * following given spacing srtategy
  16. * @param {Spacing} spacing tells how to handle the whitespace
  17. * @param {BlockMarkers} markers tells how to handle comment block delimitation
  18. */
  19. export default function descriptionTokenizer(spacing?: Spacing, markers?: typeof Markers): Tokenizer;
  20. export declare function getJoiner(spacing: Spacing): Joiner;