@@ -168,6 +168,7 @@ function handleMixinAndInterfaces(
168168 const event : Event [ ] = [ ] ;
169169 const property : Record < string , DeepPartial < Property > > = { } ;
170170 let method : Record < string , DeepPartial < OverridableMethod > > = { } ;
171+ let constructor : DeepPartial < OverridableMethod > | undefined ;
171172 let typeParameters = { } ;
172173
173174 for ( const child of node . children ) {
@@ -182,12 +183,17 @@ function handleMixinAndInterfaces(
182183 }
183184 case "method" : {
184185 const methodName = string ( child . values [ 0 ] ) ;
185- const m = handleMethod ( child ) ;
186+ const m = handleMethodAndConstructor ( child ) ;
186187 method = merge ( method , {
187188 [ methodName ] : m ,
188189 } ) ;
189190 break ;
190191 }
192+ case "constructor" : {
193+ const c = handleMethodAndConstructor ( child , true ) ;
194+ constructor = merge ( constructor , c ) ;
195+ break ;
196+ }
191197 case "typeParameters" : {
192198 typeParameters = handleTypeParameters ( child ) ;
193199 break ;
@@ -199,6 +205,7 @@ function handleMixinAndInterfaces(
199205
200206 const interfaceObject = type === "interface" && {
201207 ...typeParameters ,
208+ ...( constructor ? { constructor } : { } ) ,
202209 ...optionalMember ( "exposed" , "string" , node . properties ?. exposed ) ,
203210 ...optionalMember ( "deprecated" , "string" , node . properties ?. deprecated ) ,
204211 ...optionalMember (
@@ -294,11 +301,15 @@ function handleParam(node: Node) {
294301}
295302
296303/**
297- * Handles a child node of type "method" and adds it to the method object.
304+ * Handles a child node of type "method" or "constructor" and adds it to the method or constructor object.
298305 * @param child The child node to handle.
306+ * @param isConstructor Whether the child node is a constructor.
299307 */
300- function handleMethod ( child : Node ) : DeepPartial < OverridableMethod > {
301- const name = string ( child . values [ 0 ] ) ;
308+ function handleMethodAndConstructor (
309+ child : Node ,
310+ isConstructor : boolean = false ,
311+ ) : DeepPartial < OverridableMethod > {
312+ const name = isConstructor ? undefined : string ( child . values [ 0 ] ) ;
302313
303314 let typeNode : Node | undefined ;
304315 const params : Partial < Param > [ ] = [ ] ;
0 commit comments