forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhistoryTypes.ts
More file actions
92 lines (83 loc) · 3.28 KB
/
historyTypes.ts
File metadata and controls
92 lines (83 loc) · 3.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
'use strict';
import { ICell, IHistoryInfo } from './types';
export namespace HistoryMessages {
export const StartCell = 'start_cell';
export const FinishCell = 'finish_cell';
export const UpdateCell = 'update_cell';
export const GotoCodeCell = 'gotocell_code';
export const RestartKernel = 'restart_kernel';
export const Export = 'export_to_ipynb';
export const GetAllCells = 'get_all_cells';
export const ReturnAllCells = 'return_all_cells';
export const DeleteCell = 'delete_cell';
export const DeleteAllCells = 'delete_all_cells';
export const Undo = 'undo';
export const Redo = 'redo';
export const ExpandAll = 'expand_all';
export const CollapseAll = 'collapse_all';
export const StartProgress = 'start_progress';
export const StopProgress = 'stop_progress';
export const Interrupt = 'interrupt';
export const SubmitNewCell = 'submit_new_cell';
export const UpdateSettings = 'update_settings';
export const SendInfo = 'send_info';
export const Started = 'started';
export const AddedSysInfo = 'added_sys_info';
export const RemoteAddCode = 'remote_add_code';
}
// These are the messages that will mirror'd to guest/hosts in
// a live share session
export const HistoryRemoteMessages : string[] = [
HistoryMessages.SubmitNewCell,
HistoryMessages.AddedSysInfo,
HistoryMessages.RemoteAddCode
];
export interface IGotoCode {
file: string;
line: number;
}
export interface IAddedSysInfo {
id: string;
sysInfoCell: ICell;
}
export interface IExecuteInfo {
code: string;
id: string;
file: string;
line: number;
}
export interface IRemoteAddCode extends IExecuteInfo {
originator: string;
}
export interface ISubmitNewCell {
code: string;
id: string;
}
// Map all messages to specific payloads
export class IHistoryMapping {
public [HistoryMessages.StartCell]: ICell;
public [HistoryMessages.FinishCell]: ICell;
public [HistoryMessages.UpdateCell]: ICell;
public [HistoryMessages.GotoCodeCell]: IGotoCode;
public [HistoryMessages.RestartKernel]: never | undefined;
public [HistoryMessages.Export]: ICell[];
public [HistoryMessages.GetAllCells]: ICell;
public [HistoryMessages.ReturnAllCells]: ICell[];
public [HistoryMessages.DeleteCell]: never | undefined;
public [HistoryMessages.DeleteAllCells]: never | undefined;
public [HistoryMessages.Undo]: never | undefined;
public [HistoryMessages.Redo]: never | undefined;
public [HistoryMessages.ExpandAll]: never | undefined;
public [HistoryMessages.CollapseAll]: never | undefined;
public [HistoryMessages.StartProgress]: never | undefined;
public [HistoryMessages.StopProgress]: never | undefined;
public [HistoryMessages.Interrupt]: never | undefined;
public [HistoryMessages.UpdateSettings]: string;
public [HistoryMessages.SubmitNewCell]: ISubmitNewCell;
public [HistoryMessages.SendInfo]: IHistoryInfo;
public [HistoryMessages.Started]: never | undefined;
public [HistoryMessages.AddedSysInfo]: IAddedSysInfo;
public [HistoryMessages.RemoteAddCode]: IRemoteAddCode;
}