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:
parent
1825746a0d
commit
03b9c5ad6b
1 changed files with 6 additions and 6 deletions
|
@ -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);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue