-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docgen: Add support for TS exported static non-function variables (#3…
…0971) * docgen: Add support for TS exported static non-function variables * Update CHANGELOG
- Loading branch information
1 parent
758aea8
commit 17b490a
Showing
7 changed files
with
281 additions
and
4 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
4 changes: 4 additions & 0 deletions
4
...es/docgen/test/fixtures/type-annotations/exported-variable-declaration-statics/example.ts
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,4 @@ | ||
/** | ||
* This is a description of the variable | ||
*/ | ||
export const foo: ( string | number )[] = []; |
194 changes: 194 additions & 0 deletions
194
...s/docgen/test/fixtures/type-annotations/exported-variable-declaration-statics/get-node.js
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,194 @@ | ||
module.exports = () => ( { | ||
type: 'ExportNamedDeclaration', | ||
start: 49, | ||
end: 94, | ||
loc: { | ||
start: { | ||
line: 4, | ||
column: 0, | ||
}, | ||
end: { | ||
line: 4, | ||
column: 45, | ||
}, | ||
}, | ||
leadingComments: [ | ||
{ | ||
type: 'CommentBlock', | ||
value: '*\n * This is a description of the variable\n ', | ||
start: 0, | ||
end: 48, | ||
loc: { | ||
start: { | ||
line: 1, | ||
column: 0, | ||
}, | ||
end: { | ||
line: 3, | ||
column: 3, | ||
}, | ||
}, | ||
}, | ||
], | ||
exportKind: 'value', | ||
specifiers: [], | ||
source: null, | ||
declaration: { | ||
type: 'VariableDeclaration', | ||
start: 56, | ||
end: 94, | ||
loc: { | ||
start: { | ||
line: 4, | ||
column: 7, | ||
}, | ||
end: { | ||
line: 4, | ||
column: 45, | ||
}, | ||
}, | ||
declarations: [ | ||
{ | ||
type: 'VariableDeclarator', | ||
start: 62, | ||
end: 93, | ||
loc: { | ||
start: { | ||
line: 4, | ||
column: 13, | ||
}, | ||
end: { | ||
line: 4, | ||
column: 44, | ||
}, | ||
}, | ||
id: { | ||
type: 'Identifier', | ||
start: 62, | ||
end: 88, | ||
loc: { | ||
start: { | ||
line: 4, | ||
column: 13, | ||
}, | ||
end: { | ||
line: 4, | ||
column: 39, | ||
}, | ||
identifierName: 'foo', | ||
}, | ||
name: 'foo', | ||
typeAnnotation: { | ||
type: 'TSTypeAnnotation', | ||
start: 65, | ||
end: 88, | ||
loc: { | ||
start: { | ||
line: 4, | ||
column: 16, | ||
}, | ||
end: { | ||
line: 4, | ||
column: 39, | ||
}, | ||
}, | ||
typeAnnotation: { | ||
type: 'TSArrayType', | ||
start: 67, | ||
end: 88, | ||
loc: { | ||
start: { | ||
line: 4, | ||
column: 18, | ||
}, | ||
end: { | ||
line: 4, | ||
column: 39, | ||
}, | ||
}, | ||
elementType: { | ||
type: 'TSParenthesizedType', | ||
start: 67, | ||
end: 86, | ||
loc: { | ||
start: { | ||
line: 4, | ||
column: 18, | ||
}, | ||
end: { | ||
line: 4, | ||
column: 37, | ||
}, | ||
}, | ||
typeAnnotation: { | ||
type: 'TSUnionType', | ||
start: 69, | ||
end: 84, | ||
loc: { | ||
start: { | ||
line: 4, | ||
column: 20, | ||
}, | ||
end: { | ||
line: 4, | ||
column: 35, | ||
}, | ||
}, | ||
types: [ | ||
{ | ||
type: 'TSStringKeyword', | ||
start: 69, | ||
end: 75, | ||
loc: { | ||
start: { | ||
line: 4, | ||
column: 20, | ||
}, | ||
end: { | ||
line: 4, | ||
column: 26, | ||
}, | ||
}, | ||
}, | ||
{ | ||
type: 'TSNumberKeyword', | ||
start: 78, | ||
end: 84, | ||
loc: { | ||
start: { | ||
line: 4, | ||
column: 29, | ||
}, | ||
end: { | ||
line: 4, | ||
column: 35, | ||
}, | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
init: { | ||
type: 'ArrayExpression', | ||
start: 91, | ||
end: 93, | ||
loc: { | ||
start: { | ||
line: 4, | ||
column: 42, | ||
}, | ||
end: { | ||
line: 4, | ||
column: 44, | ||
}, | ||
}, | ||
elements: [], | ||
}, | ||
}, | ||
], | ||
kind: 'const', | ||
}, | ||
} ); |
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