"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.agGridDataTypeDefinitions = exports.ALL_ADAPTABLE_DATA_TYPES = exports.OBJECT_ARRAY_DATA_TYPE = exports.TUPLE_ARRAY_DATA_TYPE = exports.NUMBER_ARRAY_DATA_TYPE = exports.TEXT_ARRAY_DATA_TYPE = void 0;
exports.TEXT_ARRAY_DATA_TYPE = 'textArray';
exports.NUMBER_ARRAY_DATA_TYPE = 'numberArray';
exports.TUPLE_ARRAY_DATA_TYPE = 'tupleArray';
exports.OBJECT_ARRAY_DATA_TYPE = 'objectArray';
exports.ALL_ADAPTABLE_DATA_TYPES = [
    'text',
    'number',
    'boolean',
    'date',
    'dateString',
    'object',
    exports.TEXT_ARRAY_DATA_TYPE,
    exports.NUMBER_ARRAY_DATA_TYPE,
    exports.TUPLE_ARRAY_DATA_TYPE,
    exports.OBJECT_ARRAY_DATA_TYPE,
    'unknown',
];
// #agGridDataTypeDefinitions
exports.agGridDataTypeDefinitions = {
    // AG Grid default types
    number: {
        baseDataType: 'number',
        extendsDataType: 'number',
        // suppress AG Grid editor, we provide our own
        suppressDefaultProperties: true,
    },
    date: {
        baseDataType: 'date',
        extendsDataType: 'date',
        valueParser: null,
        valueFormatter: null,
        suppressDefaultProperties: true,
    },
    dateString: {
        baseDataType: 'dateString',
        extendsDataType: 'dateString',
        valueParser: null,
        valueFormatter: null,
        suppressDefaultProperties: true,
    },
    // text: is kept as is
    // boolean: is kept as is
    // object: is kept as is
    // Adaptable specific types
    [exports.TEXT_ARRAY_DATA_TYPE]: {
        baseDataType: 'text',
        extendsDataType: 'text',
        dataTypeMatcher: (value) => {
            return Array.isArray(value) && value.every((v) => typeof v === 'string');
        },
    },
    [exports.NUMBER_ARRAY_DATA_TYPE]: {
        baseDataType: 'number',
        extendsDataType: 'number',
        dataTypeMatcher: (value) => {
            return Array.isArray(value) && value.every((v) => typeof v === 'number');
        },
    },
    [exports.TUPLE_ARRAY_DATA_TYPE]: {
        baseDataType: 'object',
        extendsDataType: 'object',
        dataTypeMatcher: (value) => {
            return Array.isArray(value) && value.every((v) => Array.isArray(v));
        },
    },
    [exports.OBJECT_ARRAY_DATA_TYPE]: {
        baseDataType: 'object',
        extendsDataType: 'object',
        dataTypeMatcher: (value) => {
            return (Array.isArray(value) &&
                value.every((v) => typeof v === 'object' && !Array.isArray(v) && Object.keys(v).length >= 2));
        },
    },
};
