import { UnknownError } from '.' ; import { catchError , chain , map } from '../operators' ; import { IMapFn , ITaskChainFn , Task } from './task' ; declare module './task' { interface Task < T , E > { map < TResult > ( fn ) : Task < TResult , E | UnknownError > ; chain < TResult , EResult > ( fn ) : Task < TResult , E | EResult | UnknownError > ; catch < TResult , EResult > ( fn ) : Task < T | TResult , EResult | UnknownError > ; } } Task . prototype . map = function < T , TResult > ( fn ) { return map ( fn ) ( this ) ; } ; Task . prototype . chain = function < T , TResult , EResult > ( fn ) { return chain < T , TResult , EResult > ( fn ) ( this ) ; } ; Task . prototype . catch = function < E , TResult , EResult > ( fn ) { return catchError < TResult , E , EResult > ( fn ) ( this ) ; } ;