Add types for MonacoEnvironment (microsoft/monaco-editor#1795)
This commit is contained in:
parent
2ce45bf734
commit
65fee79198
|
@ -227,8 +227,13 @@ function toExternalDTS(contents) {
|
|||
if (line.indexOf('declare namespace monaco.') === 0) {
|
||||
lines[i] = line.replace('declare namespace monaco.', 'export namespace ');
|
||||
}
|
||||
|
||||
if (line.indexOf('declare let MonacoEnvironment') === 0) {
|
||||
lines[i] = `declare global {\n let MonacoEnvironment: Environment | undefined;\n}`;
|
||||
// lines[i] = line.replace('declare namespace monaco.', 'export namespace ');
|
||||
}
|
||||
}
|
||||
return lines.join('\n');
|
||||
return lines.join('\n').replace(/\n\n\n+/g, '\n\n');
|
||||
}
|
||||
|
||||
function filterStream(testFunc) {
|
||||
|
|
|
@ -3,12 +3,18 @@
|
|||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
declare let MonacoEnvironment: monaco.Environment | undefined;
|
||||
|
||||
declare namespace monaco {
|
||||
|
||||
// THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY.
|
||||
|
||||
export type Thenable<T> = PromiseLike<T>;
|
||||
|
||||
export interface Environment {
|
||||
baseUrl?: string;
|
||||
getWorker?(workerId: string, label: string): Worker;
|
||||
getWorkerUrl?(workerId: string, label: string): string;
|
||||
}
|
||||
|
||||
export interface IDisposable {
|
||||
dispose(): void;
|
||||
}
|
||||
|
|
10
src/vs/monaco.d.ts
vendored
10
src/vs/monaco.d.ts
vendored
|
@ -3,12 +3,18 @@
|
|||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
declare let MonacoEnvironment: monaco.Environment | undefined;
|
||||
|
||||
declare namespace monaco {
|
||||
|
||||
// THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY.
|
||||
|
||||
export type Thenable<T> = PromiseLike<T>;
|
||||
|
||||
export interface Environment {
|
||||
baseUrl?: string;
|
||||
getWorker?(workerId: string, label: string): Worker;
|
||||
getWorkerUrl?(workerId: string, label: string): string;
|
||||
}
|
||||
|
||||
export interface IDisposable {
|
||||
dispose(): void;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue