提交 089ac7df 编写于 作者: A Alex Dima

Fixes Microsoft/monaco-editor#973

上级 34ca4c78
......@@ -439,7 +439,7 @@ export interface IEditor {
/**
* Gets the current model attached to this editor.
*/
getModel(): IEditorModel;
getModel(): IEditorModel | null;
/**
* Sets the current model attached to this editor.
......@@ -449,7 +449,7 @@ export interface IEditor {
* will not be destroyed.
* It is safe to call setModel(null) to simply detach the current model from the editor.
*/
setModel(model: IEditorModel): void;
setModel(model: IEditorModel | null): void;
/**
* Change the decorations. All decorations added through this changeAccessor
......
......@@ -84,7 +84,7 @@ export interface IEditorConstructionOptions extends IEditorOptions {
/**
* The initial model associated with this code editor.
*/
model?: ITextModel;
model?: ITextModel | null;
/**
* The initial value of the auto created model in the editor.
* To not create automatically a model, use `model: null`.
......
......@@ -1058,7 +1058,7 @@ declare namespace monaco.editor {
/**
* The initial model associated with this code editor.
*/
model?: ITextModel;
model?: ITextModel | null;
/**
* The initial value of the auto created model in the editor.
* To not create automatically a model, use `model: null`.
......@@ -2197,7 +2197,7 @@ declare namespace monaco.editor {
/**
* Gets the current model attached to this editor.
*/
getModel(): IEditorModel;
getModel(): IEditorModel | null;
/**
* Sets the current model attached to this editor.
* If the previous model was created by the editor via the value key in the options
......@@ -2206,7 +2206,7 @@ declare namespace monaco.editor {
* will not be destroyed.
* It is safe to call setModel(null) to simply detach the current model from the editor.
*/
setModel(model: IEditorModel): void;
setModel(model: IEditorModel | null): void;
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册