[Home](../../readme.md) | [Installation](../installation.md) | [Usage](../usage.md) | **Types** | [Values](../values/) | [Syntax](../syntax/) | [TypeRegistry](../type-registry.md) | [TypeCheck](../type-check.md) # Module Types Module types are containers for a set of referential types. Modules act as namespaces, enabling types to reference one another via string identifiers. Modules support both singular and mutually recursive references, as well as deferred dereferencing for computed types such as Partial. Types imported from a module are expressed using the Json Schema `$defs` keyword. ```typescript const Module = Type.Module({ PartialUser: Type.Partial(Type.Ref("User")), // TComputed<'Partial', [TRef<'User'>]> User: Type.Object({ // TObject<{ id: Type.String(), // user: TString, name: Type.String(), // name: TString, email: Type.String(), // email: TString }), // }> }); const User = Module.Import("User"); // const User: TImport<{...}, 'User'> type User = Static; // type User = { // id: string, // name: string, // email: string // } const PartialUser = Module.Import("PartialUser"); // const PartialUser: TImport<{...}, 'PartialUser'> type PartialUser = Static; // type PartialUser = { // id?: string, // name?: string, // email?: string // } ``` Back to [Home](../../readme.md)