/** * @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 { ResizeParams } from "./resize.cpu"; export interface ImageResizeTaskInput extends ImageFilterInput { width: number; height: number; fit?: string; kernel?: string; } export type ImageResizeTaskOutput = ImageFilterOutput & Record; export declare class ImageResizeTask extends ImageFilterTask, ImageResizeTaskOutput> { static readonly type = "ImageResizeTask"; 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 width: { readonly type: "integer"; readonly title: "Width"; readonly description: "Target width in pixels"; readonly minimum: 1; }; readonly height: { readonly type: "integer"; readonly title: "Height"; readonly description: "Target height in pixels"; readonly minimum: 1; }; readonly fit: { readonly type: "string"; readonly enum: readonly ["cover", "contain", "fill", "inside", "outside"]; readonly title: "Fit"; readonly description: "How the image should be resized to fit"; }; readonly kernel: { readonly type: "string"; readonly enum: readonly ["nearest", "cubic", "mitchell", "lanczos2", "lanczos3"]; readonly title: "Kernel"; readonly description: "Resampling kernel"; }; }; readonly required: readonly ["image", "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 = "resize"; protected opParams(input: ImageResizeTaskInput & Record): ResizeParams; protected scalePreviewParams({ width, height, fit, kernel }: ResizeParams, s: number): ResizeParams; } declare module "@workglow/task-graph" { interface Workflow { imageResize: CreateWorkflow, ImageResizeTaskOutput, TaskConfig>; } }