-
-
Notifications
You must be signed in to change notification settings - Fork 254
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(Parser): Don't ignore
BackgroundPromo
It turns out this is not an ad at all.
- Loading branch information
Showing
4 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { YTNode } from '../helpers.js'; | ||
import { Parser, type RawNode } from '../index.js'; | ||
import Text from './misc/Text.js'; | ||
import Button from './Button.js'; | ||
import ButtonView from './ButtonView.js'; | ||
|
||
export default class BackgroundPromo extends YTNode { | ||
static type = 'BackgroundPromo'; | ||
|
||
public body_text?: Text; | ||
public cta_button?: Button | ButtonView | null; | ||
public icon_type?: string; | ||
public title?: Text; | ||
|
||
constructor(data: RawNode) { | ||
super(); | ||
this.body_text = new Text(data.bodyText); | ||
this.cta_button = Parser.parseItem(data.ctaButton, [ Button, ButtonView ]); | ||
|
||
if (Reflect.has(data, 'icon')) | ||
this.icon_type = data.icon.iconType; | ||
|
||
this.title = new Text(data.title); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters