Skip to content

Instantly share code, notes, and snippets.

View ejwessel's full-sized avatar
🖲️
Prismatic Core Online

Ethan Wessel ejwessel

🖲️
Prismatic Core Online
View GitHub Profile
@ejwessel
ejwessel / mixin.ts
Created April 18, 2025 21:12
Typescript Mixin
/* eslint-disable @typescript-eslint/no-non-null-assertion */
/**
* Type representing either an abstract or concrete class constructor.
* This allows the Mix function to accept both regular classes and abstract classes as input.
* The constructor can take any number of arguments (represented by ...args: any[])
* and returns an instance of type T.
*/
export type AbstractOrConcreteConstructor<T = any> = abstract new (
...args: any[]