mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-19 04:21:35 +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:
29
src/parser/classes/SubscriptionNotificationToggleButton.ts
Normal file
29
src/parser/classes/SubscriptionNotificationToggleButton.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import Parser from '../index';
|
||||
import { YTNode } from '../helpers';
|
||||
|
||||
class SubscriptionNotificationToggleButton extends YTNode {
|
||||
static type = 'SubscriptionNotificationToggleButton';
|
||||
|
||||
states: {
|
||||
id: string;
|
||||
next_id: string;
|
||||
state: any;
|
||||
};
|
||||
|
||||
current_state_id: string;
|
||||
target_id: string;
|
||||
|
||||
constructor(data: any) {
|
||||
super();
|
||||
this.states = data.states.map((data: any) => ({
|
||||
id: data.stateId,
|
||||
next_id: data.nextStateId,
|
||||
state: Parser.parse(data.state)
|
||||
}));
|
||||
|
||||
this.current_state_id = data.currentStateId;
|
||||
this.target_id = data.targetId;
|
||||
}
|
||||
}
|
||||
|
||||
export default SubscriptionNotificationToggleButton;
|
||||
Reference in New Issue
Block a user