feat(ToggleMenuServiceItem): parse default nav endpoint

This commit is contained in:
LuanRT
2023-04-13 06:10:17 -03:00
parent a9cad49333
commit a0566969ba
3 changed files with 13 additions and 12 deletions

View File

@@ -2,8 +2,9 @@ import Text from './misc/Text.js';
import NavigationEndpoint from './NavigationEndpoint.js';
import { YTNode } from '../helpers.js';
import type { RawNode } from '../index.js';
class Button extends YTNode {
export default class Button extends YTNode {
static type = 'Button';
text?: string;
@@ -15,7 +16,7 @@ class Button extends YTNode {
endpoint: NavigationEndpoint;
constructor(data: any) {
constructor(data: RawNode) {
super();
if (data.text) {
@@ -40,6 +41,4 @@ class Button extends YTNode {
this.endpoint = new NavigationEndpoint(data.navigationEndpoint || data.serviceEndpoint || data.command);
}
}
export default Button;
}