import { ShapefileRecord as ShapefileRecord_internal } from "./ShapefileRecord";
import { fromRect, toRect } from './componentUtil';
/**
 * Represents a record of data from a Shapefile (.shp and .dbf).
*/
var IgcShapefileRecord = /** @class */ /*@__PURE__*/ (function () {
    function IgcShapefileRecord() {
        this._implementation = this.createImplementation();
        this._implementation.externalObject = this;
        this.onImplementationCreated();
    }
    IgcShapefileRecord.prototype.createImplementation = function () {
        return new ShapefileRecord_internal();
    };
    Object.defineProperty(IgcShapefileRecord.prototype, "i", {
        get: function () {
            return this._implementation;
        },
        enumerable: true,
        configurable: true
    });
    IgcShapefileRecord.prototype.onImplementationCreated = function () {
    };
    IgcShapefileRecord.prototype._provideImplementation = function (i) {
        this._implementation = i;
        this._implementation.externalObject = this;
        this.onImplementationCreated();
    };
    Object.defineProperty(IgcShapefileRecord.prototype, "shapeType", {
        /**
         * Gets the shape type, as read from the header of the Shapefile.
        */
        get: function () {
            return this.i.shapeType;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcShapefileRecord.prototype, "fieldsNames", {
        /**
         * Gets an array of field names and values for this record
        */
        get: function () {
            return this.i.fieldsNames._inner;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcShapefileRecord.prototype, "fieldsTypes", {
        /**
         * Gets an arry of field types and values for this record
        */
        get: function () {
            return this.i.fieldsTypes._inner;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcShapefileRecord.prototype, "points", {
        /**
         * Gets an array of arrays of points for this record
        */
        get: function () {
            var ret = [];
            var list = this.i.points;
            for (var i = 0; i < list.count; i++) {
                var innerlist = list.item(i);
                ret.push(list.item(i)._inner);
            }
            return ret;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcShapefileRecord.prototype, "fieldValues", {
        get: function () {
            return this.i.fieldValues;
        },
        set: function (v) {
            this.i.fieldValues = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcShapefileRecord.prototype, "bounds", {
        /**
         * Gets the bounds for the shapes
        */
        get: function () {
            return fromRect(this.i.bounds);
        },
        set: function (v) {
            this.i.bounds = toRect(v);
        },
        enumerable: true,
        configurable: true
    });
    IgcShapefileRecord.prototype.findByName = function (name) {
        return null;
    };
    IgcShapefileRecord.prototype.getFieldValue = function (fieldName) {
        var iv = this.i.getFieldValue(fieldName);
        return (iv);
    };
    IgcShapefileRecord.prototype.setFieldValue = function (fieldName, value) {
        this.i.setFieldValue(fieldName, value);
    };
    return IgcShapefileRecord;
}());
export { IgcShapefileRecord };
