0.2.3 • Published 2 years ago
@jil/types v0.2.3
@jil/types
A basic TypeScript types library
Install
npm install --save-dev @jil/types
What's inside?
- Install
- Types
- All TypeScript types from ts-essential expect any functions(
assert
andnoop
functions moved into tily) - Constructor
- ValueOrPromise
- MixinTarget
- All TypeScript types from ts-essential expect any functions(
Constructor
A class constructor accepting arbitrary arguments.
signature
export declare type Constructor<T> = new (...args: any[]) => T;
ValueOrPromise
Representing a value or promise. This type is used to represent results of synchronous/asynchronous resolution of values.
signature
export type ValueOrPromise<T> = T | PromiseLike<T>;
MixinTarget
A replacement for typeof Target to be used in mixin class definitions. This is a workaround for TypeScript limitation described in:
- https://github.com/microsoft/TypeScript/issues/17293
- https://github.com/microsoft/TypeScript/issues/17744
- https://github.com/microsoft/TypeScript/issues/36060
export function MyMixin<T extends MixinTarget<Application>>(superClass: T) {
return class extends superClass {
// contribute new class members
};
}