import type { IChartApi, ISeriesApi, SeriesType } from 'lightweight-charts'; import { createContext, RefObject } from 'react'; export interface ChartContextValue { /** * The chart api object. */ chart?: IChartApi; /** * The chart container `
` element. */ containerRef: RefObject; } export const ChartContext = createContext({ containerRef: { current: null }, }); export const SeriesContext = createContext | undefined>( undefined, );