@m4k/common 0.2.2 → 0.2.3

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.
Files changed (2) hide show
  1. package/lib/index.d.ts +18 -4
  2. package/package.json +4 -2
package/lib/index.d.ts CHANGED
@@ -7,6 +7,7 @@ export type QueuePosition = {
7
7
  export type ProcessingError = {
8
8
  error: string;
9
9
  };
10
+ type ImageFormat = "avif" | "jpeg" | "png" | "webp" | "tiff" | "dz" | "ppm" | "fits" | "gif" | "svg" | "heif" | "pdf" | "jp2";
10
11
  export type ImageOptions = {
11
12
  /** The rotation of the image. If not provided, the image will be auto-rotated, according to the EXIF data. To disable auto-rotation, set to `0`. */
12
13
  rotate?: number;
@@ -19,8 +20,10 @@ export type ImageOptions = {
19
20
  /** The way to resize the image. */
20
21
  fit?: "contain" | "cover" | "fill" | "inside" | "outside";
21
22
  };
23
+ /** The extension of the output file. This is the same as the format. */
24
+ ext?: ImageFormat;
22
25
  /** The format of the output file. */
23
- format?: "avif" | "jpeg" | "png" | "webp" | "tiff" | "dz" | "ppm" | "fits" | "gif" | "svg" | "heif" | "pdf" | "jp2";
26
+ format?: ImageFormat;
24
27
  /** The quality of the output file. */
25
28
  quality?: number;
26
29
  /** Whether to keep the metadata of the image. */
@@ -42,9 +45,11 @@ export type ImageOptions = {
42
45
  /** The height of the crop. */
43
46
  height: number;
44
47
  };
48
+ };
49
+ export type RemoteImageOptions = ImageOptions & {
45
50
  /** The name of the output file. */
46
51
  name?: string;
47
- /** The output path of the file. */
52
+ /** The output path of the file. This can be a local path or an S3 path. */
48
53
  output?: string;
49
54
  };
50
55
  export type VideoOptions = {
@@ -82,9 +87,13 @@ export type VideoOptions = {
82
87
  videoCodec?: string;
83
88
  /** The filters to apply to the video. */
84
89
  videoFilters?: string;
90
+ /** Custom ffmpeg arguments to apply to this video processing. */
91
+ args?: string[];
92
+ };
93
+ export type RemoteVideoOptions = VideoOptions & {
85
94
  /** The name of the output file. */
86
95
  name?: string;
87
- /** The output path of the file. */
96
+ /** The output path of the file. This can be a local path or an S3 path. */
88
97
  output?: string;
89
98
  };
90
99
  export type AudioOptions = {
@@ -106,9 +115,13 @@ export type AudioOptions = {
106
115
  inputFormat?: string;
107
116
  /** The seek time of the audio. */
108
117
  seek?: number | string;
118
+ /** Custom ffmpeg arguments to apply to this audio processing. */
119
+ args?: string[];
120
+ };
121
+ export type RemoteAudioOptions = AudioOptions & {
109
122
  /** The name of the output file. */
110
123
  name?: string;
111
- /** The output path of the file. */
124
+ /** The output path of the file. This can be a local path or an S3 path. */
112
125
  output?: string;
113
126
  };
114
127
  export declare class ProcessedFile {
@@ -117,4 +130,5 @@ export declare class ProcessedFile {
117
130
  readonly stream?: AsyncIterable<Uint8Array> | undefined;
118
131
  constructor(name: string, type: string, stream?: AsyncIterable<Uint8Array> | undefined);
119
132
  }
133
+ export {};
120
134
  //# sourceMappingURL=index.d.ts.map
package/package.json CHANGED
@@ -1,18 +1,20 @@
1
1
  {
2
2
  "name": "@m4k/common",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "type": "module",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
7
7
  "module": "./lib/index.js",
8
8
  "license": "MIT",
9
+ "description": "Common types and utilities for m4k",
10
+ "author": "sv2dev",
9
11
  "scripts": {
10
12
  "prepublishOnly": "bun run build",
11
13
  "build": "tsc -b",
12
14
  "typecheck": "tsc --noEmit"
13
15
  },
14
16
  "devDependencies": {
15
- "typescript": "^5.0.0"
17
+ "typescript": "^5.8.3"
16
18
  },
17
19
  "repository": "github:sv2dev/m4k"
18
20
  }