@@ -1321,7 +1321,7 @@ var td;
13211321 return new td . UnionType ( types ) ;
13221322 }
13231323 function extractTypeParameterType ( node , type ) {
1324- if ( node ) {
1324+ if ( node && node . typeName ) {
13251325 var name = node . typeName [ 'text' ] ;
13261326 if ( typeParameters [ name ] ) {
13271327 return typeParameters [ name ] ;
@@ -1955,8 +1955,6 @@ var td;
19551955 function visitTypeAliasDeclaration ( node , scope ) {
19561956 var alias = createDeclaration ( scope , node , 4194304 /* TypeAlias */ ) ;
19571957 alias . type = extractType ( alias , node . type , checker . getTypeAtLocation ( node . type ) ) ;
1958- if ( alias . name == 'Callback' ) {
1959- }
19601958 return alias ;
19611959 }
19621960 function visitExportAssignment ( node , scope ) {
@@ -2170,17 +2168,34 @@ var td;
21702168 * @param state The state that describes the current declaration and reflection.
21712169 */
21722170 CommentPlugin . prototype . onDeclaration = function ( event ) {
2173- if ( event . reflection . kindOf ( td . ReflectionKind . FunctionOrMethod ) ) {
2171+ var rawComment = CommentPlugin . getComment ( event . node ) ;
2172+ if ( ! rawComment )
21742173 return ;
2174+ if ( event . reflection . kindOf ( td . ReflectionKind . FunctionOrMethod ) ) {
2175+ var comment = CommentPlugin . parseComment ( rawComment , event . reflection . comment ) ;
2176+ this . applyAccessModifiers ( event . reflection , comment ) ;
21752177 }
2176- var comment = CommentPlugin . getComment ( event . node ) ;
2177- if ( comment ) {
2178- if ( event . reflection . kindOf ( 2 /* Module */ ) ) {
2179- this . storeModuleComment ( comment , event . reflection ) ;
2180- }
2181- else {
2182- event . reflection . comment = CommentPlugin . parseComment ( comment , event . reflection . comment ) ;
2183- }
2178+ else if ( event . reflection . kindOf ( 2 /* Module */ ) ) {
2179+ this . storeModuleComment ( rawComment , event . reflection ) ;
2180+ }
2181+ else {
2182+ var comment = CommentPlugin . parseComment ( rawComment , event . reflection . comment ) ;
2183+ this . applyAccessModifiers ( event . reflection , comment ) ;
2184+ event . reflection . comment = comment ;
2185+ }
2186+ } ;
2187+ CommentPlugin . prototype . applyAccessModifiers = function ( reflection , comment ) {
2188+ if ( comment . hasTag ( 'private' ) ) {
2189+ reflection . setFlag ( 1 /* Private */ ) ;
2190+ CommentPlugin . removeTags ( comment , 'private' ) ;
2191+ }
2192+ if ( comment . hasTag ( 'protected' ) ) {
2193+ reflection . setFlag ( 2 /* Protected */ ) ;
2194+ CommentPlugin . removeTags ( comment , 'protected' ) ;
2195+ }
2196+ if ( comment . hasTag ( 'public' ) ) {
2197+ reflection . setFlag ( 4 /* Public */ ) ;
2198+ CommentPlugin . removeTags ( comment , 'public' ) ;
21842199 }
21852200 } ;
21862201 CommentPlugin . prototype . onFunctionImplementation = function ( event ) {
@@ -2810,7 +2825,7 @@ var td;
28102825 group . children . forEach ( function ( child ) {
28112826 someExported = child . flags . isExported || someExported ;
28122827 allPrivate = child . flags . isPrivate && allPrivate ;
2813- allProtected = ( child . flags . isPrivate || child . flags . isPrivate ) && allProtected ;
2828+ allProtected = ( child . flags . isPrivate || child . flags . isProtected ) && allProtected ;
28142829 allExternal = child . flags . isExternal && allExternal ;
28152830 allInherited = child . inheritedFrom && allInherited ;
28162831 } ) ;
@@ -3685,12 +3700,24 @@ var td;
36853700 switch ( flag ) {
36863701 case 1 /* Private */ :
36873702 this . flags . isPrivate = value ;
3703+ if ( value ) {
3704+ this . setFlag ( 2 /* Protected */ , false ) ;
3705+ this . setFlag ( 4 /* Public */ , false ) ;
3706+ }
36883707 break ;
36893708 case 2 /* Protected */ :
36903709 this . flags . isProtected = value ;
3710+ if ( value ) {
3711+ this . setFlag ( 1 /* Private */ , false ) ;
3712+ this . setFlag ( 4 /* Public */ , false ) ;
3713+ }
36913714 break ;
36923715 case 4 /* Public */ :
36933716 this . flags . isPublic = value ;
3717+ if ( value ) {
3718+ this . setFlag ( 1 /* Private */ , false ) ;
3719+ this . setFlag ( 2 /* Protected */ , false ) ;
3720+ }
36943721 break ;
36953722 case 8 /* Static */ :
36963723 this . flags . isStatic = value ;
@@ -4498,7 +4525,9 @@ var td;
44984525 var result = _super . prototype . toObject . call ( this ) ;
44994526 result . type = 'reference' ;
45004527 result . name = this . name ;
4501- result . symbolID = this . symbolID ;
4528+ if ( this . reflection ) {
4529+ result . id = this . reflection . id ;
4530+ }
45024531 return result ;
45034532 } ;
45044533 /**
0 commit comments