Port image processing from Oh My Pi's pi-natives crate, adapted for napi-rs v2. Exposes NativeImage class with async parse/encode/resize methods backed by the Rust `image` crate (PNG, JPEG, WebP, GIF support). Includes: - task.rs: lightweight async task scheduling for libuv thread pool - image.rs: NativeImage class with SamplingFilter enum - TypeScript types and wrapper (parseImage, ImageFormat, SamplingFilter) - 8 passing tests covering decode, encode, resize, round-trip, error cases Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
39 lines
1 KiB
JSON
39 lines
1 KiB
JSON
{
|
|
"name": "@gsd/native",
|
|
"version": "0.1.0",
|
|
"description": "Native Rust bindings for GSD — high-performance native modules via N-API",
|
|
"type": "module",
|
|
"main": "./src/index.ts",
|
|
"types": "./src/index.ts",
|
|
"scripts": {
|
|
"build:native": "node ../../native/scripts/build.js",
|
|
"build:native:dev": "node ../../native/scripts/build.js --dev",
|
|
"test": "node --test src/__tests__/grep.test.mjs src/__tests__/clipboard.test.mjs src/__tests__/image.test.mjs"
|
|
},
|
|
"exports": {
|
|
".": {
|
|
"types": "./src/index.ts",
|
|
"import": "./src/index.ts"
|
|
},
|
|
"./grep": {
|
|
"types": "./src/grep/index.ts",
|
|
"import": "./src/grep/index.ts"
|
|
},
|
|
"./clipboard": {
|
|
"types": "./src/clipboard/index.ts",
|
|
"import": "./src/clipboard/index.ts"
|
|
},
|
|
"./ast": {
|
|
"types": "./src/ast/index.ts",
|
|
"import": "./src/ast/index.ts"
|
|
},
|
|
"./image": {
|
|
"types": "./src/image/index.ts",
|
|
"import": "./src/image/index.ts"
|
|
}
|
|
},
|
|
"files": [
|
|
"src"
|
|
],
|
|
"license": "MIT"
|
|
}
|