Skip to content

Commit

Permalink
fix(types): improve various type definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
floryst committed Feb 6, 2024
1 parent 3fcef66 commit 231280e
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import vtkCompositeMouseManipulator, {
ICompositeMouseManipulatorInitialValues,
} from '../../../Interaction/Manipulators/CompositeMouseManipulator';
import { vtkObject } from '../../../interfaces';

export interface IMouseRangeManipulatorInitialValues
extends ICompositeMouseManipulatorInitialValues {}

export interface vtkMouseRangeManipulator extends vtkCompositeMouseManipulator {
export interface vtkMouseRangeManipulator
extends vtkCompositeMouseManipulator,
vtkObject {
setHorizontalListener(
min: number,
max: number,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const Corners = {
export const Corners = {
TOP_LEFT: 'TOP_LEFT',
TOP_RIGHT: 'TOP_RIGHT',
BOTTOM_LEFT: 'BOTTOM_LEFT',
Expand Down
11 changes: 5 additions & 6 deletions Sources/Interaction/Widgets/OrientationMarkerWidget/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { vtkObject } from "../../../interfaces";
import vtkAnnotatedCubeActor from "../../../Rendering/Core/AnnotatedCubeActor";
import vtkAxesActor from "../../../Rendering/Core/AxesActor";
import vtkActor from "../../../Rendering/Core/Actor";
import vtkRenderer from "../../../Rendering/Core/Renderer";
import vtkRenderWindowInteractor from "../../../Rendering/Core/RenderWindowInteractor";
import { Nullable } from "../../../types";
Expand All @@ -11,7 +10,7 @@ import { Corners } from "./Constants";
*
*/
export interface IOrientationMarkerWidgetInitialValues {
actor?: vtkAnnotatedCubeActor | vtkAxesActor,
actor?: vtkActor,
interactor?: vtkRenderWindowInteractor,
parentRenderer?: vtkRenderer,
viewportCorner?: Corners,
Expand Down Expand Up @@ -39,7 +38,7 @@ export interface vtkOrientationMarkerWidget extends vtkObject {
/**
*
*/
getActor(): vtkAnnotatedCubeActor | vtkAxesActor;
getActor(): vtkActor;

/**
* Gets the parent renderer, if any.
Expand Down Expand Up @@ -85,9 +84,9 @@ export interface vtkOrientationMarkerWidget extends vtkObject {

/**
* Get the actor associated with the widget.
* @param {vtkAnnotatedCubeActor | vtkAxesActor} actor The actor instance.
* @param {vtkActor} actor The actor instance.
*/
setActor(actor: vtkAnnotatedCubeActor | vtkAxesActor): void;
setActor(actor: vtkActor): void;

/**
* Sets the parent renderer
Expand Down
12 changes: 12 additions & 0 deletions Sources/Rendering/Core/RenderWindowInteractor/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,11 @@ export interface vtkRenderWindowInteractor extends vtkObject {
*/
invokeEndInteractionEvent(callData: IRenderWindowInteractorEvent): void;

/**
*
*/
invokeRenderEvent(): void;

/**
*
* @param cb The callback to be called
Expand Down Expand Up @@ -659,6 +664,13 @@ export interface vtkRenderWindowInteractor extends vtkObject {
*/
onEndInteractionEvent(cb: InteractorEventCallback, priority?: number): Readonly<vtkSubscription>;

/**
*
* @param {Function} cb The callback to be called.
* @param {Number} [priority] The priority of the event.
*/
onRenderEvent(cb: () => void, priority?: number): Readonly<vtkSubscription>;

/**
*
* @param args
Expand Down
4 changes: 2 additions & 2 deletions Sources/Rendering/Core/VolumeProperty/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,14 +279,14 @@ export interface vtkVolumeProperty extends vtkObject {
* @param {Number} index
* @param {vtkColorTransferFunction} func
*/
setRGBTransferFunction(index: number, func: vtkColorTransferFunction): boolean;
setRGBTransferFunction(index: number, func?: vtkColorTransferFunction | null): boolean;

/**
* Set the scalar opacity of a volume to a transfer function
* @param {Number} index
* @param {vtkPiecewiseFunction} func
*/
setScalarOpacity(index: number, func: vtkPiecewiseFunction): boolean;
setScalarOpacity(index: number, func?: vtkPiecewiseFunction | null): boolean;

/**
* Set the scalar component weights.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Rendering/OpenGL/RenderWindow/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export interface vtkOpenGLRenderWindow extends vtkOpenGLRenderWindowBase {
*
* @param {HTMLElement} el The container element.
*/
setContainer(el: HTMLElement): void;
setContainer(el: Nullable<HTMLElement>): void;

/**
* Get the container element.
Expand Down

0 comments on commit 231280e

Please sign in to comment.