I have encountered a new type from a library:
export interface AllChartOptions {
series: ApexAxisChartSeries | ApexNonAxisChartSeries;
...
}
This is the definition of series
:
export declare type ApexAxisChartSeries = {
name?: string;
type?: string;
color?: string;
group?: string;
data: (number | null)[] | {
x: any;
y: any;
...
}[] | [number, number | null][] | [number, (number | null)[]][] | number[][];
}[];
export declare type ApexNonAxisChartSeries = number[];
It seems that when series
is of type ApexAxisChartSeries
, it contains the property data
. Therefore, I should be able to perform:
chart.series.map((singleSeries)=> {...})
Am I correct in assuming that I can access data
from singleSeries? Despite this, VS Code indicates that singleSeries is of type:
singleSeries: number | {
name?: string | undefined;
type?: string | undefined;
color?: string | undefined;
group?: string | undefined;
data: number[][] | (number | null)[] | {
x: any;
y: any;
fill?: ApexFill | undefined;
... 5 more ...;
columnWidthOffset?: number | undefined;
}[] | [...][] | [...][];
}
However, the only available options for interacting with singleSeries
are
toLocaleString, toString, valueOf
. Why is this happening? How can I actually access data
?