Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Parser): Add Form node #899

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/parser/classes/Form.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { type ObservedArray, YTNode } from '../helpers.js';
import { Parser, YTNodes, type RawNode } from '../index.js';

export default class Form extends YTNode {
static type = 'Form';

fields: ObservedArray | null;

constructor(data: RawNode) {
super();
this.fields = Parser.parse(data.fields, true, YTNodes.ToggleFormField);

Check failure on line 11 in src/parser/classes/Form.ts

View workflow job for this annotation

GitHub Actions / test

Property 'ToggleFormField' does not exist on type 'typeof import("/home/runner/work/YouTube.js/YouTube.js/src/parser/nodes", { with: { "resolution-mode": "import" } })'.

Check failure on line 11 in src/parser/classes/Form.ts

View workflow job for this annotation

GitHub Actions / lint

Property 'ToggleFormField' does not exist on type 'typeof import("/home/runner/work/YouTube.js/YouTube.js/src/parser/nodes", { with: { "resolution-mode": "import" } })'.
}
}
1 change: 1 addition & 0 deletions src/parser/nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ export { default as FeedFilterChipBar } from './classes/FeedFilterChipBar.js';
export { default as FeedNudge } from './classes/FeedNudge.js';
export { default as FeedTabbedHeader } from './classes/FeedTabbedHeader.js';
export { default as FlexibleActionsView } from './classes/FlexibleActionsView.js';
export { default as Form } from './classes/Form.js';
export { default as FormFooterView } from './classes/FormFooterView.js';
export { default as GameCard } from './classes/GameCard.js';
export { default as GameDetails } from './classes/GameDetails.js';
Expand Down
Loading