Skip to content

Commit

Permalink
fix: allow all NumberArray in DataXY (#99)
Browse files Browse the repository at this point in the history
It's a generic enough type that we shouldn't restrict it too much.

Refs: mljs/spectra-processing#224
  • Loading branch information
targos authored Mar 12, 2024
1 parent 556ae97 commit 49557ee
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
7 changes: 6 additions & 1 deletion cheminfoTypes.test-d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { pino } from 'pino';
import { expectAssignable } from 'tsd';

import type { Logger } from '.';
import type { Logger, DataXY } from '.';

expectAssignable<Logger>(pino());

expectAssignable<DataXY>({
x: new Float32Array(),
y: new Float32Array(),
});
8 changes: 4 additions & 4 deletions src/core/DataXY.d.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { DoubleArray } from './DoubleArray';
import { NumberArray } from './NumberArray';

export interface DataXY<DataType extends DoubleArray = DoubleArray> {
export interface DataXY<DataType extends NumberArray = NumberArray> {
/**
* 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;
}

0 comments on commit 49557ee

Please sign in to comment.