@vibephoto/edit-schema
v1.1.0
Published
VibePhoto edit-state TypeScript interfaces, JSON Schema, and AJV validator.
Downloads
7
Maintainers
Readme
@vibephoto/edit-schema
TypeScript interfaces, JSON Schema, and AJV validator for VibePhoto non-destructive photo edits.
Install
npm i @vibephoto/edit-schema ajv ajv-formats
# or
pnpm add @vibephoto/edit-schema ajv ajv-formatsUsage
import { validateEdit, VibePhotoJSONSchema } from "@vibephoto/edit-schema";
import type { VibePhotoEdit } from "@vibephoto/edit-schema";
const edit: VibePhotoEdit = {
vibephotoVersion: "1.0",
image: { id: "IMG1", fileName: "photo.jpg", dimensions: { width: 4032, height: 3024 } }
};
const res = validateEdit(edit);
if (!res.ok) {
console.error(res.errors);
}Exports
VibePhotoEditTypeScript interfacesVibePhotoJSONSchemaJSON Schema (Draft-07)validateEdit()AJV helper
Scripts
npm run build— builds ESM + CJS + types viatsupnpm test— runs unit tests viavitest
License
MIT
