/**
* Lark Block Framework - Main Export
* @module @hypelab/hype-dash/block
*/
export * from './types';
export * from './ChartBlockCreator';
export * from './validation';
export {
createChartBlockCreator,
createQuickChartConfig,
} from './ChartBlockCreator';
export type {
ChartBlockCreatorOptions,
} from './ChartBlockCreator';
// Re-export types with consistent naming (aliases for backward compatibility)
export type {
ChartType,
ChartType as BlockChartType,
ChartConfig,
ChartConfig as ChartBlockData,
DataSource,
DataSource as BitableDataSource,
ChartOptions,
CreatorConfig,
BlockSourceMeta,
BlockSourceMeta as SourceMeta,
TtApi,
TtApi as LarkTT,
RequestOptions,
LifecycleOptions,
LifecycleOptions as LoadCallbackData,
BlockInfo,
BlockMode,
HostEnvironment,
FilterCondition,
} from './types';
/**
* Block configuration (loaded dynamically)
*/
export const blockConfig = {
version: '1.0.0',
name: 'Chart Block',
supportedChartTypes: [
{ type: 'bar', label: 'Bar Chart', icon: 'π' },
{ type: 'line', label: 'Line Chart', icon: 'π' },
{ type: 'pie', label: 'Pie Chart', icon: 'π₯§' },
{ type: 'area', label: 'Area Chart', icon: 'π' },
{ type: 'scatter', label: 'Scatter Plot', icon: 'β«' },
{ type: 'funnel', label: 'Funnel Chart', icon: 'π»' },
{ type: 'radar', label: 'Radar Chart', icon: 'π―' },
],
settings: {
colors: ['#1890ff', '#36cfc9', '#73d13d', '#ffec3d', '#ff4d4f', '#722ed1', '#fa8c16'],
},
};
/**
* Helper to get chart type configuration
*/
export function getChartTypeConfig(chartType: string) {
return blockConfig.supportedChartTypes.find((type) => type.type === chartType);
}
/**
* Helper to get supported chart types
*/
export function getSupportedChartTypes() {
return blockConfig.supportedChartTypes.map((type) => ({
type: type.type,
label: type.label,
icon: type.icon,
}));
}
/**
* Helper to get default colors
*/
export function getDefaultColors(): string[] {
return blockConfig.settings.colors;
}
/**
* Version information
*/
export const BLOCK_VERSION = blockConfig.version;
export const BLOCK_NAME = blockConfig.name;