diff --git a/packages/line/index.d.ts b/packages/line/index.d.ts index c7eeec053..c1d0f89a9 100644 --- a/packages/line/index.d.ts +++ b/packages/line/index.d.ts @@ -43,12 +43,12 @@ export interface ComputedDatum { export interface Serie { id: string | number - data: Datum[] + data: readonly Datum[] [key: string]: any } export interface ComputedSerie { id: string | number - data: ComputedDatum[] + data: readonly ComputedDatum[] color?: string [key: string]: any } @@ -69,8 +69,8 @@ export interface CustomLayerProps extends Omit - points: Point[] - series: ComputedSerie[] + points: readonly Point[] + series: readonly ComputedSerie[] xScale: Scale yScale: Scale } @@ -116,7 +116,7 @@ export interface SliceTooltipProps { x: number y0: number y: number - points: Point[] + points: readonly Point[] } } export type SliceTooltip = React.FunctionComponent @@ -130,14 +130,14 @@ export interface PointSymbolProps { } export interface LineProps { - data: Serie[] + data: readonly Serie[] xScale?: ScaleSpec xFormat?: ValueFormat yScale?: ScaleSpec yFormat?: ValueFormat - layers?: Layer[] + layers?: readonly Layer[] margin?: Box @@ -179,7 +179,7 @@ export interface LineProps { areaOpacity?: number areaBaselineValue?: DatumValue - markers?: CartesianMarkerProps[] + markers?: readonly CartesianMarkerProps[] isInteractive?: boolean onMouseEnter?: PointMouseHandler @@ -203,7 +203,7 @@ export interface LineProps { crosshairType?: CrosshairType enableTouchCrosshair?: boolean - legends?: LegendProps[] + legends?: readonly LegendProps[] } export interface LineSvgProps extends LineProps, MotionProps, SvgDefsAndFill { @@ -227,7 +227,7 @@ export type CanvasLayer = LineLayerType | CustomCanvasLayer export interface LineCanvasProps extends Omit { pixelRatio?: number - layers?: CanvasLayer[] + layers?: readonly CanvasLayer[] } export class LineCanvas extends React.Component {}