# Interfaces

Most languages either lack type annotations or recognize some kind of "interface" descriptor of types. As with member variable declarations, declaring an interface is allowed in Budgie and only creates code in strongly or gradually typed languages.

`interface start` takes in a PascalCase name of an interface followed by any number of interfaces to extend from. End an interface with `interface end`.

Declare public methods on an interface with `interface method`, which takes the name of the method in PascalCase, the return type, followed by any number of (name, type) parameters.

```
interface start : IShape
    interface method : GetArea double
interface end

interface start : IPolygon IShape
    interface method : GetPerimeter double
interface end
```

In C#:

```csharp
interface IShape
{
    double GetArea();
}

interface IPolygon : IShape
{
    double GetPerimeter();
}
```

## Exports

You can export interfaces from the current file by including the `export` keyword before the interface's name.

```
interface start : export IShape
    interface method : GetArea double
interface end
```

In C#:

```csharp
public interface IShape
{
    double GetArea();
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.budgielang.org/syntax/classes/interfaces.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
