0.2.3 • Published 2 years ago

@jil/types v0.2.3

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

@jil/types

A basic TypeScript types library

Install

npm install --save-dev @jil/types

What's inside?

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:

export function MyMixin<T extends MixinTarget<Application>>(superClass: T) {
  return class extends superClass {
    // contribute new class members
  };
}