aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player/settings-menu-button.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-10-18 14:35:31 +0200
committerChocobozzz <me@florianbigard.com>2018-10-18 14:35:31 +0200
commitc199c427d4ae586339822320f20f512a7a19dc3f (patch)
tree9cbe8bebc25e97d2e8086c41bcd7180dd752dbac /client/src/assets/player/settings-menu-button.ts
parentcdf4cb9eaf5f6bc71f7c1e1963c07575f1d2593d (diff)
downloadPeerTube-c199c427d4ae586339822320f20f512a7a19dc3f.tar.gz
PeerTube-c199c427d4ae586339822320f20f512a7a19dc3f.tar.zst
PeerTube-c199c427d4ae586339822320f20f512a7a19dc3f.zip
Better typings
Diffstat (limited to 'client/src/assets/player/settings-menu-button.ts')
-rw-r--r--client/src/assets/player/settings-menu-button.ts17
1 files changed, 10 insertions, 7 deletions
diff --git a/client/src/assets/player/settings-menu-button.ts b/client/src/assets/player/settings-menu-button.ts
index f0ccb5862..aa7281727 100644
--- a/client/src/assets/player/settings-menu-button.ts
+++ b/client/src/assets/player/settings-menu-button.ts
@@ -1,7 +1,10 @@
1// Author: Yanko Shterev 1// Author: Yanko Shterev
2// Thanks https://github.com/yshterev/videojs-settings-menu 2// Thanks https://github.com/yshterev/videojs-settings-menu
3 3
4const videojs = require('video.js') 4// FIXME: something weird with our path definition in tsconfig and typings
5// @ts-ignore
6import * as videojs from 'video.js'
7
5import { SettingsMenuItem } from './settings-menu-item' 8import { SettingsMenuItem } from './settings-menu-item'
6import { VideoJSComponentInterface, videojsUntyped } from './peertube-videojs-typings' 9import { VideoJSComponentInterface, videojsUntyped } from './peertube-videojs-typings'
7import { toTitleCase } from './utils' 10import { toTitleCase } from './utils'
@@ -11,7 +14,7 @@ const Menu: VideoJSComponentInterface = videojsUntyped.getComponent('Menu')
11const Component: VideoJSComponentInterface = videojsUntyped.getComponent('Component') 14const Component: VideoJSComponentInterface = videojsUntyped.getComponent('Component')
12 15
13class SettingsButton extends Button { 16class SettingsButton extends Button {
14 constructor (player: any, options: any) { 17 constructor (player: videojs.Player, options: any) {
15 super(player, options) 18 super(player, options)
16 19
17 this.playerComponent = player 20 this.playerComponent = player
@@ -48,7 +51,7 @@ class SettingsButton extends Button {
48 } 51 }
49 } 52 }
50 53
51 onDisposeSettingsItem (name: string) { 54 onDisposeSettingsItem (event: any, name: string) {
52 if (name === undefined) { 55 if (name === undefined) {
53 let children = this.menu.children() 56 let children = this.menu.children()
54 57
@@ -74,7 +77,7 @@ class SettingsButton extends Button {
74 } 77 }
75 } 78 }
76 79
77 onAddSettingsItem (data: any) { 80 onAddSettingsItem (event: any, data: any) {
78 const [ entry, options ] = data 81 const [ entry, options ] = data
79 82
80 this.addMenuItem(entry, options) 83 this.addMenuItem(entry, options)
@@ -218,7 +221,7 @@ class SettingsButton extends Button {
218} 221}
219 222
220class SettingsPanel extends Component { 223class SettingsPanel extends Component {
221 constructor (player: any, options: any) { 224 constructor (player: videojs.Player, options: any) {
222 super(player, options) 225 super(player, options)
223 } 226 }
224 227
@@ -232,7 +235,7 @@ class SettingsPanel extends Component {
232} 235}
233 236
234class SettingsPanelChild extends Component { 237class SettingsPanelChild extends Component {
235 constructor (player: any, options: any) { 238 constructor (player: videojs.Player, options: any) {
236 super(player, options) 239 super(player, options)
237 } 240 }
238 241
@@ -246,7 +249,7 @@ class SettingsPanelChild extends Component {
246} 249}
247 250
248class SettingsDialog extends Component { 251class SettingsDialog extends Component {
249 constructor (player: any, options: any) { 252 constructor (player: videojs.Player, options: any) {
250 super(player, options) 253 super(player, options)
251 this.hide() 254 this.hide()
252 } 255 }