import { Helpers } from '../../helpers';
export class Path2D {
    constructor(instance) {
        let nativeInstance;
        if (!instance) {
            nativeInstance = new global.CanvasModule.Path2D();
            this._native = nativeInstance;
            return this;
        }
        if (typeof instance === 'string') {
            nativeInstance = new global.CanvasModule.Path2D(instance);
        }
        else if (instance instanceof Path2D) {
            nativeInstance = new global.CanvasModule.Path2D(instance.native);
        }
        this._native = nativeInstance;
    }
    get native() {
        return this._native;
    }
    addPath(path, transform) {
        if (transform) {
            this.native.addPath(path.native, transform.native);
        }
        else {
            this.native.addPath(path.native, null);
        }
    }
    arc(x, y, radius, startAngle, endAngle, anticlockwise = false) {
        this.native.arc(x, y, radius, startAngle, endAngle, anticlockwise ?? false);
    }
    arcTo(x1, y1, x2, y2, radius) {
        this.native.arcTo(x1, y1, x2, y2, radius);
    }
    bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y) {
        this.native.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);
    }
    closePath() {
        this.native.closePath();
    }
    ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise = false) {
        this.native.ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise ?? false);
    }
    lineTo(x, y) {
        this.native.lineTo(x, y);
    }
    moveTo(x, y) {
        this.native.moveTo(x, y);
    }
    quadraticCurveTo(cpx, cpy, x, y) {
        this.native.quadraticCurveTo(cpx, cpy, x, y);
    }
    rect(x, y, width, height) {
        this.native.rect(x, y, width, height);
    }
    roundRect(x, y, width, height, radii) {
        this.native.roundRect(x, y, width, height, radii);
    }
    trim(start, end) {
        this.native.trim(start, end);
    }
    __toSVG() {
        return this.native.__toSVG();
    }
}
(() => {
    Helpers.initialize();
})();
//# sourceMappingURL=index.js.map