Skip to content

Commit d843f35

Browse files
committed
Support deprecated methods
1 parent 3e0771e commit d843f35

File tree

3 files changed

+22
-18
lines changed

3 files changed

+22
-18
lines changed

inputfiles/addedTypes.jsonc

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -531,15 +531,6 @@
531531
]
532532
}
533533
},
534-
"DOMMatrixReadOnly": {
535-
"methods": {
536-
"method": {
537-
"scaleNonUniform": {
538-
"deprecated": true
539-
}
540-
}
541-
}
542-
},
543534
"EventSource": {
544535
"events": {
545536
"event": [

inputfiles/patches/dom.kdl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,7 @@ enum InsertPosition {
1515
// ChildNode and ParentNode are actually defined as mixins, but because of their names they have historically been used as a sub-interface of Node.
1616
interface-mixin ChildNode extends=Node
1717
interface-mixin ParentNode extends=Node
18+
19+
interface DOMMatrixReadOnly {
20+
method scaleNonUniform deprecated=#true
21+
}

src/build/patches.ts

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -257,15 +257,24 @@ function handleMethod(child: Node): Partial<Method> {
257257
}
258258
}
259259

260-
const signature: Method["signature"] = [
261-
{
262-
param: params,
263-
...(typeNode
264-
? handleTyped(typeNode)
265-
: { type: string(child.properties?.returns) }),
266-
},
267-
];
268-
return { name, signature };
260+
const signature: { signature: Method["signature"] } | undefined =
261+
params.length || typeNode || child.properties?.returns
262+
? {
263+
signature: [
264+
{
265+
param: params,
266+
...(typeNode
267+
? handleTyped(typeNode)
268+
: { type: string(child.properties?.returns) }),
269+
},
270+
],
271+
}
272+
: undefined;
273+
return {
274+
name,
275+
...signature,
276+
...optionalMember("deprecated", "boolean", child.properties?.deprecated),
277+
};
269278
}
270279

271280
/**

0 commit comments

Comments
 (0)