---
title: "param(): IR builder function in typeshade/core/ir, TypeShade"
description: "param, an IR builder function in typeshade/core/ir. A function parameter reference, with the key inferred from the ShaderType."
url: https://typeshade.dev/api/param/
language: en
---

# `param()`

Function in Values

A function parameter reference, with the key inferred from the ShaderType.

`import { param } from 'typeshade/core/ir'`

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

## Syntax

```ts
function param<T extends ShaderType>(name: string, type: T): ReadonlyNode<KeyOf<T>>
```

## Parameters

**`name` `string`**

**`type` `T extends ShaderType`**

## Return value

`ReadonlyNode<KeyOf<T>>`

## Description

A parameter is read-only, so `.assign()` on one is a `tsc` error.

## In the guide

- [The CPU oracle](https://typeshade.dev/guide/internals/the-cpu-oracle/)

## See also

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

## Source

[`src/core/ir/node.ts`, line 915](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/ir/node.ts#L915), at commit af54ddad5
