[F] createTypeSpecLibrary
function createTypeSpecLibrary<T, E, State>(lib): TypeSpecLibrary<T, E, State>;Create a new TypeSpec library definition.
Type Parameters
| Type Parameter | Default type | 
|---|---|
| Textendsobject | - | 
| EextendsRecord<string,any> | - | 
| Stateextendsstring | never | 
Parameters
| Parameter | Type | Description | 
|---|---|---|
| lib | Readonly<TypeSpecLibraryDef<T,E,State>> | Library definition. | 
Returns
TypeSpecLibrary<T, E, State>
Library with utility functions.
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);