Chore: Improve typings 🧹 (#74599)

* various type fixes

* candlestick panel type fixes

* few more fixes

* some fixes

* more :)

* moar!

* undo change to SilencesFilter

* undo change to configureStore
This commit is contained in:
Ashley Harrison
2023-09-13 09:17:07 +01:00
committed by GitHub
parent 5753024ad5
commit 0c44a6f9bb
62 changed files with 335 additions and 566 deletions
@@ -9,6 +9,6 @@ import { Vector } from '../types';
export class AsNumberVector extends Array<number> {
constructor(field: Vector) {
super();
return field.map((v) => +v) as AsNumberVector;
return field.map((v) => +v);
}
}
@@ -13,6 +13,6 @@ export class BinaryOperationVector extends Array<number> {
for (let i = 0; i < arr.length; i++) {
arr[i] = operation(left[i], right[i]);
}
return arr as BinaryOperationVector;
return arr;
}
}
@@ -5,6 +5,6 @@
export class ConstantVector<T = any> extends Array<T> {
constructor(value: T, len: number) {
super();
return new Array<T>(len).fill(value) as ConstantVector<T>;
return new Array<T>(len).fill(value);
}
}
@@ -9,6 +9,6 @@ import { formattedValueToString } from '../valueFormats';
export class FormattedVector<T = any> extends Array<string> {
constructor(source: Vector<T>, formatter: DisplayProcessor) {
super();
return source.map((v) => formattedValueToString(formatter(v))) as FormattedVector<T>;
return source.map((v) => formattedValueToString(formatter(v)));
}
}
@@ -14,7 +14,7 @@ export class IndexVector extends Array<number> {
for (let i = 0; i < len; i++) {
arr[i] = i;
}
return arr as IndexVector;
return arr;
}
/**