<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@contract-case/case-definition-dsl](./case-definition-dsl.md) &gt; [matchers](./case-definition-dsl.matchers.md) &gt; [convenience](./case-definition-dsl.matchers.convenience.md) &gt; [StateVariable](./case-definition-dsl.matchers.convenience.statevariable.md)

## matchers.convenience.StateVariable class

Matches the content of a variable that comes from a state. See [state definitions](https://case.contract-testing.io/docs/defining-contracts/state-definitions) and [state handlers](https://case.contract-testing.io/docs/reference/state-handlers) for more details.

**Signature:**

```typescript
export declare class StateVariable extends AnyMatcher
```

**Extends:** AnyMatcher

## Constructors

<table><thead><tr><th>

Constructor

</th><th>

Modifiers

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

[(constructor)(name)](./case-definition-dsl.matchers.convenience.statevariable._constructor_.md)

</td><td>

</td><td>

Matches the content of a variable that comes from a state. See [state definitions](https://case.contract-testing.io/docs/defining-contracts/state-definitions) and [state handlers](https://case.contract-testing.io/docs/reference/state-handlers) for more details.

</td></tr>
</tbody></table>

## Methods

<table><thead><tr><th>

Method

</th><th>

Modifiers

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

[toJSON()](./case-definition-dsl.matchers.convenience.statevariable.tojson.md)

</td><td>

</td><td>

For non-TypeScript implementations (see `AnyMatcher.toJSON`<!-- -->)

</td></tr>
</tbody></table>
