import { TwitchMediaProps } from "./props.js"; //#region src/dom/twitch/source.d.ts /** * Twitch engine options, spelled exactly as Twitch spells them * (https://dev.twitch.tv/docs/embed/video-and-clips/). They are serialized onto * the embed URL verbatim, so what you write here is what the player reads. * * Parameters the host owns are deliberately absent: `video` and `channel` come * from `src`, and `controls`, `autoplay` and `muted` come from the props of the * same name, so configuring them here would give two ways to say one thing. So * are the ones Twitch documents for something other than the player URL — * `allowfullscreen` is an iframe attribute set by inclusion, and `quality` * belongs to the scripted embed's `setQuality` — since naming them here would * promise an effect the URL cannot have. The index signature still carries * anything not listed, so undocumented knobs and whatever Twitch adds next keep * working. */ interface TwitchEngineConfig extends Record { /** * Every hostname the embed may be framed by. Twitch checks the frame's * ancestors against it and refuses to play when the current page is missing, * which is why the page's own hostname is always included on top of this. */ parent?: string | readonly string[]; /** Collection to play through, starting from the video named by `src`. */ collection?: string; /** Start position, spelled the way Twitch spells timestamps: `1h30m10s`. */ time?: string; /** * `referrerpolicy` for the embed iframe. Not a Twitch embed parameter, so it * never reaches the URL: the React player applies it to the iframe it renders, * and the HTML player reads its own `referrerpolicy` attribute instead. */ referrerPolicy?: ReferrerPolicy; } /** Structured Twitch source: which source to play, plus how to play it. */ interface TwitchSource { /** Twitch VOD or channel URL. Mirrors the host's `src` property. */ src?: string | undefined; /** Playback options, keyed by the engine that reads them. */ engine?: TwitchSourceEngineConfig | undefined; } /** The engines a Twitch source can configure. */ interface TwitchSourceEngineConfig { /** Twitch's own embed parameters, passed through untouched. */ twitch?: TwitchEngineConfig | undefined; } /** Parsed pieces of a Twitch source URL. */ interface ParsedTwitchSource { /** `'video'` for VODs, `'channel'` for live channels. */ kind: 'video' | 'channel'; /** Numeric VOD id, without the `v` prefix the embed parameter carries. Null for channels. */ id: string | null; /** Channel name. Null for VODs. */ channel: string | null; } /** Extract a Twitch VOD id from any recognized video URL. */ declare function parseTwitchVideoId(src: string): string | null; /** * Parse a Twitch source string. Recognizes VOD URLs (`twitch.tv/videos/` * and `twitch.tv/?video=`) and channel URLs (`twitch.tv/`), with * or without the `www.` and `go.` hosts, and with or without a trailing slash. */ declare function parseTwitchSource(src: string): ParsedTwitchSource | null; /** Build the iframe `src` URL for an initial Twitch embed from the given props. */ declare function buildTwitchIframeSrc(src: string, props?: Partial): string; //#endregion export { ParsedTwitchSource, TwitchEngineConfig, TwitchSource, TwitchSourceEngineConfig, buildTwitchIframeSrc, parseTwitchSource, parseTwitchVideoId }; //# sourceMappingURL=source.d.ts.map