@@ -50,7 +50,7 @@ export class SourcePlugin extends ConverterComponent {
5050 this . listenTo ( this . owner , {
5151 [ Converter . EVENT_END ] : this . onEnd ,
5252 [ Converter . EVENT_CREATE_DECLARATION ] : this . onDeclaration ,
53- [ Converter . EVENT_CREATE_SIGNATURE ] : this . onDeclaration ,
53+ [ Converter . EVENT_CREATE_SIGNATURE ] : this . onSignature ,
5454 [ Converter . EVENT_RESOLVE_BEGIN ] : this . onBeginResolve ,
5555 } ) ;
5656 }
@@ -101,6 +101,31 @@ export class SourcePlugin extends ConverterComponent {
101101 }
102102 }
103103
104+ private onSignature (
105+ _context : Context ,
106+ reflection : Reflection ,
107+ sig ?:
108+ | ts . SignatureDeclaration
109+ | ts . IndexSignatureDeclaration
110+ | ts . JSDocSignature
111+ ) {
112+ if ( this . disableSources || ! sig ) return ;
113+
114+ const sourceFile = sig . getSourceFile ( ) ;
115+ const fileName = sourceFile . fileName ;
116+ this . fileNames . add ( fileName ) ;
117+
118+ const position = ts . getLineAndCharacterOfPosition (
119+ sourceFile ,
120+ sig . getStart ( )
121+ ) ;
122+
123+ reflection . sources ||= [ ] ;
124+ reflection . sources . push (
125+ new SourceReference ( fileName , position . line + 1 , position . character )
126+ ) ;
127+ }
128+
104129 /**
105130 * Triggered when the converter begins resolving a project.
106131 *
0 commit comments