forked from wasdk/WebAssemblyStudio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test-shim.js
93 lines (89 loc) · 1.69 KB
/
test-shim.js
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
93
global.requestAnimationFrame = function(callback) {
setTimeout(callback, 0);
};
global.Worker = function() {
this.addEventListener = function () {
// Nop
}
}
global.monaco = {
editor: {
onDidChangeContent() { },
getLineMaxColumn() { },
applyEdits() { },
setValue() { },
getValue() { },
toString() { },
onDidFocusEditorText() { },
onDidFocusEditorWidget() { },
onContextMenu() { },
setModelLanguage() { },
setModelMarkers() { },
addAction() { },
addCommand() { },
setModel() {},
getLineCount() {},
revealLine() {},
restoreViewState() { },
saveViewState() { },
updateOptions() { },
layout() {},
createModel() {
return this;
},
create() {
return this;
},
getModel() {
return this;
},
IEditorConstructionOptions: {
value: String
},
uri: {
toString: () => "uri"
},
defineTheme() { },
},
Range: function (l1, c1, l2, c2) {
this.r = [l1, c1, l2, c2];
},
languages: {
CompletionItemKind: {
Keyword: 12
},
typescript: {
getTypeScriptWorker() { },
typescriptDefaults: {
addExtraLib() {},
setCompilerOptions() {}
},
javascriptDefaults: {
setCompilerOptions() {}
}
},
register() {},
onLanguage() {},
setMonarchTokensProvider() {},
setLanguageConfiguration() {},
registerCompletionItemProvider() {},
registerHoverProvider() {},
},
KeyMod: {
CtrlCmd: 0,
Alt: 2
},
KeyCode: {
KEY_S: 83,
KEY_B: 66,
Enter: 13,
},
MarkerSeverity: {
Info: 2,
Warning: 4,
Error: 8
},
Promise: {
as: (args) => Promise.resolve(args)
}
}