youtubei.js / YTNodes / ButtonView
Class: ButtonView
Defined in: src/parser/classes/ButtonView.ts:6
Extends
Constructors
Constructor
new ButtonView(
data):ButtonView
Defined in: src/parser/classes/ButtonView.ts:38
Parameters
data
Returns
ButtonView
Overrides
Properties
accessibility_id?
optionalaccessibility_id:string
Defined in: src/parser/classes/ButtonView.ts:30
accessibility_text?
optionalaccessibility_text:string
Defined in: src/parser/classes/ButtonView.ts:36
button_size?
optionalbutton_size:"BUTTON_VIEW_MODEL_SIZE_UNKNOWN"|"BUTTON_VIEW_MODEL_SIZE_DEFAULT"|"BUTTON_VIEW_MODEL_SIZE_COMPACT"|"BUTTON_VIEW_MODEL_SIZE_XSMALL"|"BUTTON_VIEW_MODEL_SIZE_LARGE"|"BUTTON_VIEW_MODEL_SIZE_XLARGE"|"BUTTON_VIEW_MODEL_SIZE_XXLARGE"
Defined in: src/parser/classes/ButtonView.ts:14
button_type?
optionalbutton_type:"BUTTON_VIEW_MODEL_TYPE_UNKNOWN"|"BUTTON_VIEW_MODEL_TYPE_FILLED"|"BUTTON_VIEW_MODEL_TYPE_OUTLINE"|"BUTTON_VIEW_MODEL_TYPE_TEXT"|"BUTTON_VIEW_MODEL_TYPE_TONAL"
Defined in: src/parser/classes/ButtonView.ts:28
custom_background_color?
optionalcustom_background_color:number
Defined in: src/parser/classes/ButtonView.ts:31
custom_border_color?
optionalcustom_border_color:number
Defined in: src/parser/classes/ButtonView.ts:19
custom_dark_theme_border_color?
optionalcustom_dark_theme_border_color:number
Defined in: src/parser/classes/ButtonView.ts:23
custom_font_color?
optionalcustom_font_color:number
Defined in: src/parser/classes/ButtonView.ts:27
enable_full_width_margins?
optionalenable_full_width_margins:boolean
Defined in: src/parser/classes/ButtonView.ts:26
enable_icon_button?
optionalenable_icon_button:boolean
Defined in: src/parser/classes/ButtonView.ts:11
enabled?
optionalenabled:boolean
Defined in: src/parser/classes/ButtonView.ts:29
icon_image?
optionalicon_image:object
Defined in: src/parser/classes/ButtonView.ts:22
icon_image_flip_for_rtl?
optionalicon_image_flip_for_rtl:boolean
Defined in: src/parser/classes/ButtonView.ts:13
icon_name?
optionalicon_name:string
Defined in: src/parser/classes/ButtonView.ts:10
icon_position?
optionalicon_position:"BUTTON_VIEW_MODEL_ICON_POSITION_UNKNOWN"|"BUTTON_VIEW_MODEL_ICON_POSITION_TRAILING"|"BUTTON_VIEW_MODEL_ICON_POSITION_LEADING"|"BUTTON_VIEW_MODEL_ICON_POSITION_ABOVE"|"BUTTON_VIEW_MODEL_ICON_POSITION_LEADING_TRAILING"
Defined in: src/parser/classes/ButtonView.ts:15
icon_trailing?
optionalicon_trailing:boolean
Defined in: src/parser/classes/ButtonView.ts:35
is_full_width?
optionalis_full_width:boolean
Defined in: src/parser/classes/ButtonView.ts:16
on_disabled_tap?
optionalon_disabled_tap:NavigationEndpoint
Defined in: src/parser/classes/ButtonView.ts:18
on_long_press?
optionalon_long_press:NavigationEndpoint
Defined in: src/parser/classes/ButtonView.ts:32
on_tap?
optionalon_tap:NavigationEndpoint
Defined in: src/parser/classes/ButtonView.ts:20
on_visible?
optionalon_visible:object
Defined in: src/parser/classes/ButtonView.ts:34
secondary_icon_image?
optionalsecondary_icon_image:Thumbnail[]
Defined in: src/parser/classes/ButtonView.ts:9
state?
optionalstate:"BUTTON_VIEW_MODEL_STATE_UNKNOWN"|"BUTTON_VIEW_MODEL_STATE_ACTIVE"|"BUTTON_VIEW_MODEL_STATE_INACTIVE"|"BUTTON_VIEW_MODEL_STATE_DISABLED"
Defined in: src/parser/classes/ButtonView.ts:17
style?
optionalstyle:"BUTTON_VIEW_MODEL_STYLE_UNKNOWN"|"BUTTON_VIEW_MODEL_STYLE_CTA"|"BUTTON_VIEW_MODEL_STYLE_BRAND"|"BUTTON_VIEW_MODEL_STYLE_ADS_CTA"|"BUTTON_VIEW_MODEL_STYLE_OVERLAY"|"BUTTON_VIEW_MODEL_STYLE_CTA_THEMED"|"BUTTON_VIEW_MODEL_STYLE_BLACK_CTA"|"BUTTON_VIEW_MODEL_STYLE_CUSTOM"|"BUTTON_VIEW_MODEL_STYLE_MONO"|"BUTTON_VIEW_MODEL_STYLE_OVERLAY_DARK"|"BUTTON_VIEW_MODEL_STYLE_CTA_OVERLAY"|"BUTTON_VIEW_MODEL_STYLE_BRAND_AI"|"BUTTON_VIEW_MODEL_STYLE_YT_GRADIENT"|"BUTTON_VIEW_MODEL_STYLE_BRAND_GRADIENT"
Defined in: src/parser/classes/ButtonView.ts:21
target_id?
optionaltarget_id:string
Defined in: src/parser/classes/ButtonView.ts:25
title?
optionaltitle:string
Defined in: src/parser/classes/ButtonView.ts:24
title_formatted?
optionaltitle_formatted:object
Defined in: src/parser/classes/ButtonView.ts:33
tooltip?
optionaltooltip:string
Defined in: src/parser/classes/ButtonView.ts:12
type
readonlytype:string
Defined in: src/parser/helpers.ts:8
Inherited from
type
statictype:string='ButtonView'
Defined in: src/parser/classes/ButtonView.ts:7
Overrides
Methods
as()
as<
T,K>(...types):InstanceType<K[number]>
Defined in: src/parser/helpers.ts:29
Cast to one of the given types.
Type Parameters
T
T extends YTNode
K
K extends YTNodeConstructor<T>[]
Parameters
types
...K
The types to cast to
Returns
InstanceType<K[number]>
The node cast to one of the given types
Throws
If the node is not of the given type
Inherited from
hasKey()
hasKey<
T,R>(key):this is ButtonView & { [k in string]: R }
Defined in: src/parser/helpers.ts:41
Check for a key without asserting the type.
Type Parameters
T
T extends string
R
R = any
Parameters
key
T
The key to check
Returns
this is ButtonView & { [k in string]: R }
Whether the node has the key
Inherited from
is()
is<
T,K>(...types):this is InstanceType<K[number]>
Defined in: src/parser/helpers.ts:19
Check if the node is of the given type.
Type Parameters
T
T extends YTNode
K
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
key()
key<
T,R>(key):Maybe
Defined in: src/parser/helpers.ts:51
Assert that the node has the given key and return it.
Type Parameters
T
T extends string
R
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