Skip to content
@traits-ts

traits-ts

Traits for TypeScript Classes

traits-ts.org

Traits for TypeScript Classes

Traits TS is a project for providing a Traits mechanism for TypeScript. It consists of the core @traits-ts/core and the companion standard library @traits-ts/stdlib.

The base @traits-ts/core is a TypeScript library providing the bare traits (aka mixins) mechanism for extending classes with multiple base functionalities, although TypeScript/JavaScript technically do not allow multiple inheritance. For this, it internally leverages the regular class extends mechanism at the JavaScript level, so it is does not have to manipulate the run-time objects at all. At the TypeScript level, it is fully type-safe and correctly derives all properties of the traits a class is derived from.

The companion @traits-ts/stdlib provides a set of standard, reusable, generic, typed traits, based on @traits-ts/core. Currently, this standard library provides the particular traits Identifiable, Configurable, Bindable, Subscribable, Hookable, Disposable, Traceable, and Serializable.

This is Traits TS, the home of the project. Its two main parts can be found here:

Pinned Loading

  1. core core Public

    Traits for TypeScript Classes (Core)

    TypeScript 25

  2. stdlib stdlib Public

    Traits for TypeScript Classes (Standard Library)

    TypeScript 6

Repositories

Showing 4 of 4 repositories

People

This organization has no public members. You must be a member to see who’s a part of this organization.

Top languages

Loading…

Most used topics

Loading…