tiny-types
Version:
A tiny library that brings Tiny Types to JavaScript and TypeScript
13 lines (12 loc) • 774 B
TypeScript
import { TinyType } from '../TinyType';
import { ConstructorAbstractOrInstance } from '../types';
import { PatternMatcher } from './PatternMatcher';
/**
* @access private
*/
export declare class ObjectMatcher<Input_Type, Output_Type> extends PatternMatcher<Input_Type, TinyType | ConstructorAbstractOrInstance<Input_Type>, TinyType | Input_Type, Output_Type> {
when<MT extends Input_Type>(pattern: ConstructorAbstractOrInstance<MT>, transformation: (v: MT) => Output_Type): ObjectMatcher<Input_Type, Output_Type>;
when(pattern: TinyType, transformation: (v: TinyType) => Output_Type): ObjectMatcher<Input_Type, Output_Type>;
when(pattern: Input_Type, transformation: (v: Input_Type) => Output_Type): ObjectMatcher<Input_Type, Output_Type>;
private rule;
}