@@ -50,7 +50,7 @@ export class SourcePlugin extends ConverterComponent {
50
50
this . listenTo ( this . owner , {
51
51
[ Converter . EVENT_END ] : this . onEnd ,
52
52
[ Converter . EVENT_CREATE_DECLARATION ] : this . onDeclaration ,
53
- [ Converter . EVENT_CREATE_SIGNATURE ] : this . onDeclaration ,
53
+ [ Converter . EVENT_CREATE_SIGNATURE ] : this . onSignature ,
54
54
[ Converter . EVENT_RESOLVE_BEGIN ] : this . onBeginResolve ,
55
55
} ) ;
56
56
}
@@ -101,6 +101,31 @@ export class SourcePlugin extends ConverterComponent {
101
101
}
102
102
}
103
103
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
+
104
129
/**
105
130
* Triggered when the converter begins resolving a project.
106
131
*
0 commit comments