import { List as ImmutableList, Record, RecordOf } from "immutable"; import { ExecutionCount, JSONObject, MediaBundle, MultiLineString, OnDiskMediaBundle } from "./primitives"; /** ExecuteResult Record Boilerplate */ export interface ExecuteResultParams { output_type: "execute_result"; execution_count: ExecutionCount; data: Readonly; metadata?: any; } export declare const makeExecuteResult: Record.Factory; export declare type ImmutableExecuteResult = RecordOf; /** DisplayData Record Boilerplate */ export interface DisplayDataParams { data: Readonly; output_type: "display_data"; metadata?: any; } export declare const makeDisplayData: Record.Factory; export declare type ImmutableDisplayData = RecordOf; /** StreamOutput Record Boilerplate */ export interface StreamOutputParams { output_type: "stream"; name: "stdout" | "stderr"; text: string; } export declare const makeStreamOutput: Record.Factory; export declare type ImmutableStreamOutput = RecordOf; /** ErrorOutput Record Boilerplate */ export interface ErrorOutputParams { output_type: "error"; ename: string; evalue: string; traceback: ImmutableList; } export declare const makeErrorOutput: Record.Factory; export declare type ImmutableErrorOutput = RecordOf; export declare type ImmutableOutput = ImmutableExecuteResult | ImmutableDisplayData | ImmutableStreamOutput | ImmutableErrorOutput; export interface OnDiskExecuteResult { output_type: "execute_result"; execution_count: ExecutionCount; data: OnDiskMediaBundle; metadata: JSONObject; transient?: JSONObject; } export interface OnDiskDisplayData { output_type: "display_data"; data: OnDiskMediaBundle; metadata: JSONObject; transient?: JSONObject; } export interface OnDiskStreamOutput { output_type: "stream"; name: "stdout" | "stderr"; text: MultiLineString; } export interface OnDiskErrorOutput { output_type: "error"; ename: string; evalue: string; traceback: string[]; } export declare type OnDiskOutput = OnDiskExecuteResult | OnDiskDisplayData | OnDiskStreamOutput | OnDiskErrorOutput; /** * Converts a mutable representation of an output to an immutable representation. * * @param output The mutable output that will be converted. * * @returns ImmutableOutput An immutable representation of the same output. */ export declare function createImmutableOutput(output: OnDiskOutput): ImmutableOutput;