-
-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(parser): add
MacroMarkersList
(#444)
This should fix a few parsing issues that were happening after recent updates.
- Loading branch information
Showing
4 changed files
with
40 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { YTNode } from '../helpers.js'; | ||
import { Parser, type RawNode } from '../index.js'; | ||
import Menu from './menus/Menu.js'; | ||
import Text from './misc/Text.js'; | ||
|
||
export default class MacroMarkersInfoItem extends YTNode { | ||
static type = 'MacroMarkersInfoItem'; | ||
|
||
info_text: Text; | ||
menu: Menu | null; | ||
|
||
constructor(data: RawNode) { | ||
super(); | ||
this.info_text = new Text(data.infoText); | ||
this.menu = Parser.parseItem(data.menu, Menu); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { YTNode, type ObservedArray } from '../helpers.js'; | ||
import { Parser, type RawNode } from '../index.js'; | ||
import { Text } from '../misc.js'; | ||
import MacroMarkersInfoItem from './MacroMarkersInfoItem.js'; | ||
import MacroMarkersListItem from './MacroMarkersListItem.js'; | ||
|
||
export default class MacroMarkersList extends YTNode { | ||
static type = 'MacroMarkersList'; | ||
|
||
contents: ObservedArray<MacroMarkersInfoItem | MacroMarkersListItem>; | ||
sync_button_label: Text; | ||
|
||
constructor(data: RawNode) { | ||
super(); | ||
this.contents = Parser.parseArray(data.contents, [ MacroMarkersInfoItem, MacroMarkersListItem ]); | ||
this.sync_button_label = new Text(data.syncButtonLabel); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters