Skip to content

Commit 0a6222a

Browse files
committed
fix(types): improve various type definitions
1 parent 9bd65c6 commit 0a6222a

File tree

6 files changed

+26
-11
lines changed

6 files changed

+26
-11
lines changed

Sources/Interaction/Manipulators/MouseRangeManipulator/index.d.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1+
import { vtkObject } from '../../../interfaces';
12
import vtkCompositeMouseManipulator, {
23
ICompositeMouseManipulatorInitialValues,
34
} from '../../../Interaction/Manipulators/CompositeMouseManipulator';
45

56
export interface IMouseRangeManipulatorInitialValues
67
extends ICompositeMouseManipulatorInitialValues {}
78

8-
export interface vtkMouseRangeManipulator extends vtkCompositeMouseManipulator {
9+
export interface vtkMouseRangeManipulator
10+
extends vtkCompositeMouseManipulator,
11+
vtkObject {
912
setHorizontalListener(
1013
min: number,
1114
max: number,

Sources/Interaction/Widgets/OrientationMarkerWidget/Constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const Corners = {
1+
export const Corners = {
22
TOP_LEFT: 'TOP_LEFT',
33
TOP_RIGHT: 'TOP_RIGHT',
44
BOTTOM_LEFT: 'BOTTOM_LEFT',

Sources/Interaction/Widgets/OrientationMarkerWidget/index.d.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { vtkObject } from "../../../interfaces";
2-
import vtkAnnotatedCubeActor from "../../../Rendering/Core/AnnotatedCubeActor";
3-
import vtkAxesActor from "../../../Rendering/Core/AxesActor";
2+
import vtkActor from "../../../Rendering/Core/Actor";
43
import vtkRenderer from "../../../Rendering/Core/Renderer";
54
import vtkRenderWindowInteractor from "../../../Rendering/Core/RenderWindowInteractor";
65
import { Nullable } from "../../../types";
@@ -11,7 +10,7 @@ import { Corners } from "./Constants";
1110
*
1211
*/
1312
export interface IOrientationMarkerWidgetInitialValues {
14-
actor?: vtkAnnotatedCubeActor | vtkAxesActor,
13+
actor?: vtkActor,
1514
interactor?: vtkRenderWindowInteractor,
1615
parentRenderer?: vtkRenderer,
1716
viewportCorner?: Corners,
@@ -39,7 +38,7 @@ export interface vtkOrientationMarkerWidget extends vtkObject {
3938
/**
4039
*
4140
*/
42-
getActor(): vtkAnnotatedCubeActor | vtkAxesActor;
41+
getActor(): vtkActor;
4342

4443
/**
4544
* Gets the parent renderer, if any.
@@ -85,9 +84,9 @@ export interface vtkOrientationMarkerWidget extends vtkObject {
8584

8685
/**
8786
* Get the actor associated with the widget.
88-
* @param {vtkAnnotatedCubeActor | vtkAxesActor} actor The actor instance.
87+
* @param {vtkActor} actor The actor instance.
8988
*/
90-
setActor(actor: vtkAnnotatedCubeActor | vtkAxesActor): void;
89+
setActor(actor: vtkActor): void;
9190

9291
/**
9392
* Sets the parent renderer

Sources/Rendering/Core/RenderWindowInteractor/index.d.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,11 @@ export interface vtkRenderWindowInteractor extends vtkObject {
396396
*/
397397
invokeEndInteractionEvent(callData: IRenderWindowInteractorEvent): void;
398398

399+
/**
400+
*
401+
*/
402+
invokeRenderEvent(): void;
403+
399404
/**
400405
*
401406
* @param cb The callback to be called
@@ -659,6 +664,13 @@ export interface vtkRenderWindowInteractor extends vtkObject {
659664
*/
660665
onEndInteractionEvent(cb: InteractorEventCallback, priority?: number): Readonly<vtkSubscription>;
661666

667+
/**
668+
*
669+
* @param {Function} cb The callback to be called.
670+
* @param {Number} [priority] The priority of the event.
671+
*/
672+
onRenderEvent(cb: () => void, priority?: number): Readonly<vtkSubscription>;
673+
662674
/**
663675
*
664676
* @param args

Sources/Rendering/Core/VolumeProperty/index.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import vtkPiecewiseFunction from "../../../Common/DataModel/PiecewiseFunction";
22
import { vtkObject } from "../../../interfaces";
3+
import { Nullable } from "../../../types";
34
import vtkColorTransferFunction from "../ColorTransferFunction";
45
import { InterpolationType, OpacityMode } from "./Constants";
56

@@ -279,14 +280,14 @@ export interface vtkVolumeProperty extends vtkObject {
279280
* @param {Number} index
280281
* @param {vtkColorTransferFunction} func
281282
*/
282-
setRGBTransferFunction(index: number, func: vtkColorTransferFunction): boolean;
283+
setRGBTransferFunction(index: number, func?: Nullable<vtkColorTransferFunction>): boolean;
283284

284285
/**
285286
* Set the scalar opacity of a volume to a transfer function
286287
* @param {Number} index
287288
* @param {vtkPiecewiseFunction} func
288289
*/
289-
setScalarOpacity(index: number, func: vtkPiecewiseFunction): boolean;
290+
setScalarOpacity(index: number, func?: Nullable<vtkPiecewiseFunction>): boolean;
290291

291292
/**
292293
* Set the scalar component weights.

Sources/Rendering/OpenGL/RenderWindow/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export interface vtkOpenGLRenderWindow extends vtkOpenGLRenderWindowBase {
8080
*
8181
* @param {HTMLElement} el The container element.
8282
*/
83-
setContainer(el: HTMLElement): void;
83+
setContainer(el: Nullable<HTMLElement>): void;
8484

8585
/**
8686
* Get the container element.

0 commit comments

Comments
 (0)