mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-13 09:32:12 +00:00
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
28 lines
717 B
TypeScript
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
|
|
};
|
|
}
|
|
}
|
|
} |