syavorsky/comment-parser

Types is not exported

Closed this issue · 7 comments

I migrated from 0.x to 1.x. in current version types not exported

Are you talking about some specific types not exposed through the *.d.ts files, or should they be just wrapped differently?
https://unpkg.com/browse/comment-parser@1.1.2/lib/

I think types should export from index.d.ts

+1, I'd like to be able to type a getTag function, but the Block type isn't exposed anywhere. In the previous version I could refer to the Comment type, like this:

import commentParser from 'comment-parser';

function getTag(comment: commentParser.Comment, tag: string) {
  const tags = comment.tags || [];
  return tags.find(t => t.tag === tag);
}

As a workaround I'm importing Block from the primitives file, but I'd rather not reach into the internals.

import { Block } from 'comment-parser/lib/primitives';

comment-parser@1.1.3 is out and provides these exports

Maybe not correctly build because lib/index.d.ts is old version, but src/index.ts is new version.

indeed, should be fixed in comment-parser@1.1.4