mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-18 03:59:38 +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
21 lines
603 B
TypeScript
21 lines
603 B
TypeScript
import Text from './misc/Text.js';
|
|
import NavigationEndpoint from './NavigationEndpoint.js';
|
|
import { YTNode } from '../helpers.js';
|
|
import type { RawNode } from '../index.js';
|
|
|
|
export default class ChipCloudChip extends YTNode {
|
|
static type = 'ChipCloudChip';
|
|
|
|
is_selected: boolean;
|
|
endpoint?: NavigationEndpoint;
|
|
text: string;
|
|
|
|
constructor(data: RawNode) {
|
|
super();
|
|
this.is_selected = data.isSelected;
|
|
if (Reflect.has(data, 'navigationEndpoint')) {
|
|
this.endpoint = new NavigationEndpoint(data.navigationEndpoint);
|
|
}
|
|
this.text = new Text(data.text).toString();
|
|
}
|
|
} |