InterfaceMethod
An interface method declaration.
Props for [unresolved link] component
import { InterfaceMethod } from "@alloy-js/typescript";
<InterfaceMethod async doc={Children} name={string | Namekey} parameters={ParameterDescriptor[] | string[]} parametersChildren={Children} refkey={Refkey | Refkey[]} returnType={Children} typeParameters={TypeParameterDescriptor[] | string[]} typeParametersChildren={Children}> {children}</InterfaceMethod>import { InterfaceMethod } from "@alloy-js/typescript/stc";
InterfaceMethod({ async: boolean, doc: Children, name: string | Namekey, parameters: ParameterDescriptor[] | string[], parametersChildren: Children, refkey: Refkey | Refkey[], returnType: Children, typeParameters: TypeParameterDescriptor[] | string[], typeParametersChildren: Children,}).children(children)| async | optionalbooleanIf the method is async. It will change the returnType from |
| children | optionalChildrenJsx content |
| doc | optionalChildrenDocumentation for this method. |
| name | string | NamekeyInterface member name |
| parameters | optionalParameterDescriptor[] | string[]The parameters to the function. Can be an array of strings for parameters which don’t have a type or a default value. Otherwise, it’s an array of ParameterDescriptors. |
| parametersChildren | optionalChildrenRaw content to be used as the parameter list. |
| refkey | optionalRefkey | Refkey[]Ref key for the member declaration |
| returnType | optionalChildrenThe return type of the function. |
| typeParameters | optionalTypeParameterDescriptor[] | string[]The type parameters for the function. Can be an array of strings for type parameters which don’t have any constraints or a default type, otherwise it’s an array of TypeParameterDescriptors. |
| typeParametersChildren | optionalChildrenRaw content to be used as the type parameter list. |
Remarks
Section titled “Remarks”Providing parameters and type parameters can be accomplished in one of three ways:
- As an array of TypeParameterDescriptors or TypeParameterDescriptors.
- As raw content via the
parametersChildrenortypeParametersChildrenprops. - As a child of this component via the [unresolved link] or [unresolved link] components.
Example
Section titled “Example”(foo: string, bar: number) => void