SourceFile
import { SourceFile } from "@alloy-js/core";
<SourceFile filetype="string" header={Children} insertFinalNewLine noFlush path="string" printWidth={number} reference={ComponentDefinition<{ refkey: Refkey; }>} tabWidth={number} useTabs> {children}</SourceFile>import { SourceFile } from "@alloy-js/core/stc";
SourceFile({ filetype: string, header: Children, insertFinalNewLine: boolean, noFlush: boolean, path: string, printWidth: number, reference: ComponentDefinition<{ refkey: Refkey; }>, tabWidth: number, useTabs: boolean,}).children(children)| children | optional Children | |
| filetype | string | The type of contents in this file. This is a metadata hint only. It does not trigger formatting or content processing. The value is forwarded to debug tooling and the ContentOutputFile output metadata. |
| header | optional Children | Content rendered before the file body, separated from it by a hard line break. The separator is emitted whenever header is not undefined — including when it is an empty string or a component that renders nothing. To suppress both the header and the separator, omit this prop entirely. |
| insertFinalNewLine | optional boolean | If files should end with a final new line. |
| noFlush | optional boolean | Skip flushing scheduled jobs before printing. |
| path | string | The path of this file relative to its parent directory |
| printWidth | optional number | The number of characters the printer will wrap on. Defaults to 100 characters. |
| reference | optional ComponentDefinition<{ refkey: Refkey; }> | The component to use to render refkeys references within the file’s contents. |
| tabWidth | optional number | The number of spaces to use for indentation. Defaults to 2 spaces. |
| useTabs | optional boolean | Whether to use tabs instead of spaces for indentation. Defaults to false. |