import type Deferred from './Deferred.js' ; export type { Deferred } ; template T returns { Deferred . < T > } export default function createDeferred < T > ( ) { let reject ; let resolve ; return { promise : new Promise < T > ( ( _resolve , _reject ) => { reject = _reject ; resolve = _resolve ; } ) , reject , resolve } ; }