/** * @copyright * Copyright 2026 Steven Roussey * All Rights Reserved */ import { CreateWorkflow, Task, type IExecuteContext, type IExecutePreviewContext, type TaskConfig } from "@workglow/task-graph"; import type { ImageValue, WithImageValuePorts } from "@workglow/util/media"; import type { DataPortSchema, FromSchema } from "@workglow/util/schema"; declare const inputSchema: { readonly type: "object"; readonly properties: { readonly text: { readonly type: "string"; readonly title: "Text"; readonly description: "Text to render (use \\n for line breaks)"; readonly minLength: 1; }; readonly font: { readonly type: "string"; readonly title: "Font"; readonly description: "CSS font family name (e.g. sans-serif, Arial)"; readonly default: "sans-serif"; }; readonly fontSize: { readonly type: "integer"; readonly title: "Font size"; readonly description: "Font size in pixels"; readonly minimum: 1; readonly default: 24; }; readonly bold: { readonly type: "boolean"; readonly title: "Bold"; readonly default: false; }; readonly italic: { readonly type: "boolean"; readonly title: "Italic"; readonly default: false; }; readonly color: { readonly oneOf: readonly [{ readonly type: "object"; readonly properties: { readonly r: { readonly type: "integer"; readonly minimum: 0; readonly maximum: 255; readonly title: "Red"; }; readonly g: { readonly type: "integer"; readonly minimum: 0; readonly maximum: 255; readonly title: "Green"; }; readonly b: { readonly type: "integer"; readonly minimum: 0; readonly maximum: 255; readonly title: "Blue"; }; readonly a: { readonly type: "integer"; readonly minimum: 0; readonly maximum: 255; readonly title: "Alpha"; readonly default: 255; }; }; readonly required: readonly ["r", "g", "b"]; readonly format: "color"; readonly additionalProperties: false; }, { readonly type: "string"; readonly format: "color"; readonly pattern: "^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"; readonly title: "Color (hex)"; readonly description: "Color as a `#RRGGBB[AA]` or `#RGB[A]` hex string"; }, { readonly type: "string"; readonly format: "color"; readonly pattern: string; readonly title: "Color (RGB)"; readonly description: "Color as a CSS `rgb(r,g,b)` or `rgba(r,g,b,a)` string"; }]; }; readonly position: { readonly type: "string"; readonly title: "Position"; readonly description: "Anchor position of the text block within the image"; readonly enum: readonly ["top-left", "top-center", "top-right", "middle-left", "middle-center", "middle-right", "bottom-left", "bottom-center", "bottom-right"]; readonly default: "middle-center"; readonly "x-ui-enum-labels": Record<"bottom-center" | "bottom-left" | "bottom-right" | "middle-center" | "middle-left" | "middle-right" | "top-center" | "top-left" | "top-right", string>; }; 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: "Output width in pixels"; readonly minimum: 1; }; readonly height: { readonly type: "integer"; readonly title: "Height"; readonly description: "Output height in pixels"; readonly minimum: 1; }; }; readonly required: readonly ["text", "color"]; readonly additionalProperties: false; readonly if: { readonly not: { readonly required: readonly ["image"]; }; }; readonly then: { readonly required: readonly ["width", "height"]; }; }; type ImageTextSchemaInput = FromSchema; export type ImageTextTaskInput = WithImageValuePorts; export type ImageTextTaskOutput = { image: ImageValue; }; export declare class ImageTextTask extends Task { static readonly type = "ImageTextTask"; static readonly category = "Image"; static title: string; static description: string; static inputSchema(): DataPortSchema; static outputSchema(): DataPortSchema; getDefaultInputsFromStaticInputDefinitions(): Partial; execute(input: Input, _context: IExecuteContext): Promise; executePreview(input: Input, _context: IExecutePreviewContext): Promise; } declare module "@workglow/task-graph" { interface Workflow { imageText: CreateWorkflow; } } export {};