---
title: "VariantWgslResult: interface in Variants, TypeShade API"
description: "VariantWgslResult, an interface in Variants. What happened to one variant on the WGSL side."
url: https://typeshade.dev/api/variantwgslresult/
language: en
---

# `VariantWgslResult`

Interface in Variants

What happened to one variant on the WGSL side.

`import type { VariantWgslResult } from 'typeshade'`

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

## Syntax

```ts
interface VariantWgslResult {
  readonly key: string;
  readonly ok: boolean;
  readonly failedAt?: 'emit' | 'validate';
  readonly errors?: readonly string[];
}
```

## Instance properties

**`key` read only `string`**

**`ok` read only `boolean`**

**`failedAt` optional read only `'emit' | 'validate'`**

Which step failed. Absent when `ok`. `'emit'` means the DSL threw before any device call. `'validate'` means the WGSL compiler reported errors, or the device call itself threw.

**`errors` optional read only `readonly string[]`**

Every compilation message of type `'error'`, formatted as `L<line>: <message>`. Absent when `ok`. Warnings and info messages are never counted as failures: the compiler emits them for valid shaders, and a check that fails on them is soon ignored.

## Source

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