Skip to content

Commit 32cbe43

Browse files
Merge pull request #257 from NextFaze/fix/types
Add types for undocumented methods
2 parents 7e55bcf + 794ff83 commit 32cbe43

File tree

1 file changed

+30
-18
lines changed

1 file changed

+30
-18
lines changed

index.d.ts

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -282,10 +282,7 @@ export type VLCPlayerProps = VLCPlayerCallbackProps & {
282282
autoplay?: boolean;
283283
};
284284

285-
/**
286-
* A component that can be used to show a playback
287-
*/
288-
declare class VLCPlayer extends Component<VLCPlayerProps> {
285+
declare class PlaybackMethods<T> extends Component<T> {
289286
/**
290287
* Start a new recording session at the given path
291288
* @param path Directory to create new recording in
@@ -299,30 +296,45 @@ declare class VLCPlayer extends Component<VLCPlayerProps> {
299296

300297
/**
301298
* Take a screenshot of the current video frame
299+
*
302300
* @param path The file path where to save the screenshot
303301
*/
304302
snapshot(path: string);
305-
}
306303

307-
/**
308-
* A component that renders a playback with additional
309-
* features like fullscreen, controls, etc.
310-
*/
311-
declare class VlCPlayerView extends Component<any> {
312304
/**
313-
* Start a new recording session at the given path
314-
* @param path Directory to create new recording in
305+
* Seek to the given position
306+
*
307+
* @param pos Position to seek to (as a percentage of the full duration)
315308
*/
316-
startRecording(path: string);
309+
seek(pos: number);
317310

318311
/**
319-
* Stop current recording session
312+
* Resume playback
320313
*/
321-
stopRecording();
314+
resume();
322315

323316
/**
324-
* Take a screenshot of the current video frame
325-
* @param path The file path where to save the screenshot
317+
* Change auto aspect ratio setting
318+
*
319+
* @param useAuto Whether or not to use auto aspect ratio
326320
*/
327-
snapshot(path: string);
321+
autoAspectRatio(useAuto: boolean);
322+
323+
/**
324+
* Update video aspect ratio e.g. `"16:9"`
325+
*
326+
* @param ratio Aspect ratio to use
327+
*/
328+
changeVideoAspectRatio(ratio: string);
328329
}
330+
331+
/**
332+
* A component that can be used to show a playback
333+
*/
334+
declare class VLCPlayer extends PlaybackMethods<VLCPlayerProps> {}
335+
336+
/**
337+
* A component that renders a playback with additional
338+
* features like fullscreen, controls, etc.
339+
*/
340+
declare class VlCPlayerView extends PlaybackMethods<any> {}

0 commit comments

Comments
 (0)