Skip to content
This repository was archived by the owner on Mar 16, 2022. It is now read-only.

Commit

Permalink
fix: Fixed default generic return type
Browse files Browse the repository at this point in the history
  • Loading branch information
edgardmessias committed Apr 22, 2021
1 parent ad94bbd commit c4e38f1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,10 @@ class WPPConnectLoader {
* @param condition Function for compare the modules
* @param reverse Search in reverse order
*/
public searchModule<T>(condition: SearchModuleCondition, reverse = false): T {
public searchModule<T = any>(
condition: SearchModuleCondition,
reverse = false
): T {
const moduleId = this.searchModuleId(condition, reverse);

if (moduleId) {
Expand All @@ -199,7 +202,7 @@ class WPPConnectLoader {
* Return the webpack module from a search function, checking new loaded scripts
* @param condition Function for compare the modules
*/
async waitForModule<T>(
async waitForModule<T = any>(
condition: SearchModuleCondition,
reverse = false,
timeout: number | false = false
Expand Down Expand Up @@ -239,7 +242,7 @@ class WPPConnectLoader {
* Return the webpack module from ID
* @param moduleId Webpack module ID
*/
public get<T>(moduleId: string): T {
public get<T = any>(moduleId: string): T {
return this._modules.get(moduleId + '');
}

Expand Down

0 comments on commit c4e38f1

Please sign in to comment.