pulsar/exports/atom.js

45 lines
1.3 KiB
JavaScript
Raw Normal View History

2019-05-31 19:33:56 +03:00
const TextBuffer = require('text-buffer');
const { Point, Range } = TextBuffer;
const { File, Directory } = require('pathwatcher');
const { Emitter, Disposable, CompositeDisposable } = require('event-kit');
const BufferedNodeProcess = require('../src/buffered-node-process');
const BufferedProcess = require('../src/buffered-process');
const GitRepository = require('../src/git-repository');
const Notification = require('../src/notification');
const { watchPath } = require('../src/path-watcher');
2016-08-07 03:20:46 +03:00
const atomExport = {
BufferedNodeProcess,
BufferedProcess,
GitRepository,
Notification,
TextBuffer,
Point,
Range,
File,
Directory,
Emitter,
Disposable,
2017-08-01 21:13:44 +03:00
CompositeDisposable,
watchPath
2019-05-31 19:33:56 +03:00
};
2016-08-07 03:20:46 +03:00
// Shell integration is required by both Squirrel and Settings-View
if (process.platform === 'win32') {
Object.defineProperty(atomExport, 'WinShell', {
enumerable: true,
2019-05-31 19:33:56 +03:00
get() {
return require('../src/main-process/win-shell');
}
2019-05-31 19:33:56 +03:00
});
2016-08-07 03:20:46 +03:00
}
// The following classes can't be used from a Task handler and should therefore
// only be exported when not running as a child node process
if (process.type === 'renderer') {
2019-05-31 19:33:56 +03:00
atomExport.Task = require('../src/task');
atomExport.TextEditor = require('../src/text-editor');
2016-08-07 03:20:46 +03:00
}
2019-05-31 19:33:56 +03:00
module.exports = atomExport;