File tree Expand file tree Collapse file tree 2 files changed +16
-8
lines changed Expand file tree Collapse file tree 2 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,10 @@ interface-mixin DocumentOrShadowRoot {
5
5
param x type= long
6
6
param y type= long
7
7
}
8
- method elementsFromPoint returns= "Element" array {
8
+ method elementsFromPoint {
9
+ type sequence {
10
+ type Element
11
+ }
9
12
param x type= long
10
13
param y type= long
11
14
}
Original file line number Diff line number Diff line change @@ -155,21 +155,26 @@ function handleProperty(child: Node): Partial<Property> {
155
155
*/
156
156
function handleMethod ( child : Node ) : Partial < Method > {
157
157
const name = child . values [ 0 ] as string ;
158
- const isArray = child . values [ 1 ] as boolean | undefined ;
158
+ const type = child . children [ 0 ] ;
159
159
const returnType = child . properties . returns as string ;
160
160
const nullable = child . properties . nullable as boolean ;
161
161
162
- const params = child . children . map ( ( c ) => ( {
163
- name : c . values [ 0 ] as string ,
164
- type : c . properties . type as string ,
165
- } ) ) ;
162
+ const params = child . children
163
+ . filter ( ( c ) => c . values [ 0 ] != "sequence" )
164
+ . map ( ( c ) => ( {
165
+ name : c . values [ 0 ] as string ,
166
+ type : c . properties . type as string ,
167
+ } ) ) ;
166
168
167
169
const signature : Method [ "signature" ] = [
168
170
{
169
- type : isArray ? "sequence" : returnType ,
171
+ type : type . name == "type" ? ( type . values [ 0 ] as string ) : returnType ,
170
172
param : params ,
171
173
nullable,
172
- ...( isArray ? { subtype : { type : returnType } } : { } ) ,
174
+ subtype :
175
+ type . name == "type"
176
+ ? { type : type . children [ 0 ] . values [ 0 ] as string }
177
+ : undefined ,
173
178
} ,
174
179
] ;
175
180
return { name, signature } ;
You can’t perform that action at this time.
0 commit comments