import type { FieldObj, ColumnValue, RowItem, JSONArray, JSONCols, JSONRows } from './datasourceUtils';
export type Field = string | FieldObj;
/**
 * @class
 * DataSet represent a set of 2 dimensional data
 */
export default class DataSet {
    fields: FieldObj[];
    columns: ColumnValue[][];
    /**
     * @constructor
     * @param {Field[]} [fields= []] List of field name or field objects
     * @param {ColumnValue[][]} [columns=[]] List of column values related to fields
     * @returns DataSet
     */
    constructor(fields?: Field[], columns?: ColumnValue[][]);
    /**
     * Returns a empty Dataset
     *
     * Examples:
     * ```js
     * const empty = DataSet.empty();
     * ```
     * @returns {DataSet} DataSet
     * @public
     */
    static empty(): DataSet;
    /**
     * Construct a Dataset with data in json array format
     *
     * Examples:
     * ```js
     *  const dataset = DataSet.fromJSONArray(
     *     [{ name: 'x' }, { name: 'y' }, { name: 'z' }],
     *     [{ x: 'a', y: 4, z: 70 }, { x: 'b', y: 5, z: 80 }, { x: 'c', y: 6, z: 90 }]
     *  );
     * ```
     * @param {FieldObj[]} [fields=[]] List of objects containing field names
     * @param {RowItem[]} [results=[]] List of objects containing results for each field
     * @returns {DataSet}
     * @public
     */
    static fromJSONArray(fields?: FieldObj[] | null, results?: RowItem[]): DataSet;
    /**
     * Construct a Dataset with data in json columns format
     *
     * Examples:
     * ```js
     *  const dataset = DataSet.fromJSONCols(
     *     [{ name: 'x' }, { name: 'y' }, { name: 'z' }],
     *     [['a', 'b', 'c'], [4, 5, 6], [70, 80, 90]];
     *  );
     * ```
     * @param {Field[]} [fields=[]] List of fields
     * @param {ColumnValue[][]} [columns=[]] list of column values
     * @returns {DataSet}
     * @public
     */
    static fromJSONCols(fields?: Field[], columns?: ColumnValue[][]): DataSet;
    /**
     * Construct a Dataset with data in json rows format
     *
     * Examples:
     * ```js
     *  const dataset = DataSet.fromJSONRows(
     *     [{ name: 'x' }, { name: 'y' }, { name: 'z' }],
     *     [['a', 4, 70], ['b', 5, 80], ['c', 6, 90]];
     *  );
     * ```
     * @param {Field[]} [fields=[]] List of fields
     * @param {ColumnValue[][]} [columns=[]] list of column values
     * @returns {DataSet}
     * @public
     */
    static fromJSONRows(fields?: Field[], rows?: ColumnValue[][]): DataSet;
    /**
     * Convert data to json array
     * @return {JSONArray} data in json array format
     * @public
     */
    toJSONArray(): JSONArray;
    /**
     * Convert data to json columns
     * @return {JSONCols} data in json columns format
     * @public
     */
    toJSONCols(): JSONCols;
    /**
     * Convert data to json rows
     * @return {JSONRows} data in json rows format
     * @public
     */
    toJSONRows(): JSONRows;
    /**
     * List all fields
     * @return {FieldObj[]} fields array
     * @public
     */
    getFields(): FieldObj[];
    /**
     * List data columns
     * @return {Object} columns array
     * @public
     */
    getColumns(): ColumnValue[][];
    /**
     *
     * @param {String} fieldName
     * @return {ColumnValue[]} column data
     * @public
     */
    getColumnByField(fieldName: string): ColumnValue[];
    /**
     *
     * @param {String} fieldName
     * @return {Boolean}
     * @public
     */
    hasField(fieldName: string): boolean;
    /**
     * @return {Boolean} true if DataSet has no data
     * @public
     */
    isEmpty(): boolean;
    /**
     *
     * @param {DataSet} dataSet DataSet to compare
     * @return {Boolean} true if another dataset is equals to current one
     * @public
     */
    equals(dataSet: DataSet): boolean;
    /**
     * Returns a slice of the dataset, useful for pagination.
     * @param options {Object}
     * @param options.count {Number} number of rows
     * @param options.offset {Number} starting row index
     * @returns {DataSet}
     * @public
     */
    getPage({ count, offset }: {
        count?: number;
        offset?: number;
    }): DataSet;
    /**
     * Get total number of rows. Note this is not affected by the pagination.
     * @public
     */
    getTotalCount(): number;
}
