mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
atom: add missing methods (#42549)
* atom: add missing methods * fix linter errors * fix linter errors * fix linter errors * fix jsdoc format * fix jsdoc format * fix jsdoc format * fix return type of displayWindow() * make getWindowDomensions() return types optional * bump version occurances * fix *WindowDimension types * split arguments over lines
This commit is contained in:
@@ -157,6 +157,7 @@ function testAtomEnvironment() {
|
||||
bool = atom.inDevMode();
|
||||
bool = atom.inSafeMode();
|
||||
bool = atom.inSpecMode();
|
||||
str = atom.getAppName();
|
||||
str = atom.getVersion();
|
||||
bool = atom.isReleasedVersion();
|
||||
num = atom.getWindowLoadTime();
|
||||
@@ -190,6 +191,9 @@ function testAtomEnvironment() {
|
||||
bool = atom.isFullScreen();
|
||||
atom.setFullScreen(true);
|
||||
atom.toggleFullScreen();
|
||||
atom.displayWindow();
|
||||
obj = atom.getWindowDimensions();
|
||||
atom.setWindowDimensions({ x: 0, y: 0, width: 640, height: 480 });
|
||||
|
||||
// Messaging the User
|
||||
atom.beep();
|
||||
|
||||
26
types/atom/index.d.ts
vendored
26
types/atom/index.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for non-npm package Atom 1.36
|
||||
// Type definitions for non-npm package Atom 1.40
|
||||
// Project: https://github.com/atom/atom
|
||||
// Definitions by: GlenCFL <https://github.com/GlenCFL>
|
||||
// smhxx <https://github.com/smhxx>
|
||||
@@ -7,7 +7,7 @@
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
// NOTE: only those classes exported within this file should be retain that status below.
|
||||
// https://github.com/atom/atom/blob/v1.36.0/exports/atom.js
|
||||
// https://github.com/atom/atom/blob/v1.40.0/exports/atom.js
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
@@ -121,6 +121,9 @@ export interface AtomEnvironment {
|
||||
/** Returns a boolean that is true if the current window is running specs. */
|
||||
inSpecMode(): boolean;
|
||||
|
||||
/** Get the full name of this Atom release (e.g. "Atom", "Atom Beta") */
|
||||
getAppName(): string;
|
||||
|
||||
/** Get the version of the Atom application. */
|
||||
getVersion(): string;
|
||||
|
||||
@@ -199,6 +202,23 @@ export interface AtomEnvironment {
|
||||
/** Toggle the full screen state of the current window. */
|
||||
toggleFullScreen(): void;
|
||||
|
||||
/**
|
||||
* Restores the full screen and maximized state after the window has resized to prevent resize
|
||||
* glitches.
|
||||
*/
|
||||
displayWindow(): Promise<undefined>;
|
||||
|
||||
/** Get the dimensions of this window. */
|
||||
getWindowDimensions(): { x: number, y: number, width: number, height: number };
|
||||
|
||||
/** Set the dimensions of the window. */
|
||||
setWindowDimensions(dimensions: {
|
||||
x?: number,
|
||||
y?: number,
|
||||
width?: number,
|
||||
height?: number
|
||||
}): Promise<object>;
|
||||
|
||||
// Messaging the User
|
||||
/** Visually and audibly trigger a beep. */
|
||||
beep(): void;
|
||||
@@ -5968,7 +5988,7 @@ export interface TextEditorObservedEvent {
|
||||
// information under certain contexts.
|
||||
|
||||
// NOTE: the config schema with these defaults can be found here:
|
||||
// https://github.com/atom/atom/blob/v1.36.0/src/config-schema.js
|
||||
// https://github.com/atom/atom/blob/v1.40.0/src/config-schema.js
|
||||
/**
|
||||
* Allows you to strongly type Atom configuration variables. Additional key:value
|
||||
* pairings merged into this interface will result in configuration values under
|
||||
|
||||
Reference in New Issue
Block a user