Merge pull request #3137 from remcohaszing/fix-monaco-environment-types

Fix MonacoEnvironment types
pull/3227/head
Henning Dieterichs 3 years ago committed by GitHub
commit 58100e52b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -364,7 +364,16 @@ function toExternalDTS(contents: string): string {
}
if (line.indexOf('declare let MonacoEnvironment') === 0) {
lines[i] = `declare global {\n let MonacoEnvironment: Environment | undefined;\n}`;
lines[i] = [
'declare global {',
' let MonacoEnvironment: Environment | undefined;',
'',
' interface Window {',
' MonacoEnvironment?: Environment | undefined;',
' }',
'}',
''
].join('\n');
}
if (line.indexOf(' MonacoEnvironment?') === 0) {
lines[i] = ` MonacoEnvironment?: Environment | undefined;`;

Loading…
Cancel
Save