mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-17 11:32:27 +00:00
feat(parser): Support new like and dislike nodes (#557)
This commit is contained in:
20
src/parser/classes/ToggleButtonView.ts
Normal file
20
src/parser/classes/ToggleButtonView.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { YTNode } from '../helpers.js';
|
||||
import { Parser, type RawNode } from '../index.js';
|
||||
import ButtonView from './ButtonView.js';
|
||||
|
||||
export default class ToggleButtonView extends YTNode {
|
||||
static type = 'ToggleButtonView';
|
||||
|
||||
default_button: ButtonView | null;
|
||||
toggled_button: ButtonView | null;
|
||||
identifier?: string;
|
||||
is_toggling_disabled: boolean;
|
||||
|
||||
constructor(data: RawNode) {
|
||||
super();
|
||||
this.default_button = Parser.parseItem(data.defaultButtonViewModel, ButtonView);
|
||||
this.toggled_button = Parser.parseItem(data.toggledButtonViewModel, ButtonView);
|
||||
this.identifier = data.identifier;
|
||||
this.is_toggling_disabled = data.isTogglingDisabled;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user