# BlockScope

Create a TypeScript block which includes a scope for any nested declarations. Can either provide the scope directly via the `value` prop, or else provide information about the scope.

## Overload 1

* jsx

  ```tsx
  import { BlockScope } from "@alloy-js/typescript";


  <BlockScope
    closer="string"
    inline
    newline
    opener="string"
    value={OutputScope}
   />
  ```

* stc

  ```ts
  import { BlockScope } from "@alloy-js/typescript/stc";


  BlockScope({
    closer: string,
    inline: boolean,
    newline: boolean,
    opener: string,
    value: OutputScope,
  }).children(children)
  ```

### Props

|          |                                                   |                                                                                                                                                                                  |
| -------- | ------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| children | optional[Children](../../../core/types/children/) |                                                                                                                                                                                  |
| children | optional[Children](../../../core/types/children/) | The block’s contents                                                                                                                                                             |
| closer   | optional string                                   | The closing punctuation of the block. Defaults to “}”.                                                                                                                           |
| inline   | optional boolean                                  | If true the block will not indent the content into new lines                                                                                                                     |
| newline  | optional boolean                                  | Whether the block starts on a new line. When true, a hardline is added prior to the block. If `inline` is true, this will only apply if the block is also split due to breaking. |
| opener   | optional string                                   | The opening punctuation of the block. Defaults to “{”.                                                                                                                           |
| value    | [OutputScope](../../../core/types/outputscope/)   | The scope to use. If not provided, a new scope will be created.                                                                                                                  |

## Overload 2

* jsx

  ```tsx
  import { BlockScope } from "@alloy-js/typescript";


  <BlockScope
    closer="string"
    inline
    metadata={Record<string, unknown>}
    name="string"
    newline
    opener="string"
    ownerSymbol={OutputSymbol}
   />
  ```

* stc

  ```ts
  import { BlockScope } from "@alloy-js/typescript/stc";


  BlockScope({
    closer: string,
    inline: boolean,
    metadata: Record<string, unknown>,
    name: string,
    newline: boolean,
    opener: string,
    ownerSymbol: OutputSymbol,
  }).children(children)
  ```

### Props

|             |                                                           |                                                                                                                                                                                  |
| ----------- | --------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| children    | optional[Children](../../../core/types/children/)         |                                                                                                                                                                                  |
| children    | optional[Children](../../../core/types/children/)         | The block’s contents                                                                                                                                                             |
| closer      | optional string                                           | The closing punctuation of the block. Defaults to “}”.                                                                                                                           |
| inline      | optional boolean                                          | If true the block will not indent the content into new lines                                                                                                                     |
| metadata    | optional Record\<string, unknown>                         | Additional metadata for the scope.                                                                                                                                               |
| name        | optional string                                           | The name of this scope.                                                                                                                                                          |
| newline     | optional boolean                                          | Whether the block starts on a new line. When true, a hardline is added prior to the block. If `inline` is true, this will only apply if the block is also split due to breaking. |
| opener      | optional string                                           | The opening punctuation of the block. Defaults to “{”.                                                                                                                           |
| ownerSymbol | optional[OutputSymbol](../../../core/types/outputsymbol/) | Create a member scope with the owner symbol providing the in-scope symbols.                                                                                                      |
