drizzle-cube
Version:
Drizzle ORM-first semantic layer with Cube.js compatibility. Type-safe analytics and dashboards with SQL injection protection.
36 lines (35 loc) • 1.44 kB
TypeScript
import { default as React } from 'react';
import { CubeClient } from '../client/CubeClient';
import { CubeQueryOptions, CubeApiOptions, FeaturesConfig } from '../types';
import { CubeMeta, FieldLabelMap } from '../hooks/useCubeMeta';
import { BatchCoordinator } from '../client/BatchCoordinator';
interface CubeContextValue {
cubeApi: CubeClient;
options?: CubeQueryOptions;
meta: CubeMeta | null;
labelMap: FieldLabelMap;
metaLoading: boolean;
metaError: string | null;
getFieldLabel: (fieldName: string) => string;
refetchMeta: () => void;
updateApiConfig: (apiOptions: CubeApiOptions, token?: string) => void;
features: FeaturesConfig;
batchCoordinator: BatchCoordinator | null;
enableBatching: boolean;
}
interface CubeProviderProps {
cubeApi?: CubeClient;
apiOptions?: CubeApiOptions;
token?: string;
options?: CubeQueryOptions;
features?: FeaturesConfig;
enableBatching?: boolean;
batchDelayMs?: number;
children: React.ReactNode;
}
export declare function CubeProvider({ cubeApi: initialCubeApi, apiOptions: initialApiOptions, token: initialToken, options, features, // Default to AI enabled for backward compatibility
enableBatching, // Default to batching enabled
batchDelayMs, // Default 100ms batch window
children }: CubeProviderProps): import("react/jsx-runtime").JSX.Element;
export declare function useCubeContext(): CubeContextValue;
export {};