youtubei.js / YTNodes / NavigationEndpoint
Class: NavigationEndpoint
Extends
Constructors
new NavigationEndpoint()
new NavigationEndpoint(
data):NavigationEndpoint
Parameters
• data: RawNode
Returns
Overrides
Defined in
src/parser/classes/NavigationEndpoint.ts:27
Properties
dialog?
optionaldialog:null|YTNode|CreatePlaylistDialog
Defined in
src/parser/classes/NavigationEndpoint.ts:14
metadata
metadata:
object
api_url?
optionalapi_url:string
page_type?
optionalpage_type:string
send_post?
optionalsend_post:boolean
url?
optionalurl:string
Defined in
src/parser/classes/NavigationEndpoint.ts:20
modal?
optionalmodal:null|YTNode|ModalWithTitleAndButton
Defined in
src/parser/classes/NavigationEndpoint.ts:15
next_endpoint?
optionalnext_endpoint:NavigationEndpoint
Defined in
src/parser/classes/NavigationEndpoint.ts:18
open_popup?
optionalopen_popup:null|OpenPopupAction
Defined in
src/parser/classes/NavigationEndpoint.ts:16
payload
payload:
any
Defined in
src/parser/classes/NavigationEndpoint.ts:13
type
readonlytype:string
Inherited from
Defined in
type
statictype:string='NavigationEndpoint'
Overrides
Defined in
src/parser/classes/NavigationEndpoint.ts:11
Methods
as()
as<
T,K>(...types):InstanceType<K[number]>
Cast to one of the given types.
Type Parameters
• T extends YTNode
• K extends YTNodeConstructor<T>[]
Parameters
• ...types: K
Returns
InstanceType<K[number]>
Inherited from
Defined in
call()
call(actions, args)
call<
T>(actions,args):Promise<T>
Type Parameters
• T extends IParsedResponse
Parameters
• actions: Actions
• args
• args.parse: true
Returns
Promise<T>
Defined in
src/parser/classes/NavigationEndpoint.ts:106
call(actions, args)
call(
actions,args?):Promise<ApiResponse>
Parameters
• actions: Actions
• args?
• args.parse?: false
Returns
Promise<ApiResponse>
Defined in
src/parser/classes/NavigationEndpoint.ts:107
getEndpoint()
getEndpoint(
name):undefined|"/browse"|"/player"|"/search"|"/next"|"/live_chat/get_item_context_menu"
Sometimes InnerTube does not return an API url, in that case the library should set it based on the name of the payload object.
Parameters
• name: string
Returns
undefined | "/browse" | "/player" | "/search" | "/next" | "/live_chat/get_item_context_menu"
Defined in
src/parser/classes/NavigationEndpoint.ts:90
hasKey()
hasKey<
T,R>(key):this is NavigationEndpoint & { [k in string]: R }
Check for a key without asserting the type.
Type Parameters
• T extends string
• R = any
Parameters
• key: T
The key to check
Returns
this is NavigationEndpoint & { [k in string]: R }
Whether the node has the key
Inherited from
Defined in
is()
is<
T,K>(...types):this is InstanceType<K[number]>
Check if the node is of the given type.
Type Parameters
• T extends YTNode
• K extends YTNodeConstructor<T>[]
Parameters
• ...types: K
The type to check
Returns
this is InstanceType<K[number]>
whether the node is of the given type
Inherited from
Defined in
key()
key<
T,R>(key):Maybe
Assert that the node has the given key and return it.
Type Parameters
• T extends string
• R = any
Parameters
• key: T
The key to check
Returns
The value of the key wrapped in a Maybe
Throws
If the node does not have the key
Inherited from
Defined in
toURL()
toURL():
undefined|string
Returns
undefined | string