import type { Utils } from '../packages/artplayer/types/utils' export function checkSilencePromiseTypes(utils: Utils, thenable: PromiseLike) { const promise: Promise = utils.silencePromise(Promise.resolve(42)) const synchronous: undefined = utils.silencePromise(undefined) const unchanged: PromiseLike = utils.silencePromise(thenable) // @ts-expect-error A catch-less thenable is not converted to a native Promise. utils.silencePromise(thenable).catch(() => {}) return { promise, synchronous, unchanged } }