yt-channel-info icon indicating copy to clipboard operation
yt-channel-info copied to clipboard

TypeError on return type of functions

Open DoormatIka opened this issue 3 years ago • 2 comments

This is the error I'm getting: Screenshot_2023-01-17-08-10-10-833-edit_com termux

Exporting everything in the index.d.ts file will fix this problem.

DoormatIka avatar Jan 17 '23 00:01 DoormatIka

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>

DoormatIka avatar Jan 17 '23 00:01 DoormatIka

Would you like to open a pr for this? 🙂

ChunkyProgrammer avatar Jan 19 '23 08:01 ChunkyProgrammer