Skip to content

Commit

Permalink
Add typescript definition file
Browse files Browse the repository at this point in the history
Fixes #134
  • Loading branch information
cookpete committed Dec 12, 2016
1 parent b674882 commit 5f48260
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
44 changes: 44 additions & 0 deletions index.d.ts
@@ -0,0 +1,44 @@
import * as React from 'react';

export interface ReactPlayerProps {
url?: string;
playing?: boolean;
loop?: boolean;
controls?: boolean;
volume?: number;
playbackRate?: number;
width?: string|number;
height?: string|number;
hidden?: boolean;
className?: string;
style?: Object;
progressFrequency?: number;
soundcloudConfig?: {
clientId: string,
showArtwork: boolean
};
youtubeConfig?: {
playerVars: Object,
preload: boolean
};
vimeoConfig?: {
iframeParams: Object,
preload: boolean
};
fileConfig?: {
attributes: Object
};
onReady?(): void;
onStart?(): void;
onPlay?(): void;
onPause?(): void;
onBuffer?(): void;
onEnded?(): void;
onError?(error: any): void;
onDuration?(duration: number): void;
onProgress?(state: { played: number, loaded: number }): void;
}

export default class ReactPlayer extends React.Component<ReactPlayerProps, any>{
seekTo(fraction: number): void;
}
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -3,6 +3,7 @@
"version": "0.12.1",
"description": "A react component for playing a variety of URLs, including file paths, YouTube, SoundCloud, Streamable, Vidme and Vimeo",
"main": "lib/ReactPlayer.js",
"typings": "index.d.ts",
"scripts": {
"clean": "rimraf lib demo",
"build:webpack": "NODE_ENV=production webpack --config webpack.config.prod.js",
Expand Down

0 comments on commit 5f48260

Please sign in to comment.