---
jsApi: true
title: "[F] createCadlLibrary"

---
```ts
createCadlLibrary<T, E>(lib): TypeSpecLibrary<T, E>
```

## Type parameters

| Parameter |
| :------ |
| `T` extends `object` |
| `E` extends `Record`<`string`, `any`\> |

## Parameters

| Parameter | Type |
| :------ | :------ |
| `lib` | `Readonly`<[`TypeSpecLibraryDef`](../interfaces/TypeSpecLibraryDef.md)<`T`, `E`\>\> |

## Returns

[`TypeSpecLibrary`](../interfaces/TypeSpecLibrary.md)<`T`, `E`\>

## Deprecated

use createTypeSpecLibrary
