/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options */ /** * @module ai/aicore/model/airunresult * @publicApi */ import type { AIRunSingleRootResult, AIRunStatus } from "./airunsinglerootresult.js"; import { type CKEditorError } from "@ckeditor/ckeditor5-utils"; /** * Container returned by any per-root AI run. Wraps one * {@link module:ai/aicore/model/airunsinglerootresult~AIRunSingleRootResult} (or feature-specific subclass) per root * when the run completes successfully; on whole-run failures (transport / parse errors or abort) the `results` array * stays empty and the outcome is described by `status` and `error`. */ export declare class AIRunResult { constructor(results?: Array); /** * Marks the run as aborted. Reflected via {@link #status}. No-op when the run has already errored — a * concrete error is more informative to the integrator than a subsequent abort. */ abort(): void; /** * Outcome of the whole run — driven explicitly by the runner. Per-root sub-results carry their own * `status` / `error`; consult {@link #results} for per-root outcomes. */ get status(): AIRunStatus; set status(value: AIRunStatus); /** * The error that caused the whole run to fail. Undefined when the run completed successfully or was aborted. * * When the failure originated in the AI service backend, its structured response (for example, an `issues` * list describing which fields failed validation) is available under `error.data.backendData`. */ get error(): Error | undefined; set error(value: CKEditorError); get results(): Array; /** * Appends one or more per-root sub-results to the multi. */ addResult(...results: Array): void; }