feat(parser): Add UnifiedSharePanel

This commit is contained in:
Luan
2024-11-10 04:08:23 -03:00
parent fdb754043b
commit 4a1397f1bc
7 changed files with 123 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
import type { RawNode } from '../index.js';
import { Text } from '../misc.js';
import { YTNode } from '../helpers.js';
import NavigationEndpoint from './NavigationEndpoint.js';
export default class ShareTarget extends YTNode {
static type = 'ShareTarget';
public endpoint?: NavigationEndpoint;
public service_name: string;
public target_id: string;
public title: Text;
constructor(data: RawNode) {
super();
if (Reflect.has(data, 'serviceEndpoint'))
this.endpoint = new NavigationEndpoint(data.serviceEndpoint);
else if (Reflect.has(data, 'navigationEndpoint'))
this.endpoint = new NavigationEndpoint(data.navigationEndpoint);
this.service_name = data.serviceName;
this.target_id = data.targetId;
this.title = new Text(data.title);
}
}