File tree Expand file tree Collapse file tree 4 files changed +26
-2
lines changed Expand file tree Collapse file tree 4 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ export class AppComponent {
23
23
amount : 5.99 ,
24
24
unit : '€' ,
25
25
} ,
26
+ hiddenProperty : '' ,
26
27
} ;
27
28
28
29
/**
Original file line number Diff line number Diff line change @@ -15,6 +15,20 @@ Interfaces need to be annotated with `@include-docs` for the type information to
15
15
>
16
16
> Add at least one ** used** constant or function declaration to the file containing the interface.
17
17
18
+ To exclude certain properties, annotate them with the ` @exclude-docs ` annotation:
19
+
20
+ ``` typescript
21
+ /**
22
+ * @include-docs Product
23
+ */
24
+ export interface Product {
25
+ /**
26
+ * @exclude-docs
27
+ */
28
+ hiddenProperty: unknown ;
29
+ }
30
+ ```
31
+
18
32
<ArgTypes of = " Product" />
19
33
20
34
## Aliases
Original file line number Diff line number Diff line change @@ -31,6 +31,11 @@ export interface Item {
31
31
description ?: string ;
32
32
size ?: Size3 ;
33
33
meta ?: object ;
34
+
35
+ /**
36
+ * @exclude -docs
37
+ */
38
+ hiddenProperty : unknown ;
34
39
}
35
40
36
41
export interface Size3 extends Size2 {
Original file line number Diff line number Diff line change 1
1
import { EntitiesByCategory , Entity , InterfaceInformation } from '../../types' ;
2
2
import { InterfaceDeclaration } from 'ts-morph' ;
3
- import { groupBy } from '../utils' ;
4
- import { collectBaseInterfaces , getJsDocsIncludeDocsAliases } from './ast-utils' ;
3
+ import { EXCLUDE_DOCS_JS_DOCS_PARAM , groupBy } from '../utils' ;
4
+ import { collectBaseInterfaces , getJsDocsIncludeDocsAliases , hasJsDocsTag } from './ast-utils' ;
5
5
import { mapSignatureToEntity } from './signature-mappers' ;
6
6
import { getterOrSetterInputExists , mergeEntities } from './utils' ;
7
7
@@ -17,6 +17,10 @@ function getInterfaceEntities(
17
17
const entities = new Map < string , Entity > ( ) ;
18
18
19
19
for ( const signature of [ ...properties , ...methods ] ) {
20
+ if ( hasJsDocsTag ( signature , EXCLUDE_DOCS_JS_DOCS_PARAM ) ) {
21
+ continue ;
22
+ }
23
+
20
24
// do not include the property if it passes the exclusion test
21
25
if ( propertiesToExclude ?. test ( signature . getName ( ) ) ) {
22
26
continue ;
You can’t perform that action at this time.
0 commit comments