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

Fix MonacoEnvironment types
This commit is contained in:
Henning Dieterichs 2022-08-03 14:06:34 +02:00 committed by GitHub
commit 58100e52b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -364,7 +364,16 @@ function toExternalDTS(contents: string): string {
} }
if (line.indexOf('declare let MonacoEnvironment') === 0) { 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) { if (line.indexOf(' MonacoEnvironment?') === 0) {
lines[i] = ` MonacoEnvironment?: Environment | undefined;`; lines[i] = ` MonacoEnvironment?: Environment | undefined;`;