Atom global for dealing with packages, themes, menus, and the window.
An instance of this class is always available as the atom
global.
A Clipboard instance
A DeserializerManager instance
A ViewRegistry instance
A NotificationManager instance
A KeymapManager instance
A TooltipManager instance
A CommandRegistry instance
A GrammarRegistry instance
A StyleManager instance
A PackageManager instance
A ThemeManager instance
A MenuManager instance
A ContextMenuManager instance
A TextEditorRegistry instance
A Workspace instance
A HistoryManager instance
This section only has Extended methods.
Invoke the given callback whenever ::beep is called.
Argument | Description |
---|---|
|
Return values |
---|
Returns a Disposable on which |
Invoke the given callback when there is an unhandled error, but before the devtools pop open
Argument | Description |
---|---|
|
Function to be called whenever there is an unhandled error |
|
|
|
Object the original error object |
|
String the original error object |
|
String Url to the file where the error originated. |
|
|
|
|
|
Function call this to avoid popping up the dev tools. |
Return values |
---|
Returns a Disposable on which |
Invoke the given callback whenever there is an unhandled error.
Argument | Description |
---|---|
|
Function to be called whenever there is an unhandled error |
|
|
|
Object the original error object |
|
String the original error object |
|
String Url to the file where the error originated. |
|
|
|
Return values |
---|
Returns a Disposable on which |
Invoke the given callback as soon as the shell environment is loaded (or immediately if it was already loaded).
Argument | Description |
---|---|
|
Function to be called whenever there is an unhandled error |
Get the full name of this Atom release (e.g. “Atom”, “Atom Beta”)
Return values |
---|
Returns the app name String. |
Gets the release channel of the Atom application.
Return values |
---|
Returns the release channel as a String. Will return a specific release channel name like ‘beta’ or ‘nightly’ if one is found in the Atom version or ‘stable’ otherwise. |
Get the time taken to completely load the current window.
This time include things like loading and activating packages, creating DOM elements for the editor, and reading the config.
Return values |
---|
Returns the Number of milliseconds taken to load the window or null if the window hasn’t finished loading yet. |
Get the all the markers with the information about startup time.
Return values |
---|
Returns an array of timing markers. Each timing is an object with two keys:
|
Get the load settings for the current window.
Return values |
---|
Returns an Object containing all the load setting key/value pairs. |
Open a new Atom window using the given options.
Calling this method without an options parameter will open a prompt to pick a file/folder to open in the new window.
Argument | Description |
---|---|
|
An Object with the following keys: |
|
|
|
A Boolean, true to always open a new window instead of reusing existing windows depending on the paths to open. |
|
A Boolean, true to open the window in development mode. Development mode loads the Atom source from the locally cloned repository and also loads all the packages in ~/.atom/dev/packages |
|
A Boolean, true to open the window in safe mode. Safe mode prevents all packages installed to ~/.atom/packages from loading. |
Close the current window.
Get the size of current window.
Return values |
---|
Returns an Object in the format |
Get the current window
Move current window to the center of the screen.
Focus the current window.
Show the current window.
Hide the current window.
Reload the current window.
Relaunch the entire application.
Set the full screen state of the current window.
Toggle the full screen state of the current window.
Visually and audibly trigger a beep.
A flexible way to open a dialog akin to an alert dialog.
While both async and sync versions are provided, it is recommended to use the async version such that the renderer process is not blocked while the dialog box is open.
The async version accepts the same options as Electron’s dialog.showMessageBox
.
For convenience, it sets type
to 'info'
and normalizeAccessKeys
to true
by default.
If the dialog is closed (via Esc
key or X
in the top corner) without selecting a button
the first button will be clicked unless a “Cancel” or “No” button is provided.
Argument | Description |
---|---|
|
An options Object. If the callback argument is also supplied, see the documentation at https://electronjs.org/docs/api/dialog#dialogshowmessageboxbrowserwindow-options-callback for the list of available options. Otherwise, only the following keys are accepted: |
|
The String message to display. |
|
optional
The String detailed message to display. |
|
optional
Either an Array of Strings or an Object where keys are button names and the values are callback Functions to invoke when clicked. |
|
optional
A Function that will be called with the index of the chosen option. If a callback is supplied, the dialog will be non-blocking. This argument is recommended. |
Return values |
---|
Returns the chosen button index Number if the buttons option is an array
or the return value of the callback if the buttons option is an object.
If a callback function is supplied, returns |
This section only has Extended methods.
Open the dev tools for the current window.
Return values |
---|
Returns a Promise that resolves when the DevTools have been opened. |
Toggle the visibility of the dev tools for the current window.
Return values |
---|
Returns a Promise that resolves when the DevTools have been opened or closed. |
Execute code in dev tools.