diff --git a/src/parser/classes/ImageBannerView.ts b/src/parser/classes/ImageBannerView.ts new file mode 100644 index 000000000..dcdca96f7 --- /dev/null +++ b/src/parser/classes/ImageBannerView.ts @@ -0,0 +1,16 @@ +import { YTNode } from '../helpers.js'; +import type { RawNode } from '../index.js'; +import Thumbnail from './misc/Thumbnail.js'; + +export default class ImageBannerView extends YTNode { + static type = 'ImageBannerView'; + + image: Thumbnail[]; + style: string; + + constructor(data: RawNode) { + super(); + this.image = Thumbnail.fromResponse(data.image); + this.style = data.style; + } +} \ No newline at end of file diff --git a/src/parser/classes/PageHeaderView.ts b/src/parser/classes/PageHeaderView.ts index f5d4a9f50..af95de1c6 100644 --- a/src/parser/classes/PageHeaderView.ts +++ b/src/parser/classes/PageHeaderView.ts @@ -7,6 +7,7 @@ import DynamicTextView from './DynamicTextView.js'; import FlexibleActionsView from './FlexibleActionsView.js'; import DescriptionPreviewView from './DescriptionPreviewView.js'; import AttributionView from './AttributionView.js'; +import ImageBannerView from './ImageBannerView.js'; export default class PageHeaderView extends YTNode { static type = 'PageHeaderView'; @@ -17,6 +18,7 @@ export default class PageHeaderView extends YTNode { actions: FlexibleActionsView | null; description: DescriptionPreviewView | null; attributation: AttributionView | null; + banner: ImageBannerView | null; constructor(data: RawNode) { super(); @@ -26,5 +28,6 @@ export default class PageHeaderView extends YTNode { this.actions = Parser.parseItem(data.actions, FlexibleActionsView); this.description = Parser.parseItem(data.description, DescriptionPreviewView); this.attributation = Parser.parseItem(data.attributation, AttributionView); + this.banner = Parser.parseItem(data.banner, ImageBannerView); } } \ No newline at end of file diff --git a/src/parser/nodes.ts b/src/parser/nodes.ts index 2f9d84976..7dac3c793 100644 --- a/src/parser/nodes.ts +++ b/src/parser/nodes.ts @@ -153,6 +153,7 @@ export { default as HorizontalCardList } from './classes/HorizontalCardList.js'; export { default as HorizontalList } from './classes/HorizontalList.js'; export { default as HorizontalMovieList } from './classes/HorizontalMovieList.js'; export { default as IconLink } from './classes/IconLink.js'; +export { default as ImageBannerView } from './classes/ImageBannerView.js'; export { default as IncludingResultsFor } from './classes/IncludingResultsFor.js'; export { default as InfoPanelContainer } from './classes/InfoPanelContainer.js'; export { default as InfoPanelContent } from './classes/InfoPanelContent.js';