Skip to content
This repository has been archived by the owner on May 17, 2024. It is now read-only.

Commit

Permalink
Added types
Browse files Browse the repository at this point in the history
  • Loading branch information
evoactivity committed Jul 21, 2023
1 parent d264a8f commit 74be5ea
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
32 changes: 32 additions & 0 deletions hls-video-element.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { CustomVideoElement } from 'custom-media-element';
import Hls from 'hls.js';

declare class HLSVideoElement extends CustomVideoElement {
/**
* The current instance of the HLS.js library.
*
* @example
* ```js
* const video = document.querySelector('hls-video');
* video.api.on(Hls.Events.MANIFEST_PARSED, () => {});
* ```
*/
api: Hls | null;

/**
* Fires when attributes are changed on the custom element.
*/
attributeChangedCallback(attrName: string, oldValue: any, newValue: any): void;

/**
* Loads the HLS.js instance and attach it to the video element.
*/
load(): Promise<void>;

/**
* Unloads the HLS.js instance and detaches it from the video element.
*/
private destroy(): void;
}

export default HLSVideoElement;
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "Custom element (web component) for playing video using the HTTP Live Streaming (HLS) format. Uses HLS.js.",
"type": "module",
"main": "hls-video-element.js",
"types": "hls-video-element.d.ts",
"files": [],
"scripts": {
"lint": "npx eslint *.js -c ./node_modules/wet-run/.eslintrc.json",
Expand Down

0 comments on commit 74be5ea

Please sign in to comment.