feat(Parser): Add HowThisWasMadeSectionView node

This commit is contained in:
Luan
2024-12-14 12:32:29 -03:00
parent c0043d0194
commit 5da8a66551
3 changed files with 28 additions and 6 deletions

View File

@@ -0,0 +1,18 @@
import { type RawNode } from '../index.js';
import { YTNode } from '../helpers.js';
import Text from "./misc/Text.js";
export default class HowThisWasMadeSectionView extends YTNode {
static type = 'HowThisWasMadeSectionView';
public section_title: Text;
public body_text: Text;
public body_header: Text;
constructor(data: RawNode) {
super();
this.section_title = Text.fromAttributed(data.sectionText);
this.body_text = Text.fromAttributed(data.bodyText);
this.body_header = Text.fromAttributed(data.bodyHeader);
}
}

View File

@@ -1,4 +1,4 @@
import { YTNode, type ObservedArray } from '../helpers.js';
import { type ObservedArray, YTNode } from '../helpers.js';
import { Parser, type RawNode } from '../index.js';
import ExpandableVideoDescriptionBody from './ExpandableVideoDescriptionBody.js';
import HorizontalCardList from './HorizontalCardList.js';
@@ -7,16 +7,18 @@ import VideoDescriptionInfocardsSection from './VideoDescriptionInfocardsSection
import VideoDescriptionMusicSection from './VideoDescriptionMusicSection.js';
import VideoDescriptionTranscriptSection from './VideoDescriptionTranscriptSection.js';
import VideoDescriptionCourseSection from './VideoDescriptionCourseSection.js';
import ReelShelf from './ReelShelf.js';
import VideoAttributesSectionView from './VideoAttributesSectionView.js';
import HowThisWasMadeSectionView from "./HowThisWasMadeSectionView.js";
import ReelShelf from './ReelShelf.js';
export default class StructuredDescriptionContent extends YTNode {
static type = 'StructuredDescriptionContent';
items: ObservedArray<
public items: ObservedArray<
VideoDescriptionHeader | ExpandableVideoDescriptionBody | VideoDescriptionMusicSection |
VideoDescriptionInfocardsSection | VideoDescriptionTranscriptSection | VideoDescriptionTranscriptSection |
VideoDescriptionCourseSection | HorizontalCardList | ReelShelf | VideoAttributesSectionView
VideoDescriptionInfocardsSection | VideoDescriptionTranscriptSection |
VideoDescriptionCourseSection | HorizontalCardList | ReelShelf | VideoAttributesSectionView |
HowThisWasMadeSectionView
>;
constructor(data: RawNode) {
@@ -24,7 +26,8 @@ export default class StructuredDescriptionContent extends YTNode {
this.items = Parser.parseArray(data.items, [
VideoDescriptionHeader, ExpandableVideoDescriptionBody, VideoDescriptionMusicSection,
VideoDescriptionInfocardsSection, VideoDescriptionCourseSection, VideoDescriptionTranscriptSection,
VideoDescriptionTranscriptSection, HorizontalCardList, ReelShelf, VideoAttributesSectionView
VideoDescriptionTranscriptSection, HorizontalCardList, ReelShelf, VideoAttributesSectionView,
HowThisWasMadeSectionView
]);
}
}

View File

@@ -201,6 +201,7 @@ export { default as HistorySuggestion } from './classes/HistorySuggestion.js';
export { default as HorizontalCardList } from './classes/HorizontalCardList.js';
export { default as HorizontalList } from './classes/HorizontalList.js';
export { default as HorizontalMovieList } from './classes/HorizontalMovieList.js';
export { default as HowThisWasMadeSectionView } from './classes/HowThisWasMadeSectionView.js';
export { default as IconLink } from './classes/IconLink.js';
export { default as ImageBannerView } from './classes/ImageBannerView.js';
export { default as IncludingResultsFor } from './classes/IncludingResultsFor.js';