Skip to content

Commit

Permalink
Improve & Fix mw.Api
Browse files Browse the repository at this point in the history
- add autocompletion for token types (and legacy ones) with `postWithToken`/`getToken`/`badToken`
- add autocompletion for `getToken` API arguments
- fix return type of multiple methods
  • Loading branch information
Adrien LESÉNÉCHAL committed Feb 16, 2024
1 parent 9fac2e6 commit dec4928
Show file tree
Hide file tree
Showing 2 changed files with 137 additions and 37 deletions.
24 changes: 24 additions & 0 deletions api_params/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,30 @@ type password = string;
type upload = File; // XXX
type OneOrMore<T> = T | T[];

export type ApiAssert = "anon" | "bot" | "user";

export type ApiTokenType =
| "createaccount"
| "csrf"
| "deleteglobalaccount"
| "login"
| "patrol"
| "rollback"
| "setglobalaccountstatus"
| "userrights"
| "watch";

export type ApiLegacyTokenType =
| "block"
| "delete"
| "edit"
| "email"
| "import"
| "move"
| "options"
| "protect"
| "unblock";

export interface ApiParams {
action?: string;
format?: "json" | "jsonfm" | "xml" | "xmlfm" | "php" | "none";
Expand Down
Loading

0 comments on commit dec4928

Please sign in to comment.