mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-07-01 02:15:42 +00:00
refactor(Parser): Update view models to use RendererContext.ts
May or may not be a breaking change for some.
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
import NavigationEndpoint from './NavigationEndpoint.js';
|
||||
import { YTNode } from '../helpers.js';
|
||||
import type { RawNode } from '../index.js';
|
||||
import RendererContext from './misc/RendererContext.js';
|
||||
|
||||
export default class ButtonCardView extends YTNode {
|
||||
static type = 'ButtonCardView';
|
||||
|
||||
title: string;
|
||||
icon_name: string;
|
||||
on_tap_endpoint: NavigationEndpoint;
|
||||
public title: string;
|
||||
public icon_name: string;
|
||||
public renderer_context: RendererContext;
|
||||
|
||||
constructor(data: RawNode) {
|
||||
super();
|
||||
this.title = data.title;
|
||||
this.icon_name = data.image.sources[0].clientResource.imageName;
|
||||
this.on_tap_endpoint = new NavigationEndpoint(data.rendererContext.commandContext.onTap);
|
||||
this.renderer_context = new RendererContext(data.rendererContext);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user