spectatr-player-sdk
Version:
A custom video player built with Stencil with Shaka Player integration
178 lines (177 loc) • 6.8 kB
TypeScript
/* eslint-disable */
/* tslint:disable */
/**
* This is an autogenerated file created by the Stencil compiler.
* It contains typing information for all components that exist in this project.
*/
import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
import { Poll, Quiz, Suggestion } from "./types/videoPlayer";
export { Poll, Quiz, Suggestion } from "./types/videoPlayer";
export namespace Components {
interface SpectatrPlayerSdk {
/**
* @default false
*/
"autoPlay"?: boolean;
/**
* @default 'https://media-ingestion.antino.ca'
*/
"baseUrl"?: string;
/**
* @default true
*/
"captureReaction"?: boolean;
"clientId": string;
/**
* @default true
*/
"showSuggestions"?: boolean;
/**
* @default 'classic-youtube'
*/
"theme"?: string;
/**
* @default ''
*/
"userId"?: string;
/**
* @default ''
*/
"videoId"?: string;
}
interface VideoPlayer {
"autoPlay": boolean;
"baseUrl": string;
"captureReaction": boolean;
"clientId": string;
"nextVideoId": string;
"setVideoId": (id: string) => void;
"userId": string;
"videoId": string;
}
interface VideoSuggestions {
"baseUrl": string;
"clientId": string;
"handlePlaySuggestion": (id: string) => void;
"height": number;
"setSuggestions": (suggestions: Suggestion[]) => void;
"videoId": string;
}
}
export interface VideoPlayerCustomEvent<T> extends CustomEvent<T> {
detail: T;
target: HTMLVideoPlayerElement;
}
declare global {
interface HTMLSpectatrPlayerSdkElement extends Components.SpectatrPlayerSdk, HTMLStencilElement {
}
var HTMLSpectatrPlayerSdkElement: {
prototype: HTMLSpectatrPlayerSdkElement;
new (): HTMLSpectatrPlayerSdkElement;
};
interface HTMLVideoPlayerElementEventMap {
"quizTriggered": Quiz;
"pollTriggered": Poll;
"playVideo": void;
"pauseVideo": void;
"videoCompleted": void;
"videoError": string;
}
interface HTMLVideoPlayerElement extends Components.VideoPlayer, HTMLStencilElement {
addEventListener<K extends keyof HTMLVideoPlayerElementEventMap>(type: K, listener: (this: HTMLVideoPlayerElement, ev: VideoPlayerCustomEvent<HTMLVideoPlayerElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof HTMLVideoPlayerElementEventMap>(type: K, listener: (this: HTMLVideoPlayerElement, ev: VideoPlayerCustomEvent<HTMLVideoPlayerElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
}
var HTMLVideoPlayerElement: {
prototype: HTMLVideoPlayerElement;
new (): HTMLVideoPlayerElement;
};
interface HTMLVideoSuggestionsElement extends Components.VideoSuggestions, HTMLStencilElement {
}
var HTMLVideoSuggestionsElement: {
prototype: HTMLVideoSuggestionsElement;
new (): HTMLVideoSuggestionsElement;
};
interface HTMLElementTagNameMap {
"spectatr-player-sdk": HTMLSpectatrPlayerSdkElement;
"video-player": HTMLVideoPlayerElement;
"video-suggestions": HTMLVideoSuggestionsElement;
}
}
declare namespace LocalJSX {
interface SpectatrPlayerSdk {
/**
* @default false
*/
"autoPlay"?: boolean;
/**
* @default 'https://media-ingestion.antino.ca'
*/
"baseUrl"?: string;
/**
* @default true
*/
"captureReaction"?: boolean;
"clientId"?: string;
/**
* @default true
*/
"showSuggestions"?: boolean;
/**
* @default 'classic-youtube'
*/
"theme"?: string;
/**
* @default ''
*/
"userId"?: string;
/**
* @default ''
*/
"videoId"?: string;
}
interface VideoPlayer {
"autoPlay"?: boolean;
"baseUrl"?: string;
"captureReaction"?: boolean;
"clientId"?: string;
"nextVideoId"?: string;
"onPauseVideo"?: (event: VideoPlayerCustomEvent<void>) => void;
"onPlayVideo"?: (event: VideoPlayerCustomEvent<void>) => void;
"onPollTriggered"?: (event: VideoPlayerCustomEvent<Poll>) => void;
"onQuizTriggered"?: (event: VideoPlayerCustomEvent<Quiz>) => void;
"onVideoCompleted"?: (event: VideoPlayerCustomEvent<void>) => void;
"onVideoError"?: (event: VideoPlayerCustomEvent<string>) => void;
"setVideoId"?: (id: string) => void;
"userId"?: string;
"videoId"?: string;
}
interface VideoSuggestions {
"baseUrl"?: string;
"clientId"?: string;
"handlePlaySuggestion"?: (id: string) => void;
"height"?: number;
"setSuggestions"?: (suggestions: Suggestion[]) => void;
"videoId"?: string;
}
interface IntrinsicElements {
"spectatr-player-sdk": SpectatrPlayerSdk;
"video-player": VideoPlayer;
"video-suggestions": VideoSuggestions;
}
}
export { LocalJSX as JSX };
declare module "@stencil/core" {
export namespace JSX {
interface IntrinsicElements {
"spectatr-player-sdk": LocalJSX.SpectatrPlayerSdk & JSXBase.HTMLAttributes<HTMLSpectatrPlayerSdkElement>;
"video-player": LocalJSX.VideoPlayer & JSXBase.HTMLAttributes<HTMLVideoPlayerElement>;
"video-suggestions": LocalJSX.VideoSuggestions & JSXBase.HTMLAttributes<HTMLVideoSuggestionsElement>;
}
}
}