File tree Expand file tree Collapse file tree 3 files changed +23
-23
lines changed
Expand file tree Collapse file tree 3 files changed +23
-23
lines changed Original file line number Diff line number Diff line change 3030 }
3131 }
3232 },
33- "WebGLRenderingContextBase" : {
34- "methods" : {
35- "method" : {
36- "pixelStorei" : {
37- "name" : " pixelStorei" ,
38- "signature" : {
39- "0" : {
40- "param" : [
41- {
42- "name" : " param" ,
43- "additionalTypes" : [" GLboolean" ]
44- }
45- ]
46- }
47- }
48- }
49- }
50- }
51- },
5233 "Body" : {
5334 "properties" : {
5435 "property" : {
Original file line number Diff line number Diff line change @@ -170,4 +170,10 @@ interface-mixin WebGLRenderingContextBase {
170170 param extensionName overrideType= "\" WEBGL_multi_draw\" "
171171 type WEBGL_multi_draw null able= #true
172172 }
173+
174+ method pixelStorei signatureIndex= 0 {
175+ param param {
176+ additionalType GLboolean
177+ }
178+ }
173179}
Original file line number Diff line number Diff line change @@ -63,6 +63,21 @@ function handleTyped(type: Node): Typed {
6363 } ;
6464}
6565
66+ function handleAdditionalTypes ( node :Node ) {
67+ const additionalTypes = [ ]
68+ for ( const child of node . children ) {
69+ if ( child . name === "additionalType" ) {
70+ additionalTypes . push ( string ( child . values [ 0 ] ) ) ;
71+ }
72+
73+ }
74+ // Check if additionalTypes has elements and return array if so, otherwise undefined/empty.
75+ if ( additionalTypes . length > 0 ) {
76+ return { additionalTypes} ;
77+ }
78+ return undefined ;
79+ }
80+
6681function handleTypeParameters ( value : Value | Node ) {
6782 if ( ! value ) {
6883 return { } ;
@@ -290,6 +305,7 @@ function handleMethod(child: Node): DeepPartial<OverridableMethod> {
290305 "string" ,
291306 c . properties ?. overrideType ,
292307 ) ,
308+ ...handleAdditionalTypes ( c )
293309 } ) ;
294310 break ;
295311
@@ -308,12 +324,9 @@ function handleMethod(child: Node): DeepPartial<OverridableMethod> {
308324 : null ;
309325
310326 const signatureIndex = child . properties ?. signatureIndex ;
311- if ( ( params . length || signatureIndex ) && ! type ) {
312- throw new Error ( "A method signature requires a type" ) ;
313- }
314327
315328 let signature : OverridableMethod [ "signature" ] = [ ] ;
316- if ( type ) {
329+ if ( type || params . length > 0 ) {
317330 // Determine the actual signature object
318331 const signatureObj : DeepPartial < Signature > = {
319332 param : params ,
You can’t perform that action at this time.
0 commit comments