Skip to content

Commit 770530f

Browse files
Bugfix: Events with sigantures resolve parameter describtions incorrectly, see #136
1 parent ac10648 commit 770530f

File tree

4 files changed

+425
-2
lines changed

4 files changed

+425
-2
lines changed

bin/typedoc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4161,7 +4161,7 @@ var td;
41614161
var rawComment = CommentPlugin.getComment(node);
41624162
if (!rawComment)
41634163
return;
4164-
if (reflection.kindOf(td.models.ReflectionKind.FunctionOrMethod)) {
4164+
if (reflection.kindOf(td.models.ReflectionKind.FunctionOrMethod) || (reflection.kindOf(td.models.ReflectionKind.Event) && reflection['signatures'])) {
41654165
var comment = CommentPlugin.parseComment(rawComment, reflection.comment);
41664166
this.applyModifiers(reflection, comment);
41674167
}

src/td/converter/plugins/CommentPlugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ module td.converter
158158
var rawComment = CommentPlugin.getComment(node);
159159
if (!rawComment) return;
160160

161-
if (reflection.kindOf(models.ReflectionKind.FunctionOrMethod)) {
161+
if (reflection.kindOf(models.ReflectionKind.FunctionOrMethod) || (reflection.kindOf(models.ReflectionKind.Event) && reflection['signatures'])) {
162162
var comment = CommentPlugin.parseComment(rawComment, reflection.comment);
163163
this.applyModifiers(reflection, comment);
164164
} else if (reflection.kindOf(models.ReflectionKind.Module)) {
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/// <reference path="../lib.core.d.ts" />
2+
3+
/**
4+
* Encapsulates some information for background http transfers.
5+
*
6+
* @see https://github.com/sebastian-lenz/typedoc/issues/136
7+
*/
8+
interface Test
9+
{
10+
/**
11+
* Subscribe for a general event by name.
12+
*
13+
* @event
14+
* @param event The name of the event to subscribe for.
15+
* @param handler The handler called when the event occure.
16+
*/
17+
on(event: string, handler: (e:any) => void): void;
18+
19+
/**
20+
* Subscribe for error notifications.
21+
*
22+
* @event
23+
* @param event The name of the event to subscribe for.
24+
* @param handler A handler that will receive the error details
25+
*/
26+
on(event: "error", handler: (e:any) => void): void;
27+
28+
/**
29+
* Subscribe for progress notifications.
30+
*
31+
* @event
32+
* @param event The name of the event to subscribe for.
33+
* @param handler A handler that will receive a progress event with the current and expected total bytes
34+
*/
35+
on(event: "progress", handler: (e:any) => void): void;
36+
37+
/**
38+
* Subscribe for success notification.
39+
*
40+
* @event
41+
* @param event The name of the event to subscribe for.
42+
* @param handler A function that will be called with general event data upon successful completion
43+
*/
44+
on(event: "complete", handler: (e:any) => void): void;
45+
}

0 commit comments

Comments
 (0)