Skip to content

Commit f738a17

Browse files
dnicolsonabsidue
andauthored
feat(parser): Add FormPopup.ts parser class (#1057)
* Update src/parser/classes/FormPopup.ts --------- Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>
1 parent 3d6ed1d commit f738a17

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/parser/classes/FormPopup.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { YTNode } from '../helpers.js';
2+
import { Parser, type RawNode } from '../index.js';
3+
import { type ObservedArray } from '../helpers.js';
4+
import Text from './misc/Text.js';
5+
import Form from './Form.js';
6+
import Button from './Button.js';
7+
8+
export default class FormPopup extends YTNode {
9+
static type = 'FormPopup';
10+
11+
title: Text;
12+
form: Form | null;
13+
buttons: ObservedArray<Button>;
14+
15+
constructor(data: RawNode) {
16+
super();
17+
this.title = new Text(data.title);
18+
this.form = Parser.parseItem(data.form, Form);
19+
this.buttons = Parser.parseArray(data.buttons, Button);
20+
}
21+
}

src/parser/nodes.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ export { default as FeedTabbedHeader } from './classes/FeedTabbedHeader.js';
183183
export { default as FlexibleActionsView } from './classes/FlexibleActionsView.js';
184184
export { default as Form } from './classes/Form.js';
185185
export { default as FormFooterView } from './classes/FormFooterView.js';
186+
export { default as FormPopup } from './classes/FormPopup.js';
186187
export { default as GameCard } from './classes/GameCard.js';
187188
export { default as GameDetails } from './classes/GameDetails.js';
188189
export { default as Grid } from './classes/Grid.js';

0 commit comments

Comments
 (0)