Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for generic type aliases (#622)
Include type parameter information for generic type aliases
- Loading branch information
1 parent
dad509d
commit eb7c305
Showing
3 changed files
with
166 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/** | ||
* A type that describes a compare function, e.g. for array.sort(). | ||
*/ | ||
declare type TCompareFunction<T> = (a: T, b: T) => number; | ||
|
||
/** | ||
* A type for IDs. | ||
*/ | ||
declare type TId = number | string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
{ | ||
"id": 0, | ||
"name": "typedoc", | ||
"kind": 0, | ||
"flags": {}, | ||
"children": [ | ||
{ | ||
"id": 1, | ||
"name": "\"alias\"", | ||
"kind": 1, | ||
"kindString": "External module", | ||
"flags": { | ||
"isExported": true | ||
}, | ||
"originalName": "%BASE%/alias/alias.ts", | ||
"children": [ | ||
{ | ||
"id": 2, | ||
"name": "TCompareFunction", | ||
"kind": 4194304, | ||
"kindString": "Type alias", | ||
"flags": {}, | ||
"comment": { | ||
"shortText": "A type that describes a compare function, e.g. for array.sort()." | ||
}, | ||
"typeParameter": [ | ||
{ | ||
"id": 3, | ||
"name": "T", | ||
"kind": 131072, | ||
"kindString": "Type parameter", | ||
"flags": {} | ||
} | ||
], | ||
"sources": [ | ||
{ | ||
"fileName": "alias.ts", | ||
"line": 4, | ||
"character": 29 | ||
} | ||
], | ||
"type": { | ||
"type": "reflection", | ||
"declaration": { | ||
"id": 4, | ||
"name": "__type", | ||
"kind": 65536, | ||
"kindString": "Type literal", | ||
"flags": {}, | ||
"signatures": [ | ||
{ | ||
"id": 5, | ||
"name": "__call", | ||
"kind": 4096, | ||
"kindString": "Call signature", | ||
"flags": {}, | ||
"parameters": [ | ||
{ | ||
"id": 6, | ||
"name": "a", | ||
"kind": 32768, | ||
"kindString": "Parameter", | ||
"flags": {}, | ||
"type": { | ||
"type": "typeParameter", | ||
"name": "T" | ||
} | ||
}, | ||
{ | ||
"id": 7, | ||
"name": "b", | ||
"kind": 32768, | ||
"kindString": "Parameter", | ||
"flags": {}, | ||
"type": { | ||
"type": "typeParameter", | ||
"name": "T" | ||
} | ||
} | ||
], | ||
"type": { | ||
"type": "intrinsic", | ||
"name": "number" | ||
} | ||
} | ||
], | ||
"sources": [ | ||
{ | ||
"fileName": "alias.ts", | ||
"line": 4, | ||
"character": 34 | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
{ | ||
"id": 8, | ||
"name": "TId", | ||
"kind": 4194304, | ||
"kindString": "Type alias", | ||
"flags": {}, | ||
"comment": { | ||
"shortText": "A type for IDs." | ||
}, | ||
"sources": [ | ||
{ | ||
"fileName": "alias.ts", | ||
"line": 9, | ||
"character": 16 | ||
} | ||
], | ||
"type": { | ||
"type": "union", | ||
"types": [ | ||
{ | ||
"type": "intrinsic", | ||
"name": "number" | ||
}, | ||
{ | ||
"type": "intrinsic", | ||
"name": "string" | ||
} | ||
] | ||
} | ||
} | ||
], | ||
"groups": [ | ||
{ | ||
"title": "Type aliases", | ||
"kind": 4194304, | ||
"children": [ | ||
2, | ||
8 | ||
] | ||
} | ||
], | ||
"sources": [ | ||
{ | ||
"fileName": "alias.ts", | ||
"line": 1, | ||
"character": 0 | ||
} | ||
] | ||
} | ||
], | ||
"groups": [ | ||
{ | ||
"title": "External modules", | ||
"kind": 1, | ||
"children": [ | ||
1 | ||
] | ||
} | ||
] | ||
} |