'use strict' ; interface ICallbackFunc < T , R > { ( arg , cb ) : void ; } interface ICallbackFuncNoErr < T , R > { ( arg , cb ) : void ; } interface IPromiseFunc < T , R > { ( arg ) : Promise < R > ; } export function toPromiseFunc < T , R > ( target ) { return ( arg ) => { return new Promise < R > ( ( c , e ) => { target ( arg , ( err , data ) => { if ( err ) { e ( err ) ; } else { c ( data ) ; } } ) ; } ) ; } ; } export function toPromiseFuncNoErr < T , R > ( target ) { return ( arg ) => { return new Promise < R > ( ( c , e ) => { target ( arg , ( data ) => { c ( data ) ; } ) ; } ) ; } ; }