Editor

Properties

Editor.argv

An yargs.argv value.

Editor.dev

Indicates if the application is running with --dev option.

Editor.frameworkPath

The Editor-Framework module path. Usually it is {your-app}/editor-framework/

Editor.isClosing readonly

Indicates if the Editor-Framework App is closing.

Editor.lang

Indicates the language used in --lang option.

Editor.logfile

Specify the log file path. By default it is saving in:

Editor.versions

A table contains all version info for app and sub-modules. By default it contains App and Editor-Framework version info.

Methods

Editor.init(opts)

Init and config the Editor module. For more details about Editor.init options, read Editor Configuration

Editor.run(url, opts)

Run the Editor by restoring last window or openning the a new one.

Editor.reset()

Reset the configuration of Editor

Editor.loadPackagesAt(path, callback)

Load all packages under path. Once it done the callback will be invoked.

Editor.loadAllPackages(callback)

Load all packages under the package-search-path which specified in Editor.init. Once it done the callback will be invoked.

Editor.require(url)

Require the module by Editor.url. This is good for module exists in package, since the absolute path of package may be variant in different machine. Example:

// this is equal to require(Editor.url('packages://foobar/foo'))
const Foo = Editor.require('packages://foobar/foo');

Editor.url(url)

Returns the file path (if it is registered in custom protocol) or url (if it is a known public protocol).

Editor.watchPackages(callback)

Start watching all packages. Once it done the callback will be invoked.