# CompiledValidator (@salmonui/data-grid/engine)

> The CompiledValidator interface of @salmonui/data-grid/engine: One column's compiled rules.

Canonical: https://salmonui.dev/docs/reference/data-grid/engine/CompiledValidator

```ts
import type { CompiledValidator } from '@salmonui/data-grid/engine';
```

Also exported from `@salmonui/data-grid/engine/validation`.

Entry index: https://salmonui.dev/docs/reference/data-grid/engine (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/data-grid/engine.md).

## Reference

Kind: interface

```ts
interface CompiledValidator {
    readonly required: boolean;
    validate(value: unknown, row: unknown): readonly string[];
    readonly custom: AsyncCheck | null;
}
```

One column's compiled rules.

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `required` | `readonly required: boolean;` |  | True when a `required` rule (or an implicit primary-key requirement) applies. |
| `validate` | `validate(value: unknown, row: unknown): readonly string[];` |  | Synchronous built-in rules: the first failing message, as a one-element array, or `NO_ERRORS`. |
| `custom` | `readonly custom: AsyncCheck \| null;` |  | Custom validators: a message, null, or a promise of either. Null when the column has no custom rule. |
