1.0.1 • Published 7 years ago

@pincette/function-types v1.0.1

Weekly downloads
1
License
BSD-3-Clause
Repository
-
Last release
7 years ago

Java Style Function Types For TypeScript

This package declares the following:

export interface BiConsumer<T, U> {
    (p1: T, p2: U): void;
}

export interface BiFunction<T, U, R> {
    (p1: T, p2: U): R;
}

export interface BiPredicate<T, U> {
    (p1: T, p2: U): boolean;
}

export interface Comparator<T> {
    (p1: T, p2: T): number;
}

export interface Consumer<T> {
    (p: T): void;
}

export interface Function<T, R> {
    (p: T): R;
}

export interface Runnable {
    (): void;
}

export interface Predicate<T> {
    (p: T): boolean;
}

export interface Supplier<T> {
    (): T;
}

export interface TriConsumer<T, U, V> {
    (p1: T, p2: U, p3: V): void;
}

Install

npm i --save @pincette/function-types