import { IgxFinancialCalculationDataSource } from './igx-financial-calculation-data-source';
import { IgxFinancialCalculationSupportingCalculations } from './igx-financial-calculation-supporting-calculations';
import { List$1 } from "igniteui-angular-core";
import { String_$type } from "igniteui-angular-core";
/**
 * Parameterizes a financial calculation event.
*/
export class IgxFinancialEventArgs {
    constructor() {
    }
    get i() {
        return this._implementation;
    }
    onImplementationCreated() {
    }
    _provideImplementation(i) {
        this._implementation = i;
        this._implementation.externalObject = this;
        this.onImplementationCreated();
    }
    get basedOn() {
        let ret = null;
        if (this.i.basedOn) {
            ret = [];
            for (let i = 0; i < this.i.basedOn.count; i++) {
                ret.push(this.i.basedOn[i]);
            }
        }
        return ret;
    }
    set basedOn(v) {
        if (!v) {
            this.i.basedOn = null;
            return;
        }
        let list = new List$1(String_$type, 0);
        for (let i = 0; i < v.length; i++) {
            list.add(v[i]);
        }
        this.i.basedOn = list;
    }
    /**
 * The beginning position that should be calculated from.
*/
    get position() {
        return this.i.position;
    }
    set position(v) {
        this.i.position = +v;
    }
    /**
     * The number of positions that should be calculated from the start.
    */
    get count() {
        return this.i.count;
    }
    set count(v) {
        this.i.count = +v;
    }
    /**
     * The data to use for the calculation.
    */
    get dataSource() {
        if (this.i.dataSource == null) {
            return null;
        }
        if (!this.i.dataSource.externalObject) {
            let e = new IgxFinancialCalculationDataSource();
            e._implementation = this.i.dataSource;
            this.i.dataSource.externalObject = e;
        }
        return this.i.dataSource.externalObject;
    }
    set dataSource(v) {
        v == null ? this.i.dataSource = null : this.i.dataSource = v.i;
    }
    /**
     * The supporting calculations to use in the calculation.
    */
    get supportingCalculations() {
        if (this.i.supportingCalculations == null) {
            return null;
        }
        if (!this.i.supportingCalculations.externalObject) {
            let e = new IgxFinancialCalculationSupportingCalculations();
            e._implementation = this.i.supportingCalculations;
            this.i.supportingCalculations.externalObject = e;
        }
        return this.i.supportingCalculations.externalObject;
    }
    set supportingCalculations(v) {
        v == null ? this.i.supportingCalculations = null : this.i.supportingCalculations = v.i;
    }
}
