---
title: "WgslValidator: interface in Variants, TypeShade API"
description: "WgslValidator, an interface in Variants. The slice of GPUDevice that validating a WGSL module needs."
url: https://typeshade.dev/api/wgslvalidator/
language: en
---

# `WgslValidator`

Interface in Variants

The slice of GPUDevice that validating a WGSL module needs.

`import type { WgslValidator } from 'typeshade'`

The signature, the description and the examples come from the compiler's own source at commit af54ddad5.

## Syntax

```ts
interface WgslValidator<Module = unknown> {
  createShaderModule(descriptor: { code: string }): Module;
}
```

## Description

A real `GPUDevice` satisfies this as-is: pass it straight in. The interface is structural for the same two reasons as [`GlLinker`](https://typeshade.dev/api/gllinker/): the package builds without WebGPU type definitions, and a test can drive the result aggregation with a recorder while the real run goes through the browser’s WGSL compiler.

## Instance methods

**`createShaderModule` `(descriptor: { code: string }): Module`**

## See also

- [`GlLinker`](https://typeshade.dev/api/gllinker/)

## Source

[`src/core/variant-link.ts`, line 181](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/variant-link.ts#L181), at commit af54ddad5
