-
Notifications
You must be signed in to change notification settings - Fork 712
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
593e803
commit e08c3b3
Showing
4 changed files
with
159 additions
and
0 deletions.
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,34 @@ | ||
import * as ts from 'typescript'; | ||
|
||
import { Type, IntrinsicType } from '../../models/types/index'; | ||
import { Component, ConverterTypeComponent, TypeNodeConverter } from '../components'; | ||
import { Context } from '../context'; | ||
|
||
@Component({ name: 'type:this' }) | ||
export class ThisConverter extends ConverterTypeComponent implements TypeNodeConverter<ts.Type, ts.ThisTypeNode> { | ||
/** | ||
* Test whether this converter can handle the given TypeScript node. | ||
*/ | ||
public supportsNode(context: Context, node: ts.ThisTypeNode, type: ts.Type): boolean { | ||
return node.kind === ts.SyntaxKind.ThisType; | ||
} | ||
|
||
/** | ||
* Convert the type reference node to its type reflection. | ||
* | ||
* This is a node based converter, see [[convertTypeReferenceType]] for the type equivalent. | ||
* | ||
* ``` | ||
* class SomeClass { } | ||
* var someValue:SomeClass; | ||
* ``` | ||
* | ||
* @param context The context object describing the current state the converter is in. | ||
* @param node The type reference node that should be converted. | ||
* @param type The type of the type reference node. | ||
* @returns The type reflection representing the given reference node. | ||
*/ | ||
public convertNode(context: Context, node: ts.ThisTypeNode, type: ts.Type): Type { | ||
return new IntrinsicType('this'); | ||
} | ||
} |
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,109 @@ | ||
{ | ||
"id": 0, | ||
"name": "typedoc", | ||
"kind": 0, | ||
"flags": {}, | ||
"children": [ | ||
{ | ||
"id": 1, | ||
"name": "\"this\"", | ||
"kind": 1, | ||
"kindString": "External module", | ||
"flags": { | ||
"isExported": true | ||
}, | ||
"originalName": "%BASE%/this/this.ts", | ||
"children": [ | ||
{ | ||
"id": 2, | ||
"name": "ChainClass", | ||
"kind": 128, | ||
"kindString": "Class", | ||
"flags": { | ||
"isExported": true | ||
}, | ||
"comment": { | ||
"shortText": "ChainClass comment short text.", | ||
"text": "ChainClass comment text.\n" | ||
}, | ||
"children": [ | ||
{ | ||
"id": 3, | ||
"name": "chain", | ||
"kind": 2048, | ||
"kindString": "Method", | ||
"flags": { | ||
"isExported": true, | ||
"isPublic": true | ||
}, | ||
"signatures": [ | ||
{ | ||
"id": 4, | ||
"name": "chain", | ||
"kind": 4096, | ||
"kindString": "Call signature", | ||
"flags": {}, | ||
"comment": { | ||
"shortText": "Chain method that returns this." | ||
}, | ||
"type": { | ||
"type": "instrinct", | ||
"name": "this" | ||
} | ||
} | ||
], | ||
"sources": [ | ||
{ | ||
"fileName": "this.ts", | ||
"line": 11, | ||
"character": 13 | ||
} | ||
] | ||
} | ||
], | ||
"groups": [ | ||
{ | ||
"title": "Methods", | ||
"kind": 2048, | ||
"children": [ | ||
3 | ||
] | ||
} | ||
], | ||
"sources": [ | ||
{ | ||
"fileName": "this.ts", | ||
"line": 6, | ||
"character": 23 | ||
} | ||
] | ||
} | ||
], | ||
"groups": [ | ||
{ | ||
"title": "Classes", | ||
"kind": 128, | ||
"children": [ | ||
2 | ||
] | ||
} | ||
], | ||
"sources": [ | ||
{ | ||
"fileName": "this.ts", | ||
"line": 1, | ||
"character": 0 | ||
} | ||
] | ||
} | ||
], | ||
"groups": [ | ||
{ | ||
"title": "External modules", | ||
"kind": 1, | ||
"children": [ | ||
1 | ||
] | ||
} | ||
] | ||
} |
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,15 @@ | ||
/** | ||
* ChainClass comment short text. | ||
* | ||
* ChainClass comment text. | ||
*/ | ||
export class ChainClass | ||
{ | ||
/** | ||
* Chain method that returns this. | ||
*/ | ||
public chain(): this | ||
{ | ||
return this; | ||
} | ||
} |