imgflip.com 3.5.7 → 3.6.1
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 +1 -1
- package/dist/Imgflip.js +5 -2
- package/dist/interfaces.d.ts +14 -4
- package/package.json +14 -9
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# imgflip.com [](https://www.npmjs.com/package/imgflip.com)
|
|
2
2
|
|
|
3
|
-
An [imgflip.com](https://imgflip.com) API client. For a documentation on the API see https://
|
|
3
|
+
An [imgflip.com](https://imgflip.com) API client. For a documentation on the API see [the imgflip API reference](https://imgflip.com/api).
|
|
4
4
|
|
|
5
5
|
### Installation
|
|
6
6
|
|
package/dist/Imgflip.js
CHANGED
|
@@ -60,9 +60,12 @@ class Imgflip {
|
|
|
60
60
|
const response = yield this.apiClient.request(endpoint, config);
|
|
61
61
|
return response.json();
|
|
62
62
|
});
|
|
63
|
-
this.getMemes = () => __awaiter(this, void 0, void 0, function* () {
|
|
63
|
+
this.getMemes = (options) => __awaiter(this, void 0, void 0, function* () {
|
|
64
64
|
const endpoint = Endpoints_1.Endpoint.getMemes();
|
|
65
|
-
const { data } = yield this.apiClient.get(endpoint
|
|
65
|
+
const { data } = yield this.apiClient.get(endpoint, {
|
|
66
|
+
params: options
|
|
67
|
+
? Object.assign(Object.assign({}, options), { type: Array.isArray(options.type) ? options.type.join(',') : options.type }) : undefined,
|
|
68
|
+
});
|
|
66
69
|
return data;
|
|
67
70
|
});
|
|
68
71
|
this.apiClient = new api_client_1.APIClient(apiUrl || Imgflip.BASE_URL);
|
package/dist/interfaces.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export interface API {
|
|
|
14
14
|
* Gets an array of popular memes that may be captioned with this API.
|
|
15
15
|
* The size of this array and the order of memes may change at any time.
|
|
16
16
|
*/
|
|
17
|
-
getMemes(): Promise<Response<Memes>>;
|
|
17
|
+
getMemes(options?: GetMemesOptions): Promise<Response<Memes>>;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* `x`, `y`, `width`, and `height` are for the bounding box of the text box. `x` and
|
|
@@ -34,6 +34,13 @@ export interface Box {
|
|
|
34
34
|
x?: number;
|
|
35
35
|
y?: number;
|
|
36
36
|
}
|
|
37
|
+
export type GetMemesOptions = {
|
|
38
|
+
/**
|
|
39
|
+
* The type of meme templates to return.
|
|
40
|
+
* Valid values are `gif` or `image`.
|
|
41
|
+
*/
|
|
42
|
+
type?: MemeType | MemeType[];
|
|
43
|
+
};
|
|
37
44
|
export interface Image {
|
|
38
45
|
page_url: string;
|
|
39
46
|
url: string;
|
|
@@ -44,7 +51,7 @@ export interface ImageCaptionWithBoxes extends ImageCaptionBase {
|
|
|
44
51
|
* For creating memes with more than two text boxes, or for further
|
|
45
52
|
* customization. If boxes is specified, text will not be automatically
|
|
46
53
|
* converted to uppercase, so you'll have to handle capitalization yourself
|
|
47
|
-
* if you want the standard uppercase meme text. You may specify up to
|
|
54
|
+
* if you want the standard uppercase meme text. You may specify up to 20
|
|
48
55
|
* text boxes. You may leave the first box completely empty, so that the
|
|
49
56
|
* second box will automatically be used for the bottom text.
|
|
50
57
|
*/
|
|
@@ -67,6 +74,7 @@ export interface Meme {
|
|
|
67
74
|
export interface Memes {
|
|
68
75
|
memes: Meme[];
|
|
69
76
|
}
|
|
77
|
+
export type MemeType = 'gif' | 'image';
|
|
70
78
|
export type Response<T> = {
|
|
71
79
|
data: T;
|
|
72
80
|
success: true;
|
|
@@ -76,9 +84,11 @@ export type Response<T> = {
|
|
|
76
84
|
};
|
|
77
85
|
interface ImageCaptionBase {
|
|
78
86
|
/** The font family to use for the text. Defaults to `impact`. */
|
|
79
|
-
font?:
|
|
87
|
+
font?: string;
|
|
80
88
|
/** Maximum font size in pixels. Defaults to `50px`. */
|
|
81
|
-
max_font_size?: string;
|
|
89
|
+
max_font_size?: number | string;
|
|
90
|
+
/** Remove the imgflip.com watermark (premium feature). */
|
|
91
|
+
no_watermark?: 0 | 1 | boolean;
|
|
82
92
|
/** password for the imgflip account */
|
|
83
93
|
password: string;
|
|
84
94
|
/**
|
package/package.json
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"author": "Florian Imdahl <git@ffflorian.de>",
|
|
3
3
|
"dependencies": {
|
|
4
|
-
"@ffflorian/api-client": "2.5.
|
|
5
|
-
"qs": "6.15.
|
|
4
|
+
"@ffflorian/api-client": "2.5.2",
|
|
5
|
+
"qs": "6.15.2"
|
|
6
6
|
},
|
|
7
7
|
"description": "A imgflip.com API client",
|
|
8
8
|
"devDependencies": {
|
|
9
|
-
"@types/node": "~
|
|
10
|
-
"@types/qs": "6.15.
|
|
9
|
+
"@types/node": "~25",
|
|
10
|
+
"@types/qs": "6.15.1",
|
|
11
|
+
"nock": "14.0.15",
|
|
11
12
|
"rimraf": "6.1.3",
|
|
12
|
-
"typedoc": "0.28.
|
|
13
|
-
"typescript": "6.0.
|
|
13
|
+
"typedoc": "0.28.19",
|
|
14
|
+
"typescript": "6.0.3",
|
|
15
|
+
"vitest": "4.1.6"
|
|
14
16
|
},
|
|
15
17
|
"engines": {
|
|
16
18
|
"node": ">= 21"
|
|
@@ -29,14 +31,17 @@
|
|
|
29
31
|
"license": "GPL-3.0",
|
|
30
32
|
"name": "imgflip.com",
|
|
31
33
|
"readme": "https://github.com/ffflorian/api-clients#readme",
|
|
32
|
-
"repository":
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "git+https://github.com/ffflorian/api-clients.git"
|
|
37
|
+
},
|
|
33
38
|
"scripts": {
|
|
34
39
|
"build": "yarn build:ts",
|
|
35
40
|
"build:ts": "tsc -p tsconfig.build.json",
|
|
36
41
|
"build:docs": "typedoc --tsconfig tsconfig.build.json --options ../../typedoc.json --out ../../docs/packages/imgflip.com src/index.ts",
|
|
37
42
|
"clean": "rimraf dist",
|
|
38
43
|
"dist": "yarn clean && yarn build",
|
|
39
|
-
"test": "
|
|
44
|
+
"test": "vitest run"
|
|
40
45
|
},
|
|
41
|
-
"version": "3.
|
|
46
|
+
"version": "3.6.1"
|
|
42
47
|
}
|