diff --git a/src/compat/browser_compatibility_types.ts b/src/compat/browser_compatibility_types.ts index 8c9037e585..f5671998e8 100644 --- a/src/compat/browser_compatibility_types.ts +++ b/src/compat/browser_compatibility_types.ts @@ -321,62 +321,20 @@ export interface IMediaKeySession extends IEventTarget update(response: BufferSource): Promise; } -// @ts-expect-error unused function, just used for compile-time typechecking -// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-restricted-types -function testMediaElement(x: HTMLMediaElement) { - assertCompatibleIMediaElement(x); -} -function assertCompatibleIMediaElement(_x: IMediaElement) { - // Noop -} -// @ts-expect-error unused function, just used for compile-time typechecking -// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-restricted-types -function testMediaSource(x: MediaSource) { - assertCompatibleIMediaSource(x); -} -function assertCompatibleIMediaSource(_x: IMediaSource) { - // Noop -} -// @ts-expect-error unused function, just used for compile-time typechecking -// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-restricted-types -function testSourceBuffer(x: SourceBuffer) { - assertCompatibleISourceBuffer(x); -} -function assertCompatibleISourceBuffer(_x: ISourceBuffer) { - // Noop -} -// @ts-expect-error unused function, just used for compile-time typechecking -// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-restricted-types -function testSourceBufferList(x: SourceBufferList) { - assertCompatibleISourceBufferList(x); -} -function assertCompatibleISourceBufferList(_x: ISourceBufferList) { - // Noop -} -// @ts-expect-error unused function, just used for compile-time typechecking -// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-restricted-types -function testMediaKeySystemAccess(x: MediaKeySystemAccess) { - assertCompatibleIMediaKeySystemAccess(x); -} -function assertCompatibleIMediaKeySystemAccess(_x: IMediaKeySystemAccess) { - // Noop -} -// @ts-expect-error unused function, just used for compile-time typechecking -// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-restricted-types -function testMediaKeys(x: MediaKeys) { - assertCompatibleIMediaKeys(x); -} -function assertCompatibleIMediaKeys(_x: IMediaKeys) { - // Noop -} -// @ts-expect-error unused function, just used for compile-time typechecking -// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-restricted-types -function testMediaKeySession(x: MediaKeySession) { - assertCompatibleIMediaKeySession(x); -} -function assertCompatibleIMediaKeySession(_x: IMediaKeySession) { - // Noop -} +// Trick to ensure our own types are compatible to TypeScript's +function assertTypeCompatibility(): void { + // noop +} + +/* eslint-disable @typescript-eslint/no-restricted-types */ +assertTypeCompatibility(); +assertTypeCompatibility(); +assertTypeCompatibility(); +assertTypeCompatibility(); +assertTypeCompatibility(); +assertTypeCompatibility(); +assertTypeCompatibility(); +/* eslint-enable @typescript-eslint/no-restricted-types */ /** * AudioTrackList implementation (that TS forgot).