import { Context } from '@tego/server';
/**
 * 获取工作流的实际数据（处理 Model 和 JSON 两种格式）
 */
export declare function getWorkflowData(workflow: any): {
    id?: number;
    key?: string;
};
/**
 * 查询单个工作流的最新执行时间
 * @param ctx 上下文对象
 * @param workflowId 工作流 ID（优先使用，可利用外键索引）
 * @param workflowKey 工作流 Key（备用）
 * @returns UTC ISO 格式的时间字符串，如果不存在则返回 null
 */
export declare function getLatestExecutedTimeForWorkflow(ctx: Context, workflowId?: number, workflowKey?: string): Promise<string | null>;
/**
 * 为工作流对象设置最新执行时间
 * 支持 Model 和普通对象两种格式
 */
export declare function setLatestExecutedTime(row: any, executedTime: string | null): void;
/**
 * 查询单个工作流关联的事件源名称
 * @param ctx 上下文对象
 * @param workflowKey 工作流 Key
 * @returns 事件源名称，如果不存在则返回 null
 */
export declare function getEventSourceNameForWorkflow(ctx: Context, workflowKey?: string): Promise<string | null>;
/**
 * 为工作流对象设置事件源名称
 * 支持 Model 和普通对象两种格式
 */
export declare function setEventSourceName(row: any, eventSourceName: string | null): void;
/**
 * 查询单个工作流的分类信息
 * 优先从 workflow 对象中获取已加载的分类数据（通过 appends），如果不存在则查询数据库
 * @param ctx 上下文对象
 * @param workflow 工作流对象（可能包含已加载的分类数据）
 * @param workflowKey 工作流 Key（用于查询数据库）
 * @returns 分类信息数组，格式：{ id, name, color? }[]
 */
export declare function getCategoriesForWorkflow(ctx: Context, workflow?: any, workflowKey?: string): Promise<Array<{
    id: number;
    name: string;
    color?: string;
}> | null>;
/**
 * 为工作流对象设置分类信息
 * 支持 Model 和普通对象两种格式
 */
export declare function setCategories(row: any, categories: Array<{
    id: number;
    name: string;
    color?: string;
}> | null): void;
