Skip to content

Commit 16c4f14

Browse files
committed
KDL parser
1 parent 4c85911 commit 16c4f14

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

src/build/patches.ts

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,11 @@
11
import { parse } from "kdljs";
2-
import { Enum, Event, Method, Property } from "./types";
2+
import { Enum } from "./types";
33
import { readdir, readFile } from "fs/promises";
44
import { merge } from "./helpers.js";
55

6-
interface MethodDescriptor {
7-
[x: string]: Omit<Method, "signature">;
8-
}
9-
106
interface EnumDescriptor {
117
[x: string]: Enum;
128
}
13-
interface PropertyDescriptor {
14-
[x: string]: Omit<Property, "type">;
15-
}
16-
17-
interface InterfaceMixin {
18-
[x: string]: {
19-
events?: { event: Event[] };
20-
methods?: { method: MethodDescriptor };
21-
};
22-
}
239

2410
/**
2511
* Converts patch files in KDL to match the [types](types.d.ts).
@@ -33,7 +19,6 @@ export function parseKDL(kdlText: string) {
3319

3420
const nodes = output!;
3521
const enums: EnumDescriptor = {};
36-
const interfaces: InterfaceMixin = {};
3722

3823
for (const node of nodes) {
3924
if (node.name === "enum") {
@@ -58,7 +43,7 @@ export function parseKDL(kdlText: string) {
5843
}
5944
}
6045

61-
return { mixins: { mixin: interfaces }, enums: { enum: enums } };
46+
return { enums: { enum: enums } };
6247
}
6348

6449
/**

0 commit comments

Comments
 (0)