atom.js
1 const TextBuffer = require('text-buffer'); 2 const { Point, Range } = TextBuffer; 3 const { File, Directory } = require('pathwatcher'); 4 const { Emitter, Disposable, CompositeDisposable } = require('event-kit'); 5 const BufferedNodeProcess = require('../src/buffered-node-process'); 6 const BufferedProcess = require('../src/buffered-process'); 7 const GitRepository = require('../src/git-repository'); 8 const Notification = require('../src/notification'); 9 const { watchPath } = require('../src/path-watcher'); 10 11 const atomExport = { 12 BufferedNodeProcess, 13 BufferedProcess, 14 GitRepository, 15 Notification, 16 TextBuffer, 17 Point, 18 Range, 19 File, 20 Directory, 21 Emitter, 22 Disposable, 23 CompositeDisposable, 24 watchPath 25 }; 26 27 // Shell integration is required by both Squirrel and Settings-View 28 if (process.platform === 'win32') { 29 Object.defineProperty(atomExport, 'WinShell', { 30 enumerable: true, 31 get() { 32 return require('../src/main-process/win-shell'); 33 } 34 }); 35 } 36 37 // The following classes can't be used from a Task handler and should therefore 38 // only be exported when not running as a child node process 39 if (process.type === 'renderer') { 40 atomExport.Task = require('../src/task'); 41 atomExport.TextEditor = require('../src/text-editor'); 42 } 43 44 module.exports = atomExport;