import { extendsBuiltIn } from "../common" ; interface Thumbnail { url : string ; width : number ; height : number ; } /**
 * Represents Thumbnails, usually found inside Playlist / Channel / Video, etc.
 *
 *  Thumbnails is an array of  Thumbnail noInheritDoc @ extendsBuiltIn ( ) export default class Thumbnails extends Array < Thumbnail > { hidden constructor ( ) { super ( ) ; } example get min ( ) : string | undefined { return Thumbnails . parseThumbnailUrl ( this [ 0 ] ) ; } example get best ( ) : string | undefined { return Thumbnails . parseThumbnailUrl ( this [ this . length - 1 ] ) ; } hidden load ( thumbnails ) { this . push ( ... thumbnails ) ; return this ; } private static parseThumbnailUrl ( { url } ) { if ( url . startsWith ( "//" ) ) return `https:${ url }` ; if ( ! url . startsWith ( "https://" ) ) return `https://${ url }` ; else return url ; } }