diff --git a/hls-video-element.d.ts b/hls-video-element.d.ts new file mode 100644 index 0000000..af58b73 --- /dev/null +++ b/hls-video-element.d.ts @@ -0,0 +1,11 @@ +import { CustomVideoElement } from 'custom-media-element'; +import Hls from 'hls.js/dist/hls.mjs'; + +declare class HLSVideoElement extends CustomVideoElement { + api: Hls | null; + attributeChangedCallback(attrName: string, oldValue: any, newValue: any): void; + load(): Promise; + private destroy(): void; +} + +export default HLSVideoElement; diff --git a/package.json b/package.json index b3c3d38..c401cd7 100644 --- a/package.json +++ b/package.json @@ -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",