export default class Canvas2d implements CanvasRenderingContext2D { private img : ImageObject ; constructor ( ) { } public drawImage ( image , sx , sy , sw , sh , dx , dy , dw , dh ) { this . img = < ImageObject > < any > image ; } public getImageData ( sx , sy , sw , sh ) { const data = new Uint8Array ( this . img . width * this . img . height * 4 ) ; return { data : < ImageData > < any > data } ; } }