Skip to content

Commit 596775b

Browse files
committed
docs(ts): Fix vtkAlgorithm type definition
1 parent 3f4938a commit 596775b

File tree

1 file changed

+66
-24
lines changed

1 file changed

+66
-24
lines changed

Sources/interfaces.d.ts

Lines changed: 66 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import vtkDataArray from "./Common/Core/DataArray";
2+
import vtkImageData from "./Common/DataModel/ImageData";
3+
import vtkPolyData from "./Common/DataModel/PolyData";
24
import { vtkPipelineConnection } from "./types";
35

46
/**
@@ -32,48 +34,88 @@ export interface vtkOutputPort {
3234
* vtkAlgorithm API
3335
*/
3436
export interface vtkAlgorithm {
37+
3538
/**
36-
* @param dataset
37-
* @param port (default 0)
39+
* Assign a data object as input.
40+
* @param {vtkPolyData} dataset
41+
* @param {Number} [port] The port number (default 0).
3842
*/
39-
setInputData(dataset: any, port?: number): void;
43+
setInputData(dataset: vtkPolyData, port?: number): void;
44+
4045
/**
41-
* @param port (default 0)
46+
* @param {Number} [port] The port number (default 0).
4247
*/
4348
getInputData(port?: number): any;
49+
4450
/**
4551
* @param outputPort
46-
* @param port (default 0)
52+
* @param {Number} [port] The port number (default 0).
4753
*/
4854
setInputConnection(outputPort: vtkPipelineConnection, port?: number): void;
55+
4956
/**
50-
* @param port (default 0)
57+
* @param {Number} [port] The port number (default 0).
5158
*/
5259
getInputConnection(port?: number): vtkPipelineConnection;
60+
61+
/**
62+
* Add a connection to the given input port index.
63+
* @param {vtkPipelineConnection} outputPort
64+
*/
5365
addInputConnection(outputPort: vtkPipelineConnection): void;
66+
67+
/**
68+
*
69+
* @param dataset
70+
*/
5471
addInputData(dataset: any): void;
72+
5573
/**
56-
* @param port (default 0)
74+
* Get the data object that will contain the algorithm output for the given
75+
* port.
76+
* @param {Number} [port] The port number (default 0).
77+
*/
78+
getOutputData(port?: number): vtkImageData | vtkPolyData;
79+
80+
/**
81+
*
5782
*/
58-
getOutputData(port?: number): any;
5983
shouldUpdate(): boolean;
84+
6085
/**
61-
* @param port (default 0)
86+
* Get a proxy object corresponding to the given output port of this
87+
* algorithm.
88+
* @param {Number} [port] The port number (default 0).
6289
*/
6390
getOutputPort(port?: number): vtkPipelineConnection;
91+
92+
/**
93+
* Bring this algorithm's outputs up-to-date.
94+
*/
6495
update(): void;
96+
97+
/**
98+
* Get the number of input ports used by the algorithm.
99+
*/
65100
getNumberOfInputPorts(): number;
101+
102+
/**
103+
* Get the number of output ports provided by the algorithm.
104+
*/
66105
getNumberOfOutputPorts(): number;
106+
67107
/**
68-
* @param port (default 0)
108+
* Get the actual data array for the input array sepcified by idx.
109+
* @param {Number} port (default 0)
69110
*/
70111
getInputArrayToProcess(inputPort?: number): vtkDataArray;
112+
71113
/**
72-
*
73-
* @param inputPort
74-
* @param arrayName
75-
* @param fieldAssociation
76-
* @param attributeType (default 'Scalars')
114+
* Set the input data arrays that this algorithm will process.
115+
* @param {Number} inputPort The port number.
116+
* @param {String} arrayName The name of the array.
117+
* @param {String} fieldAssociation The name of the association field.
118+
* @param {String} attributeType (default 'Scalars')
77119
*/
78120
setInputArrayToProcess(
79121
inputPort: number,
@@ -87,9 +129,9 @@ export interface vtkAlgorithm {
87129
* Base vtkClass which provides MTime tracking and class infrastructure
88130
*/
89131
export interface vtkObject {
132+
90133
/**
91134
* Allow to check if that object was deleted (.delete() was called before).
92-
*
93135
* @returns true if delete() was previously called
94136
*/
95137
isDeleted(): boolean;
@@ -137,14 +179,14 @@ export interface vtkObject {
137179
* Generic method to set many fields at one.
138180
*
139181
* For example calling the following function
140-
* ```
182+
* ```js
141183
* changeDetected = sphereSourceInstance.set({
142184
* phiResolution: 10,
143185
* thetaResolution: 20,
144186
* });
145187
* ```
146188
* will be equivalent of calling
147-
* ```
189+
* ```js
148190
* changeDetected += sphereSourceInstance.setPhiResolution(10);
149191
* changeDetected += sphereSourceInstance.setThetaResolution(20);
150192
* changeDetected = !!changeDetected;
@@ -157,9 +199,9 @@ export interface vtkObject {
157199
* If `noFunction` is set to true, the field will be set directly on the model
158200
* without calling the `set${FieldName}()` method.
159201
*
160-
* @param map (default: {}) Object capturing the set of fieldNames and associated values to set.
161-
* @param noWarning (default: false) Boolean to disable any warning.
162-
* @param noFunctions (default: false) Boolean to skip any function execution and rely on only setting the fields on the model.
202+
* @param [map] (default: {}) Object capturing the set of fieldNames and associated values to set.
203+
* @param [noWarning] (default: false) Boolean to disable any warning.
204+
* @param [noFunctions] (default: false) Boolean to skip any function execution and rely on only setting the fields on the model.
163205
* @return true if a change was actually performed. False otherwise when the value provided were equal to the ones already set inside the instance.
164206
*/
165207
set(map?: object, noWarning?: boolean, noFunction?: boolean): boolean;
@@ -215,15 +257,15 @@ export interface vtkObject {
215257
/**
216258
* Try to copy the state of the other to ourselves by just using references.
217259
*
218-
* @param other instance to copy the reference from
219-
* @param debug (default: false) if true feedback will be provided when mismatch happen
260+
* @param {vtkObject} other instance to copy the reference from
261+
* @param {Boolean} [debug] (default: false) if true feedback will be provided when mismatch happen
220262
*/
221263
shallowCopy(other: vtkObject, debug?: boolean): void;
222264
}
223265

224266
export interface vtkProperty {
225267
name: string;
226-
children?: Array<vtkProperty>;
268+
children?: vtkProperty[];
227269
}
228270

229271
export interface vtkPropertyDomain {}

0 commit comments

Comments
 (0)