-
-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ShowingResultsFor): parse all props
- Loading branch information
Showing
1 changed file
with
13 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,25 @@ | ||
import { YTNode } from '../helpers.js'; | ||
import type { RawNode } from '../index.js'; | ||
import Text from './misc/Text.js'; | ||
import NavigationEndpoint from './NavigationEndpoint.js'; | ||
import { YTNode } from '../helpers.js'; | ||
|
||
class ShowingResultsFor extends YTNode { | ||
export default class ShowingResultsFor extends YTNode { | ||
static type = 'ShowingResultsFor'; | ||
|
||
corrected_query: Text; | ||
endpoint: NavigationEndpoint; | ||
original_query: Text; | ||
corrected_query_endpoint: NavigationEndpoint; | ||
original_query_endpoint: NavigationEndpoint; | ||
search_instead_for: Text; | ||
showing_results_for: Text; | ||
|
||
constructor(data: any) { | ||
constructor(data: RawNode) { | ||
super(); | ||
this.corrected_query = new Text(data.correctedQuery); | ||
this.endpoint = new NavigationEndpoint(data.correctedQueryEndpoint); | ||
this.original_query = new Text(data.originalQuery); | ||
this.corrected_query_endpoint = new NavigationEndpoint(data.correctedQueryEndpoint); | ||
this.original_query_endpoint = new NavigationEndpoint(data.originalQueryEndpoint); | ||
this.search_instead_for = new Text(data.searchInsteadFor); | ||
this.showing_results_for = new Text(data.showingResultsFor); | ||
} | ||
} | ||
|
||
export default ShowingResultsFor; | ||
} |