mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-18 20:12:12 +00:00
feat: add parsers for TimeWatched
This commit is contained in:
38
src/parser/classes/SettingBoolean.ts
Normal file
38
src/parser/classes/SettingBoolean.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import Text from './misc/Text';
|
||||
import NavigationEndpoint from './NavigationEndpoint';
|
||||
|
||||
import { YTNode } from '../helpers';
|
||||
|
||||
class SettingBoolean extends YTNode {
|
||||
static type = 'SettingBoolean';
|
||||
|
||||
title?: Text;
|
||||
summary?: Text;
|
||||
enable_endpoint?: NavigationEndpoint;
|
||||
disable_endpoint?: NavigationEndpoint;
|
||||
item_id: string;
|
||||
|
||||
constructor(data: any) {
|
||||
super();
|
||||
|
||||
if (data.title) {
|
||||
this.title = new Text(data.title);
|
||||
}
|
||||
|
||||
if (data.summary) {
|
||||
this.summary = new Text(data.summary);
|
||||
}
|
||||
|
||||
if (data.enableServiceEndpoint) {
|
||||
this.enable_endpoint = new NavigationEndpoint(data.enableServiceEndpoint);
|
||||
}
|
||||
|
||||
if (data.disableServiceEndpoint) {
|
||||
this.disable_endpoint = new NavigationEndpoint(data.disableServiceEndpoint);
|
||||
}
|
||||
|
||||
this.item_id = data.itemId;
|
||||
}
|
||||
}
|
||||
|
||||
export default SettingBoolean;
|
||||
Reference in New Issue
Block a user