> 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.md).

# Yarn Namespace

## Summary

Contains classes for working with compiled Yarn programs.

## Classes

| Name                                                                  | Description                                                                                                                                                      |
| --------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [ConstantTypeProperty](/api/csharp/yarn/yarn.constanttypeproperty.md) | Represents a property that belongs to a type and contains a read-only value.                                                                                     |
| [Dialogue](/api/csharp/yarn/yarn.dialogue.md)                         | Co-ordinates the execution of Yarn programs.                                                                                                                     |
| [DialogueException](/api/csharp/yarn/yarn.dialogueexception.md)       | An exception that is thrown by [Dialogue](/api/csharp/yarn/yarn.dialogue.md) when there is an error in executing a [Program](/api/csharp/yarn/yarn.program.md) . |
| [EnumBase](/api/csharp/yarn/yarn.enumbase.md)                         | The base type for all enumeration types.                                                                                                                         |
| [EnumType](/api/csharp/yarn/yarn.enumtype.md)                         | A type that represents enumerations.                                                                                                                             |
| [FunctionType](/api/csharp/yarn/yarn.functiontype.md)                 | A type that represents a function.                                                                                                                               |
| [Header](/api/csharp/yarn/yarn.header.md)                             |                                                                                                                                                                  |
| [Library](/api/csharp/yarn/yarn.library.md)                           | A collection of functions that can be called from Yarn programs.                                                                                                 |
| [MemoryVariableStore](/api/csharp/yarn/yarn.memoryvariablestore.md)   | A simple concrete implementation of [IVariableStorage](/api/csharp/yarn/yarn.ivariablestorage.md) that keeps all variables in memory.                            |
| [Node](/api/csharp/yarn/yarn.node.md)                                 | A node of Yarn script, contained within a [Program](/api/csharp/yarn/yarn.program.md) , and containing `Yarn.Instruction` s.                                     |
| [Program](/api/csharp/yarn/yarn.program.md)                           | A compiled Yarn program.                                                                                                                                         |
| [TypeBase](/api/csharp/yarn/yarn.typebase.md)                         | Provides the base class for all concrete types.                                                                                                                  |
| [Types](/api/csharp/yarn/yarn.types.md)                               | Contains the built-in types available in the Yarn language.                                                                                                      |

## Delegates

| Name                                                                        | Description                                                                                                                        |
| --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| [CommandHandler](/api/csharp/yarn/yarn.commandhandler.md)                   | Represents the method that is called when the Dialogue delivers a [Command](/api/csharp/yarn/yarn.command.md) .                    |
| [DialogueCompleteHandler](/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](/api/csharp/yarn/yarn.linehandler.md)                         | Represents the method that is called when the Dialogue delivers a [Line](/api/csharp/yarn/yarn.line.md) .                          |
| [Logger](/api/csharp/yarn/yarn.logger.md)                                   | Represents a method that receives diagnostic messages and error information from a [Dialogue](/api/csharp/yarn/yarn.dialogue.md) . |
| [NodeCompleteHandler](/api/csharp/yarn/yarn.nodecompletehandler.md)         | Represents the method that is called when the Dialogue reaches the end of a node.                                                  |
| [NodeStartHandler](/api/csharp/yarn/yarn.nodestarthandler.md)               | Represents the method that is called when the Dialogue begins executing a node.                                                    |
| [OptionsHandler](/api/csharp/yarn/yarn.optionshandler.md)                   | Represents the method that is called when the Dialogue delivers an [OptionSet](/api/csharp/yarn/yarn.optionset.md) .               |
| [PrepareForLinesHandler](/api/csharp/yarn/yarn.prepareforlineshandler.md)   | Represents the method that is called when the dialogue anticipates that it will deliver lines.                                     |

## Enums

| Name                                                  | Description                                                                                                                                                                                                                      |
| ----------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [VariableKind](/api/csharp/yarn/yarn.variablekind.md) | Represents different kinds of variables that can be fetched from a [Dialogue](/api/csharp/yarn/yarn.dialogue.md) using [TryGetValue\<T>(string,T?)](/api/csharp/yarn/yarn.ivariableaccess/yarn.ivariableaccess.trygetvalue.md) . |

## Interfaces

| Name                                                                        | Description                                                                                                                  |
| --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| [IMarkupParser](/api/csharp/yarn/yarn.imarkupparser.md)                     | Contains methods for parsing raw text into a [MarkupParseResult](/api/csharp/yarn.markup/yarn.markup.markupparseresult.md) . |
| [ISmartVariableEvaluator](/api/csharp/yarn/yarn.ismartvariableevaluator.md) | Contains methods for evaluating the value of smart variables                                                                 |
| [IType](/api/csharp/yarn/yarn.itype.md)                                     | Defines properties that describe a type in the Yarn language.                                                                |
| [ITypeMember](/api/csharp/yarn/yarn.itypemember.md)                         | Provides properties used to work with members of a type.                                                                     |
| [IVariableAccess](/api/csharp/yarn/yarn.ivariableaccess.md)                 | Provides a mechanism for retrieving values.                                                                                  |
| [IVariableStorage](/api/csharp/yarn/yarn.ivariablestorage.md)               | Provides a mechanism for storing values.                                                                                     |
| [IYarnValue](/api/csharp/yarn/yarn.iyarnvalue.md)                           | Represents a read-only value in the Yarn Spinner virtual machine.                                                            |

## Namespaces

| Name                                          | Description                                                                               |
| --------------------------------------------- | ----------------------------------------------------------------------------------------- |
| [Yarn.Compiler](/api/csharp/yarn.compiler.md) | Contains classes for compiling Yarn code.                                                 |
| [Yarn.Markup](/api/csharp/yarn.markup.md)     | Contains classes for working with markup in Yarn lines.                                   |
| [Yarn.Saliency](/api/csharp/yarn.saliency.md) | Contains classes for choosing the most relevant content out of a set of possible options. |
| [Yarn.Unity](/api/csharp/yarn.unity.md)       | Contains classes for working with Yarn Spinner in the Unity game engine.                  |
| [Yarn.Utility](/api/csharp/yarn.utility.md)   | Contains utility classes used by Yarn Spinner.                                            |

## Structs

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