monaco.d.ts.recipe 3.7 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

22 23 24 25 26 27
    export class Emitter<T> {
        constructor();
        event: Event<T>;
        fire(event?: T): void;
        dispose(): void;
    }
A
Alex Dima 已提交
28

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

36 37 38
#include(vs/base/common/winjs.base.d.ts): TValueCallback, ProgressCallback, TPromise
#include(vs/base/common/cancellation): CancellationTokenSource, CancellationToken
#include(vs/base/common/uri): URI
39 40 41 42 43 44 45 46 47 48
#include(vs/base/common/keyCodes): KeyCode, KeyMod
#include(vs/base/common/htmlContent): IHTMLContentElementCode, IHTMLContentElement
#include(vs/base/common/actions): IAction
#include(vs/base/browser/keyboardEvent): IKeyboardEvent
#include(vs/base/browser/mouseEvent): IMouseEvent
#include(vs/editor/common/editorCommon): IScrollEvent
#include(vs/editor/common/editorCommon): IPosition, IRange, SelectionDirection, ISelection
#include(vs/editor/common/core/position): Position
#include(vs/editor/common/core/range): Range
#include(vs/editor/common/core/selection): Selection
49 50 51
}

declare module monaco.editor {
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66

#includeAll(vs/editor/browser/standalone/standaloneEditor;modes.=>languages.):
#include(vs/editor/browser/standalone/standaloneCodeEditor): IEditorConstructionOptions, IDiffEditorConstructionOptions
#include(vs/editor/browser/standalone/standaloneServices): IEditorOverrideServices
#include(vs/platform/markers/common/markers): IMarkerData

    export interface IColorizerOptions {
        tabSize?: number;
    }

    export interface IColorizerElementOptions extends IColorizerOptions {
        theme?: string;
        mimeType?: string;
    }

67 68
#include(vs/editor/common/modes/monarch/monarchTypes): ILanguage, ILanguageBracket
#include(vs/base/browser/ui/scrollbar/scrollableElementOptions): ScrollbarVisibility
69 70
#includeAll(vs/editor/common/editorCommon;IMode=>languages.IMode): IPosition, IRange, ISelection, SelectionDirection, IScrollEvent
#includeAll(vs/editor/browser/editorBrowser;editorCommon.=>):
71 72 73 74 75
}

declare module monaco.languages {

#includeAll(vs/editor/browser/standalone/standaloneLanguages;modes.=>;editorCommon.=>editor.):
76
#include(vs/editor/common/modes/languageConfigurationRegistry): CommentRule, IRichLanguageConfiguration
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
#include(vs/editor/common/modes/supports/onEnter): IIndentationRules, IOnEnterRegExpRules
#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

}

declare module monaco.worker {

    export interface IMirrorModel {
        uri: Uri;
        version: number;
        getText(): string;
    }

    export var mirrorModels: IMirrorModel[];

94
}