mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-28 00:56:23 +00:00
feat(Parser): just-in-time YTNode generation (#310)
* refactor: merge NavigatableText into Text * fix(Text): data might not be object * refactor: remove GetParserByName from map * feat(Parser): just-in-time YTNode generation * refactor: cleanup YTNodeGenerator * fix: YTNode map imports * feat(YTNodeGenerator): primative types Add support for inferring primatives types * fix(YTNodeGenerator): NavigationEndpoint detection * fix(YTNodeGenerator): fix generated typescript Correct types and linting for generated typescript class * chore: update parsers after merge * feat: add support for object type inference * fix: object type def * docs: basic YTNodeGenerator explanation * docs: tsdoc for YTNodeGenerator * docs: update parser updating guide * fix: apply suggested changes * docs: accessing generated nodes
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import Parser from '../../index.js';
|
||||
import NavigatableText from './NavigatableText.js';
|
||||
import NavigationEndpoint from '../NavigationEndpoint.js';
|
||||
import TextRun from './TextRun.js';
|
||||
import Thumbnail from './Thumbnail.js';
|
||||
import Constants from '../../../utils/Constants.js';
|
||||
import Text from './Text.js';
|
||||
|
||||
class Author {
|
||||
#nav_text;
|
||||
@@ -11,14 +11,14 @@ class Author {
|
||||
id: string;
|
||||
name: string;
|
||||
thumbnails: Thumbnail[];
|
||||
endpoint: NavigationEndpoint | null;
|
||||
endpoint?: NavigationEndpoint;
|
||||
badges?: any;
|
||||
is_verified?: boolean | null;
|
||||
is_verified_artist?: boolean | null;
|
||||
url: string | null;
|
||||
|
||||
constructor(item: any, badges?: any, thumbs?: any) {
|
||||
this.#nav_text = new NavigatableText(item);
|
||||
this.#nav_text = new Text(item);
|
||||
|
||||
this.id =
|
||||
(this.#nav_text.runs?.[0] as TextRun)?.endpoint?.payload?.browseId ||
|
||||
|
||||
Reference in New Issue
Block a user