TypeScript implementation of DOM Future as per spec