---
meta:
 - name: keywords
   description: api typescript node.js documentation Infer type
---
# Infer - @tsed/schema

## Usage

```typescript
import { Infer } from "@tsed/specs/schema/src/domain/types";
```

> See [/packages/specs/schema/src/domain/types.ts](https://github.com/tsedio/tsed/blob/v8.26.2/packages/specs/schema/src/domain/types.ts#L0-L0).

## Overview

```ts
type Infer<S> = S extends JsonSchema<infer T> ? T : never;
```

<!-- Description -->

## Description

Extracts the inferred TypeScript type from a JsonSchema.

This utility type enables type-safe schema usage by extracting the type parameter
from JsonSchema instances.

### Usage

```typescript
const userSchema = JsonSchema.from({ type: "object" });
type User = Infer<typeof userSchema>; // Extracts the type
```
