Skip to content

Commit a932c53

Browse files
authored
Merge pull request #2399 from daker/fix-ts-defs
docs(ts): fix typescript defs
2 parents df07e5f + 2366361 commit a932c53

File tree

23 files changed

+450
-245
lines changed

23 files changed

+450
-245
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
export declare enum VectorMode {
2+
MAGNITUDE = 0,
3+
COMPONENT = 1,
4+
RGBCOLORS = 2,
5+
}
6+
7+
export declare enum ScalarMappingTarget {
8+
LUMINANCE = 1,
9+
LUMINANCE_ALPHA = 2,
10+
RGB = 3,
11+
RGBA = 4,
12+
}
13+
14+
declare const _default: {
15+
VectorMode: typeof VectorMode;
16+
ScalarMappingTarget: typeof ScalarMappingTarget;
17+
};
18+
export default _default;

Sources/Common/Core/ScalarsToColors/index.d.ts

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,7 @@
1-
import { vtkObject } from "../../../interfaces" ;
2-
import { ColorMode } from "../../../Rendering/Core/Mapper";
3-
import { Range } from "../../../types" ;
4-
5-
export enum VectorMode {
6-
MAGNITUDE,
7-
COMPONENT,
8-
RGBCOLORS
9-
}
10-
11-
export enum ScalarMappingTarget {
12-
LUMINANCE,
13-
LUMINANCE_ALPHA,
14-
RGB,
15-
RGBA
16-
}
1+
import { vtkObject } from "../../../interfaces";
2+
import { ColorMode } from "../../../Rendering/Core/Mapper/Constants";
3+
import { Range } from "../../../types";
4+
import { ScalarMappingTarget, VectorMode } from "./Constants";
175

186
/**
197
*
@@ -370,5 +358,7 @@ export function newInstance(initialValues?: IScalarsToColorsInitialValues): vtkS
370358
export declare const vtkScalarsToColors: {
371359
newInstance: typeof newInstance;
372360
extend: typeof extend;
361+
VectorMode: typeof VectorMode;
362+
ScalarMappingTarget: typeof VectorMode;
373363
}
374364
export default vtkScalarsToColors;

Sources/Common/DataModel/Box/index.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { vtkObject } from "../../../interfaces" ;
2-
import { Bounds, Point } from "../../../types";
1+
import { vtkObject } from "../../../interfaces";
2+
import { Bounds, Vector3 } from "../../../types";
33

44

55
export interface IBoxInitialValues {
@@ -22,9 +22,9 @@ export interface vtkBox extends vtkObject {
2222

2323
/**
2424
*
25-
* @param {Point} x The point coordinate.
25+
* @param {Vector3} x The point coordinate.
2626
*/
27-
evaluateFunction(x: Point): number;
27+
evaluateFunction(x: Vector3): number;
2828

2929
/**
3030
*

Sources/Common/DataModel/ITKHelper/index.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import vtkPolyData from "../PolyData";
22
import vtkImageData from "../ImageData";
33

44
export interface IOptions {
5-
pointDataName: string;
6-
scalarArrayName: string;
7-
cellDataName: string;
5+
pointDataName?: string;
6+
scalarArrayName?: string;
7+
cellDataName?: string;
88
}
99

1010
/**

Sources/Common/DataModel/Line/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export function newInstance(initialValues?: ILineInitialValues): vtkLine;
7777
* t: tolerance of the distance
7878
* distance: quared distance between closest point and x
7979
* }
80-
*
80+
* ```
8181
* @static
8282
* @param {Vector3} x
8383
* @param {Vector3} p1
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export declare const POLYDATA_FIELDS : string[];
2+
3+
declare const _default: {
4+
POLYDATA_FIELDS: typeof POLYDATA_FIELDS;
5+
};
6+
export default _default;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export declare enum splineKind {
2+
CARDINAL_SPLINE = 'CARDINAL_SPLINE',
3+
KOCHANEK_SPLINE = 'KOCHANEK_SPLINE',
4+
}
5+
6+
declare const _default: {
7+
splineKind: typeof splineKind;
8+
};
9+
export default _default;

Sources/Common/DataModel/Spline3D/index.d.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
import { vtkObject } from "../../../interfaces" ;
2-
3-
export enum splineKind {
4-
CARDINAL_SPLINE,
5-
KOCHANEK_SPLINE,
6-
}
7-
1+
import { vtkObject } from "../../../interfaces";
2+
import { splineKind } from "./Constants";
83

94
export interface ISpline3DInitialValues {
105
close?: boolean;
@@ -52,7 +47,7 @@ export function newInstance(initialValues?: ISpline3DInitialValues): vtkSpline3D
5247
* at any given point inside the spline intervals.
5348
*/
5449
export declare const vtkSpline3D: {
55-
newInstance: typeof newInstance,
56-
extend: typeof extend
50+
newInstance: typeof newInstance;
51+
extend: typeof extend;
5752
};
5853
export default vtkSpline3D;

Sources/Filters/General/ImageCropFilter/index.d.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import { vtkAlgorithm, vtkObject } from "../../../interfaces";
22

3+
type CroppingPlanes = number[];
4+
35
/**
46
*
57
*/
6-
interface IImageCropFilterInitialValues {
7-
croppingPlanes?: any;
8+
export interface IImageCropFilterInitialValues {
9+
croppingPlanes?: CroppingPlanes;
810
}
911

1012
type vtkImageCropFilterBase = vtkObject & vtkAlgorithm;
@@ -15,18 +17,19 @@ export interface vtkImageCropFilter extends vtkImageCropFilterBase {
1517
* Get The cropping planes, in IJK space.
1618
* @default [0, 0, 0, 0, 0, 0].
1719
*/
18-
getCroppingPlanes(): number[];
20+
getCroppingPlanes(): CroppingPlanes;
1921

2022
/**
2123
* Get The cropping planes, in IJK space.
2224
* @default [0, 0, 0, 0, 0, 0].
2325
*/
24-
getCroppingPlanesByReference(): number[];
26+
getCroppingPlanesByReference(): CroppingPlanes;
2527

2628
/**
2729
*
2830
*/
2931
isResetAvailable(): boolean;
32+
3033
/**
3134
*
3235
*/
@@ -43,13 +46,13 @@ export interface vtkImageCropFilter extends vtkImageCropFilterBase {
4346
*
4447
* @param croppingPlanes
4548
*/
46-
setCroppingPlanes(croppingPlanes: number[]): boolean;
49+
setCroppingPlanes(croppingPlanes: CroppingPlanes): boolean;
4750

4851
/**
4952
*
5053
* @param croppingPlanes
5154
*/
52-
setCroppingPlanesFrom(croppingPlanes: number[]): boolean;
55+
setCroppingPlanesFrom(croppingPlanes: CroppingPlanes): boolean;
5356
}
5457

5558
/**
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export declare enum Corners {
2+
TOP_LEFT = 'TOP_LEFT',
3+
TOP_RIGHT = 'TOP_RIGHT',
4+
BOTTOM_LEFT = 'BOTTOM_LEFT',
5+
BOTTOM_RIGHT = 'BOTTOM_RIGHT',
6+
}
7+
8+
declare const _default: {
9+
Corners: typeof Corners;
10+
};
11+
export default _default;

0 commit comments

Comments
 (0)