mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
[atom] atom.workspace.isTextEditor is a type assertion (#22590)
This commit is contained in:
parent
12522af29a
commit
cbf0da6545
@ -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();
|
||||
|
||||
2
types/atom/index.d.ts
vendored
2
types/atom/index.d.ts
vendored
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user