/** * @copyright * Copyright 2026 Steven Roussey * All Rights Reserved */ import { CreateWorkflow, type TaskConfig } from "@workglow/task-graph"; import { ImageFilterTask, type ImageFilterInput, type ImageFilterOutput } from "../ImageFilterTask"; import type { CropParams } from "./crop.cpu"; export interface ImageCropTaskInput extends ImageFilterInput { left: number; top: number; width: number; height: number; } export type ImageCropTaskOutput = ImageFilterOutput & Record; export declare class ImageCropTask extends ImageFilterTask, ImageCropTaskOutput> { static readonly type = "ImageCropTask"; static readonly category = "Image"; static title: string; static description: string; static inputSchema(): { readonly type: "object"; readonly properties: { readonly image: { readonly oneOf: readonly [{ readonly type: "string"; readonly format: "image:data-uri"; }, { readonly type: "object"; readonly format: "image"; }]; readonly title: "Image"; readonly description: "Image"; readonly format: "image"; }; readonly left: { readonly type: "integer"; readonly title: "Left"; readonly description: "Left offset"; readonly minimum: 0; readonly default: 0; }; readonly top: { readonly type: "integer"; readonly title: "Top"; readonly description: "Top offset"; readonly minimum: 0; readonly default: 0; }; readonly width: { readonly type: "integer"; readonly title: "Width"; readonly description: "Crop width"; readonly minimum: 1; }; readonly height: { readonly type: "integer"; readonly title: "Height"; readonly description: "Crop height"; readonly minimum: 1; }; }; readonly required: readonly ["image", "left", "top", "width", "height"]; readonly additionalProperties: false; }; static outputSchema(): { readonly type: "object"; readonly properties: { readonly image: { readonly oneOf: readonly [{ readonly type: "string"; readonly format: "image:data-uri"; }, { readonly type: "object"; readonly format: "image"; }]; readonly title: "Image"; readonly description: "Image"; readonly format: "image"; }; }; readonly required: readonly ["image"]; readonly additionalProperties: false; }; protected readonly filterName = "crop"; protected opParams(input: ImageCropTaskInput & Record): CropParams; protected scalePreviewParams({ left, top, width, height }: CropParams, s: number): CropParams; } declare module "@workglow/task-graph" { interface Workflow { imageCrop: CreateWorkflow, ImageCropTaskOutput, TaskConfig>; } }