mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 15:05:39 +01:00
Also generate a top level monaco.d.ts
This commit is contained in:
parent
77e9dcdca4
commit
564d195403
3 changed files with 5227 additions and 167 deletions
31
gulpfile.js
31
gulpfile.js
|
|
@ -163,14 +163,43 @@ function addPluginDTS() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
contents += '\n' + extraContent.join('\n');
|
contents = [
|
||||||
|
'/*!-----------------------------------------------------------',
|
||||||
|
' * Copyright (c) Microsoft Corporation. All rights reserved.',
|
||||||
|
' * Type definitions for monaco-editor v'+MONACO_EDITOR_VERSION,
|
||||||
|
' * Released under the MIT license',
|
||||||
|
'*-----------------------------------------------------------*/',
|
||||||
|
].join('\n') + '\n' + contents + '\n' + extraContent.join('\n');
|
||||||
|
|
||||||
|
// Ensure consistent indentation and line endings
|
||||||
|
contents = cleanFile(contents);
|
||||||
|
|
||||||
data.contents = new Buffer(contents);
|
data.contents = new Buffer(contents);
|
||||||
|
|
||||||
fs.writeFileSync('website/playground/monaco.d.ts.txt', contents);
|
fs.writeFileSync('website/playground/monaco.d.ts.txt', contents);
|
||||||
|
fs.writeFileSync('monaco.d.ts', contents);
|
||||||
this.emit('data', data);
|
this.emit('data', data);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Normalize line endings and ensure consistent 4 spaces indentation
|
||||||
|
*/
|
||||||
|
function cleanFile(contents) {
|
||||||
|
return contents.split(/\r\n|\r|\n/).map(function(line) {
|
||||||
|
var m = line.match(/^(\t+)/);
|
||||||
|
if (!m) {
|
||||||
|
return line;
|
||||||
|
}
|
||||||
|
var tabsCount = m[1].length;
|
||||||
|
var newIndent = '';
|
||||||
|
for (var i = 0; i < 4 * tabsCount; i++) {
|
||||||
|
newIndent += ' ';
|
||||||
|
}
|
||||||
|
return newIndent + line.substring(tabsCount);
|
||||||
|
}).join('\n');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Edit ThirdPartyNotices.txt:
|
* Edit ThirdPartyNotices.txt:
|
||||||
* - append ThirdPartyNotices.txt from plugins
|
* - append ThirdPartyNotices.txt from plugins
|
||||||
|
|
|
||||||
5026
monaco.d.ts
vendored
Normal file
5026
monaco.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -1,3 +1,8 @@
|
||||||
|
/*!-----------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Type definitions for monaco-editor v0.7.0
|
||||||
|
* Released under the MIT license
|
||||||
|
*-----------------------------------------------------------*/
|
||||||
declare module monaco {
|
declare module monaco {
|
||||||
|
|
||||||
interface Thenable<R> {
|
interface Thenable<R> {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue