Skip to content

Commit

Permalink
bot: make query() return ApiQueryResponse to avoid type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
siddharthvp committed Nov 13, 2024
1 parent 8527210 commit 464d05f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ import type {
ApiEditResponse,
ApiMoveResponse,
ApiPage,
ApiQueryResponse,
ApiResponse,
ApiRevision,
ApiRollbackResponse,
Expand Down Expand Up @@ -555,8 +556,11 @@ export class Mwn {
);
}

async query(params: ApiParams, customRequestOptions: RawRequestParams = {}): Promise<ApiResponse> {
return this.request(Object.assign({ action: 'query' }, params), customRequestOptions);
async query(params: ApiParams, customRequestOptions: RawRequestParams = {}): Promise<ApiQueryResponse> {
return this.request(
Object.assign({ action: 'query' }, params),
customRequestOptions
) as Promise<ApiQueryResponse>;
}

/************** CORE FUNCTIONS *******************/
Expand Down

0 comments on commit 464d05f

Please sign in to comment.