"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Holder_1 = require("../../../Class/Holder");
const OffscreenCanvas_1 = require("../../../wrap/OffscreenCanvas");
const _ids_1 = require("../../_ids");
class OffscreenCanvas_ extends Holder_1.Holder {
    constructor(system) {
        super({
            fi: ['width', 'height', 'opt'],
            fo: ['canvas'],
            i: [],
            o: [],
        }, {
            output: {
                canvas: {
                    ref: true,
                },
            },
        }, system, _ids_1.ID_OFFSCREEN_CANVAS);
        this.__ = ['U', 'CA'];
    }
    f({ width, height, opt }, done) {
        this._offscreen = new OffscreenCanvas(width, height);
        this._offscreen_ctx = this._offscreen.getContext('2d', opt);
        const canvas = (0, OffscreenCanvas_1.wrapOffscreenCanvas)(this._offscreen, this._offscreen_ctx, this.__system);
        done({ canvas });
    }
}
exports.default = OffscreenCanvas_;
//# sourceMappingURL=index.js.map