Files
YouTube.js/src/parser/classes/CreatePlaylistDialog.ts
Daniel Wykerd b13bf6e992 refactor(Parser)!: general refactoring of parsers (#344)
* refactor: move common info into MediaInfo

* refactor: better inference on Memo

* refactor: improved typesafety in parser methods

* refactor: remove PlaylistAuthor in favor of Author

* refactor: cleanup live chat parsers

- Replace non standard author type with Author class
- Remove redundant code

* fix: new errors due to changes

* fix: pass actions to FormatUtils#toDash

* refactor!: merge NavigatableText and Text into single class
2023-03-15 18:25:12 -03:00

27 lines
921 B
TypeScript

import Parser from '../index.js';
import { ObservedArray, YTNode } from '../helpers.js';
import Button from './Button.js';
import Dropdown from './Dropdown.js';
import DropdownItem from './DropdownItem.js';
import Text from './misc/Text.js';
class CreatePlaylistDialog extends YTNode {
static type = 'CreatePlaylistDialog';
title: string;
title_placeholder: string;
privacy_option: ObservedArray<DropdownItem> | null;
cancel_button: Button | null;
create_button: Button | null;
constructor(data: any) {
super();
this.title = new Text(data.dialogTitle).toString();
this.title_placeholder = data.titlePlaceholder || '';
this.privacy_option = Parser.parseItem(data.privacyOption, Dropdown)?.entries || null;
this.create_button = Parser.parseItem(data.cancelButton, Button);
this.cancel_button = Parser.parseItem(data.cancelButton, Button);
}
}
export default CreatePlaylistDialog;