yt-channel-info
yt-channel-info copied to clipboard
TypeError on return type of functions
This is the error I'm getting:

Exporting everything in the index.d.ts file will fix this problem.
New solution:
This part in index.d.ts:
class YoutubeGrabber {
static getChannelInfo(payload: ChannelInfoPayload): Promise<ChannelInfo>;
static getChannelVideos(payload: ChannelVideosPayload): ChannelInfoResponse<Video>;
static getChannelVideosMore(payload: ContinuationPayload): Promise<ChannelInfoResponseContinuation<Video>>;
static getChannelPlaylistInfo(payload: ChannelPlaylistPayload): Promise<ChannelInfoResponse<Playlist>>;
static getChannelPlaylistsMore(payload: ContinuationPayload): Promise<ChannelInfoResponseContinuation<Playlist>>;
static searchChannel(payload: ChannelSearchPayload): Promise<ChannelInfoResponseContinuation<Video>>;
static searchChannelMore(payload: ContinuationPayload): Promise<ChannelInfoResponseContinuation<Video>>;
static getChannelLivestreams(payload: ChannelLivestreamsPayload): ChannelInfoResponse<Video>;
static getChannelShorts(payload: ChannelShortsPayload): ChannelInfoResponse<Video>;
static getRelatedChannelsMore(payload: ContinuationPayload): Promise<ChannelInfoResponseContinuation<RelatedChannel>>;
static getChannelCommunityPosts(payload: ChannelInfoPayload): Promise<ChannelCommunityPostsResponse>
static getChannelCommunityPostsMore(payload: CommunityPostContinuationPayload): Promise<ChannelCommunityPostsContinuationResponse>
static getChannelStats(payload: ChannelInfoPayload): Promise<ChannelStatsResponse>
static getChannelHome(payload: ChannelInfoPayload): Promise<ChannelHomeResponse>
}
export = YoutubeGrabber;
should be replaced by:
function getChannelInfo(payload: ChannelInfoPayload): Promise<ChannelInfo>;
function getChannelVideos(payload: ChannelVideosPayload): ChannelInfoResponse<Video>;
function getChannelVideosMore(payload: ContinuationPayload): Promise<ChannelInfoResponseContinuation<Video>>;
function getChannelPlaylistInfo(payload: ChannelPlaylistPayload): Promise<ChannelInfoResponse<Playlist>>;
function getChannelPlaylistsMore(payload: ContinuationPayload): Promise<ChannelInfoResponseContinuation<Playlist>>;
function searchChannel(payload: ChannelSearchPayload): Promise<ChannelInfoResponseContinuation<Video>>;
function searchChannelMore(payload: ContinuationPayload): Promise<ChannelInfoResponseContinuation<Video>>;
function getRelatedChannelsMore(payload: ContinuationPayload): Promise<ChannelInfoResponseContinuation<RelatedChannel>>;
function getChannelCommunityPosts(payload: ChannelInfoPayload): Promise<ChannelCommunityPostsResponse>
function getChannelCommunityPostsMore(payload: CommunityPostContinuationPayload): Promise<ChannelCommunityPostsContinuationResponse>
function getChannelStats(payload: ChannelInfoPayload): Promise<ChannelStatsResponse>
function getChannelHome(payload: ChannelInfoPayload): Promise<ChannelHomeResponse>
Would you like to open a pr for this? 🙂