/**
 * This file is part of the NocoBase (R) project.
 * Copyright (c) 2020-2024 NocoBase Co., Ltd.
 * Authors: NocoBase Team.
 *
 * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
 * For more information, please refer to: https://www.nocobase.com/agreement.
 */
import { FlowContext } from '@nocobase/flow-engine';
export type RunJSIssue = {
    type: 'lint' | 'runtime';
    message: string;
    ruleId?: string;
    location?: {
        start?: {
            line: number;
            column: number;
        };
    };
    stack?: string;
};
export type RunJSLog = {
    level: 'log' | 'info' | 'warn' | 'error';
    message: string;
};
export type DiagnoseRunJSResult = {
    issues: RunJSIssue[];
    logs: RunJSLog[];
    execution?: {
        started: boolean;
        finished: boolean;
        timeout: boolean;
        durationMs?: number;
    };
};
export type PreviewRunJSResult = {
    success: boolean;
    message: string;
};
export type RunJSDiagnosticsOptions = {
    version?: string;
};
export declare const MAX_MESSAGE_CHARS = 4000;
export declare function formatRunJSPreviewMessage(result: DiagnoseRunJSResult): string;
export declare function diagnoseRunJS(code: string, ctx: FlowContext, options?: RunJSDiagnosticsOptions): Promise<DiagnoseRunJSResult>;
export declare function previewRunJS(code: string, ctx: FlowContext, options?: RunJSDiagnosticsOptions): Promise<PreviewRunJSResult>;
