WIP main worktree changes before merge
This commit is contained in:
91
lib/types.ts
91
lib/types.ts
@@ -498,11 +498,16 @@ export type NormalizationSummary = {
|
||||
};
|
||||
|
||||
export type NormalizationMetadata = {
|
||||
parserEngine: string;
|
||||
regime: 'us-gaap' | 'ifrs-full' | 'unknown';
|
||||
fiscalPack: string | null;
|
||||
parserVersion: string;
|
||||
surfaceRowCount: number;
|
||||
detailRowCount: number;
|
||||
kpiRowCount: number;
|
||||
unmappedRowCount: number;
|
||||
materialUnmappedRowCount: number;
|
||||
warnings: string[];
|
||||
};
|
||||
|
||||
export type RatioRow = DerivedFinancialRow & {
|
||||
@@ -741,6 +746,7 @@ export type CompanyAnalysis = {
|
||||
quote: number;
|
||||
position: Holding | null;
|
||||
priceHistory: Array<{ date: string; close: number }>;
|
||||
benchmarkHistory: Array<{ date: string; close: number }>;
|
||||
financials: CompanyFinancialPoint[];
|
||||
filings: Filing[];
|
||||
aiReports: CompanyAiReport[];
|
||||
@@ -788,3 +794,88 @@ export type ActiveContext = {
|
||||
pathname: string;
|
||||
activeTicker: string | null;
|
||||
};
|
||||
|
||||
// Chart Types
|
||||
export type ChartType = 'line' | 'combination';
|
||||
export type TimeRange = '1W' | '1M' | '3M' | '1Y' | '3Y' | '5Y' | '10Y' | '20Y';
|
||||
|
||||
// Chart Data Formats
|
||||
export type PriceDataPoint = {
|
||||
date: string;
|
||||
price: number;
|
||||
};
|
||||
|
||||
export type OHLCVDataPoint = {
|
||||
date: string;
|
||||
open: number;
|
||||
high: number;
|
||||
low: number;
|
||||
close: number;
|
||||
volume: number;
|
||||
};
|
||||
|
||||
export type ChartDataPoint = PriceDataPoint | OHLCVDataPoint;
|
||||
|
||||
export type DataSeries<T extends ChartDataPoint = ChartDataPoint> = {
|
||||
id: string;
|
||||
label: string;
|
||||
data: T[];
|
||||
color?: string;
|
||||
type?: 'line' | 'area' | 'bar';
|
||||
visible?: boolean;
|
||||
};
|
||||
|
||||
// Chart Configuration
|
||||
export type ChartZoomState = {
|
||||
startIndex: number;
|
||||
endIndex: number;
|
||||
isZoomed: boolean;
|
||||
};
|
||||
|
||||
export type ChartColorPalette = {
|
||||
primary: string;
|
||||
secondary: string;
|
||||
positive: string;
|
||||
negative: string;
|
||||
grid: string;
|
||||
text: string;
|
||||
muted: string;
|
||||
tooltipBg: string;
|
||||
tooltipBorder: string;
|
||||
volume: string;
|
||||
};
|
||||
|
||||
export type InteractivePriceChartProps = {
|
||||
// Data
|
||||
data: ChartDataPoint[];
|
||||
dataSeries?: DataSeries[];
|
||||
|
||||
// Configuration
|
||||
defaultChartType?: ChartType;
|
||||
defaultTimeRange?: TimeRange;
|
||||
showVolume?: boolean;
|
||||
showToolbar?: boolean;
|
||||
height?: number;
|
||||
|
||||
// Customization
|
||||
colors?: Partial<ChartColorPalette>;
|
||||
formatters?: {
|
||||
price?: (value: number) => string;
|
||||
date?: (value: string) => string;
|
||||
volume?: (value: number) => string;
|
||||
};
|
||||
|
||||
// Event handlers
|
||||
onChartTypeChange?: (type: ChartType) => void;
|
||||
onTimeRangeChange?: (range: TimeRange) => void;
|
||||
onDataPointHover?: (point: ChartDataPoint | null) => void;
|
||||
onZoomChange?: (state: ChartZoomState) => void;
|
||||
|
||||
// State
|
||||
loading?: boolean;
|
||||
error?: string | null;
|
||||
|
||||
// Accessibility
|
||||
ariaLabel?: string;
|
||||
description?: string;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user