constructor(sizeFunc, drawingFunc) {
        /** @type {!function(key: *) : !{width: !int, height: !int}} */
        this.sizeFunc = sizeFunc;
        /**
         * @type {!(function(!Painter): void) | !(function(!Painter, !string): void)}
         * @private
         */
        this._drawingFunc = drawingFunc;
        /**
         * @type {!Map.<!string, !HTMLCanvasElement>}
         * @private
         */
        this._cachedCanvases = new Map();
    }
@param {!function(key: *) : !{width: !int, height: !int}} sizeFunc
@param {!function(painter: !Painter | !(function(!Painter, !string): void)) : void} drawingFunc