From 49557ee1b7dc64eef0ac2f0ebd8a0266e4a3757e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Tue, 12 Mar 2024 10:50:50 +0100 Subject: [PATCH] fix: allow all NumberArray in DataXY (#99) It's a generic enough type that we shouldn't restrict it too much. Refs: https://github.com/mljs/spectra-processing/pull/224 --- cheminfoTypes.test-d.ts | 7 ++++++- src/core/DataXY.d.ts | 8 ++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/cheminfoTypes.test-d.ts b/cheminfoTypes.test-d.ts index e3c4968..e80f641 100644 --- a/cheminfoTypes.test-d.ts +++ b/cheminfoTypes.test-d.ts @@ -1,6 +1,11 @@ import { pino } from 'pino'; import { expectAssignable } from 'tsd'; -import type { Logger } from '.'; +import type { Logger, DataXY } from '.'; expectAssignable(pino()); + +expectAssignable({ + x: new Float32Array(), + y: new Float32Array(), +}); diff --git a/src/core/DataXY.d.ts b/src/core/DataXY.d.ts index 171f67c..0d39452 100644 --- a/src/core/DataXY.d.ts +++ b/src/core/DataXY.d.ts @@ -1,12 +1,12 @@ -import { DoubleArray } from './DoubleArray'; +import { NumberArray } from './NumberArray'; -export interface DataXY { +export interface DataXY { /** - * Array of numbers on x axis + * Array of numbers on x-axis */ x: DataType; /** - * Array of numbers on y axis + * Array of numbers on y-axis */ y: DataType; }