feat(Parser): Add ClipSection (#532)

* feat: add `ClipSection`

* fix: Update src/parser/classes/ClipCreation.ts

---------

Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>
This commit is contained in:
JellyBrick
2023-12-01 09:29:18 +09:00
committed by GitHub
parent e02139532b
commit 9007b65237
7 changed files with 129 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
import { YTNode } from '../helpers.js';
import Parser, { type RawNode } from '../index.js';
import ClipSection from './ClipSection.js';
import ContinuationItem from './ContinuationItem.js';
import EngagementPanelTitleHeader from './EngagementPanelTitleHeader.js';
import MacroMarkersList from './MacroMarkersList.js';
@@ -11,7 +12,7 @@ export default class EngagementPanelSectionList extends YTNode {
static type = 'EngagementPanelSectionList';
header: EngagementPanelTitleHeader | null;
content: SectionList | ContinuationItem | StructuredDescriptionContent | MacroMarkersList | ProductList | null;
content: SectionList | ContinuationItem | ClipSection | StructuredDescriptionContent | MacroMarkersList | ProductList | null;
target_id?: string;
panel_identifier?: string;
visibility?: string;
@@ -19,7 +20,7 @@ export default class EngagementPanelSectionList extends YTNode {
constructor(data: RawNode) {
super();
this.header = Parser.parseItem(data.header, EngagementPanelTitleHeader);
this.content = Parser.parseItem(data.content, [ SectionList, ContinuationItem, StructuredDescriptionContent, MacroMarkersList, ProductList ]);
this.content = Parser.parseItem(data.content, [ SectionList, ContinuationItem, ClipSection, StructuredDescriptionContent, MacroMarkersList, ProductList ]);
this.panel_identifier = data.panelIdentifier;
this.target_id = data.targetId;
this.visibility = data.visibility;