import assertUnreachable from '../utils/assertUnreachable';
import { DimensionType, MetricType, } from './field';
export var CatalogType;
(function (CatalogType) {
    CatalogType["Table"] = "table";
    CatalogType["Field"] = "field";
})(CatalogType || (CatalogType = {}));
export var CatalogFilter;
(function (CatalogFilter) {
    CatalogFilter["Tables"] = "tables";
    CatalogFilter["Dimensions"] = "dimensions";
    CatalogFilter["Metrics"] = "metrics";
})(CatalogFilter || (CatalogFilter = {}));
export var CatalogCategoryFilterMode;
(function (CatalogCategoryFilterMode) {
    CatalogCategoryFilterMode["AND"] = "and";
    CatalogCategoryFilterMode["OR"] = "or";
})(CatalogCategoryFilterMode || (CatalogCategoryFilterMode = {}));
export const UNCATEGORIZED_TAG_UUID = '__uncategorized__';
export const UNASSIGNED_OWNER = '__unassigned__';
export const isEmojiIcon = (icon) => Boolean(icon && 'unicode' in icon);
export const isCustomIcon = (icon) => Boolean(icon && 'url' in icon);
export const getBasicType = (field) => {
    const { type } = field;
    switch (type) {
        case DimensionType.STRING:
        case MetricType.STRING:
            return 'string';
        case DimensionType.NUMBER:
        case MetricType.NUMBER:
        case MetricType.PERCENTILE:
        case MetricType.MEDIAN:
        case MetricType.AVERAGE:
        case MetricType.COUNT:
        case MetricType.COUNT_DISTINCT:
        case MetricType.SUM:
        case MetricType.SUM_DISTINCT:
        case MetricType.AVERAGE_DISTINCT:
        case MetricType.MIN:
        case MetricType.MAX:
        case MetricType.PERCENT_OF_PREVIOUS:
        case MetricType.PERCENT_OF_TOTAL:
        case MetricType.RUNNING_TOTAL:
            return 'number';
        case DimensionType.DATE:
        case MetricType.DATE:
            return 'date';
        case DimensionType.TIMESTAMP:
        case MetricType.TIMESTAMP:
            return 'timestamp';
        case DimensionType.BOOLEAN:
        case MetricType.BOOLEAN:
            return 'boolean';
        default:
            return assertUnreachable(type, `Invalid field type ${type}`);
    }
};
//# sourceMappingURL=catalog.js.map