Skip to content

Commit

Permalink
🏷️(type) add missing elements property in Plyr class
Browse files Browse the repository at this point in the history
In Plyr class, you can access elements set in cache. This property is
missing in the class definition. The Plyr.Elements is for now
incomplete.
  • Loading branch information
lunika committed Nov 17, 2020
1 parent 5892ba2 commit 30f23b7
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/js/plyr.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ declare class Plyr {
*/
ratio?: string;

/**
* Access Elements cache
*/
elements: Plyr.Elements;

/**
* Returns the current video Provider
*/
Expand Down Expand Up @@ -562,6 +567,27 @@ declare namespace Plyr {
src?: string | string[];
}

export interface Elements {
buttons: {
airplay?: HTMLButtonElement;
captions?: HTMLButtonElement;
download?: HTMLButtonElement;
fastForward?: HTMLButtonElement;
fullscreen?: HTMLButtonElement;
mute?: HTMLButtonElement;
pip?: HTMLButtonElement;
play?: HTMLButtonElement | HTMLButtonElement[];
restart?: HTMLButtonElement;
rewind?: HTMLButtonElement;
settings?: HTMLButtonElement;
};
captions: HTMLElement | null;
container: HTMLElement | null;
controls: HTMLElement | null;
fullscreen: HTMLElement | null;
wrapper: HTMLElement | null;
}

interface SourceInfo {
/**
* Note: YouTube and Vimeo are currently not supported as audio sources.
Expand Down

0 comments on commit 30f23b7

Please sign in to comment.