---
title: "ArrayElemKey: type in Types, TypeShade API reference"
description: "ArrayElemKey, a type in Types. Element key of an array key: array<f32,4> → 'f32', array<vec3<f32>> → 'vec3<f32>', and never for a key that is not an array."
url: https://typeshade.dev/api/arrayelemkey/
language: en
---

# `ArrayElemKey`

Type in Types

Element key of an array key: `array<f32,4>` → '`f32`', array<`vec3<f32>`> → '`vec3<f32>`', and never for a key that is not an array.

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

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

## Syntax

```ts
type ArrayElemKey<K extends string> = K extends `array<${infer Inner}>`
  ? DropArraySize<Inner>
  : never;
```

## Description

Element key of an array key: `array<f32,4>` → `'f32'`, `array<vec3<f32>>` → `'vec3<f32>'`, and `never` for a key that is not an array. It is the inverse of the `array` arm of [`KeyOf`](https://typeshade.dev/api/keyof/), and it is what lets `xs.at(i)` know the element type without being told again — the declaration already said it.

## See also

- [`KeyOf`](https://typeshade.dev/api/keyof/)

## Source

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