---
title: "ScalarKey: type in Types, TypeShade API reference"
description: "ScalarKey, a type in Types. The key form of Scalar without 'bool': the set accepted wherever the DSL needs an indexable or comparable native scalar…"
url: https://typeshade.dev/api/scalarkey/
language: en
---

# `ScalarKey`

Type in Types

The key form of Scalar without 'bool': the set accepted wherever the DSL needs an indexable or comparable native scalar, such as array indices (.at(i, elem)), bitwise-op operands, and matchExpr or Switch scrutinees.

`import type { ScalarKey } from 'typeshade'`
`import type { ScalarKey } from 'typeshade/core/ir'`

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

## Syntax

```ts
type ScalarKey = 'f32' | 'i32' | 'u32';
```

## Description

`'f64'` and `'bool'` are excluded because a `Switch` scrutinee must become a WGSL `switch`, which only accepts integer cases, and an array index or bit-op operand is never boolean.

## See also

- [`Scalar`](https://typeshade.dev/api/scalar/)
- [`matchExpr`](https://typeshade.dev/api/matchexpr/)
- [`Switch`](https://typeshade.dev/api/switch/)

## Source

[`src/core/ir/types/key-of.ts`, line 88](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/ir/types/key-of.ts#L88), at commit af54ddad5
