This code snippet is dealing with the 'legend' function:
legend = (value) => {
return typeof value === 'boolean' ?
{
'options.legend.display': value
} :
{
'options.legend.display' : true,
'options.legend.position': value
};
};
}
Issue in the any.d.ts file:
legend: (value: any) => {
'options.legend.display': boolean;
options.legned.display?: undefined;
options.legend.position?: undefined;
} | {
'options.legned.display': boolean;
'options.legend.position': any;
options.legend.display?: undefined;
};
It seems there was an error in the *.d.ts files.
Why doesn't the compiler use quotes? Am I using the wrong syntax?
The following codes seem to work fine:
Modified version of any.d.ts:
legend: (value: any) => {
'options.legend.display': boolean;
'options.legned.display'?: undefined;
'options.legend.position'?: undefined;
} | {
'options.legned.display': boolean;
'options.legend.position': any;
'options.legend.display'?: undefined;
};