mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-17 03:22:15 +00:00
* dev: finish top-level parsers TS migration
* dev: migrate menu renderers to TS
* chore: fix ts errors
* dev: finish ts migration 🎉
31 lines
649 B
TypeScript
31 lines
649 B
TypeScript
import NavigationEndpoint from './NavigationEndpoint';
|
|
import { YTNode } from '../helpers';
|
|
|
|
class LikeButton extends YTNode {
|
|
static type = 'LikeButton';
|
|
|
|
target: {
|
|
video_id: string;
|
|
};
|
|
|
|
like_status: string;
|
|
likes_allowed: string;
|
|
endpoints?: NavigationEndpoint[];
|
|
|
|
constructor(data: any) {
|
|
super();
|
|
|
|
this.target = {
|
|
video_id: data.target.videoId
|
|
};
|
|
|
|
this.like_status = data.likeStatus;
|
|
this.likes_allowed = data.likesAllowed;
|
|
|
|
if (data.serviceEndpoints) {
|
|
this.endpoints = data.serviceEndpoints?.map((endpoint: any) => new NavigationEndpoint(endpoint));
|
|
}
|
|
}
|
|
}
|
|
|
|
export default LikeButton; |