Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/ipynb/src/common.ts
3292 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import type * as nbformat from '@jupyterlab/nbformat';
7
8
/**
9
* Metadata we store in VS Code cell output items.
10
* This contains the original metadata from the Jupyter outputs.
11
*/
12
export interface CellOutputMetadata {
13
/**
14
* Cell output metadata.
15
*/
16
metadata?: any;
17
18
/**
19
* Transient data from Jupyter.
20
*/
21
transient?: {
22
/**
23
* This is used for updating the output in other cells.
24
* We don't know of other properties, but this is definitely used.
25
*/
26
display_id?: string;
27
} & any;
28
29
/**
30
* Original cell output type
31
*/
32
outputType: nbformat.OutputType | string;
33
34
executionCount?: nbformat.IExecuteResult['ExecutionCount'];
35
36
/**
37
* Whether the original Mime data is JSON or not.
38
* This properly only exists in metadata for NotebookCellOutputItems
39
* (this is something we have added)
40
*/
41
__isJson?: boolean;
42
}
43
44
45
/**
46
* Metadata we store in VS Code cells.
47
* This contains the original metadata from the Jupyter cells.
48
*/
49
export interface CellMetadata {
50
/**
51
* Cell id for notebooks created with the new 4.5 version of nbformat.
52
*/
53
id?: string;
54
/**
55
* Stores attachments for cells.
56
*/
57
attachments?: nbformat.IAttachments;
58
/**
59
* Stores cell metadata.
60
*/
61
metadata?: Partial<nbformat.ICellMetadata> & { vscode?: { languageId?: string } };
62
/**
63
* The code cell's prompt number. Will be null if the cell has not been run.
64
*/
65
execution_count?: number | null;
66
}
67
68
69