Summary
Atom global for dealing with packages, themes, menus, and the window.
The singleton of this class is always available as the atom
global.
- Properties
- Event Subscription
- Atom Details
- Managing The Atom Window
- Messaging the User
- Managing the Dev Tools
Instance Methods
onDidBeep(callback)
Invoke the given callback whenever beep is called.
Argument | Description |
---|---|
callback |
Return Values |
---|
Returns a {Disposable} on which |
onWillThrowError(callback)
Invoke the given callback when there is an unhandled error, but before the devtools pop open
Argument | Description |
---|---|
callback |
Function to be called whenever there is an unhandled error |
Return Values |
---|
Returns a {Disposable} on which |
onDidThrowError(callback)
Invoke the given callback whenever there is an unhandled error.
Argument | Description |
---|---|
callback |
Function to be called whenever there is an unhandled error |
Return Values |
---|
Returns a {Disposable} on which |
trace()
Run the Chromium content-tracing module for five seconds, and save the output to a file which is printed to the command-line output of the app. You can take the file exported by this function and load it into Chrome's content trace visualizer (chrome://tracing). It's like Chromium Developer Tools Profiler, but for all processes and threads.
inDevMode()
Is the current window in development mode?
inSafeMode()
Is the current window in safe mode?
inSpecMode()
Is the current window running specs?
getVersion()
Get the version of the Atom application.
Return Values |
---|
Returns the version text String. |
isReleasedVersion()
Determine whether the current version is an official release.
getWindowLoadTime()
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. |
close()
Close the current window.
getSize()
Get the size of current window.
Return Values |
---|
Returns an Object in the format |
setSize(widthheight)
Set the size of current window.
Argument | Description |
---|---|
width |
The Number of pixels. |
height |
The Number of pixels. |
getPosition()
Get the position of current window.
Return Values |
---|
Returns an Object in the format |
setPosition(xy)
Set the position of current window.
Argument | Description |
---|---|
x |
The Number of pixels. |
y |
The Number of pixels. |
center()
Move current window to the center of the screen.
focus()
Focus the current window.
show()
Show the current window.
hide()
Hide the current window.
reload()
Reload the current window.
getWindowProps()
The windowProps passed when creating the window via newWindow
.
onWindowPropsReceived()
If your package declares hot-loaded window types, onWindowPropsReceived
fires when your hot-loaded window is about to be shown so you can update
components to reflect the new window props.
- callback: A function to call when window props are received, just before the hot window is shown. The first parameter is the new windowProps.
isMaximixed()
Is the current window maximized?
isFullScreen()
Is the current window in full screen mode?
setFullScreen()
Set the full screen state of the current window.
toggleFullScreen()
Toggle the full screen state of the current window.
beep()
Visually and audibly trigger a beep.
confirm(options)
A flexible way to open a dialog akin to an alert dialog.
Argument | Description |
---|---|
options |
An Object with the following keys: |
Return Values |
---|
Returns the chosen button index Number if the buttons option was an array. |
openDevTools()
Open the dev tools for the current window.
toggleDevTools()
Toggle the visibility of the dev tools for the current window.
executeJavaScriptInDevTools()
Execute code in dev tools.