import { ChannelParts, ChannelSectionParts, PlaylistParts, SubscriptionParts } from '../types/Parts'; import { YouTube, Playlist, Thumbnail, Subscription, ChannelSection, ChannelBrandingSettings, PageOptions, PaginatedResponse, Image, SubscriptionResolvable } from '..'; import { youtube_v3 } from '@googleapis/youtube'; /** * A YouTube channel. */ export declare class Channel { /** * The name of the endpoint used for this entity. */ static endpoint: string; /** * The parts to request for this entity. */ static part: string; /** * The fields to request for this entity. */ static fields: string; /** * The YouTube object that created this channel object. */ youtube: YouTube; /** * Whether or not this a full channel object. */ full: boolean; /** * The raw data of this channel. */ data: any; /** * The name of this channel. */ name: string; /** * The description of this channel. */ about: string; /** * The ID of this channel. */ id: string; /** * The country this channel is based in. */ country: string; /** * The url of the channel. */ url: string; /** * This channel's custom URL, if they have one. */ customUrl: string; /** * This channel's profile pictures. */ profilePictures: { default?: Thumbnail; high?: Thumbnail; maxres?: Thumbnail; medium?: Thumbnail; standard?: Thumbnail; }; /** * The date this channel was created. */ dateCreated: Date; /** * The default language for this channel's uploads. */ language: string; /** * This channel's view count. */ views: number; /** * This channel's keywords. */ keywords: string[]; /** * The channel's uploads. Only available after calling [Channel.fetchVideos](./Channel#fetchvideos) */ videos: Playlist; /** * The number of subscribers this channel has. `-1` if the subcount is hidden. */ subCount: number; /** * The URLs of all of this channel's featured channels. This property is broken for some channels. */ featuredChannels: string[]; /** * The channel's playlists. Only defined when [Channel.fetchPlaylists](./Channel#fetchplaylists) is called. */ playlists: PaginatedResponse; /** * The channel's subscriptions. Only defined when [Channel.fetchSubscriptions](./Channel#fetchsubscriptions) is called. */ subscriptions: PaginatedResponse; /** * The channel's sections. Only defined when [Channel.fetchSections](./Channel#fetchsections) is called. */ sections: ChannelSection[]; /** * The URL to the image used to generate YouTube banner images for * this channel across all platforms. */ banner: string; /** * The localized titles and descriptions of this channel, if any. */ localizations: { [language: string]: youtube_v3.Schema$ChannelLocalization; }; /** * Only set if the channel is a search result. * * If the channel has an ongoing livestream, this is `live`. * If the channel has an upcoming livestream, this is `upcoming`. * If the channel has neither an ongoing nor upcoming livestream, this is `false`. */ liveStatus: 'live' | 'upcoming' | false; /** * Properties to do with videos made for children. */ kids: { /** * Whether or not the channel is made for children. */ madeForKids: boolean; /** * Whether or not the owner of the channel marked it as made for kids. */ selfDeclaredMadeForKids: boolean; }; constructor(youtube: YouTube, data: youtube_v3.Schema$Channel | youtube_v3.Schema$SearchResult, full?: boolean); /** * @ignore */ private _init; /** * Fetches this channel from the API and reassigns this object to the new channel object. * Only useful if `this.full` is false, or if you want updated channel info. */ fetch(parts?: ChannelParts): Promise; /** * Fetches the channel's playlist of uploads from the API and assigns it to the [Channel.videos](./Channel#videos) property. */ fetchVideos(parts?: PlaylistParts): Promise; /** * Fetches the channel's playlists from the API and assigns them to [Channel.playlists](./Channel#playlists). * @param pageOptions The number of pages and maximum number of items per page. * Fetches the maximum number of items allowed by the API per page by default. * Set pages to a value {'<='}0 to fetch all. * @param parts The parts of the object to fetch (saves quota if you aren't using certain properties!) */ fetchPlaylists(pageOptions?: PageOptions, parts?: PlaylistParts): Promise>; /** * Fetches the channel's subscriptions from the API and assigns them to [Channel.subscriptions](./Channel#subscriptions). * @param pageOptions The number of pages and maximum number of items per page. * Fetches the maximum number of items allowed by the API per page by default. * Set pages to a value {'<='}0 to fetch all. * @param parts The parts of the object to fetch (saves quota if you aren't using certain properties!) */ fetchSubscriptions(pageOptions?: PageOptions, parts?: SubscriptionParts): Promise>; /** * Fetches the channel's sections from the API and assigns them to [Channel.sections](./Channel#sections). */ fetchSections(parts?: ChannelSectionParts): Promise; /** * Subscribes to the channel. * Must be using an access token with correct scopes. */ subscribe(): Promise; /** * Unsubscribes from the channel. * Must be using an access token with correct scopes. * @param subscriptionResolvable The ID or object of the subscription to remove, if you have it. * @param myId The ID of the authorized channel, if you have it. */ unsubscribe(subscriptionResolvable?: SubscriptionResolvable, myId?: string): Promise; /** * Updates the channel's branding settings. * Must be using an access token with correct scopes. */ updateBranding(branding: ChannelBrandingSettings): Promise; /** * Updates the channel's localizations. * Must be using an access token with correct scopes. */ updateLocalizations(localizations: { [key: string]: { title: string; description: string; }; }): Promise; /** * Sets whether or not the channel is made for kids. * Must be using an access token with correct scopes. */ setMadeForKids(madeForKids: boolean): Promise; /** * Sets the channel's watermark. * Must be using an access token with correct scopes. */ setWatermark(type: 'fromStart' | 'fromEnd', offset: number, duration: number, image: Image): Promise; /** * Unsets the channel's watermark. * Must be using an access token with correct scopes. */ unsetWatermark(): Promise; /** * Uploads and sets the channel's banner. * Must be using an access token with correct scopes. */ setBanner(image: { data: Buffer; type: 'png' | 'jpeg'; }): Promise; }