monaco.d.ts.recipe 3.5 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/keybinding): 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
51 52 53
}

declare module monaco.editor {
54 55

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

declare module monaco.languages {

72
#includeAll(vs/editor/browser/standalone/standaloneLanguages;modes.=>;editorCommon.=>editor.;IMarkerData=>editor.IMarkerData):
73
#includeAll(vs/editor/common/modes/languageConfiguration):
74 75
#includeAll(vs/editor/common/modes;editorCommon.IRange=>IRange;editorCommon.IPosition=>IPosition;editorCommon.=>editor.;IToken2=>IToken;ILineTokens2=>ILineTokens;IState2=>IState):
#include(vs/editor/common/services/modeService): ILanguageExtensionPoint
76
#includeAll(vs/editor/common/modes/monarch/monarchTypes):
77 78 79 80 81

}

declare module monaco.worker {

82
#includeAll(vs/editor/common/services/editorSimpleWorker;):
83

84
}