@ffflorian/xkcdjs 3.4.7 → 3.5.0
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/README.md +3 -3
- package/dist/XKCDAPI.d.ts +4 -4
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# xkcdjs [](https://www.npmjs.com/package/@ffflorian/xkcdjs)
|
|
2
2
|
|
|
3
|
-
An [xkcd](https://xkcd.com) API client with a CLI.
|
|
3
|
+
An [xkcd](https://xkcd.com) API client with a CLI. For a documentation on the API see [the xkcd API reference](https://xkcd.com/json.html).
|
|
4
4
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
@@ -45,7 +45,7 @@ xkcd.api.getRandom().then(result => {
|
|
|
45
45
|
// XKCDResult
|
|
46
46
|
});
|
|
47
47
|
|
|
48
|
-
xkcd.api.
|
|
48
|
+
xkcd.api.getByIndex(2036).then(result => {
|
|
49
49
|
// XKCDResult
|
|
50
50
|
});
|
|
51
51
|
|
|
@@ -57,7 +57,7 @@ xkcd.api.getRandom({withData: true}).then(result => {
|
|
|
57
57
|
// XKCDResultWithData
|
|
58
58
|
});
|
|
59
59
|
|
|
60
|
-
xkcd.api.
|
|
60
|
+
xkcd.api.getByIndex(2036, {withData: true}).then(result => {
|
|
61
61
|
// XKCDResultWithData
|
|
62
62
|
});
|
|
63
63
|
```
|
package/dist/XKCDAPI.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { APIClient } from '@ffflorian/api-client';
|
|
2
|
-
import type { ClientOptions, RequestOptions, XKCDResultWithData } from './Interfaces';
|
|
2
|
+
import type { ClientOptions, RequestOptions, XKCDResult, XKCDResultWithData } from './Interfaces';
|
|
3
3
|
export declare class XKCDAPI {
|
|
4
4
|
protected readonly apiClient: APIClient;
|
|
5
5
|
protected readonly options: ClientOptions;
|
|
@@ -14,7 +14,7 @@ export declare class XKCDAPI {
|
|
|
14
14
|
getByIndex(index: number, options: {
|
|
15
15
|
withData: true;
|
|
16
16
|
}): Promise<XKCDResultWithData>;
|
|
17
|
-
getByIndex(index: number, options?: RequestOptions): Promise<
|
|
17
|
+
getByIndex(index: number, options?: RequestOptions): Promise<XKCDResult>;
|
|
18
18
|
/**
|
|
19
19
|
* Get the latest comic.
|
|
20
20
|
* @param options Request options
|
|
@@ -22,7 +22,7 @@ export declare class XKCDAPI {
|
|
|
22
22
|
getLatest(options: {
|
|
23
23
|
withData: true;
|
|
24
24
|
}): Promise<XKCDResultWithData>;
|
|
25
|
-
getLatest(options?: RequestOptions): Promise<
|
|
25
|
+
getLatest(options?: RequestOptions): Promise<XKCDResult>;
|
|
26
26
|
/**
|
|
27
27
|
* Get a random comic.
|
|
28
28
|
* @param options Request options
|
|
@@ -30,6 +30,6 @@ export declare class XKCDAPI {
|
|
|
30
30
|
getRandom(options: {
|
|
31
31
|
withData: true;
|
|
32
32
|
}): Promise<XKCDResultWithData>;
|
|
33
|
-
getRandom(options?: RequestOptions): Promise<
|
|
33
|
+
getRandom(options?: RequestOptions): Promise<XKCDResult>;
|
|
34
34
|
private getImage;
|
|
35
35
|
}
|
package/package.json
CHANGED
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
"devDependencies": {
|
|
10
10
|
"@types/node": "~24",
|
|
11
11
|
"http-status-codes": "2.3.0",
|
|
12
|
-
"nock": "14.0.
|
|
12
|
+
"nock": "14.0.12",
|
|
13
13
|
"rimraf": "6.1.3",
|
|
14
14
|
"tsx": "4.21.0",
|
|
15
|
-
"typedoc": "0.28.
|
|
16
|
-
"typescript": "6.0.
|
|
17
|
-
"vitest": "4.1.
|
|
15
|
+
"typedoc": "0.28.19",
|
|
16
|
+
"typescript": "6.0.3",
|
|
17
|
+
"vitest": "4.1.5"
|
|
18
18
|
},
|
|
19
19
|
"engines": {
|
|
20
20
|
"node": ">= 21"
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"start": "tsx src/cli.ts",
|
|
43
43
|
"test": "vitest"
|
|
44
44
|
},
|
|
45
|
-
"version": "3.
|
|
45
|
+
"version": "3.5.0"
|
|
46
46
|
}
|