Block
Create an indented block of source text. The block has opener
text which is
added prior to the block, which defaults to "{"
, and closer
text which is
added after the block, which defaults to "}"
.
import { Block } from "@alloy-js/core";
<Block closer="string" inline newline opener="string"> {children}</Block>
import { Block } from "@alloy-js/core/stc";
Block({ closer: string, inline: boolean, newline: boolean, opener: string,}).children(children)
Props
children | optionalChildren The block’s contents |
closer | optionalstring The closing punctuation of the block. Defaults to ”}“. |
inline | optionalboolean If true the block will not indent the content into new lines |
newline | optionalboolean Whether the block starts on a new line. When true, a hardline is added
prior to the block. If |
opener | optionalstring The opening punctuation of the block. Defaults to ”{”. |