Skip to content

Commit

Permalink
[wip] update types for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
James Manners committed Dec 7, 2022
1 parent d55ab3b commit 09ca22f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
7 changes: 7 additions & 0 deletions packages/dicom-image-loader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@
"dicom-parser": "^1.8.9",
"pako": "^2.0.4"
},
"devDependencies": {
"@types/chai": "^4.3.4",
"@types/mocha": "^9.1.1",
"chai": "^4.3.4",
"mocha": "^9.1.1"

},
"contributors": [
{
"name": "Cornerstone.js Contributors",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ let nextTaskId = 0;

export interface CornerstoneWadoWebWorkerDecodeConfig {
initializeCodecsOnStartup: boolean;
strict: boolean;
strict?: boolean;
}

export interface CornerstoneWadoWebWorkerTaskOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect } from 'chai';
import calculateMinMax from './calculateMinMax';

describe('#calculateMinMax', () => {
let imageFrame = {};
let imageFrame: any = {};

beforeEach(() => {
imageFrame = {
Expand Down
5 changes: 4 additions & 1 deletion packages/dicom-image-loader/src/shared/getMinMax.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import { ByteArray } from 'dicom-parser';
* @param {Number[]} storedPixelData
* @return {{min: Number, max: Number}}
*/
function getMinMax(storedPixelData: ByteArray): { min: number; max: number } {
function getMinMax(storedPixelData: ByteArray | number[]): {
min: number;
max: number;
} {
// we always calculate the min max values since they are not always
// present in DICOM and we don't want to trust them anyway as cornerstone
// depends on us providing reliable values for these
Expand Down

0 comments on commit 09ca22f

Please sign in to comment.