InterfaceDeclaration
CSharp interface declaration.
import { InterfaceDeclaration } from "@alloy-js/csharp";
<InterfaceDeclaration doc={core.Children} file internal name="string" partial private protected public refkey={core.Refkey} typeParameters={(TypeParameterProps | string)[]} />
import { InterfaceDeclaration } from "@alloy-js/csharp/stc";
InterfaceDeclaration({ doc: core.Children, file: boolean, internal: boolean, name: string, partial: boolean, private: boolean, protected: boolean, public: boolean, refkey: core.Refkey, typeParameters: (TypeParameterProps | string)[],}).children(children)
Props
doc | optionalChildren Doc comment |
file | optionalboolean |
internal | optionalboolean |
name | string |
partial | optionalboolean |
private | optionalboolean |
protected | optionalboolean |
public | optionalboolean |
refkey | optionalRefkey |
typeParameters | optional(TypeParameterProps | string)[] Type parameters for the interface |
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);}