import { type InlineError } from './explore';
import { DimensionType, type CompiledDimension, type CompiledMetric, type Dimension, type Field, type FieldType, type Metric } from './field';
import type { KnexPaginatedData } from './knex-paginate';
import { type ChartSummary } from './savedCharts';
import { type TraceTaskBase } from './scheduler';
import { type TableBase } from './table';
import type { Tag } from './tags';
export declare enum CatalogType {
    Table = "table",
    Field = "field"
}
export declare enum CatalogFilter {
    Tables = "tables",
    Dimensions = "dimensions",
    Metrics = "metrics"
}
export type CatalogSelection = {
    group: string;
    table?: string;
    field?: string;
};
export declare enum CatalogCategoryFilterMode {
    AND = "and",
    OR = "or"
}
export type ApiCatalogSearch = {
    searchQuery?: string;
    type?: CatalogType;
    filter?: CatalogFilter;
    catalogTags?: string[];
    catalogTagsFilterMode?: CatalogCategoryFilterMode;
    tables?: string[];
    ownerUserUuids?: string[];
};
type EmojiIcon = {
    unicode: string;
};
type CustomIcon = {
    url: string;
};
export type CatalogItemIcon = EmojiIcon | CustomIcon;
export declare const UNCATEGORIZED_TAG_UUID = "__uncategorized__";
export declare const UNASSIGNED_OWNER = "__unassigned__";
export type CatalogOwner = {
    userUuid: string;
    firstName: string;
    lastName: string;
    email: string;
};
export declare const isEmojiIcon: (icon: CatalogItemIcon | null) => icon is EmojiIcon;
export declare const isCustomIcon: (icon: CatalogItemIcon | null) => icon is CustomIcon;
export type CatalogField = Pick<Field, 'name' | 'label' | 'fieldType' | 'tableLabel' | 'description'> & Pick<Dimension, 'requiredAttributes'> & {
    catalogSearchUuid: string;
    type: CatalogType.Field;
    basicType: 'string' | 'number' | 'date' | 'timestamp' | 'boolean';
    fieldValueType: Metric['type'] | Dimension['type'];
    tableName: string;
    tableGroupLabel?: string;
    tags?: string[];
    categories: Pick<Tag, 'name' | 'color' | 'tagUuid' | 'yamlReference'>[];
    chartUsage: number | undefined;
    icon: CatalogItemIcon | null;
    aiHints: string[] | null;
    searchRank?: number;
    spotlightFilterBy?: string[];
    spotlightSegmentBy?: string[];
    owner: CatalogOwner | null;
};
export type CatalogTable = Pick<TableBase, 'name' | 'label' | 'groupLabel' | 'description' | 'requiredAttributes'> & {
    catalogSearchUuid: string;
    errors?: InlineError[];
    type: CatalogType.Table;
    groupLabel?: string;
    tags?: string[];
    categories: Pick<Tag, 'name' | 'color' | 'tagUuid' | 'yamlReference'>[];
    chartUsage: number | undefined;
    icon: CatalogItemIcon | null;
    aiHints: string[] | null;
    joinedTables: string[] | null;
    searchRank?: number;
};
export type CatalogItem = CatalogField | CatalogTable;
export type CatalogMetricsTreeNode = Pick<CatalogField, 'catalogSearchUuid' | 'name' | 'tableName'>;
export type CatalogMetricsTreeEdge = {
    source: CatalogMetricsTreeNode;
    target: CatalogMetricsTreeNode;
    createdAt: Date;
    createdByUserUuid: string | null;
    projectUuid: string;
};
export type ApiCatalogResults = CatalogItem[];
export type ApiMetricsCatalogResults = CatalogField[];
export type ApiMetricsCatalog = {
    status: 'ok';
    results: KnexPaginatedData<ApiMetricsCatalogResults>;
};
export type MetricWithAssociatedTimeDimension = CompiledMetric & {
    timeDimension: (CompiledMetric['defaultTimeDimension'] & {
        table: string;
    }) | undefined;
    availableTimeDimensions?: (CompiledDimension & {
        type: DimensionType.DATE | DimensionType.TIMESTAMP;
    })[];
};
export type ApiGetMetricPeek = {
    status: 'ok';
    results: MetricWithAssociatedTimeDimension;
};
export type ApiGetMetricsTree = {
    status: 'ok';
    results: {
        edges: CatalogMetricsTreeEdge[];
    };
};
export type ApiMetricsTreeEdgePayload = {
    sourceCatalogSearchUuid: string;
    targetCatalogSearchUuid: string;
};
export type CatalogMetadata = {
    name: string;
    description: string | undefined;
    label: string;
    modelName: string;
    source: string | undefined;
    fields: CatalogField[];
    joinedTables: string[];
    tableLabel?: string;
    fieldType?: FieldType;
};
export type ApiCatalogMetadataResults = CatalogMetadata;
export type CatalogAnalytics = {
    charts: (Pick<ChartSummary, 'uuid' | 'name' | 'description' | 'spaceUuid' | 'spaceName' | 'dashboardName' | 'dashboardUuid' | 'chartKind'> & {
        viewsCount?: number;
    })[];
};
export type ApiCatalogAnalyticsResults = CatalogAnalytics;
export declare const getBasicType: (field: CompiledDimension | CompiledMetric) => "string" | "number" | "boolean" | "date" | "timestamp";
export type CatalogFieldMap = {
    [fieldId: string]: {
        fieldName: string;
        tableName: string;
        cachedExploreUuid: string;
        fieldType: FieldType;
    };
};
export type CatalogItemSummary = Pick<CatalogItem, 'catalogSearchUuid' | 'name' | 'type'> & {
    projectUuid: string;
    cachedExploreUuid: string;
    tableName: string;
    fieldType: string | undefined;
};
export type CatalogItemWithTagUuids = CatalogItemSummary & {
    catalogTags: {
        tagUuid: string;
        createdByUserUuid: string | null;
        createdAt: Date;
        taggedViaYaml: boolean;
    }[];
};
export type CatalogItemsWithIcons = CatalogItemSummary & Pick<CatalogItem, 'icon'>;
export type SchedulerIndexCatalogJobPayload = TraceTaskBase & {
    prevCatalogItemsWithTags: CatalogItemWithTagUuids[];
    prevCatalogItemsWithIcons: CatalogItemsWithIcons[];
    prevMetricTreeEdges: CatalogMetricsTreeEdge[];
};
export type ChartFieldUpdates = {
    oldChartFields: {
        metrics: string[];
        dimensions: string[];
    };
    newChartFields: {
        metrics: string[];
        dimensions: string[];
    };
};
export type ChartFieldChanges = {
    added: {
        dimensions: string[];
        metrics: string[];
    };
    removed: {
        dimensions: string[];
        metrics: string[];
    };
};
export type CatalogFieldWhere = {
    fieldName: string;
    fieldType: FieldType;
    cachedExploreUuid: string;
};
export type ChartFieldUsageChanges = {
    fieldsToIncrement: CatalogFieldWhere[];
    fieldsToDecrement: CatalogFieldWhere[];
};
export type ChartUsageIn = CatalogFieldWhere & {
    chartUsage: number;
};
export type ApiMetricsWithAssociatedTimeDimensionResponse = {
    status: 'ok';
    results: MetricWithAssociatedTimeDimension[];
};
export type ApiSegmentDimensionsResponse = {
    status: 'ok';
    results: CompiledDimension[];
};
export type ApiFilterDimensionsResponse = {
    status: 'ok';
    results: CompiledDimension[];
};
export {};
//# sourceMappingURL=catalog.d.ts.map