InterfaceDeclaration
CSharp interface declaration.
import { InterfaceDeclaration } from "@alloy-js/csharp";
<InterfaceDeclaration attributes={AttributesProp} doc={core.Children} file internal name={string | core.Namekey} partial private protected public refkey={core.Refkey} typeParameters={(TypeParameterProps | string)[]} />import { InterfaceDeclaration } from "@alloy-js/csharp/stc";
InterfaceDeclaration({ attributes: AttributesProp, doc: core.Children, file: boolean, internal: boolean, name: string | core.Namekey, partial: boolean, private: boolean, protected: boolean, public: boolean, refkey: core.Refkey, typeParameters: (TypeParameterProps | string)[],}).children(children)| attributes | optionalAttributesPropDefine attributes to attach |
| doc | optionalChildrenDoc comment |
| file | optionalboolean |
| internal | optionalboolean |
| name | string | Namekey |
| partial | optionalboolean |
| private | optionalboolean |
| protected | optionalboolean |
| public | optionalboolean |
| refkey | optionalRefkey |
| typeParameters | optional(TypeParameterProps | string)[]Type parameters for the interface |
Example
Section titled “Example”<InterfaceDeclaration public name="IMyInterface"> <InterfaceMember public name="MyProperty" type="int" /> <InterfaceMethod public name="MyMethod" returnType="void"> <Parameter name="value" type="int" /> </InterfaceMethod></InterfaceDeclaration>This will produce:
public interface MyIface{ public int MyProperty { get; set; } public void MyMethod(int value);}