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 doc={Children} symbol={TSOutputSymbol} />
childrenoptionalChildren
docoptionalChildren

Documentation for this declaration

symbol[unresolved link]

The symbol to use for this declaration.

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[]}
/>
childrenoptionalChildren
defaultoptionalboolean

Whether this is the default export of the module.

docoptionalChildren

Documentation for this declaration

exportoptionalboolean

Whether to export this declaration from the module.

kindoptional”type” | “value”

Whether this is a declaration of a type (e.g. interface, type alias) or a value (e.g. var, const, let).

metadataoptionalRecord<string, unknown>

Arbitrary metadata about this declaration.

namestring | Namekey

The base name of this declaration. May change depending on naming policy and any conflicts.

nameKindTypeScriptElements

The name policy kind to apply to the declaration.

refkeyoptionalRefkey | Refkey[]

The refkey or array of refkeys for this declaration.

This component will wrap its contents in a Declaration component, so children can make use of declaration context.