Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

TypeError on return type of functions #150

Open
DoormatIka opened this issue Jan 17, 2023 · 2 comments
Open

TypeError on return type of functions #150

DoormatIka opened this issue Jan 17, 2023 · 2 comments

Comments

@DoormatIka
Copy link

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
Copy link
Author

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>

@ChunkyProgrammer
Copy link
Member

Would you like to open a pr for this? 🙂

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants