1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-24 20:36:40 +07:00

fixed player typings

This commit is contained in:
Fedor Katurov 2019-10-11 14:11:23 +07:00
parent 1825746a0d
commit 03b9c5ad6b

View file

@ -1,9 +1,9 @@
// import { Howl } from 'howler';
// import { store } from '~/redux/store';
type PlayerEventType = keyof HTMLMediaElementEventMap;
// export const Player: HTMLAudioElement = new Audio();
//
// console.log(Player);
type PlayerEventListener = (
this: HTMLAudioElement,
ev: HTMLMediaElementEventMap[keyof HTMLMediaElementEventMap]
) => void;
export class PlayerClass {
public constructor() {
@ -38,7 +38,7 @@ export class PlayerClass {
this.element.addEventListener(type, callback);
};
public off = (type: string, callback) => {
public off = (type: PlayerEventType, callback: PlayerEventListener) => {
this.element.removeEventListener(type, callback);
};