Skip to content

Commit 841cd82

Browse files
committed
Update
1 parent cad1aa8 commit 841cd82

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

inputfiles/patches/html.kdl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,12 @@ interface HTMLInputElement {
5757
property valueAsDate type=Date
5858
property selectionDirection type=SelectionDirection
5959
method setSelectionRange signatureIndex=0 {
60-
param start nullable=#true
61-
param end nullable=#true
60+
param start {
61+
type nullable=#true
62+
}
63+
param end {
64+
type nullable=#true
65+
}
6266
param direction type=SelectionDirection
6367
}
6468
}

src/build/patches.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ function handleProperty(child: Node): DeepPartial<Property> {
307307
function handleParam(node: Node) {
308308
const name = string(node.values[0]);
309309
let additionalTypes: string[] | undefined;
310+
const typeNodes: Node[] = [];
310311

311312
for (const child of node.children) {
312313
switch (child.name) {
@@ -317,16 +318,19 @@ function handleParam(node: Node) {
317318
additionalTypes = child.values.map(string);
318319
break;
319320
}
321+
case "type": {
322+
typeNodes.push(child);
323+
break;
324+
}
320325
default:
321326
throw new Error(`Unexpected child "${child.name}" in param "${name}"`);
322327
}
323328
}
324329

325330
return {
326331
name,
327-
...optionalMember("type", "string", node.properties?.type),
332+
...handleTyped(typeNodes, node.properties?.type),
328333
...optionalMember("overrideType", "string", node.properties?.overrideType),
329-
...optionalMember("nullable", "boolean", node.properties?.nullable),
330334
additionalTypes,
331335
};
332336
}
@@ -344,7 +348,7 @@ function handleMethodAndConstructor(
344348

345349
// Collect all type nodes into an array
346350
const typeNodes: Node[] = [];
347-
const params: Partial<Param>[] = [];
351+
const params: DeepPartial<Param>[] = [];
348352

349353
for (const c of child.children) {
350354
switch (c.name) {

0 commit comments

Comments
 (0)