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} />
import { Declaration } from "@alloy-js/typescript/stc";
Declaration({ name: string, nameKind: TypeScriptElements, symbol: TSOutputSymbol,}).children(children)
Props
name | optionalstring The name of this declaration. |
nameKind | optionalTypeScriptElements The name policy kind to apply to the declaration. |
symbol | optionalTSOutputSymbol 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.