@codingame/monaco-vscode-api 1.67.8-dev.0 → 1.67.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,158 @@
1
+ import * as monaco from 'monaco-editor';
2
+
3
+ /**
4
+ * A model.
5
+ */
6
+ type ITextModel = monaco.editor.ITextModel
7
+
8
+ /**
9
+ * A rich code editor.
10
+ */
11
+ type ICodeEditor = monaco.editor.ICodeEditor
12
+
13
+ declare enum EditorActivation {
14
+ /**
15
+ * Activate the editor after it opened. This will automatically restore
16
+ * the editor if it is minimized.
17
+ */
18
+ ACTIVATE = 1,
19
+ /**
20
+ * Only restore the editor if it is minimized but do not activate it.
21
+ *
22
+ * Note: will only work in combination with the `preserveFocus: true` option.
23
+ * Otherwise, if focus moves into the editor, it will activate and restore
24
+ * automatically.
25
+ */
26
+ RESTORE = 2,
27
+ /**
28
+ * Preserve the current active editor.
29
+ *
30
+ * Note: will only work in combination with the `preserveFocus: true` option.
31
+ * Otherwise, if focus moves into the editor, it will activate and restore
32
+ * automatically.
33
+ */
34
+ PRESERVE = 3
35
+ }
36
+ declare enum EditorResolution {
37
+ /**
38
+ * Displays a picker and allows the user to decide which editor to use.
39
+ */
40
+ PICK = 0,
41
+ /**
42
+ * Disables editor resolving.
43
+ */
44
+ DISABLED = 1,
45
+ /**
46
+ * Only exclusive editors are considered.
47
+ */
48
+ EXCLUSIVE_ONLY = 2
49
+ }
50
+ declare enum EditorOpenSource {
51
+ /**
52
+ * Default: the editor is opening via a programmatic call
53
+ * to the editor service API.
54
+ */
55
+ API = 0,
56
+ /**
57
+ * Indicates that a user action triggered the opening, e.g.
58
+ * via mouse or keyboard use.
59
+ */
60
+ USER = 1
61
+ }
62
+ interface IEditorOptions {
63
+ /**
64
+ * Tells the editor to not receive keyboard focus when the editor is being opened.
65
+ *
66
+ * Will also not activate the group the editor opens in unless the group is already
67
+ * the active one. This behaviour can be overridden via the `activation` option.
68
+ */
69
+ preserveFocus?: boolean;
70
+ /**
71
+ * This option is only relevant if an editor is opened into a group that is not active
72
+ * already and allows to control if the inactive group should become active, restored
73
+ * or preserved.
74
+ *
75
+ * By default, the editor group will become active unless `preserveFocus` or `inactive`
76
+ * is specified.
77
+ */
78
+ activation?: EditorActivation;
79
+ /**
80
+ * Tells the editor to reload the editor input in the editor even if it is identical to the one
81
+ * already showing. By default, the editor will not reload the input if it is identical to the
82
+ * one showing.
83
+ */
84
+ forceReload?: boolean;
85
+ /**
86
+ * Will reveal the editor if it is already opened and visible in any of the opened editor groups.
87
+ *
88
+ * Note that this option is just a hint that might be ignored if the user wants to open an editor explicitly
89
+ * to the side of another one or into a specific editor group.
90
+ */
91
+ revealIfVisible?: boolean;
92
+ /**
93
+ * Will reveal the editor if it is already opened (even when not visible) in any of the opened editor groups.
94
+ *
95
+ * Note that this option is just a hint that might be ignored if the user wants to open an editor explicitly
96
+ * to the side of another one or into a specific editor group.
97
+ */
98
+ revealIfOpened?: boolean;
99
+ /**
100
+ * An editor that is pinned remains in the editor stack even when another editor is being opened.
101
+ * An editor that is not pinned will always get replaced by another editor that is not pinned.
102
+ */
103
+ pinned?: boolean;
104
+ /**
105
+ * An editor that is sticky moves to the beginning of the editors list within the group and will remain
106
+ * there unless explicitly closed. Operations such as "Close All" will not close sticky editors.
107
+ */
108
+ sticky?: boolean;
109
+ /**
110
+ * The index in the document stack where to insert the editor into when opening.
111
+ */
112
+ index?: number;
113
+ /**
114
+ * An active editor that is opened will show its contents directly. Set to true to open an editor
115
+ * in the background without loading its contents.
116
+ *
117
+ * Will also not activate the group the editor opens in unless the group is already
118
+ * the active one. This behaviour can be overridden via the `activation` option.
119
+ */
120
+ inactive?: boolean;
121
+ /**
122
+ * Will not show an error in case opening the editor fails and thus allows to show a custom error
123
+ * message as needed. By default, an error will be presented as notification if opening was not possible.
124
+ */
125
+ ignoreError?: boolean;
126
+ /**
127
+ * Allows to override the editor that should be used to display the input:
128
+ * - `undefined`: let the editor decide for itself
129
+ * - `string`: specific override by id
130
+ * - `EditorResolution`: specific override handling
131
+ */
132
+ override?: string | EditorResolution;
133
+ /**
134
+ * A optional hint to signal in which context the editor opens.
135
+ *
136
+ * If configured to be `EditorOpenSource.USER`, this hint can be
137
+ * used in various places to control the experience. For example,
138
+ * if the editor to open fails with an error, a notification could
139
+ * inform about this in a modal dialog. If the editor opened through
140
+ * some background task, the notification would show in the background,
141
+ * not as a modal dialog.
142
+ */
143
+ source?: EditorOpenSource;
144
+ /**
145
+ * An optional property to signal that certain view state should be
146
+ * applied when opening the editor.
147
+ */
148
+ viewState?: object;
149
+ }
150
+
151
+ interface IEditorOverrideServices {
152
+ [index: string]: any;
153
+ }
154
+
155
+ declare type OpenEditor = (model: ITextModel, options: IEditorOptions | undefined, sideBySide?: boolean) => Promise<ICodeEditor | undefined>;
156
+ declare function getServiceOverride(openEditor: OpenEditor): IEditorOverrideServices;
157
+
158
+ export { IEditorOptions, OpenEditor, getServiceOverride as default };