Skip to content

SourceFile

import { SourceFile } from "@alloy-js/core";
<SourceFile
filetype="string"
header={Children}
path="string"
printWidth={number}
reference={ComponentDefinition<{
refkey: Refkey;
}>}
tabWidth={number}
useTabs
>
{children}
</SourceFile>

Props

childrenoptionalChildren
filetypestring

The type of contents in this file.

headeroptionalChildren

The header of the file. This is rendered before the contents of the file. This is useful for adding license headers or other metadata to the file.

pathstring

The path of this file relative to its parent directory

printWidthoptionalnumber

The number of characters the printer will wrap on. Defaults to 100 characters.

referenceoptionalComponentDefinition<{ refkey: Refkey; }>

The component to use to render refkeys references within the file’s contents.

tabWidthoptionalnumber

The number of spaces to use for indentation. Defaults to 2 spaces.

useTabsoptionalboolean

Whether to use tabs instead of spaces for indentation. Defaults to false.