import { ShapefileConverter as ShapefileConverter_internal } from "./ShapefileConverter";
import { fromRect, toRect } from "./componentUtil";
/**
 * Class used to convert Shapefiles into CLR objects.
*/
export class ShapeDataSource {
    constructor() {
        this._implementation = this.createImplementation();
        this._implementation.externalObject = this;
        this.onImplementationCreated();
    }
    createImplementation() {
        return new ShapefileConverter_internal();
    }
    /**
     * @hidden
     */
    get i() {
        return this._implementation;
    }
    onImplementationCreated() {
    }
    _provideImplementation(i) {
        this._implementation = i;
        this._implementation.externalObject = this;
        this.onImplementationCreated();
    }
    /**
     * Gets the world bounding rectangle, as read from the header of the Shapefile.
    */
    get worldRect() {
        return fromRect(this.i.worldRect);
    }
    set worldRect(v) {
        this.i.worldRect = toRect(v);
    }
    /**
     * Gets the shape type, as read from the header of the Shapefile.
    */
    get shapeType() {
        return this.i.shapeType;
    }
    /**
     * Gets the header of the Shapefile.
    */
    get shapeHeader() {
        return this.i.shapeHeader;
    }
    set shapeHeader(v) {
        this.i.shapeHeader = v;
    }
}
