@sudobility/svgr_types 1.0.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/dist/index.cjs +22 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/package.json +54 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.successResponse = successResponse;
|
|
4
|
+
exports.errorResponse = errorResponse;
|
|
5
|
+
// ============================================
|
|
6
|
+
// Helper Functions
|
|
7
|
+
// ============================================
|
|
8
|
+
function successResponse(data) {
|
|
9
|
+
return {
|
|
10
|
+
success: true,
|
|
11
|
+
data,
|
|
12
|
+
timestamp: new Date().toISOString(),
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function errorResponse(error) {
|
|
16
|
+
return {
|
|
17
|
+
success: false,
|
|
18
|
+
error,
|
|
19
|
+
timestamp: new Date().toISOString(),
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type { ApiResponse, BaseResponse } from '@sudobility/types';
|
|
2
|
+
/** Request body for POST /convert */
|
|
3
|
+
export interface ConvertRequest {
|
|
4
|
+
/** Base64-encoded raster image (PNG, JPG, WEBP, BMP, GIF) */
|
|
5
|
+
original: string;
|
|
6
|
+
/** Optional filename for metadata */
|
|
7
|
+
filename?: string;
|
|
8
|
+
}
|
|
9
|
+
/** Result returned from a successful conversion */
|
|
10
|
+
export interface ConvertResult {
|
|
11
|
+
/** SVG content as a string */
|
|
12
|
+
svg: string;
|
|
13
|
+
/** Original image width in pixels */
|
|
14
|
+
width: number;
|
|
15
|
+
/** Original image height in pixels */
|
|
16
|
+
height: number;
|
|
17
|
+
}
|
|
18
|
+
import type { BaseResponse } from '@sudobility/types';
|
|
19
|
+
export type ConvertResponse = BaseResponse<ConvertResult>;
|
|
20
|
+
export declare function successResponse<T>(data: T): BaseResponse<T>;
|
|
21
|
+
export declare function errorResponse(error: string): BaseResponse<never>;
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAMnE,qCAAqC;AACrC,MAAM,WAAW,cAAc;IAC7B,6DAA6D;IAC7D,QAAQ,EAAE,MAAM,CAAC;IACjB,qCAAqC;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAMD,mDAAmD;AACnD,MAAM,WAAW,aAAa;IAC5B,8BAA8B;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,qCAAqC;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,sCAAsC;IACtC,MAAM,EAAE,MAAM,CAAC;CAChB;AAKD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,MAAM,eAAe,GAAG,YAAY,CAAC,aAAa,CAAC,CAAC;AAM1D,wBAAgB,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAM3D;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,CAMhE"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// ============================================
|
|
2
|
+
// Helper Functions
|
|
3
|
+
// ============================================
|
|
4
|
+
export function successResponse(data) {
|
|
5
|
+
return {
|
|
6
|
+
success: true,
|
|
7
|
+
data,
|
|
8
|
+
timestamp: new Date().toISOString(),
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export function errorResponse(error) {
|
|
12
|
+
return {
|
|
13
|
+
success: false,
|
|
14
|
+
error,
|
|
15
|
+
timestamp: new Date().toISOString(),
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAsCA,+CAA+C;AAC/C,mBAAmB;AACnB,+CAA+C;AAE/C,MAAM,UAAU,eAAe,CAAI,IAAO;IACxC,OAAO;QACL,OAAO,EAAE,IAAI;QACb,IAAI;QACJ,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;KACpC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,KAAa;IACzC,OAAO;QACL,OAAO,EAAE,KAAK;QACd,KAAK;QACL,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;KACpC,CAAC;AACJ,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sudobility/svgr_types",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.cjs",
|
|
6
|
+
"module": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"require": "./dist/index.cjs",
|
|
12
|
+
"types": "./dist/index.d.ts"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "bun run build:cjs && bun run build:esm",
|
|
17
|
+
"build:esm": "tsc -p tsconfig.esm.json",
|
|
18
|
+
"build:cjs": "tsc -p tsconfig.cjs.json && bun run build:cjs-rename",
|
|
19
|
+
"build:cjs-rename": "for f in dist/*.js; do mv \"$f\" \"${f%.js}.cjs\"; done",
|
|
20
|
+
"clean": "rimraf dist",
|
|
21
|
+
"dev": "tsc --watch",
|
|
22
|
+
"test": "vitest run",
|
|
23
|
+
"test:watch": "vitest",
|
|
24
|
+
"test:coverage": "vitest --coverage",
|
|
25
|
+
"lint": "eslint src --ext .ts",
|
|
26
|
+
"lint:fix": "eslint src --ext .ts --fix",
|
|
27
|
+
"format": "prettier --write \"src/**/*.{ts,js,json,md}\"",
|
|
28
|
+
"format:check": "prettier --check \"src/**/*.{ts,js,json,md}\"",
|
|
29
|
+
"typecheck": "tsc --noEmit",
|
|
30
|
+
"verify": "bun run typecheck && bun run lint && bun run test && bun run build",
|
|
31
|
+
"prepublishOnly": "bun run clean && bun run verify"
|
|
32
|
+
},
|
|
33
|
+
"files": [
|
|
34
|
+
"dist/**/*"
|
|
35
|
+
],
|
|
36
|
+
"peerDependencies": {
|
|
37
|
+
"@sudobility/types": "^1.9.50"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@eslint/js": "^9.38.0",
|
|
41
|
+
"@sudobility/types": "^1.9.50",
|
|
42
|
+
"@typescript-eslint/eslint-plugin": "^8.46.2",
|
|
43
|
+
"@typescript-eslint/parser": "^8.46.2",
|
|
44
|
+
"eslint": "^9.38.0",
|
|
45
|
+
"globals": "^16.4.0",
|
|
46
|
+
"prettier": "^3.6.2",
|
|
47
|
+
"rimraf": "^6.0.1",
|
|
48
|
+
"typescript": "^5.9.3",
|
|
49
|
+
"vitest": "^4.0.15"
|
|
50
|
+
},
|
|
51
|
+
"publishConfig": {
|
|
52
|
+
"access": "public"
|
|
53
|
+
}
|
|
54
|
+
}
|