General Structure
TypeTools library is designed to help programmers add useful runtime features for class instances and data models.
import { defineOn } from 'ts-basis';
class TargetClass {
constructor(init?: Partial<TargetClass>) {
defineOn( this, TargetClass, lib => {
lib.extension1.featureA( /* define */ )
...
lib.extension2.featureX( /* define */ )
}
Feature Extensions
Validatable
(Runtime data model validation)Ephemerals
(Non-serializable properties)Derivables
(Derived properties)
Base Classes
TypeToolsBase
(Base interface for all extensions)DataImportable
(Instance initialization from object initializers)PropertiesController
(Controller class for getters & setters)
Util Classes
ClassLineage
(Inheritance utils)