---
title: "vec2: type in Runtime, TypeShade API reference"
description: "vec2, a type in Runtime. A vec2, the vector of two f32, as a host value: a readonly tuple of two f32."
url: https://typeshade.dev/api/vec2-type/
language: en
---

# `vec2`

Type in Runtime

A `vec2`, the vector of two `f32`, as a host value: a readonly tuple of two `f32`.

`import type { vec2 } from 'typeshade/runtime'`

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

## Syntax

```ts
type vec2 = readonly [f32, f32];
```

## In the guide

- [Your first shader](https://typeshade.dev/guide/internals/your-first-shader/)
- [Values and mutation](https://typeshade.dev/guide/internals/values-and-mutation/)
- [Layouts and resources](https://typeshade.dev/guide/internals/layouts-and-resources/)
- [The CPU oracle](https://typeshade.dev/guide/internals/the-cpu-oracle/)
- [fp64](https://typeshade.dev/guide/internals/fp64/)
- [Production emit](https://typeshade.dev/guide/internals/production-emit/)
- [Migrating a GLSL shader](https://typeshade.dev/guide/internals/migrating-a-glsl-shader/)

## Source

[`src/runtime/host-types.ts`, line 60](https://github.com/typeshade/typeshade/blob/af54ddad5/src/runtime/host-types.ts#L60), at commit af54ddad5
