---
title: Indexed access types reuse property and element types
slug: typescript-indexed-access-types
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source: https://iinventedlight.com/library/notes/typescript-indexed-access-types.md
source_license: CC-BY-4.0
attribution: Original synthesis by iinventedlight, drafted by Librarian with AI assistance; based on the attributed sources
  below.
author: Librarian
client: Librarian
date: '2026-11-05'
checked_on: '2026-11-05'
as_of: '2026-11-05'
status: published
confidence: medium
category: coding-references
tags:
- typescript
- indexed
- access
untested: Reference note. No code or commands were run to validate behavior.
sources:
- id: S1
  title: Indexed access types
  publisher: Microsoft and TypeScript documentation contributors
  url: https://www.typescriptlang.org/docs/handbook/2/indexed-access-types.html
  accessed: '2026-11-05'
  license: CC-BY-4.0
  license_url: https://raw.githubusercontent.com/microsoft/TypeScript-Website/v2/LICENSE
  license_verified: '2026-11-05'
  green: true
  attribution: Microsoft and TypeScript documentation contributors; Indexed access types; CC-BY-4.0
  snapshot: _fetched/ts-indexed.txt
- id: S2
  title: Keyof type operator
  publisher: Microsoft and TypeScript documentation contributors
  url: https://www.typescriptlang.org/docs/handbook/2/keyof-types.html
  accessed: '2026-11-05'
  license: CC-BY-4.0
  license_url: https://raw.githubusercontent.com/microsoft/TypeScript-Website/v2/LICENSE
  license_verified: '2026-11-05'
  green: true
  attribution: Microsoft and TypeScript documentation contributors; Keyof type operator; CC-BY-4.0
  snapshot: _fetched/ts-keyof.txt
---
# Indexed access types reuse property and element types

## Summary
An indexed access type such as `RecordType["field"]` retrieves a property type. The index is a type, so a literal-key union can retrieve a union of property types. [S1]

## Details
`keyof` supplies the allowed keys of an object type. Combining it with indexed access can collect that object's property value types. For arrays, indexing the array type with `number` retrieves its element type. A missing property is a type error. A value variable is not itself a type-level key, though a suitable type alias can be used. [S1, S2]

## Claims
- id: C1
  claim: "Indexed access can retrieve a property type."
  source: S1
  evidence: "look up a specific property on another type"
- id: C2
  claim: "number can retrieve an array element type."
  source: S1
  evidence: "using number to get the type of an array"
- id: C3
  claim: "keyof produces a union of object keys."
  source: S2
  evidence: "produces a string or numeric literal union of its keys"

## Sources
- [S1] Indexed access types. Microsoft and TypeScript documentation contributors. https://www.typescriptlang.org/docs/handbook/2/indexed-access-types.html. CC-BY-4.0; license: https://raw.githubusercontent.com/microsoft/TypeScript-Website/v2/LICENSE. Accessed 2026-11-05.
- [S2] Keyof type operator. Microsoft and TypeScript documentation contributors. https://www.typescriptlang.org/docs/handbook/2/keyof-types.html. CC-BY-4.0; license: https://raw.githubusercontent.com/microsoft/TypeScript-Website/v2/LICENSE. Accessed 2026-11-05.

## Attribution and notices
This note is CC BY 4.0. Source material has been condensed and restated; short evidence excerpts retain their source license.

TypeScript Website documentation is CC BY 4.0. This is an original condensed explanation, not the original documentation.
