File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -4,15 +4,23 @@ export class Documentation implements SerializableNode {
44 constructor (
55 public description : string | undefined ,
66 public defaultValue : unknown | undefined = undefined ,
7- public visibility : 'public' | 'private' | 'internal' = 'public' ,
7+ public visibility : 'public' | 'private' | 'internal' | undefined ,
88 public tags : DocumentationTag [ ] = [ ] ,
99 ) { }
1010
11+ hasTag ( name : string ) : boolean {
12+ return this . tags . some ( ( tag ) => tag . name === name ) ;
13+ }
14+
15+ getTagValue ( name : string ) : string | undefined {
16+ return this . tags . find ( ( tag ) => tag . name === name ) ?. name ;
17+ }
18+
1119 toObject ( ) : Record < string , unknown > {
1220 return {
1321 description : this . description ,
1422 defaultValue : this . defaultValue ,
15- visibility : this . visibility === 'public' ? undefined : this . visibility ,
23+ visibility : this . visibility ,
1624 tags : this . tags . length > 0 ? this . tags : undefined ,
1725 } ;
1826 }
Original file line number Diff line number Diff line change @@ -11,8 +11,14 @@ export class ExportNode implements SerializableNode {
1111 /**
1212 * Whether the export is public.
1313 * Exports are considered public if they are not explicitly marked as private or internal.
14+ *
15+ * @param requireExplicitAnnotation Whether the export must have an explicit visibility annotation to be considered public.
1416 */
15- get isPublic ( ) {
17+ isPublic ( requireExplicitAnnotation = false ) : boolean {
18+ if ( requireExplicitAnnotation ) {
19+ return this . documentation ?. visibility === 'public' ;
20+ }
21+
1622 return (
1723 this . documentation ?. visibility !== 'private' && this . documentation ?. visibility !== 'internal'
1824 ) ;
You can’t perform that action at this time.
0 commit comments