AppShimHost

external class AppShimHost : EventEmitter(source)

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
Link copied to clipboard
external val bundleId: String

A string representing the bundle identifier from that bundle's Info.plist. This value is not verified, so do not use it to decide whether to trust the shim. Use shim.satisfiesCodeRequirement() instead.

Link copied to clipboard
external val bundlePath: String

A string representing the path of the app bundle that the shim's process was launched from.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
external val pid: Double

A number representing the process ID of the shim.

Link copied to clipboard

Functions

Link copied to clipboard
external fun addListener(type: EventType, listener: EventListener)
Link copied to clipboard
external fun bounce(type: AppShimHostBounceType = definedExternally)

Bounces the shim's Dock icon, in the same way that dock.bounce() bounces your app's.

Link copied to clipboard
external fun cancelBounce()

Cancels a bounce started by shim.bounce().

Link copied to clipboard
external fun emit(type: EventType, vararg args: Any?): Boolean
Link copied to clipboard
Link copied to clipboard
external fun getMaxListeners(): Double
Link copied to clipboard
external fun isConnected(): Boolean

Whether the shim's process is still connected.

Link copied to clipboard
external fun listenerCount(type: EventType, listener: EventListener): Double
Link copied to clipboard
Link copied to clipboard
external fun off(type: EventType, listener: EventListener)
Link copied to clipboard
external fun on(type: EventType, listener: EventListener)
Link copied to clipboard
external fun once(type: EventType, listener: EventListener)
Link copied to clipboard
external fun prependListener(type: EventType, listener: EventListener)
Link copied to clipboard
external fun prependOnceListener(type: EventType, listener: EventListener)
Link copied to clipboard
external fun quit()

Quits the shim's process and closes its windows. The windows do not emit close events. They emit closed shortly after this method returns. shim.isConnected() returns false as soon as this method returns.

Link copied to clipboard
Link copied to clipboard
external fun removeAllListeners(type: EventType)
Link copied to clipboard
external fun removeListener(type: EventType, listener: EventListener)
Link copied to clipboard
external fun satisfiesCodeRequirement(requirement: String): Boolean

Whether the code signature of the shim's process satisfies requirement. The check is performed on the running process that connected, not on the bundle at shim.bundlePath.

Link copied to clipboard
external fun setApplicationMenu(menu: Menu?)

Sets the menu bar that is shown while the shim is the active app. This is the shim's equivalent of Menu.setApplicationMenu(). Passing null restores the shim's minimal default menu.

Link copied to clipboard
external fun setBadge(text: String)

Sets the text displayed on the shim's Dock icon. An empty string clears it.

Link copied to clipboard
external fun setMaxListeners(n: Number)