next-image-transformer 0.0.11

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.
@@ -0,0 +1 @@
1
+ export declare const notNullish: <T>(item: T | undefined | null) => item is T;
@@ -0,0 +1,7 @@
1
+ export declare function readTransformCache({ cacheKey, cacheDir, }: {
2
+ cacheKey: string;
3
+ cacheDir: string;
4
+ }): Promise<{
5
+ body: Uint8Array<ArrayBuffer>;
6
+ contentType: string;
7
+ } | null>;
@@ -0,0 +1,12 @@
1
+ import z from "zod";
2
+ export declare const searchParamsToTransformConfigCodec: z.ZodCodec<z.ZodCustom<import("url").URLSearchParams, import("url").URLSearchParams>, z.ZodObject<{
3
+ w: z.ZodOptional<z.ZodInt32>;
4
+ h: z.ZodOptional<z.ZodInt32>;
5
+ fmt: z.ZodEnum<{
6
+ preserve: "preserve";
7
+ webp: "webp";
8
+ avif: "avif";
9
+ }>;
10
+ q: z.ZodOptional<z.ZodInt32>;
11
+ source: z.ZodString;
12
+ }, z.core.$strip>>;
@@ -0,0 +1,2 @@
1
+ import z from "zod";
2
+ export declare const stringToIntCodec: z.ZodCodec<z.ZodString, z.ZodInt>;
@@ -0,0 +1,13 @@
1
+ import z from "zod";
2
+ export declare const transformConfigSchema: z.ZodObject<{
3
+ w: z.ZodOptional<z.ZodInt32>;
4
+ h: z.ZodOptional<z.ZodInt32>;
5
+ fmt: z.ZodEnum<{
6
+ preserve: "preserve";
7
+ webp: "webp";
8
+ avif: "avif";
9
+ }>;
10
+ q: z.ZodOptional<z.ZodInt32>;
11
+ source: z.ZodString;
12
+ }, z.core.$strip>;
13
+ export type TransformConfig = z.output<typeof transformConfigSchema>;
@@ -0,0 +1,8 @@
1
+ export declare function writeTransformCache({ cacheKey, body, meta, cacheDir, }: {
2
+ cacheKey: string;
3
+ body: Buffer;
4
+ meta: {
5
+ contentType: string;
6
+ };
7
+ cacheDir: string;
8
+ }): Promise<void>;
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "next-image-transformer",
3
+ "version": "0.0.11",
4
+ "main": "dist/index.js",
5
+ "types": "dist/index.d.ts",
6
+ "exports": {
7
+ ".": {
8
+ "types": "./dist/index.d.ts",
9
+ "import": "./dist/index.js"
10
+ }
11
+ },
12
+ "type": "module",
13
+ "publishConfig": {
14
+ "registry": "https://registry.npmjs.org",
15
+ "access": "public"
16
+ },
17
+ "sideEffects": false,
18
+ "files": [
19
+ "dist",
20
+ "README.md",
21
+ "LICENSE*"
22
+ ],
23
+ "packageManager": "yarn@4.9.2",
24
+ "devDependencies": {
25
+ "@types/node": "24",
26
+ "np": "^10.2.0",
27
+ "prettier": "^3.7.4",
28
+ "typescript": "^5.9.3",
29
+ "vite": "^7.3.0"
30
+ },
31
+ "dependencies": {
32
+ "fp-ts": "^2.16.11",
33
+ "sharp": "^0.34.5",
34
+ "zod": "^4.3.5"
35
+ },
36
+ "peerDependencies": {
37
+ "next": ">=13.4 <17"
38
+ },
39
+ "scripts": {
40
+ "build": "vite build && tsc"
41
+ }
42
+ }