mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-07-02 21:52:48 +00:00
feat(parser): Add UnifiedSharePanel
This commit is contained in:
25
src/parser/classes/ShareTarget.ts
Normal file
25
src/parser/classes/ShareTarget.ts
Normal 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user