drizzle-cube
Version:
Drizzle ORM-first semantic layer with Cube.js compatibility. Type-safe analytics and dashboards with SQL injection protection.
30 lines (29 loc) • 765 B
TypeScript
import { CubeClient } from '../client/CubeClient';
export interface CubeMetaField {
name: string;
title: string;
shortTitle: string;
type: string;
}
export interface CubeMetaCube {
name: string;
title: string;
description?: string;
measures: CubeMetaField[];
dimensions: CubeMetaField[];
segments: CubeMetaField[];
}
export interface CubeMeta {
cubes: CubeMetaCube[];
}
export type FieldLabelMap = Record<string, string>;
interface UseCubeMetaResult {
meta: CubeMeta | null;
labelMap: FieldLabelMap;
loading: boolean;
error: string | null;
refetch: () => void;
getFieldLabel: (fieldName: string) => string;
}
export declare function useCubeMeta(cubeApi: CubeClient): UseCubeMetaResult;
export {};