FunctionDeclaration
import { FunctionDeclaration } from "@alloy-js/go";
<FunctionDeclaration doc={Children} name={string | Namekey} parameters={FunctionParameterProps[]} receiver={Children} refkey={Refkey} returns={Children} singleLine typeParameters={TypeParameterProps[]}> {children}</FunctionDeclaration>import { FunctionDeclaration } from "@alloy-js/go/stc";
FunctionDeclaration({ doc: Children, name: string | Namekey, parameters: FunctionParameterProps[], receiver: Children, refkey: Refkey, returns: Children, singleLine: boolean, typeParameters: TypeParameterProps[],}).children(children)| children | optionalChildren |
| doc | optionalChildrenDoc comment |
| name | string | Namekey |
| parameters | optionalFunctionParameterProps[] |
| receiver | optionalChildrenGo receiver (for methods) |
| refkey | optionalRefkey |
| returns | optionalChildren |
| singleLine | optionalbooleanWhether to render the function in a single line.
This will only compile if |
| typeParameters | optionalTypeParameterProps[]Type parameters for generic functions |