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 | optional AttributesProp | Define attributes to attach |
| doc | optional Children | Doc comment |
| file | optional boolean | |
| internal | optional boolean | |
| name | string | Namekey | |
| partial | optional boolean | |
| private | optional boolean | |
| protected | optional boolean | |
| public | optional boolean | |
| refkey | optional Refkey | |
| 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);
}