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