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

3 4 5 6 7 8 9 10 11 12 13 14 15 16
    interface Thenable<R> {
        /**
         * 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.
         */
        then<TResult>(onfulfilled?: (value: R) => TResult | Thenable<TResult>, onrejected?: (reason: any) => TResult | Thenable<TResult>): Thenable<TResult>;
        then<TResult>(onfulfilled?: (value: R) => TResult | Thenable<TResult>, onrejected?: (reason: any) => void): Thenable<TResult>;
    }

    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 27 28 29 30
    export class Emitter<T> {
        constructor();
        event: Event<T>;
        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
42
#include(vs/base/common/keyCodes): KeyCode, KeyMod
43
#include(vs/base/common/htmlContent): MarkedString
44 45 46
#include(vs/base/browser/keyboardEvent): IKeyboardEvent
#include(vs/base/browser/mouseEvent): IMouseEvent
#include(vs/editor/common/editorCommon): IScrollEvent
47
#include(vs/editor/common/editorCommon): 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.):
A
Alex Dima 已提交
56 57 58 59
#include(vs/editor/browser/standalone/standaloneCodeEditor): IEditorConstructionOptions, IDiffEditorConstructionOptions, IStandaloneCodeEditor, IStandaloneDiffEditor
export interface ICommandHandler {
    (...args:any[]): void;
}
A
Alex Dima 已提交
60
#include(vs/platform/contextkey/common/contextkey): IContextKey
61 62
#include(vs/editor/browser/standalone/standaloneServices): IEditorOverrideServices
#include(vs/platform/markers/common/markers): IMarkerData
63
#include(vs/editor/browser/standalone/colorizer): IColorizerOptions, IColorizerElementOptions
64
#include(vs/base/common/scrollable): ScrollbarVisibility
65
#include(vs/base/common/actions): IAction
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):
A
Alex Dima 已提交
73 74
#include(vs/editor/common/modes/languageConfigurationRegistry): CommentRule, LanguageConfiguration
#include(vs/editor/common/modes/supports/onEnter): IndentationRule, OnEnterRule
75 76 77
#include(vs/editor/common/modes/supports/electricCharacter): IBracketElectricCharacterContribution, IDocComment
#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
78
#includeAll(vs/editor/common/modes/monarch/monarchTypes):
79 80 81 82 83

}

declare module monaco.worker {

84
#includeAll(vs/editor/common/services/editorSimpleWorker;):
85

86
}