mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-14 01:52:11 +00:00
* tests: improve coverage * refactor: clean up nodes * chore: lint * feat(parser): ignore `BrandVideoShelf` Seems to be used for ads. * feat(parser): ignore `BrandVideoSingleton` too
42 lines
1021 B
TypeScript
42 lines
1021 B
TypeScript
import NavigationEndpoint from './NavigationEndpoint.js';
|
|
import { YTNode } from '../helpers.js';
|
|
import type { RawNode } from '../index.js';
|
|
|
|
export default class ThumbnailOverlayToggleButton extends YTNode {
|
|
static type = 'ThumbnailOverlayToggleButton';
|
|
|
|
is_toggled?: boolean;
|
|
|
|
icon_type: {
|
|
toggled: string;
|
|
untoggled: string;
|
|
};
|
|
|
|
tooltip: {
|
|
toggled: string;
|
|
untoggled: string;
|
|
};
|
|
|
|
toggled_endpoint: NavigationEndpoint;
|
|
untoggled_endpoint: NavigationEndpoint;
|
|
|
|
constructor(data: RawNode) {
|
|
super();
|
|
if (Reflect.has(data, 'isToggled')) {
|
|
this.is_toggled = data.isToggled;
|
|
}
|
|
|
|
this.icon_type = {
|
|
toggled: data.toggledIcon.iconType,
|
|
untoggled: data.untoggledIcon.iconType
|
|
};
|
|
|
|
this.tooltip = {
|
|
toggled: data.toggledTooltip,
|
|
untoggled: data.untoggledTooltip
|
|
};
|
|
|
|
this.toggled_endpoint = new NavigationEndpoint(data.toggledServiceEndpoint);
|
|
this.untoggled_endpoint = new NavigationEndpoint(data.untoggledServiceEndpoint);
|
|
}
|
|
} |