Chore: some any fixes (#113290)
* fix some anys in select styles * remove anys from ModalsContext * improve some types * improve ArrayDataFrame * restore behavior * use unknown for Parser type
This commit is contained in:
@@ -8,14 +8,14 @@ import { guessFieldTypeForField } from './processDataFrame';
|
||||
*
|
||||
* @deprecated use arrayToDataFrame
|
||||
*/
|
||||
export class ArrayDataFrame<T = any> implements DataFrame {
|
||||
export class ArrayDataFrame implements DataFrame {
|
||||
fields: Field[] = [];
|
||||
length = 0;
|
||||
name?: string;
|
||||
refId?: string;
|
||||
meta?: QueryResultMeta;
|
||||
|
||||
constructor(source: T[], names?: string[]) {
|
||||
constructor(source: unknown[], names?: string[]) {
|
||||
return arrayToDataFrame(source, names); // returns a standard DataFrame
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,7 @@ export class ArrayDataFrame<T = any> implements DataFrame {
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export function arrayToDataFrame(source: Array<Record<string, unknown>> | unknown[], names?: string[]): DataFrame {
|
||||
export function arrayToDataFrame(source: unknown[], names?: string[]): DataFrame {
|
||||
const df: DataFrame = {
|
||||
fields: [],
|
||||
length: source.length,
|
||||
|
||||
Reference in New Issue
Block a user