Skip to content

Commit

Permalink
file: fix type of MwnFile usages()
Browse files Browse the repository at this point in the history
Fixes #78
  • Loading branch information
siddharthvp committed Sep 22, 2024
1 parent a11b508 commit 59d29b4
Showing 2 changed files with 5 additions and 7 deletions.
3 changes: 1 addition & 2 deletions src/category.ts
Original file line number Diff line number Diff line change
@@ -61,8 +61,7 @@ export default function (bot: Mwn) {
/** @inheritDoc */
members(options?: ApiQueryCategoryMembersParams): Promise<ApiPageInfo[]> {
return bot
.request({
action: 'query',
.query({
list: 'categorymembers',
cmtitle: 'Category:' + this.title,
cmlimit: 'max',
9 changes: 4 additions & 5 deletions src/file.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Mwn, MwnPage, MwnTitle } from './bot';
import type { Mwn, MwnPage, MwnTitle, ReverseLinkTarget } from './bot';
import { ApiQueryBacklinkspropParams } from './api_params';

export interface MwnFileStatic {
@@ -74,12 +74,11 @@ export default function (bot: Mwn) {
}

/** @inheritDoc */
usages(options?: ApiQueryBacklinkspropParams): Promise<{ pageid: number; title: string; redirect: boolean }[]> {
usages(options?: ApiQueryBacklinkspropParams): Promise<ReverseLinkTarget[]> {
return bot
.request({
action: 'query',
prop: 'fileusage',
.query({
titles: this.toString(),
prop: 'fileusage',
fuprop: 'pageid|title|redirect',
...options,
})

0 comments on commit 59d29b4

Please sign in to comment.