You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: inputfiles/README.md
+57-1Lines changed: 57 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,62 @@ Some files in this directory are generated. Please do not edit them.
4
4
This specifically includes:
5
5
6
6
*`idl/*`
7
-
*`mdn/*`
8
7
9
8
Feel free to send a pull request with changes to any other files.
9
+
Note It is recommended to add your patch use KDL format, continue reading to find out more.
10
+
11
+
## Documentation for `patches/` KDL Folder
12
+
13
+
The `patches/` directory only contains `.kdl` files that specify modifications ("patches") to the default Web IDL or related specifications, using the [KDL format](https://kdl.dev/).
14
+
These modifications are integrated into the build system (see [`src/build/patches.ts`](../src/build/patches.ts) for implementation details).
15
+
16
+
### Purpose
17
+
18
+
- Fix errors or omissions in upstream IDL data.
19
+
- Add or override interfaces, mixins, and enums.
20
+
- Apply project-specific features or changes.
21
+
22
+
### Editing Policy
23
+
24
+
It is **recommended** to document and comment your patch files and their intent.
25
+
This helps keep the integration clear and maintainable.
26
+
27
+
### Structure & Parsing
28
+
29
+
- All `.kdl` files in this folder are read and parsed at build time.
30
+
- Their structure typically mirrors major Web IDL concepts:
- Locates all KDL files in the `patches/` directory.
55
+
- Parses and type-checks them.
56
+
- Merges their contents and applies structural transformations over the main IDL dataset.
57
+
58
+
See the source or comments in `patches.ts` for precise KDL syntax and advanced features.
59
+
60
+
### Notes
61
+
62
+
- You can split patches into multiple `.kdl` files if desired.
63
+
- All the data in the json and jsonc files will be eventually transformed to KDL, so if possible submit patches to KDL.
64
+
- When in doubt, consult `/src/build/patches.ts` for details on supported KDL structure and merging logic.
65
+
- If there is a feature that is missing from the KDL parser, feel free to implement it yourself or ping @bashamega to help implement that feature in [this issue](https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/2053), or just add it to the jsonc files.
0 commit comments