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 | optionalChildrenDocumentation 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 | optionalbooleanWhether this is the default export of the module. |
| doc | optionalChildrenDocumentation for this declaration |
| export | optionalbooleanWhether 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 | NamekeyThe base name of this declaration. May change depending on naming policy and any conflicts. |
| nameKind | TypeScriptElementsThe 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.