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

# Yarn Namespace

## Summary

Contains classes for working with compiled Yarn programs.

## Classes

| Name                                                                    | Description                                                                                                                                                              |
| ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [BuiltinTypes](/2.2/api/csharp/yarn/yarn.builtintypes.md)               | Contains the built-in types available in the Yarn language.                                                                                                              |
| [Dialogue](/2.2/api/csharp/yarn/yarn.dialogue.md)                       | Co-ordinates the execution of Yarn programs.                                                                                                                             |
| [DialogueException](/2.2/api/csharp/yarn/yarn.dialogueexception.md)     | An exception that is thrown by [Dialogue](/2.2/api/csharp/yarn/yarn.dialogue.md) when there is an error in executing a [Program](/2.2/api/csharp/yarn/yarn.program.md) . |
| [FunctionType](/2.2/api/csharp/yarn/yarn.functiontype.md)               | A type that represents functions.                                                                                                                                        |
| [Library](/2.2/api/csharp/yarn/yarn.library.md)                         | A collection of functions that can be called from Yarn programs.                                                                                                         |
| [MemoryVariableStore](/2.2/api/csharp/yarn/yarn.memoryvariablestore.md) | A simple concrete implementation of [IVariableStorage](/2.2/api/csharp/yarn/yarn.ivariablestorage.md) that keeps all variables in memory.                                |
| [Node](/2.2/api/csharp/yarn/yarn.node.md)                               | A node of Yarn script, contained within a [Program](/2.2/api/csharp/yarn/yarn.program.md) , and containing `Yarn.Instruction` s.                                         |
| [Program](/2.2/api/csharp/yarn/yarn.program.md)                         | A compiled Yarn program.                                                                                                                                                 |

## Delegates

| Name                                                                            | Description                                                                                                                            |
| ------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| [CommandHandler](/2.2/api/csharp/yarn/yarn.commandhandler.md)                   | Represents the method that is called when the Dialogue delivers a [Command](/2.2/api/csharp/yarn/yarn.command.md) .                    |
| [DialogueCompleteHandler](/2.2/api/csharp/yarn/yarn.dialoguecompletehandler.md) | Represents the method that is called when the dialogue has reached its end, and no more code remains to be run.                        |
| [LineHandler](/2.2/api/csharp/yarn/yarn.linehandler.md)                         | Represents the method that is called when the Dialogue delivers a [Line](/2.2/api/csharp/yarn/yarn.line.md) .                          |
| [Logger](/2.2/api/csharp/yarn/yarn.logger.md)                                   | Represents a method that receives diagnostic messages and error information from a [Dialogue](/2.2/api/csharp/yarn/yarn.dialogue.md) . |
| [NodeCompleteHandler](/2.2/api/csharp/yarn/yarn.nodecompletehandler.md)         | Represents the method that is called when the Dialogue reaches the end of a node.                                                      |
| [NodeStartHandler](/2.2/api/csharp/yarn/yarn.nodestarthandler.md)               | Represents the method that is called when the Dialogue begins executing a node.                                                        |
| [OptionsHandler](/2.2/api/csharp/yarn/yarn.optionshandler.md)                   | Represents the method that is called when the Dialogue delivers an [OptionSet](/2.2/api/csharp/yarn/yarn.optionset.md) .               |
| [PrepareForLinesHandler](/2.2/api/csharp/yarn/yarn.prepareforlineshandler.md)   | Represents the method that is called when the dialogue anticipates that it will deliver lines.                                         |

## Interfaces

| Name                                                              | Description                                                                          |
| ----------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| [IType](/2.2/api/csharp/yarn/yarn.itype.md)                       | Defines properties that describe a type in the Yarn language.                        |
| [IVariableStorage](/2.2/api/csharp/yarn/yarn.ivariablestorage.md) | Provides a mechanism for storing and retrieving instances of the `Yarn.Value` class. |

## Namespaces

| Name                                              | Description                                                              |
| ------------------------------------------------- | ------------------------------------------------------------------------ |
| [Yarn.Compiler](/2.2/api/csharp/yarn.compiler.md) | Contains classes for compiling Yarn code.                                |
| [Yarn.Markup](/2.2/api/csharp/yarn.markup.md)     | Contains classes for working with markup in Yarn lines.                  |
| [Yarn.Unity](/2.2/api/csharp/yarn.unity.md)       | Contains classes for working with Yarn Spinner in the Unity game engine. |

## Structs

| Name                                                | Description                                                                                                                                                     |
| --------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Command](/2.2/api/csharp/yarn/yarn.command.md)     | A command, sent from the [Dialogue](/2.2/api/csharp/yarn/yarn.dialogue.md) to the game.                                                                         |
| [Line](/2.2/api/csharp/yarn/yarn.line.md)           | A line of dialogue, sent from the [Dialogue](/2.2/api/csharp/yarn/yarn.dialogue.md) to the game.                                                                |
| [OptionSet](/2.2/api/csharp/yarn/yarn.optionset.md) | A set of [Option](/2.2/api/csharp/yarn/yarn.optionset/yarn.optionset.option.md) s, sent from the [Dialogue](/2.2/api/csharp/yarn/yarn.dialogue.md) to the game. |
