# SelfClosingElementNode

Represents a self-closing HTML element (e.g. `<br />`, `<img />`).

## Signatures

```ts
export declare class SelfClosingElementNode {
    readonly _tag = "self-closing-element";
    readonly tagName: string;
    readonly attributes: Array<Attribute>;
    constructor(tagName: string, attributes: Array<Attribute>);
}
```

## Why

The distinct tag preserves author syntax for compilation and serialization.

## Ownership and lifetime

The model owns parsed metadata, not the eventual native Element.

## Constructor

Creates a self-closing element AST node.

## Constructor: Why

Makes compiler input explicit.

## Constructor: Ownership and lifetime

Retains parsed data and creates no DOM.

## Property: _tag

Self-closing-element discriminant.

## Property: _tag: Why

Preserves author syntax in compilation.

## Property: _tag: Ownership and lifetime

Immutable metadata.

## Property: attributes

Parsed attributes.

## Property: attributes: Why

Retains native directive distinctions.

## Property: attributes: Ownership and lifetime

Retained AST array.

## Property: tagName

Authored tag name.

## Property: tagName: Why

Selects the native element kind.

## Property: tagName: Ownership and lifetime

Retained string metadata.

## Examples

```ts
import { SelfClosingElementNode } from "@typed/template/Template"

const node = new SelfClosingElementNode("img", [])
```
