mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-26 00:02:09 +00:00
refactor: migrate parsers to TS (#133)
* dev: finish top-level parsers TS migration
* dev: migrate menu renderers to TS
* chore: fix ts errors
* dev: finish ts migration 🎉
This commit is contained in:
20
src/parser/classes/livechat/UpdateViewershipAction.ts
Normal file
20
src/parser/classes/livechat/UpdateViewershipAction.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import Text from '../misc/Text';
|
||||
import { YTNode } from '../../helpers';
|
||||
|
||||
class UpdateViewershipAction extends YTNode {
|
||||
static type = 'UpdateViewershipAction';
|
||||
|
||||
view_count: Text;
|
||||
extra_short_view_count: Text;
|
||||
is_live: boolean;
|
||||
|
||||
constructor(data: any) {
|
||||
super();
|
||||
const view_count_renderer = data.viewCount.videoViewCountRenderer;
|
||||
this.view_count = new Text(view_count_renderer.viewCount);
|
||||
this.extra_short_view_count = new Text(view_count_renderer.extraShortViewCount);
|
||||
this.is_live = view_count_renderer.isLive;
|
||||
}
|
||||
}
|
||||
|
||||
export default UpdateViewershipAction;
|
||||
Reference in New Issue
Block a user