mirror of
https://github.com/microsoft/vscode.git
synced 2026-09-19 10:06:19 +01:00
simplify ITransformedDisplayOutputDto type
This commit is contained in:
@@ -184,27 +184,14 @@ export interface IOrderedMimeType {
|
||||
rendererId: string;
|
||||
}
|
||||
|
||||
export interface ITransformedDisplayOutputDto {
|
||||
outputKind: CellOutputKind.Rich;
|
||||
export interface ITransformedDisplayOutputDto extends IDisplayOutput {
|
||||
outputId: string;
|
||||
data: { [key: string]: unknown; }
|
||||
metadata?: NotebookCellOutputMetadata;
|
||||
|
||||
// orderedMimeTypes?: IOrderedMimeType[];
|
||||
// pickedMimeTypeIndex?: number;
|
||||
}
|
||||
|
||||
export function isTransformedDisplayOutput(thing: unknown): thing is ITransformedDisplayOutputDto {
|
||||
return (thing as ITransformedDisplayOutputDto).outputKind === CellOutputKind.Rich && !!(thing as ITransformedDisplayOutputDto).outputId;
|
||||
}
|
||||
|
||||
export interface IGenericOutput {
|
||||
outputKind: CellOutputKind;
|
||||
pickedMimeType?: string;
|
||||
pickedRenderer?: number;
|
||||
transformedOutput?: { [key: string]: IDisplayOutput };
|
||||
}
|
||||
|
||||
|
||||
export const addIdToOutput = (output: IRawOutput, id = UUID.generateUuid()): IProcessedOutput => output.outputKind === CellOutputKind.Rich
|
||||
? ({ ...output, outputId: id }) : output;
|
||||
|
||||
Reference in New Issue
Block a user