mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-18 20:12:12 +00:00
* refactor: move common info into MediaInfo * refactor: better inference on Memo * refactor: improved typesafety in parser methods * refactor: remove PlaylistAuthor in favor of Author * refactor: cleanup live chat parsers - Replace non standard author type with Author class - Remove redundant code * fix: new errors due to changes * fix: pass actions to FormatUtils#toDash * refactor!: merge NavigatableText and Text into single class
30 lines
846 B
TypeScript
30 lines
846 B
TypeScript
import { Parser } from '../index.js';
|
|
import Button from './Button.js';
|
|
import Text from './misc/Text.js';
|
|
import Thumbnail from './misc/Thumbnail.js';
|
|
|
|
import { YTNode } from '../helpers.js';
|
|
import type { RawNode } from '../index.js';
|
|
|
|
class ChannelAgeGate extends YTNode {
|
|
static type = 'ChannelAgeGate';
|
|
|
|
channel_title: string;
|
|
avatar: Thumbnail[];
|
|
header: Text;
|
|
main_text: Text;
|
|
sign_in_button: Button | null;
|
|
secondary_text: Text;
|
|
|
|
constructor(data: RawNode) {
|
|
super();
|
|
this.channel_title = data.channelTitle;
|
|
this.avatar = Thumbnail.fromResponse(data.avatar);
|
|
this.header = new Text(data.header);
|
|
this.main_text = new Text(data.mainText);
|
|
this.sign_in_button = Parser.parseItem(data.signInButton, Button);
|
|
this.secondary_text = new Text(data.secondaryText);
|
|
}
|
|
}
|
|
|
|
export default ChannelAgeGate; |