> For the complete documentation index, see [llms.txt](https://docs.yarnspinner.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.yarnspinner.dev/3.1/api/csharp/yarn/yarn.functiontype.md).

# FunctionType

Class in [Yarn](/3.1/api/csharp/yarn.md)

Inherits from `System.Object`

## Summary

A type that represents a function.

```csharp
public class FunctionType : IType, IEquatable<IType>
```

## Remarks

Functions have parameters and a return type, and can be called from script. Instances of this type are created when the host application registers new functions (such as through using the [RegisterFunction(string,Delegate)](/3.1/api/csharp/yarn/yarn.library/yarn.library.registerfunction-7.md) methods or similar.)

## Constructors

| Name                                                                                               | Description                                                                                         |
| -------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| [FunctionType(IType,IType\[\])](/3.1/api/csharp/yarn/yarn.functiontype/yarn.functiontype..ctor.md) | Initialises a new instances of the [FunctionType](/3.1/api/csharp/yarn/yarn.functiontype.md) class. |

## Methods

| Name                                                                                              | Description                                        |
| ------------------------------------------------------------------------------------------------- | -------------------------------------------------- |
| [Equals(IType)](/3.1/api/csharp/yarn/yarn.functiontype/yarn.functiontype.equals.md)               |                                                    |
| [GetParameterAt(int)](/3.1/api/csharp/yarn/yarn.functiontype/yarn.functiontype.getparameterat.md) | Gets the type of the parameter at the given index. |
| [ToString()](/3.1/api/csharp/yarn/yarn.functiontype/yarn.functiontype.tostring.md)                |                                                    |

## Properties

| Name                                                                                                       | Description                                                                        |
| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| [Description](/3.1/api/csharp/yarn/yarn.functiontype/yarn.functiontype.description.md)                     | Gets a more verbose description of this type.                                      |
| [Name](/3.1/api/csharp/yarn/yarn.functiontype/yarn.functiontype.name.md)                                   | Gets the name of this type.                                                        |
| [Parameters](/3.1/api/csharp/yarn/yarn.functiontype/yarn.functiontype.parameters.md)                       | Gets the list of the parameter types that this function is called with.            |
| [Parent](/3.1/api/csharp/yarn/yarn.functiontype/yarn.functiontype.parent.md)                               | Gets the parent of this type.                                                      |
| [ReturnType](/3.1/api/csharp/yarn/yarn.functiontype/yarn.functiontype.returntype.md)                       | Gets the type of value that this function returns.                                 |
| [TypeMembers](/3.1/api/csharp/yarn/yarn.functiontype/yarn.functiontype.typemembers.md)                     | Gets the collection of type information for this type's type members.              |
| [VariadicParameterType](/3.1/api/csharp/yarn/yarn.functiontype/yarn.functiontype.variadicparametertype.md) | Gets the type of value that this type of function accepts as a variadic parameter. |
