<!-- 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; [base](./case-definition-dsl.matchers.base.md) &gt; [AnyMatcher](./case-definition-dsl.matchers.base.anymatcher.md)

## matchers.base.AnyMatcher class

The base class for all Test Equivalence Matchers. Extend this if you don't have an example in your Matcher. Otherwise, use `AnyMatcherWithExample`

**Signature:**

```typescript
export declare abstract class AnyMatcher
```

## Constructors

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

Constructor

</th><th>

Modifiers

</th><th>

Description

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

[(constructor)(matcherType)](./case-definition-dsl.matchers.base.anymatcher._constructor_.md)

</td><td>

</td><td>

The base class for all Test Equivalence Matchers. Extend this if you don't have an example in your Matcher. Otherwise, use Matcher strings beginning with `_case:` are reserved for the default ContractCase matchers.

Only use a types prefixed with `_case:` if you wish to create a special case for a matching behaviour that is already provided by a core ContractCase matcher.

</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.base.anymatcher.tojson.md)

</td><td>

</td><td>

Only override this method if you are writing a matcher in a language other than TypeScript.

It exists because the ContractCase matcher format is not legal in all languages that ContractCase supports.

WARNING: Do not return a string from this method. You must instead return an object that can be serialised to JSON following the matcher format described in [Extending ContractCase](https://case.contract-testing.io/docs/reference/plugin-framework)<!-- -->.

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