-
Notifications
You must be signed in to change notification settings - Fork 484
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): Support Flow interface declarations
* Add support for interface declarations * Support exported interfaces/type aliases * Update test fixtures * Add interface type, fix test * Fix comment style and typo
- Loading branch information
Showing
9 changed files
with
364 additions
and
34 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
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
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,7 @@ | ||
/** | ||
* This is my interface. | ||
*/ | ||
interface Foo extends Bar, Baz { | ||
prop1: number; | ||
prop2: 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,132 @@ | ||
[ | ||
{ | ||
"description": { | ||
"type": "root", | ||
"children": [ | ||
{ | ||
"type": "paragraph", | ||
"children": [ | ||
{ | ||
"type": "text", | ||
"value": "This is my interface.", | ||
"position": { | ||
"start": { | ||
"line": 1, | ||
"column": 1, | ||
"offset": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 22, | ||
"offset": 21 | ||
}, | ||
"indent": [] | ||
} | ||
} | ||
], | ||
"position": { | ||
"start": { | ||
"line": 1, | ||
"column": 1, | ||
"offset": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 22, | ||
"offset": 21 | ||
}, | ||
"indent": [] | ||
} | ||
} | ||
], | ||
"position": { | ||
"start": { | ||
"line": 1, | ||
"column": 1, | ||
"offset": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 22, | ||
"offset": 21 | ||
} | ||
} | ||
}, | ||
"tags": [], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 3 | ||
} | ||
}, | ||
"context": { | ||
"loc": { | ||
"start": { | ||
"line": 4, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 7, | ||
"column": 1 | ||
} | ||
} | ||
}, | ||
"augments": [ | ||
{ | ||
"title": "extends", | ||
"name": "Bar" | ||
}, | ||
{ | ||
"title": "extends", | ||
"name": "Baz" | ||
} | ||
], | ||
"errors": [], | ||
"examples": [], | ||
"params": [], | ||
"properties": [ | ||
{ | ||
"title": "property", | ||
"name": "prop1", | ||
"lineNumber": 5, | ||
"type": { | ||
"type": "NameExpression", | ||
"name": "number" | ||
} | ||
}, | ||
{ | ||
"title": "property", | ||
"name": "prop2", | ||
"lineNumber": 6, | ||
"type": { | ||
"type": "NameExpression", | ||
"name": "string" | ||
} | ||
} | ||
], | ||
"returns": [], | ||
"sees": [], | ||
"throws": [], | ||
"todos": [], | ||
"name": "Foo", | ||
"kind": "interface", | ||
"members": { | ||
"global": [], | ||
"inner": [], | ||
"instance": [], | ||
"events": [], | ||
"static": [] | ||
}, | ||
"path": [ | ||
{ | ||
"name": "Foo", | ||
"kind": "interface" | ||
} | ||
], | ||
"namespace": "Foo" | ||
} | ||
] |
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,16 @@ | ||
<!-- Generated by documentation.js. Update this documentation by updating the source code. --> | ||
|
||
### Table of Contents | ||
|
||
- [Foo](#foo) | ||
|
||
## Foo | ||
|
||
**Extends Bar, Baz** | ||
|
||
This is my interface. | ||
|
||
**Properties** | ||
|
||
- `prop1` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** | ||
- `prop2` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** |
Oops, something went wrong.