> 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/api/csharp/yarn/yarn.functiontype.md).

# FunctionType

Class in [Yarn](/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)](/api/csharp/yarn/yarn.library/yarn.library.registerfunction-7.md) methods or similar.)

## Constructors

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

## Methods

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

## Properties

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