monaco.d.ts.recipe 3.8 KB
Newer Older
1 2
declare module monaco {

J
Johannes Rieken 已提交
3
    interface Thenable<T> {
4 5 6 7 8 9
        /**
         * Attaches callbacks for the resolution and/or rejection of the Promise.
         * @param onfulfilled The callback to execute when the Promise is resolved.
         * @param onrejected The callback to execute when the Promise is rejected.
         * @returns A Promise for the completion of which ever callback is executed.
         */
J
Johannes Rieken 已提交
10 11
        then<TResult>(onfulfilled?: (value: T) => TResult | Thenable<TResult>, onrejected?: (reason: any) => TResult | Thenable<TResult>): Thenable<TResult>;
        then<TResult>(onfulfilled?: (value: T) => TResult | Thenable<TResult>, onrejected?: (reason: any) => void): Thenable<TResult>;
12 13 14 15 16
    }

    export interface IDisposable {
        dispose(): void;
    }
17

18 19 20
    export interface IEvent<T> {
        (listener: (e: T) => any, thisArg?: any): IDisposable;
    }
21

A
Alex Dima 已提交
22 23 24
    /**
     * A helper that allows to emit and listen to typed events
     */
25 26
    export class Emitter<T> {
        constructor();
27
        readonly event: Event<T>;
28 29 30
        fire(event?: T): void;
        dispose(): void;
    }
A
Alex Dima 已提交
31

32 33 34 35 36 37
    export enum Severity {
        Ignore = 0,
        Info = 1,
        Warning = 2,
        Error = 3,
    }
A
Alex Dima 已提交
38

39 40 41
#include(vs/base/common/winjs.base.d.ts): TValueCallback, ProgressCallback, TPromise
#include(vs/base/common/cancellation): CancellationTokenSource, CancellationToken
#include(vs/base/common/uri): URI
A
Alex Dima 已提交
42
#include(vs/editor/common/standalone/standaloneBase): KeyCode, KeyMod
43
#include(vs/base/common/keyCodes): Keybinding
44
#include(vs/base/common/htmlContent): MarkedString
45 46
#include(vs/base/browser/keyboardEvent): IKeyboardEvent
#include(vs/base/browser/mouseEvent): IMouseEvent
47
#include(vs/editor/common/editorCommon): IScrollEvent, IPosition, IRange, ISelection
48 49
#include(vs/editor/common/core/position): Position
#include(vs/editor/common/core/range): Range
50
#include(vs/editor/common/core/selection): Selection, SelectionDirection
A
Alex Dima 已提交
51
#include(vs/editor/common/core/token): Token
52 53 54
}

declare module monaco.editor {
55

A
Alex Dima 已提交
56
#includeAll(vs/editor/browser/standalone/standaloneEditor;modes.=>languages.;editorCommon.=>):
57
#include(vs/editor/common/services/webWorker): MonacoWebWorker, IWebWorkerOptions
A
Alex Dima 已提交
58 59 60 61
#include(vs/editor/browser/standalone/standaloneCodeEditor): IEditorConstructionOptions, IDiffEditorConstructionOptions, IStandaloneCodeEditor, IStandaloneDiffEditor
export interface ICommandHandler {
    (...args:any[]): void;
}
A
Alex Dima 已提交
62
#include(vs/platform/contextkey/common/contextkey): IContextKey
63 64
#include(vs/editor/browser/standalone/standaloneServices): IEditorOverrideServices
#include(vs/platform/markers/common/markers): IMarkerData
65
#include(vs/editor/browser/standalone/colorizer): IColorizerOptions, IColorizerElementOptions
66
#include(vs/base/common/scrollable): ScrollbarVisibility
A
Alex Dima 已提交
67
#includeAll(vs/editor/common/editorCommon;IMode=>languages.IMode;LanguageIdentifier=>languages.LanguageIdentifier): IPosition, IRange, ISelection, SelectionDirection, IScrollEvent
68
#includeAll(vs/editor/browser/editorBrowser;editorCommon.=>):
69 70 71 72
}

declare module monaco.languages {

73
#includeAll(vs/editor/browser/standalone/standaloneLanguages;modes.=>;editorCommon.=>editor.;IMarkerData=>editor.IMarkerData):
74
#includeAll(vs/editor/common/modes/languageConfiguration):
A
Alex Dima 已提交
75 76 77 78 79 80 81 82 83
/**
 * An identifier for a registered language.
 */
export class LanguageIdentifier {
	public readonly sid: string;
	public readonly iid: number;

	constructor(sid: string, iid: number);
}
A
Alex Dima 已提交
84
#includeAll(vs/editor/common/modes;editorCommon.IRange=>IRange;editorCommon.IPosition=>IPosition;editorCommon.=>editor.;IToken2=>IToken;ILineTokens2=>ILineTokens):
85
#include(vs/editor/common/services/modeService): ILanguageExtensionPoint
86
#includeAll(vs/editor/common/modes/monarch/monarchTypes):
87 88 89 90 91

}

declare module monaco.worker {

92
#includeAll(vs/editor/common/services/editorSimpleWorker;):
93

94
}