Skip to content

Commit 3a80bc5

Browse files
Bugfix: FunctionType parameters get sorted, resolves #39
1 parent ffea384 commit 3a80bc5

File tree

3 files changed

+30
-4
lines changed

3 files changed

+30
-4
lines changed

bin/typedoc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3159,6 +3159,9 @@ var TypeDoc;
31593159

31603160
state.reflection.type = Factories.TypeHandler.createNamedType('Function');
31613161
childState.reflection.name = state.reflection.name + ' function signature';
3162+
childState.reflection.signatures.forEach(function (child) {
3163+
child.isSignature = true;
3164+
});
31623165
}
31633166
};
31643167
return FunctionTypeHandler;

examples/basic/src/functions.ts

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ export function exportedFunction():void { }
1414

1515
/**
1616
* This is a function with multiple arguments and a return value.
17-
* @param paramA This is a string parameter.
18-
* @param paramB This is a parameter flagged with any.
17+
* @param paramZ This is a string parameter.
18+
* @param paramG This is a parameter flagged with any.
1919
* This sentence is placed in the next line.
2020
*
21-
* @param paramC
21+
* @param paramA
2222
* This is a **parameter** pointing to an interface.
2323
*
2424
* ~~~
@@ -27,7 +27,27 @@ export function exportedFunction():void { }
2727
* ~~~
2828
*
2929
*/
30-
export function functionWithArguments(paramA:string, paramB:any, paramC:classes.INameInterface):number {
30+
var variableFunction = function(paramZ:string, paramG:any, paramA:classes.INameInterface):number {
31+
return 0;
32+
};
33+
34+
35+
/**
36+
* This is a function with multiple arguments and a return value.
37+
* @param paramZ This is a string parameter.
38+
* @param paramG This is a parameter flagged with any.
39+
* This sentence is placed in the next line.
40+
*
41+
* @param paramA
42+
* This is a **parameter** pointing to an interface.
43+
*
44+
* ~~~
45+
* var value:BaseClass = new BaseClass('test');
46+
* functionWithArguments('arg', 0, value);
47+
* ~~~
48+
*
49+
*/
50+
export function functionWithArguments(paramZ:string, paramG:any, paramA:classes.INameInterface):number {
3151
return 0;
3252
}
3353

src/typedoc/factories/handlers/FunctionTypeHandler.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ module TypeDoc.Factories
4242

4343
state.reflection.type = TypeHandler.createNamedType('Function');
4444
childState.reflection.name = state.reflection.name + ' function signature';
45+
childState.reflection.signatures.forEach((child) => {
46+
child.isSignature = true;
47+
});
4548
}
4649
}
4750
}

0 commit comments

Comments
 (0)