File tree Expand file tree Collapse file tree 2 files changed +20
-9
lines changed
src/generators/legacy-json Expand file tree Collapse file tree 2 files changed +20
-9
lines changed Original file line number Diff line number Diff line change @@ -26,37 +26,48 @@ export interface SectionBase {
2626 desc : string ;
2727 shortDesc ?: string ;
2828 stability ?: number ;
29- stabilityText ?: string ; // TODO find the type for this
29+ stabilityText ?: string ;
3030 meta ?: Meta ;
3131}
3232
3333export interface ModuleSection extends SectionBase {
3434 type : 'module' ;
3535 source : string ;
36- miscs : MiscSection [ ] ;
37- modules : ModuleSection [ ] ;
38- // TODO ...
36+ miscs ?: MiscSection [ ] ;
37+ modules ?: ModuleSection [ ] ;
38+ classes ?: SignatureSection [ ] ;
39+ methods ?: MethodSignature [ ] ;
40+ properties ?: PropertySection [ ] ;
41+ globals ?: object [ ] ; // TODO
42+ examples ?: object [ ] ; // TODO
43+ signatures ?: SignatureSection [ ] ;
44+ // TODO the rest
3945}
4046
4147export interface SignatureSection extends SectionBase {
4248 type : 'class' | 'ctor' | 'classMethod' | 'method' ;
4349 signatures : MethodSignature [ ] ;
4450}
4551
52+ export interface Parameter {
53+ name : string ;
54+ optional ?: boolean ;
55+ default ?: string ;
56+ }
57+
4658export interface MethodSignature {
47- params : object [ ] ; // TODO
48- return ?: object ; // TODO
59+ params : Parameter [ ] ;
60+ return ?: string ;
4961}
5062
5163export interface PropertySection extends SectionBase {
5264 type : 'property' ;
53- typeof ?: string ;
5465 [ key : string ] : string | undefined ;
5566}
5667
5768export interface EventSection extends SectionBase {
5869 type : 'event' ;
59- params : object [ ] ; // TODO
70+ params : ListItem [ ] ;
6071}
6172
6273export interface MiscSection extends SectionBase {
Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ function parseListItem(child) {
127127 // .filter(node => node.type !== 'list')
128128 // .map(node => node.)
129129
130- if ( current . textRaw ) {
130+ if ( ! current . textRaw ) {
131131 throw new Error ( `empty list item: ${ JSON . stringify ( child ) } ` ) ;
132132 }
133133
You can’t perform that action at this time.
0 commit comments