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
Improve YAML documentation with Bun.YAML.stringify and TypeScript typing
- Add Bun.YAML.stringify() documentation with examples using (null, 2) for spacing
- Document space parameter: 2 for readable format, 0 for condensed inline notation
- Add TypeScript section in Module Import explaining manual .d.ts requirement
- Clarify that unlike JSON, TypeScript doesn't automatically type YAML imports
- Show generating YAML with shared values using CodeGroup tabs
- Fix heading structure: parse examples under parse, stringify as separate section
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
Unlike JSON files, TypeScript doesn't automatically type YAML imports. Add type definitions by creating a `.d.ts` file with the same name as your YAML file:
240
+
241
+
```tsconfig.yaml.d.tsicon="/icons/typescript.svg"
242
+
constcontents: {
243
+
database: {
244
+
host: string;
245
+
port: number;
246
+
name: string;
247
+
};
248
+
server: {
249
+
port: number;
250
+
timeout: number;
251
+
};
252
+
features: {
253
+
auth: boolean;
254
+
rateLimit: boolean;
255
+
};
256
+
};
257
+
258
+
export=contents;
259
+
```
260
+
196
261
---
197
262
198
263
## Hot Reloading with YAML
@@ -435,6 +500,51 @@ if (parseConfig(migrations).autoRun === "true") {
435
500
}
436
501
```
437
502
503
+
### Generating YAML Files
504
+
505
+
You can use `Bun.YAML.stringify()` to programmatically create YAML configuration files:
0 commit comments