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.
Overload 1
Section titled “Overload 1”import { Declaration } from "@alloy-js/typescript";
<Declaration doc={Children} symbol={TSOutputSymbol} />
import { Declaration } from "@alloy-js/typescript/stc";
Declaration({ doc: Children, symbol: TSOutputSymbol }).children(children)
children | optionalChildren |
doc | optionalChildren Documentation for this declaration |
symbol | [unresolved link] The symbol to use for this declaration. |
Overload 2
Section titled “Overload 2”import { Declaration } from "@alloy-js/typescript";
<Declaration default doc={Children} export kind={"type" | "value"} metadata={Record<string, unknown>} name={string | Namekey} nameKind={TypeScriptElements} refkey={Refkey | Refkey[]} />
import { Declaration } from "@alloy-js/typescript/stc";
Declaration({ default: boolean, doc: Children, export: boolean, kind: "type" | "value", metadata: Record<string, unknown>, name: string | Namekey, nameKind: TypeScriptElements, refkey: Refkey | Refkey[],}).children(children)
children | optionalChildren |
default | optionalboolean Whether this is the default export of the module. |
doc | optionalChildren Documentation for this declaration |
export | optionalboolean Whether to export this declaration from the module. |
kind | optional”type” | “value” Whether this is a declaration of a type (e.g. interface, type alias) or a value (e.g. var, const, let). |
metadata | optionalRecord<string, unknown> Arbitrary metadata about this declaration. |
name | string | Namekey The base name of this declaration. May change depending on naming policy and any conflicts. |
nameKind | TypeScriptElements The name policy kind to apply to the declaration. |
refkey | optionalRefkey | Refkey[] The refkey or array of refkeys for this declaration. |
Remarks
Section titled “Remarks”This component will wrap its contents in a Declaration component, so children can make use of declaration context.