youtubei.js / YTNodes / SubscribeButton
Class: SubscribeButton
Defined in: src/parser/classes/SubscribeButton.ts:7
Extends
Constructors
Constructor
new SubscribeButton(
data):SubscribeButton
Defined in: src/parser/classes/SubscribeButton.ts:28
Parameters
data
Returns
SubscribeButton
Overrides
Properties
button_text
button_text:
Text
Defined in: src/parser/classes/SubscribeButton.ts:10
channel_id
channel_id:
string
Defined in: src/parser/classes/SubscribeButton.ts:14
enabled
enabled:
boolean
Defined in: src/parser/classes/SubscribeButton.ts:12
item_type
item_type:
string
Defined in: src/parser/classes/SubscribeButton.ts:13
notification_preference_button
notification_preference_button:
SubscriptionNotificationToggleButton|null
Defined in: src/parser/classes/SubscribeButton.ts:19
on_subscribe_endpoints?
optionalon_subscribe_endpoints:NavigationEndpoint[]
Defined in: src/parser/classes/SubscribeButton.ts:21
on_unsubscribe_endpoints?
optionalon_unsubscribe_endpoints:NavigationEndpoint[]
Defined in: src/parser/classes/SubscribeButton.ts:22
service_endpoints?
optionalservice_endpoints:NavigationEndpoint[]
Defined in: src/parser/classes/SubscribeButton.ts:20
show_preferences
show_preferences:
boolean
Defined in: src/parser/classes/SubscribeButton.ts:15
subscribe_accessibility_label?
optionalsubscribe_accessibility_label:string
Defined in: src/parser/classes/SubscribeButton.ts:25
subscribed
subscribed:
boolean
Defined in: src/parser/classes/SubscribeButton.ts:11
subscribed_entity_key?
optionalsubscribed_entity_key:string
Defined in: src/parser/classes/SubscribeButton.ts:23
subscribed_text?
optionalsubscribed_text:Text
Defined in: src/parser/classes/SubscribeButton.ts:16
target_id?
optionaltarget_id:string
Defined in: src/parser/classes/SubscribeButton.ts:24
type
readonlytype:string
Defined in: src/parser/helpers.ts:8
Inherited from
unsubscribe_accessibility_label?
optionalunsubscribe_accessibility_label:string
Defined in: src/parser/classes/SubscribeButton.ts:26
unsubscribe_text?
optionalunsubscribe_text:Text
Defined in: src/parser/classes/SubscribeButton.ts:18
unsubscribed_text?
optionalunsubscribed_text:Text
Defined in: src/parser/classes/SubscribeButton.ts:17
type
statictype:string='SubscribeButton'
Defined in: src/parser/classes/SubscribeButton.ts:8
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 SubscribeButton & { [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 SubscribeButton & { [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