Skip to content

Commit 26e60e7

Browse files
luciemacAdrien Boucaud
authored andcommitted
docs(ts): Add and update TypeScript definitions
1 parent 6e82cca commit 26e60e7

File tree

3 files changed

+469
-7
lines changed

3 files changed

+469
-7
lines changed
Lines changed: 241 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,241 @@
1+
import { vtkObject } from '../../../interfaces';
2+
3+
/**
4+
*
5+
*/
6+
export interface IViewStreamInitialValues {
7+
protocol?: any;
8+
api?: any;
9+
cameraUpdateRate?: number;
10+
decodeImage?: boolean;
11+
fpsWindowSize?: number;
12+
interactiveQuality?: number;
13+
interactiveRatio?: number;
14+
isAnimating?: boolean;
15+
mimeType?: string;
16+
size?: number[];
17+
stillQuality?: number;
18+
stillRatio?: number;
19+
useCameraParameters?: boolean;
20+
viewId?: string;
21+
}
22+
23+
export interface vtkViewStream extends vtkObject {
24+
/**
25+
*
26+
* @param callback
27+
*/
28+
onImageReady(callback: () => void): any;
29+
30+
/**
31+
*
32+
*/
33+
getViewId(): string;
34+
35+
/**
36+
*
37+
*/
38+
getSize(): number[];
39+
40+
/**
41+
*
42+
*/
43+
getFps(): any;
44+
45+
/**
46+
*
47+
*/
48+
getLastImageEvent(): any;
49+
50+
/**
51+
*
52+
*/
53+
getCamera(): any;
54+
55+
/**
56+
*
57+
* @param camera
58+
*/
59+
setCamera(camera: any): boolean;
60+
61+
/**
62+
*
63+
*/
64+
getCameraUpdateRate(): number;
65+
66+
/**
67+
*
68+
* @param cameraUpdateRate
69+
*/
70+
setCameraUpdateRate(cameraUpdateRate: number): boolean;
71+
72+
/**
73+
*
74+
*/
75+
getDecodeImage(): any;
76+
77+
/**
78+
*
79+
* @param decodeImage
80+
*/
81+
setDecodeImage(decodeImage: boolean): boolean;
82+
83+
/**
84+
*
85+
*/
86+
getFpsWindowSize(): number;
87+
88+
/**
89+
*
90+
* @param fpsWindowSize
91+
*/
92+
setFpsWindowSize(fpsWindowSize: number): boolean;
93+
94+
/**
95+
*
96+
*/
97+
getInteractiveQuality(): number;
98+
99+
/**
100+
*
101+
* @param interactiveQuality
102+
*/
103+
setInteractiveQuality(interactiveQuality: number): boolean;
104+
105+
/**
106+
*
107+
*/
108+
getInteractiveRatio(): number;
109+
110+
/**
111+
*
112+
* @param interactiveRatio
113+
*/
114+
setInteractiveRatio(interactiveRatio: number): boolean;
115+
116+
/**
117+
*
118+
*/
119+
getStillQuality(): number;
120+
121+
/**
122+
*
123+
* @param stillQuality
124+
*/
125+
setStillQuality(stillQuality: number): boolean;
126+
127+
/**
128+
*
129+
*/
130+
getStillRatio(): number;
131+
132+
/**
133+
*
134+
* @param stillRatio
135+
*/
136+
setStillRatio(stillRatio: number): boolean;
137+
138+
/**
139+
*
140+
*/
141+
getUseCameraParameters(): boolean;
142+
143+
/**
144+
*
145+
* @param useCameraParameters
146+
*/
147+
setUseCameraParameters(useCameraParameters: boolean): boolean;
148+
149+
/**
150+
*
151+
*/
152+
pushCamera(): any;
153+
154+
/**
155+
*
156+
*/
157+
invalidateCache(): any;
158+
159+
/**
160+
*
161+
*/
162+
render(): any;
163+
164+
/**
165+
*
166+
*/
167+
resetCamera(): any;
168+
169+
/**
170+
*
171+
*/
172+
startAnimation(): any;
173+
174+
/**
175+
*
176+
*/
177+
stopAnimation(): any;
178+
179+
/**
180+
*
181+
* @param width
182+
* @param height
183+
*/
184+
setSize(width: number, height: number): any;
185+
186+
/**
187+
*
188+
*/
189+
startInteraction(): any;
190+
191+
/**
192+
*
193+
*/
194+
endInteraction(): any;
195+
196+
/**
197+
*
198+
* @param viewId
199+
*/
200+
setViewId(viewId: string): boolean;
201+
202+
/**
203+
*
204+
* @param msg
205+
*/
206+
processMessage(msg: any): void;
207+
208+
/**
209+
*
210+
*/
211+
delete(): void;
212+
}
213+
214+
/**
215+
* Method used to decorate a given object (publicAPI+model) with vtkViewStream characteristics.
216+
* @param publicAPI
217+
* @param model
218+
* @param initialValues
219+
*/
220+
export function extend(
221+
publicAPI: object,
222+
model: object,
223+
initialValues?: IViewStreamInitialValues
224+
): void;
225+
226+
/**
227+
* Method used to create a new instance of vtkViewStream
228+
* @param {IViewStreamInitialValues} [initialValues] for pre-setting some of its content
229+
*/
230+
export function newInstance(
231+
initialValues?: IViewStreamInitialValues
232+
): vtkViewStream;
233+
234+
/**
235+
* IViewStreamInitialValues provides a way to create a remote view.
236+
*/
237+
export declare const vtkViewStream: {
238+
newInstance: typeof newInstance;
239+
extend: typeof extend;
240+
};
241+
export default vtkViewStream;

Sources/IO/Core/WSLinkClient/index.d.ts

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { vtkObject, vtkSubscription } from "../../../interfaces";
1+
import { vtkObject, vtkSubscription } from '../../../interfaces';
22

33
/**
44
* Bind optional dependency from WSLink to our current class.
@@ -15,7 +15,6 @@ import { vtkObject, vtkSubscription } from "../../../interfaces";
1515
*/
1616
export function setSmartConnectClass(smartConnectClass: object): void;
1717

18-
1918
export interface vtkWSLinkClient extends vtkObject {
2019

2120
/**
@@ -117,21 +116,45 @@ export interface vtkWSLinkClient extends vtkObject {
117116
*/
118117
getConfigDecorator(): (config: object) => object;
119118

120-
getConnection(): object;
121-
getCongig(): object;
119+
/**
120+
*
121+
*/
122+
getConnection(): any;
123+
124+
/**
125+
*
126+
*/
127+
getConfig(): object;
128+
129+
/**
130+
*
131+
*/
122132
getRemote(): object;
133+
134+
/**
135+
*
136+
*/
123137
getImageStream(): object;
124138

139+
/**
140+
*
141+
* @param callback
142+
* @param priority
143+
*/
125144
onBusyChange(callback: Function, priority: number): vtkSubscription;
145+
146+
/**
147+
*
148+
*/
126149
invokeBusyChange(): void;
127150

128-
onConnectionReady(callback: () => void): vtkSubscription;
151+
onConnectionReady(callback: (httpReq: any) => void): vtkSubscription;
129152
// invokeConnectionReady(): void
130153

131-
onConnectionError(callback: () => void): vtkSubscription;
154+
onConnectionError(callback: (httpReq: any) => void): vtkSubscription;
132155
// invokeConnectionError(): void
133156

134-
onConnectionClose(callback: () => void): vtkSubscription;
157+
onConnectionClose(callback: (httpReq: any) => void): vtkSubscription;
135158
// invokeConnectionClose(): void
136159
}
137160

0 commit comments

Comments
 (0)