mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 19:42:56 +01:00
Ship better typings file
This commit is contained in:
parent
7b320a1336
commit
c6192de715
5 changed files with 8466 additions and 8424 deletions
42
gulpfile.js
42
gulpfile.js
|
|
@ -393,7 +393,9 @@ function addPluginDTS() {
|
||||||
var pluginPath = plugin.paths[`npm/min`]; // npm/dev or npm/min
|
var pluginPath = plugin.paths[`npm/min`]; // npm/dev or npm/min
|
||||||
var dtsPath = path.join(pluginPath, '../monaco.d.ts');
|
var dtsPath = path.join(pluginPath, '../monaco.d.ts');
|
||||||
try {
|
try {
|
||||||
extraContent.push(fs.readFileSync(dtsPath).toString());
|
let plugindts = fs.readFileSync(dtsPath).toString();
|
||||||
|
plugindts = plugindts.replace('declare module', 'declare namespace');
|
||||||
|
extraContent.push(plugindts);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -412,6 +414,44 @@ function addPluginDTS() {
|
||||||
|
|
||||||
data.contents = new Buffer(contents);
|
data.contents = new Buffer(contents);
|
||||||
|
|
||||||
|
{
|
||||||
|
let lines = contents.split('\n');
|
||||||
|
let killNextCloseCurlyBrace = false;
|
||||||
|
for (let i = 0; i < lines.length; i++) {
|
||||||
|
let line = lines[i];
|
||||||
|
|
||||||
|
if (killNextCloseCurlyBrace) {
|
||||||
|
if ('}' === line) {
|
||||||
|
lines[i] = '';
|
||||||
|
killNextCloseCurlyBrace = false;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (line.indexOf(' ') === 0) {
|
||||||
|
lines[i] = line.substr(4);
|
||||||
|
}
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ('declare namespace monaco {' === line) {
|
||||||
|
lines[i] = '';
|
||||||
|
killNextCloseCurlyBrace = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (line.indexOf('declare namespace monaco.') === 0) {
|
||||||
|
lines[i] = line.replace('declare namespace monaco.', 'export namespace ');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.emit('data', new File({
|
||||||
|
path: path.join(path.dirname(data.path), 'esm/vs/editor/editor.api.d.ts'),
|
||||||
|
base: data.base,
|
||||||
|
contents: new Buffer(lines.join('\n'))
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
fs.writeFileSync('website/playground/monaco.d.ts.txt', contents);
|
fs.writeFileSync('website/playground/monaco.d.ts.txt', contents);
|
||||||
fs.writeFileSync('monaco.d.ts', contents);
|
fs.writeFileSync('monaco.d.ts', contents);
|
||||||
this.emit('data', data);
|
this.emit('data', data);
|
||||||
|
|
|
||||||
21
monaco.d.ts
vendored
21
monaco.d.ts
vendored
|
|
@ -8,9 +8,9 @@
|
||||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
declare module monaco {
|
declare namespace monaco {
|
||||||
|
|
||||||
type Thenable<T> = PromiseLike<T>;
|
export type Thenable<T> = PromiseLike<T>;
|
||||||
|
|
||||||
export interface IDisposable {
|
export interface IDisposable {
|
||||||
dispose(): void;
|
dispose(): void;
|
||||||
|
|
@ -761,9 +761,9 @@ declare module monaco {
|
||||||
constructor(offset: number, type: string, language: string);
|
constructor(offset: number, type: string, language: string);
|
||||||
toString(): string;
|
toString(): string;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
declare module monaco.editor {
|
|
||||||
|
namespace editor {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -3901,7 +3901,7 @@ declare module monaco.editor {
|
||||||
export type IModel = ITextModel;
|
export type IModel = ITextModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module monaco.languages {
|
namespace languages {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -5124,7 +5124,7 @@ declare module monaco.languages {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module monaco.worker {
|
namespace worker {
|
||||||
|
|
||||||
|
|
||||||
export interface IMirrorModel {
|
export interface IMirrorModel {
|
||||||
|
|
@ -5142,8 +5142,9 @@ declare module monaco.worker {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
declare module monaco.languages.typescript {
|
declare namespace monaco.languages.typescript {
|
||||||
|
|
||||||
enum ModuleKind {
|
enum ModuleKind {
|
||||||
None = 0,
|
None = 0,
|
||||||
|
|
@ -5299,7 +5300,7 @@ declare module monaco.languages.typescript {
|
||||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
declare module monaco.languages.css {
|
declare namespace monaco.languages.css {
|
||||||
export interface DiagnosticsOptions {
|
export interface DiagnosticsOptions {
|
||||||
readonly validate?: boolean;
|
readonly validate?: boolean;
|
||||||
readonly lint?: {
|
readonly lint?: {
|
||||||
|
|
@ -5339,7 +5340,7 @@ declare module monaco.languages.css {
|
||||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
declare module monaco.languages.json {
|
declare namespace monaco.languages.json {
|
||||||
export interface DiagnosticsOptions {
|
export interface DiagnosticsOptions {
|
||||||
/**
|
/**
|
||||||
* If set, the validator will be enabled and perform syntax validation as well as schema based validation.
|
* If set, the validator will be enabled and perform syntax validation as well as schema based validation.
|
||||||
|
|
@ -5381,7 +5382,7 @@ declare module monaco.languages.json {
|
||||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
declare module monaco.languages.html {
|
declare namespace monaco.languages.html {
|
||||||
export interface HTMLFormatConfiguration {
|
export interface HTMLFormatConfiguration {
|
||||||
readonly tabSize: number;
|
readonly tabSize: number;
|
||||||
readonly insertSpaces: boolean;
|
readonly insertSpaces: boolean;
|
||||||
|
|
|
||||||
6
package-lock.json
generated
6
package-lock.json
generated
|
|
@ -2377,9 +2377,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"monaco-editor-core": {
|
"monaco-editor-core": {
|
||||||
"version": "0.11.3",
|
"version": "0.11.4",
|
||||||
"resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.11.3.tgz",
|
"resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.11.4.tgz",
|
||||||
"integrity": "sha512-e6o/TInK+sRgWaWNj8kIaNinfmTC1vQdwF6QUaZ7h0OT+xILM6zxl+4B0imIbKm7iBYSZR2avH8Hbg8h6qQ2+g==",
|
"integrity": "sha512-9kGuoLy55omwhQ2+HeLDbykc8rwaTaj8WEBGR8YNZ3SyMTofU6i6W3GyAz65etJ6blCGk8s0RsCJNm2JcWRRcA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"monaco-html": {
|
"monaco-html": {
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
"release": "gulp release",
|
"release": "gulp release",
|
||||||
"website": "gulp website"
|
"website": "gulp website"
|
||||||
},
|
},
|
||||||
"typings": "./monaco.d.ts",
|
"typings": "./esm/vs/editor/editor.api.d.ts",
|
||||||
"module": "./esm/vs/editor/editor.main.js",
|
"module": "./esm/vs/editor/editor.main.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
"gulp-typedoc": "^2.0.0",
|
"gulp-typedoc": "^2.0.0",
|
||||||
"http-server": "^0.11.1",
|
"http-server": "^0.11.1",
|
||||||
"monaco-css": "2.0.1",
|
"monaco-css": "2.0.1",
|
||||||
"monaco-editor-core": "0.11.3",
|
"monaco-editor-core": "0.11.4",
|
||||||
"monaco-html": "2.0.2",
|
"monaco-html": "2.0.2",
|
||||||
"monaco-json": "2.0.1",
|
"monaco-json": "2.0.1",
|
||||||
"monaco-languages": "1.0.2",
|
"monaco-languages": "1.0.2",
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,9 @@
|
||||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
declare module monaco {
|
declare namespace monaco {
|
||||||
|
|
||||||
type Thenable<T> = PromiseLike<T>;
|
export type Thenable<T> = PromiseLike<T>;
|
||||||
|
|
||||||
export interface IDisposable {
|
export interface IDisposable {
|
||||||
dispose(): void;
|
dispose(): void;
|
||||||
|
|
@ -761,9 +761,9 @@ declare module monaco {
|
||||||
constructor(offset: number, type: string, language: string);
|
constructor(offset: number, type: string, language: string);
|
||||||
toString(): string;
|
toString(): string;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
declare module monaco.editor {
|
|
||||||
|
namespace editor {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -3901,7 +3901,7 @@ declare module monaco.editor {
|
||||||
export type IModel = ITextModel;
|
export type IModel = ITextModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module monaco.languages {
|
namespace languages {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -5124,7 +5124,7 @@ declare module monaco.languages {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module monaco.worker {
|
namespace worker {
|
||||||
|
|
||||||
|
|
||||||
export interface IMirrorModel {
|
export interface IMirrorModel {
|
||||||
|
|
@ -5142,8 +5142,9 @@ declare module monaco.worker {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
declare module monaco.languages.typescript {
|
declare namespace monaco.languages.typescript {
|
||||||
|
|
||||||
enum ModuleKind {
|
enum ModuleKind {
|
||||||
None = 0,
|
None = 0,
|
||||||
|
|
@ -5299,7 +5300,7 @@ declare module monaco.languages.typescript {
|
||||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
declare module monaco.languages.css {
|
declare namespace monaco.languages.css {
|
||||||
export interface DiagnosticsOptions {
|
export interface DiagnosticsOptions {
|
||||||
readonly validate?: boolean;
|
readonly validate?: boolean;
|
||||||
readonly lint?: {
|
readonly lint?: {
|
||||||
|
|
@ -5339,7 +5340,7 @@ declare module monaco.languages.css {
|
||||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
declare module monaco.languages.json {
|
declare namespace monaco.languages.json {
|
||||||
export interface DiagnosticsOptions {
|
export interface DiagnosticsOptions {
|
||||||
/**
|
/**
|
||||||
* If set, the validator will be enabled and perform syntax validation as well as schema based validation.
|
* If set, the validator will be enabled and perform syntax validation as well as schema based validation.
|
||||||
|
|
@ -5381,7 +5382,7 @@ declare module monaco.languages.json {
|
||||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
declare module monaco.languages.html {
|
declare namespace monaco.languages.html {
|
||||||
export interface HTMLFormatConfiguration {
|
export interface HTMLFormatConfiguration {
|
||||||
readonly tabSize: number;
|
readonly tabSize: number;
|
||||||
readonly insertSpaces: boolean;
|
readonly insertSpaces: boolean;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue