2016-05-21 06:45:12 +00:00
|
|
|
declare module monaco.editor {
|
|
|
|
|
|
|
|
export function create(domElement: HTMLElement, options: IEditorConstructionOptions, services?: any): ICodeEditor;
|
|
|
|
export function createDiffEditor(domElement: HTMLElement, options: IDiffEditorConstructionOptions, services?: any): IDiffEditor;
|
|
|
|
export function createModel(value:string, mode:string|ILanguage|IMode, associatedResource?:any|string): IModel;
|
|
|
|
export function getOrCreateMode(modeId: string): TPromise<IMode>;
|
|
|
|
export function createCustomMode(description:ILanguage): TPromise<IMode>;
|
|
|
|
export function colorize(text: string, modeId: string, options: IColorizerOptions): TPromise<string>;
|
|
|
|
export function colorizeElement(domNode: HTMLElement, options: IColorizerElementOptions): TPromise<void>;
|
|
|
|
export function colorizeLine(line: string, tokens: ViewLineToken[], tabSize?: number): string;
|
|
|
|
export function colorizeModelLine(model: IModel, lineNumber: number, tabSize?: number): string;
|
|
|
|
export function registerWorkerParticipant(modeId:string, moduleName:string, ctorName:string): void;
|
|
|
|
export function configureMode(modeId: string, options: any): void;
|
|
|
|
|
|
|
|
export interface IColorizerOptions {
|
|
|
|
tabSize?: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IColorizerElementOptions extends IColorizerOptions {
|
|
|
|
theme?: string;
|
|
|
|
mimeType?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IEditorConstructionOptions extends ICodeEditorWidgetCreationOptions {
|
|
|
|
value?: string;
|
|
|
|
/**
|
|
|
|
* A mode name (such as text/javascript, etc.) or an IMonarchLanguage
|
|
|
|
*/
|
|
|
|
mode?: any;
|
|
|
|
enableTelemetry?: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IDiffEditorConstructionOptions extends IDiffEditorOptions {
|
|
|
|
}
|
|
|
|
}
|
2016-05-20 15:45:31 +00:00
|
|
|
|
|
|
|
declare module monaco {
|
|
|
|
|
|
|
|
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>;
|
|
|
|
}
|
|
|
|
|
2016-05-21 06:45:12 +00:00
|
|
|
export interface IDisposable {
|
|
|
|
dispose(): void;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IEvent<T> {
|
|
|
|
(listener: (e: T) => any, thisArg?: any): IDisposable;
|
2016-05-20 15:45:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export class Emitter<T> {
|
|
|
|
constructor();
|
2016-05-21 06:45:12 +00:00
|
|
|
event: IEvent<T>;
|
2016-05-20 15:45:31 +00:00
|
|
|
fire(event?: T): void;
|
|
|
|
dispose(): void;
|
|
|
|
}
|
|
|
|
|
2016-05-21 06:45:12 +00:00
|
|
|
#include(vs/base/common/winjs.base.d.ts): TValueCallback, ProgressCallback, TPromise
|
2016-05-20 15:45:31 +00:00
|
|
|
|
|
|
|
#include(vs/base/common/uri): URI
|
2016-05-21 06:45:12 +00:00
|
|
|
#include(vs/base/common/eventEmitter): IEmitterEvent, ListenerCallback, IBulkListenerCallback, ListenerUnbind, IEventEmitter
|
2016-05-20 15:45:31 +00:00
|
|
|
|
2016-05-21 06:45:12 +00:00
|
|
|
#include(vs/base/common/keyCodes): KeyCode, KeyMod
|
2016-05-20 15:45:31 +00:00
|
|
|
|
2016-05-21 06:45:12 +00:00
|
|
|
#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
|
|
|
|
|
|
|
|
export interface IPlatformServices {
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IInstantiationService {
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IConstructorSignature1<A1, T> {
|
|
|
|
new (context: IPlatformServices, first: A1): T;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IConstructorSignature2<A1, A2, T> {
|
|
|
|
new (context: IPlatformServices, first: A1, second: A2): T;
|
|
|
|
}
|
2016-05-20 15:45:31 +00:00
|
|
|
}
|
|
|
|
|
2016-05-21 06:45:12 +00:00
|
|
|
|
2016-05-20 15:45:31 +00:00
|
|
|
declare module monaco.editor {
|
|
|
|
|
2016-05-21 06:45:12 +00:00
|
|
|
#include(vs/editor/common/modes/monarch/monarchTypes): ILanguage, ILanguageBracket
|
|
|
|
|
|
|
|
#include(vs/editor/common/core/modeTransition): ModeTransition
|
|
|
|
|
|
|
|
#include(vs/editor/common/modes): IToken, IModeTransition, ILineContext
|
|
|
|
|
|
|
|
export interface IMode {
|
|
|
|
|
|
|
|
}
|
2016-05-20 15:45:31 +00:00
|
|
|
|
|
|
|
#include(vs/base/browser/ui/scrollbar/scrollableElementOptions): ScrollbarVisibility
|
|
|
|
|
2016-05-21 06:45:12 +00:00
|
|
|
#include(vs/editor/common/core/viewLineToken): ViewLineToken
|
|
|
|
|
|
|
|
#includeAll(vs/editor/common/editorCommon): KeyCode, KeyMod
|
2016-05-20 15:45:31 +00:00
|
|
|
#includeAll(vs/editor/browser/editorBrowser):
|
|
|
|
|
|
|
|
}
|