Documentation
Library Exports.ChannelSection
A YouTube Channel section.
Constructors
constructor
• new ChannelSection(youtube, data, full?)
Parameters
| Name | Type | Default value |
|---|---|---|
youtube | YouTube | undefined |
data | any | undefined |
full | boolean | true |
Defined in
entities/channel-section.ts:90
Properties
channelId
• channelId: string
The ID of the channel that created this channel section.
Defined in
entities/channel-section.ts:51
channelIds
• Optional channelIds: string[]
The IDs of the channels in this channel section. Undefined if there aren't any.
Defined in
entities/channel-section.ts:66
channels
• Optional channels: Channel[]
The channels in the channel section. Only available after calling ChannelSection.fetchChannels.
Defined in
entities/channel-section.ts:76
data
• data: any
The raw data of this channel section.
Defined in
entities/channel-section.ts:36
full
• full: boolean = true
Whether or not this a full channel section object.
Defined in
entities/channel-section.ts:31
id
• id: string
The ID of this channel section.
Defined in
entities/channel-section.ts:88
name
• name: string
The name of this channel section.
Defined in
entities/channel-section.ts:41
playlistIds
• Optional playlistIds: string[]
The IDs of the playlists in this channel section. Undefined if there aren't any.
Defined in
entities/channel-section.ts:61
playlists
• Optional playlists: Playlist[]
The playlists in the channel section. Only available after calling ChannelSection.fetchPlaylists.
Defined in
entities/channel-section.ts:71
position
• position: number
The zero-based position of this channel section on the channel page.
Defined in
entities/channel-section.ts:56
subscriptions
• Optional subscriptions: PaginatedResponse<Subscription>
The subscriptions in the channel section.
Only valid if ChannelSection.type is subscriptions.
Only available after calling ChannelSection.fetchChannels().
Defined in
entities/channel-section.ts:83
type
• type: "subscriptions" | "likes" | "allplaylists" | "completedevents" | "likedplaylists" | "liveevents" | "multiplechannels" | "multipleplaylists" | "popularuploads" | "postedplaylists" | "postedvideos" | "recentactivity" | "recentposts" | "recentuploads" | "singleplaylist" | "upcomingevents"
The type of this channel section.
Defined in
entities/channel-section.ts:46
youtube
• youtube: YouTube
The YouTube object that created this channel section object.
Defined in
entities/channel-section.ts:26
endpoint
▪ Static endpoint: string = 'channelSections'
The name of the endpoint used for this entity.
Defined in
entities/channel-section.ts:11
fields
▪ Static fields: string = 'items(kind,id,contentDetails,snippet)'
The fields to request for this entity.
Defined in
entities/channel-section.ts:21
part
▪ Static part: string = 'snippet,contentDetails'
The parts to request for this entity.
Defined in
entities/channel-section.ts:16
Methods
fetch
▸ fetch(parts?): Promise<ChannelSection>
Fetches this channel section from the API and reassigns this object to the new channel section object.
Only useful if this.full is false, or if you want updated channel section info.
Parameters
| Name | Type |
|---|---|
parts? | ChannelSectionParts |
Returns
Promise<ChannelSection>
Defined in
entities/channel-section.ts:124
fetchChannels
▸ fetchChannels(parts?): Promise<Channel[]>
Fetches the channel section's channels from the API and assigns them to the ChannelSection.channels property.
Parameters
| Name | Type |
|---|---|
parts? | ChannelParts |
Returns
Promise<Channel[]>
Defined in
entities/channel-section.ts:149
fetchPlaylists
▸ fetchPlaylists(pageOptions?, parts?): Promise<Playlist[]>
Fetches the channel section's playlists from the API and assigns them to the ChannelSection.playlists property.
Parameters
| Name | Type |
|---|---|
pageOptions? | PageOptions |
parts? | PlaylistParts |
Returns
Promise<Playlist[]>
Defined in
entities/channel-section.ts:132
fetchSubscriptions
▸ fetchSubscriptions(pageOptions?, parts?): Promise<PaginatedResponse<Subscription>>
Parameters
| Name | Type |
|---|---|
pageOptions? | PageOptions |
parts? | SubscriptionParts |
Returns
Promise<PaginatedResponse<Subscription>>