speedruncom.js 2.0.4 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Client.d.ts +3 -3
- package/lib/endpoints/endpoints.get.d.ts +11 -0
- package/package.json +1 -1
- package/src/Client.ts +1 -1
- package/src/endpoints/endpoints.get.ts +13 -0
- package/src/responses.ts +1 -0
package/lib/Client.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { AxiosRequestConfig } from 'axios';
|
|
1
|
+
import { AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
2
2
|
import GETEndpoints from './endpoints/endpoints.get.js';
|
|
3
3
|
import POSTEndpoints from './endpoints/endpoints.post.js';
|
|
4
4
|
import Responses from './responses.js';
|
|
5
5
|
type Endpoints = GETEndpoints & POSTEndpoints;
|
|
6
6
|
export default class Client {
|
|
7
7
|
axiosClient: import("axios").AxiosInstance;
|
|
8
|
-
get<E extends keyof GETEndpoints, P extends GETEndpoints[E]>(endpoint: E, params: P, axiosConfig?: AxiosRequestConfig): Promise<
|
|
9
|
-
post<E extends keyof Endpoints, P extends Endpoints[E]>(endpoint: E, params: P, axiosConfig?: AxiosRequestConfig): Promise<
|
|
8
|
+
get<E extends keyof GETEndpoints, P extends GETEndpoints[E]>(endpoint: E, params: P, axiosConfig?: AxiosRequestConfig): Promise<AxiosResponse<Responses[E], any>>;
|
|
9
|
+
post<E extends keyof Endpoints, P extends Endpoints[E]>(endpoint: E, params: P, axiosConfig?: AxiosRequestConfig): Promise<AxiosResponse<E extends keyof Responses ? Responses[E] : void, any>>;
|
|
10
10
|
}
|
|
11
11
|
export {};
|
|
@@ -519,6 +519,17 @@ export default interface GETEndpoints {
|
|
|
519
519
|
* ID of the forum.
|
|
520
520
|
*/
|
|
521
521
|
forumId: string;
|
|
522
|
+
/**
|
|
523
|
+
* The thread page, in relation to `limit`.
|
|
524
|
+
*/
|
|
525
|
+
page: number;
|
|
526
|
+
/**
|
|
527
|
+
* The maximum amount of `Thread`s to fetch.
|
|
528
|
+
*
|
|
529
|
+
* @default 30
|
|
530
|
+
* @max 100
|
|
531
|
+
*/
|
|
532
|
+
limit: number;
|
|
522
533
|
};
|
|
523
534
|
/**
|
|
524
535
|
* Gets a comment post's Thread and Forum by `commentId`.
|
package/package.json
CHANGED
package/src/Client.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import axios, { AxiosRequestConfig } from 'axios';
|
|
1
|
+
import axios, { AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
2
2
|
import GETEndpoints from './endpoints/endpoints.get.js';
|
|
3
3
|
import POSTEndpoints from './endpoints/endpoints.post.js'
|
|
4
4
|
import Responses from './responses.js';
|
|
@@ -631,6 +631,19 @@ export default interface GETEndpoints {
|
|
|
631
631
|
* ID of the forum.
|
|
632
632
|
*/
|
|
633
633
|
forumId: string;
|
|
634
|
+
|
|
635
|
+
/**
|
|
636
|
+
* The thread page, in relation to `limit`.
|
|
637
|
+
*/
|
|
638
|
+
page: number;
|
|
639
|
+
|
|
640
|
+
/**
|
|
641
|
+
* The maximum amount of `Thread`s to fetch.
|
|
642
|
+
*
|
|
643
|
+
* @default 30
|
|
644
|
+
* @max 100
|
|
645
|
+
*/
|
|
646
|
+
limit: number;
|
|
634
647
|
};
|
|
635
648
|
|
|
636
649
|
/**
|