mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-26 08:08:54 +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:
@@ -12,17 +12,20 @@ export type AccessibilityContext = {
|
||||
export default class RendererContext {
|
||||
public command_context: CommandContext;
|
||||
public accessibility_context: AccessibilityContext;
|
||||
|
||||
constructor(data: RawNode) {
|
||||
|
||||
constructor(data?: RawNode) {
|
||||
this.command_context = {};
|
||||
this.accessibility_context = {};
|
||||
|
||||
|
||||
if (!data)
|
||||
return;
|
||||
|
||||
if (Reflect.has(data, 'commandContext')) {
|
||||
if (Reflect.has(data.commandContext, 'onTap')) {
|
||||
this.command_context.on_tap = new NavigationEndpoint(data.commandContext.onTap);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (Reflect.has(data, 'accessibilityContext')) {
|
||||
if (Reflect.has(data.accessibilityContext, 'label')) {
|
||||
this.accessibility_context.label = data.accessibilityContext.label;
|
||||
|
||||
Reference in New Issue
Block a user