imgflip.com 3.5.5 → 3.5.7

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 CHANGED
@@ -17,10 +17,9 @@ import {Imgflip} from 'imgflip.com';
17
17
 
18
18
  const imgflip = new Imgflip();
19
19
 
20
- imgflip.api
21
- .getMemes().then(response => {
22
- //
23
- });
20
+ imgflip.api.getMemes().then(response => {
21
+ //
22
+ });
24
23
 
25
24
  imgflip.api
26
25
  .captionImage({
@@ -1,6 +1,6 @@
1
1
  export declare const Endpoint: {
2
2
  CAPTION_IMAGE: string;
3
- GET_MEMES: string;
4
3
  captionImage(): string;
4
+ GET_MEMES: string;
5
5
  getMemes(): string;
6
6
  };
package/dist/Endpoints.js CHANGED
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Endpoint = void 0;
4
4
  exports.Endpoint = {
5
5
  CAPTION_IMAGE: 'caption_image',
6
- GET_MEMES: 'get_memes',
7
6
  captionImage() {
8
7
  return `/${exports.Endpoint.CAPTION_IMAGE}`;
9
8
  },
9
+ GET_MEMES: 'get_memes',
10
10
  getMemes() {
11
11
  return `/${exports.Endpoint.GET_MEMES}`;
12
12
  },
package/dist/Imgflip.d.ts CHANGED
@@ -4,11 +4,11 @@ export declare class Imgflip {
4
4
  readonly api: API;
5
5
  private readonly apiClient;
6
6
  constructor(apiUrl?: string);
7
- private readonly captionImage;
8
- private readonly getMemes;
9
7
  /**
10
8
  * Set a new API URL.
11
9
  * @param newURL The new API url
12
10
  */
13
11
  setApiUrl(newURL: string): void;
12
+ private readonly captionImage;
13
+ private readonly getMemes;
14
14
  }
@@ -16,28 +16,6 @@ export interface API {
16
16
  */
17
17
  getMemes(): Promise<Response<Memes>>;
18
18
  }
19
- export type Response<T> = {
20
- data: T;
21
- success: true;
22
- } | {
23
- error_message: string;
24
- success: false;
25
- };
26
- export interface Image {
27
- page_url: string;
28
- url: string;
29
- }
30
- export interface Memes {
31
- memes: Meme[];
32
- }
33
- export interface Meme {
34
- box_count: number;
35
- height: number;
36
- id: string;
37
- name: string;
38
- url: string;
39
- width: number;
40
- }
41
19
  /**
42
20
  * `x`, `y`, `width`, and `height` are for the bounding box of the text box. `x` and
43
21
  * `y` are the coordinates of the top left corner. If you specify bounding
@@ -56,24 +34,11 @@ export interface Box {
56
34
  x?: number;
57
35
  y?: number;
58
36
  }
59
- interface ImageCaptionBase {
60
- /** The font family to use for the text. Defaults to `impact`. */
61
- font?: 'impact' | 'arial';
62
- /** Maximum font size in pixels. Defaults to `50px`. */
63
- max_font_size?: string;
64
- /** password for the imgflip account */
65
- password: string;
66
- /**
67
- * A template ID as returned by the `get_memes` response. Any ID that was
68
- * ever returned from the `get_memes` response should work for this parameter.
69
- * For custom template uploads, the template ID can be found in the
70
- * memegenerator URL, e.g.
71
- * https://imgflip.com/memegenerator/14859329/Charlie-Sheen-DERP.
72
- */
73
- template_id: number | string;
74
- /** username of a valid imgflip account. This is used to track where API requests are coming from. */
75
- username: string;
37
+ export interface Image {
38
+ page_url: string;
39
+ url: string;
76
40
  }
41
+ export type ImageCaptionOptions = ImageCaptionWithBoxes | ImageCaptionWithTexts;
77
42
  export interface ImageCaptionWithBoxes extends ImageCaptionBase {
78
43
  /**
79
44
  * For creating memes with more than two text boxes, or for further
@@ -91,5 +56,40 @@ export interface ImageCaptionWithTexts extends ImageCaptionBase {
91
56
  /** Bottom text for the meme */
92
57
  text1: string;
93
58
  }
94
- export type ImageCaptionOptions = ImageCaptionWithBoxes | ImageCaptionWithTexts;
59
+ export interface Meme {
60
+ box_count: number;
61
+ height: number;
62
+ id: string;
63
+ name: string;
64
+ url: string;
65
+ width: number;
66
+ }
67
+ export interface Memes {
68
+ memes: Meme[];
69
+ }
70
+ export type Response<T> = {
71
+ data: T;
72
+ success: true;
73
+ } | {
74
+ error_message: string;
75
+ success: false;
76
+ };
77
+ interface ImageCaptionBase {
78
+ /** The font family to use for the text. Defaults to `impact`. */
79
+ font?: 'arial' | 'impact';
80
+ /** Maximum font size in pixels. Defaults to `50px`. */
81
+ max_font_size?: string;
82
+ /** password for the imgflip account */
83
+ password: string;
84
+ /**
85
+ * A template ID as returned by the `get_memes` response. Any ID that was
86
+ * ever returned from the `get_memes` response should work for this parameter.
87
+ * For custom template uploads, the template ID can be found in the
88
+ * memegenerator URL, e.g.
89
+ * https://imgflip.com/memegenerator/14859329/Charlie-Sheen-DERP.
90
+ */
91
+ template_id: number | string;
92
+ /** username of a valid imgflip account. This is used to track where API requests are coming from. */
93
+ username: string;
94
+ }
95
95
  export {};
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "author": "Florian Imdahl <git@ffflorian.de>",
3
3
  "dependencies": {
4
- "@ffflorian/api-client": "2.2.0",
5
- "qs": "6.14.1"
4
+ "@ffflorian/api-client": "2.5.1",
5
+ "qs": "6.15.0"
6
6
  },
7
7
  "description": "A imgflip.com API client",
8
8
  "devDependencies": {
9
9
  "@types/node": "~24",
10
- "@types/qs": "6.14.0",
11
- "rimraf": "6.1.2",
12
- "typedoc": "0.28.15",
13
- "typescript": "5.9.3"
10
+ "@types/qs": "6.15.0",
11
+ "rimraf": "6.1.3",
12
+ "typedoc": "0.28.18",
13
+ "typescript": "6.0.2"
14
14
  },
15
15
  "engines": {
16
16
  "node": ">= 21"
@@ -31,12 +31,12 @@
31
31
  "readme": "https://github.com/ffflorian/api-clients#readme",
32
32
  "repository": "https://github.com/ffflorian/api-clients.git",
33
33
  "scripts": {
34
+ "build": "yarn build:ts",
34
35
  "build:ts": "tsc -p tsconfig.build.json",
35
36
  "build:docs": "typedoc --tsconfig tsconfig.build.json --options ../../typedoc.json --out ../../docs/packages/imgflip.com src/index.ts",
36
37
  "clean": "rimraf dist",
37
- "dist": "yarn clean && yarn build:ts",
38
+ "dist": "yarn clean && yarn build",
38
39
  "test": "exit 0"
39
40
  },
40
- "version": "3.5.5",
41
- "gitHead": "8d7471cbe490305b3e441c27acbc81e36a4bd9df"
41
+ "version": "3.5.7"
42
42
  }