index.d.ts 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. declare namespace fkill {
  2. interface Options {
  3. /**
  4. Force kill the process.
  5. @default false
  6. */
  7. readonly force?: boolean;
  8. /**
  9. Kill all child processes along with the parent process. _(Windows only)_
  10. @default true
  11. */
  12. readonly tree?: boolean;
  13. /**
  14. Ignore capitalization when killing a process.
  15. Note that the case is always ignored on Windows.
  16. @default false
  17. */
  18. readonly ignoreCase?: boolean;
  19. }
  20. }
  21. declare const fkill: {
  22. /**
  23. Fabulously kill processes. Cross-platform.
  24. @param input - One or more process IDs/names/ports to kill. To kill a port, prefix it with a colon. For example: `:8080`.
  25. @example
  26. ```
  27. import fkill = require('fkill');
  28. (async () => {
  29. await fkill(1337);
  30. console.log('Killed process');
  31. })();
  32. fkill('Safari');
  33. fkill(':8080');
  34. fkill([1337, 'Safari', ':8080']);
  35. ```
  36. */
  37. (
  38. input: number | string | ReadonlyArray<string | number>,
  39. options?: fkill.Options
  40. ): Promise<void>;
  41. // TODO: remove this in the next major version, refactor the whole definition to:
  42. // declare function fkill(
  43. // input: number | string | ReadonlyArray<string | number>,
  44. // options?: fkill.Options
  45. // ): Promise<void>
  46. // export = fkill;
  47. default: typeof fkill;
  48. };
  49. export = fkill;