Skip to content

Types Reference ​

All types below are exported from the root @datastripes/forecast entry (and re-exported by every framework entry point: /react, /vue, /angular, and /elements).

DatastripesProps ​

The top-level props accepted by the React/Vue/Angular/Element wrappers.

ts
interface DatastripesProps {
  data: Array<Record<string, any>> | string;   // records, CSV text, or JSON array
  view?: ForecastViewPresentation;              // 'composite' | 'chart' | 'table' | 'kpi' | 'model_details'
  apiKey?: string;                              // licensing server API key
  apiUrl?: string;                              // licensing server base URL
  targetHost?: string;                          // override domain used for license checks
  algorithm?: ForecastAlgorithm;
  horizon?: number;
  columnMapping?: ColumnMappingOverride;
  hyperparameters?: ModelHyperparameters;
  confidenceLevel?: 80 | 90 | 95;
  theme?: 'dark' | 'light';
  height?: number | string;
  className?: string;
  customOptions?: DatastripesCustomOptions;
  onForecastComplete?: (result: ForecastOutput) => void;
  onLicenseChecked?: (status: LicenseValidationResult) => void;
  onError?: (err: Error) => void;
}

ForecastAlgorithm ​

ts
type ForecastAlgorithm =
  | 'ols' | 'polynomial' | 'ridge' | 'lasso'
  | 'holt_winters_add' | 'holt_winters_mul'
  | 'arima' | 'prophet_lite' | 'ensemble';

ForecastOutput ​

The result of executeForecast:

ts
interface ForecastOutput {
  algorithm: ForecastAlgorithm;
  points: ForecastDataPoint[];
  historicalCount: number;
  truncatedCount: number;
  forecastHorizon: number;
  metrics: ForecastMetrics;
  hyperparameters: ModelHyperparameters;
  featureImportance: FeatureImportanceItem[];
  modelComparison: MultiModelComparisonItem[];
  licenseStatus: LicenseValidationResult;
  columnMapping: {
    timeKey: string;
    targetKey: string;
    exogenousKeys: string[];
    detectedTypes?: Record<string, 'datetime' | 'numeric' | 'categorical' | 'text'>;
  };
}

LicenseValidationResult ​

Returned by checkLicense (see Licensing):

ts
interface LicenseValidationResult {
  isValid: boolean;
  licenseKey: string;
  domain: string;
  isHostMatch: boolean;
  isExpired: boolean;
  expiresAt: string | null;
  plan: 'trial' | 'pro' | 'enterprise';
  customerName?: string;
  maxHistoricalRows: number;
  canExport: boolean;
  showWatermark: boolean;
  tamperDetected: boolean;
  hashDigest: string;
  issuedAt?: string;
}

Other notable types ​

ColumnDiscoveryResult, ColumnMappingOverride, ModelHyperparameters, FeatureImportanceItem, ForecastMetrics, ForecastDataPoint, MultiModelComparisonItem, ChartStyleOptions, KpiCardsOptions, HeaderToolbarOptions, DiagnosticTabsOptions, ExportOptions, DatastripesCustomOptions, all defined in packages/forecast/src/types.ts and exported unchanged from @datastripes/forecast.