atom.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. const atomExport = {
  11. BufferedNodeProcess,
  12. BufferedProcess,
  13. GitRepository,
  14. Notification,
  15. TextBuffer,
  16. Point,
  17. Range,
  18. File,
  19. Directory,
  20. Emitter,
  21. Disposable,
  22. CompositeDisposable,
  23. watchPath
  24. };
  25. // Shell integration is required by both Squirrel and Settings-View
  26. if (process.platform === 'win32') {
  27. Object.defineProperty(atomExport, 'WinShell', {
  28. enumerable: true,
  29. get() {
  30. return require('../src/main-process/win-shell');
  31. }
  32. });
  33. }
  34. // The following classes can't be used from a Task handler and should therefore
  35. // only be exported when not running as a child node process
  36. if (process.type === 'renderer') {
  37. atomExport.Task = require('../src/task');
  38. atomExport.TextEditor = require('../src/text-editor');
  39. }
  40. module.exports = atomExport;