Skip to content

[F] createCadlLibrary

function createCadlLibrary<T, E, State>(lib): TypeSpecLibrary<T, E, State>

Type Parameters

Type ParameterDefault type
T extends object-
E extends Record<string, any>-
State extends stringnever

Parameters

ParameterTypeDescription
libReadonly<TypeSpecLibraryDef<T, E, State>>Library definition.

Returns

TypeSpecLibrary<T, E, State>

Library with utility functions.

Deprecated

use createTypeSpecLibrary

Tutorial

Create the lib object with as const to get the full typing.

Example

const libDef = {
name: "myLib",
diagnostics: {
"my-code": {serverity: "error", messages: {default: "Foo bar"}}
},
} as const;
const lib = createTypeSpecLibrary(libDef);