libresound_js_libs
    Preparing search index...

    Interface SourcePlugin

    Must be implemented by source plugins ("type": "js:source")

    interface SourcePlugin {
        afterInitAsync(): Promise<void>;
        back(): boolean;
        buildActionsAsync(
            indexedItem: {
                index: number;
                item: {
                    id: string;
                    subtitle: string;
                    thumbnailUrl: string;
                    title: string;
                };
            },
            sectionIndex: number,
        ): Promise<
            {
                callback: $InferOuterFunctionType<
                    ZodTuple<readonly [], null>,
                    ZodVoid,
                >;
                icon?: IconName;
                text: string;
            }[],
        >;
        buildMultiActionsAsync(
            indexedItemsMap: {
                [key: string]: {
                    index: number;
                    item: {
                        id: string;
                        subtitle: string;
                        thumbnailUrl: string;
                        title: string;
                    };
                }[];
            },
        ): Promise<
            {
                callback: $InferOuterFunctionType<
                    ZodTuple<readonly [], null>,
                    ZodVoid,
                >;
                icon?: IconName;
                text: string;
            }[],
        >;
        canBack(): boolean;
        chooseGroupAsync(
            group: {
                id: string;
                props?: Record<string, any>;
                subtitle: string;
                thumbnailUrl: string;
                title: string;
            },
        ): Promise<void>;
        chooseSearchTabAsync(index: number): Promise<void>;
        chooseSourceAsync(): Promise<void>;
        chooseTabAsync(index: number): Promise<void>;
        fetchBytesAsync(
            mi: {
                album: { id?: string; title: string };
                artist: { id?: string; title: string };
                downloaderType: DownloaderType;
                duration: number;
                extension: string;
                id: string;
                subtitle: string;
                thumbnailUrl: string;
                title: string;
            },
            downloadId: string,
        ): Promise<number[]>;
        fetchUrlAsync(
            mi: {
                album: { id?: string; title: string };
                artist: { id?: string; title: string };
                downloaderType: DownloaderType;
                duration: number;
                extension: string;
                id: string;
                subtitle: string;
                thumbnailUrl: string;
                title: string;
            },
            downloadId: string,
        ): Promise<String>;
        getSuggestionsAsync(text: string): Promise<string[]>;
        reloadAsync(): Promise<void>;
        searchAsync(text: string): Promise<void>;
    }
    Index

    Methods

    • Called when showing action of an item

      Parameters

      • indexedItem: {
            index: number;
            item: { id: string; subtitle: string; thumbnailUrl: string; title: string };
        }
      • sectionIndex: number

      Returns Promise<
          {
              callback: $InferOuterFunctionType<ZodTuple<readonly [], null>, ZodVoid>;
              icon?: IconName;
              text: string;
          }[],
      >

    • Called when showing actions of multiple items

      Parameters

      • indexedItemsMap: {
            [key: string]: {
                index: number;
                item: {
                    id: string;
                    subtitle: string;
                    thumbnailUrl: string;
                    title: string;
                };
            }[];
        }

      Returns Promise<
          {
              callback: $InferOuterFunctionType<ZodTuple<readonly [], null>, ZodVoid>;
              icon?: IconName;
              text: string;
          }[],
      >

    • Return value shows whether this source can go back. If it returns true then app will call [back()] method

      Returns boolean

    • On choose (tap/click) group

      Parameters

      • group: {
            id: string;
            props?: Record<string, any>;
            subtitle: string;
            thumbnailUrl: string;
            title: string;
        }

      Returns Promise<void>

    • Returns bytes to be player by App's player

      Parameters

      • mi: {
            album: { id?: string; title: string };
            artist: { id?: string; title: string };
            downloaderType: DownloaderType;
            duration: number;
            extension: string;
            id: string;
            subtitle: string;
            thumbnailUrl: string;
            title: string;
        }
      • downloadId: string

      Returns Promise<number[]>

    • Returns url to be player by App's player

      Parameters

      • mi: {
            album: { id?: string; title: string };
            artist: { id?: string; title: string };
            downloaderType: DownloaderType;
            duration: number;
            extension: string;
            id: string;
            subtitle: string;
            thumbnailUrl: string;
            title: string;
        }
      • downloadId: string

      Returns Promise<String>

    • Called when user types in search bar

      Parameters

      • text: string

      Returns Promise<string[]>