Skip to content

Declaration

Create a TypeScript declaration. Generally, this component shouldn’t be used directly, and instead prefer components for specific declarations, e.g. EnumDeclaration, InterfaceDeclaration, TypeDeclaration, etc.

import { Declaration } from "@alloy-js/typescript";
<Declaration
name="string"
nameKind={TypeScriptElements}
symbol={TSOutputSymbol}
/>

Props

nameoptionalstring

The name of this declaration.

nameKindoptionalTypeScriptElements

The name policy kind to apply to the declaration.

symboloptional[unresolved link]

The symbol to use for this declaration.

Remarks

This component will wrap its contents in a Declaration component, so children can make use of declaration context. Additionally, if the provided symbol flags have [unresolved link], this component will create a MemberScope.