import { Task , UnknownError } from '@ts-task/task' ; Task . resolve ( 8 ) ; Task . reject ( 'Buu' ) ; const r1 = new Task ( ( resolve , reject ) => { resolve ( 1 ) ; } ) ; r1 ; const r2 = new Task < number , string > ( ( resolve , reject ) => { resolve ( 1 ) ; } ) ; r2 ; const t1 = Task . resolve ( 9 ) . map ( x => x + 1 ) ; t1 ; const t2 = Task . resolve ( 9 ) . map ( x => x + 1 ) . chain ( x => x % 2 ? Task . reject ( 'I dont like pair numbers' ) : Task . resolve ( x ) ) ; t2 ; const t3 = Task . resolve < number , Error | string | UnknownError > ( 9 ) . catch ( err => typeof err === 'string' ? Task . resolve ( - 1 ) : Task . reject ( err ) ) ; t3 ; Task . resolve ( 1 ) . fork ( err => void 0 , val => void 0 ) ;