[atom] atom.workspace.isTextEditor is a type assertion (#22590)

This commit is contained in:
Nikolay Yakimov 2018-01-02 23:16:19 +03:00 committed by Mohamed Hegazy
parent 12522af29a
commit cbf0da6545
2 changed files with 4 additions and 2 deletions

View File

@ -3113,7 +3113,9 @@ function testWorkspace() {
obj = atom.workspace.createItemForURI("https://test");
bool = atom.workspace.isTextEditor(obj);
if (atom.workspace.isTextEditor(obj)) {
const textEditor: Atom.TextEditor = obj;
}
async function workspaceReopen() {
const result = await atom.workspace.reopenItem();

View File

@ -2697,7 +2697,7 @@ export interface Workspace {
createItemForURI(uri: string): Promise<object|TextEditor>;
/** Returns a boolean that is true if object is a TextEditor. */
isTextEditor(object: object): boolean;
isTextEditor(object: object): object is TextEditor;
/**
* Asynchronously reopens the last-closed item's URI if it hasn't already