Files
YouTube.js/src/parser/classes/CollectionThumbnailView.ts
Luan 8130f808d9 fix(parser): Resolve some old parser issues (#1154)
Should reduce parser warning spam quite a bit.

Closes #653
Closes #781
Closes #1121 (minus unrelated pot issue)
Closes #978
Closes #1053
Closes #695
Closes #1098
2026-03-16 13:14:09 -03:00

28 lines
717 B
TypeScript

import { YTNode } from '../helpers.js';
import { Parser, type RawNode } from '../index.js';
import ThumbnailView from './ThumbnailView.js';
interface StackColor {
light_theme?: number;
dark_theme?: number;
}
export default class CollectionThumbnailView extends YTNode {
static type = 'CollectionThumbnailView';
public primary_thumbnail: ThumbnailView | null;
public stack_color?: StackColor;
constructor(data: RawNode) {
super();
this.primary_thumbnail = Parser.parseItem(data.primaryThumbnail, ThumbnailView);
if ('stackColor' in data) {
this.stack_color = {
light_theme: data.stackColor?.lightTheme,
dark_theme: data.stackColor?.darkTheme
};
}
}
}