How to provide a stub implementation of JDK classes (like java.awt) in a Scala.js project?
问题 Here is my attempt to provide a dummy implementation of a part of java.awt related to Graphics2D : package java package object awt { object RenderingHints { type Key = Int val KEY_TEXT_ANTIALIASING = 0 val VALUE_TEXT_ANTIALIAS_ON = 0 } object Color { val GREEN = 0 } type Color = Int object image { object BufferedImage { val TYPE_INT_RGB = 0 } class BufferedImage(w: Int, h: Int, tpe: Int) { def createGraphics: Graphics2D = new Graphics2D } } class Graphics2D { def setColor(c: Color): Unit = ()