import { IOutput } from '@jupyterlab/nbformat'; import { OutputAreaModel } from '@jupyterlab/outputarea'; import { IRenderMimeRegistry } from '@jupyterlab/rendermime'; import { type VoilaWidgetManager } from '@voila-dashboards/widgets-manager8/lib/manager'; /** * Interface representing the structure of an execution result message. */ export interface IExecutionResultMessage { action: 'execution_result'; payload: { output_cell: { outputs: IOutput[]; }; cell_index: number; total_cell: number; }; } /** * Interface representing the structure of an execution error message. */ export interface IExecutionErrorMessage { action: 'execution_error'; payload: { error: string; }; } /** * Interface representing a received widget model * containing output and execution models. */ export interface IReceivedWidgetModel { [modelId: string]: { outputModel: OutputAreaModel; executionModel: IOutput; }; } export type IExecutionMessage = IExecutionResultMessage | IExecutionErrorMessage; export declare function getExecutionURL(kernelId?: string): string; /** * Handles the execution result by rendering the output area and managing widget models. * * @param payload - The payload from the execution result message, * including the output cell and cell index. * @param rendermime - A render mime registry to render the output. * @param widgetManager - The Voila widget manager to manage Jupyter widgets. * @returns An object containing a model ID and its corresponding output and * execution models if the model is not ready to be rendered, undefined otherwise. */ export declare function handleExecutionResult({ payload, rendermime, widgetManager }: { payload: IExecutionResultMessage['payload']; rendermime: IRenderMimeRegistry; widgetManager: VoilaWidgetManager; }): IReceivedWidgetModel | undefined; /** * Creates an output area model and attaches the output area to a specified parent element. * * @param rendermime - The render mime registry. * @param parent - The parent HTML element where the output area will be appended. * @returns The created OutputAreaModel. */ export declare function createOutputArea({ rendermime, parent }: { rendermime: IRenderMimeRegistry; parent: Element; }): OutputAreaModel; export declare function createSkeleton(): void;