@wocker/core 1.1.0-beta.7 → 1.1.1-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,9 @@
1
+ import { Direction } from "readline";
1
2
  export declare class ProcessService {
2
3
  get UID(): string | undefined;
3
4
  get GID(): string | undefined;
5
+ get rows(): number;
6
+ get columns(): number;
4
7
  get stdin(): NodeJS.ReadStream;
5
8
  get stdout(): NodeJS.WriteStream;
6
9
  get stderr(): NodeJS.WriteStream;
@@ -11,4 +14,9 @@ export declare class ProcessService {
11
14
  getEnv(key: string): string | undefined;
12
15
  getEnv(key: string, byDefault: string): string;
13
16
  setEnv(key: string, value: string): void;
17
+ moveCursor(x: number, y: number): void;
18
+ cursorTo(x: number, y?: number): void;
19
+ clearLine(dir: Direction): void;
20
+ saveCursor(): void;
21
+ restoreCursor(): void;
14
22
  }
@@ -11,6 +11,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.ProcessService = void 0;
13
13
  const path_1 = __importDefault(require("path"));
14
+ const readline_1 = __importDefault(require("readline"));
14
15
  const decorators_1 = require("../decorators");
15
16
  let ProcessService = class ProcessService {
16
17
  get UID() {
@@ -25,6 +26,12 @@ let ProcessService = class ProcessService {
25
26
  }
26
27
  return `${process.getgid()}`;
27
28
  }
29
+ get rows() {
30
+ return this.stdout.rows;
31
+ }
32
+ get columns() {
33
+ return this.stdout.columns;
34
+ }
28
35
  get stdin() {
29
36
  return process.stdin;
30
37
  }
@@ -55,6 +62,21 @@ let ProcessService = class ProcessService {
55
62
  setEnv(key, value) {
56
63
  process.env[key] = value;
57
64
  }
65
+ moveCursor(x, y) {
66
+ readline_1.default.moveCursor(this.stdout, x, y);
67
+ }
68
+ cursorTo(x, y) {
69
+ readline_1.default.cursorTo(this.stdout, x, y);
70
+ }
71
+ clearLine(dir) {
72
+ readline_1.default.clearLine(this.stdout, dir);
73
+ }
74
+ saveCursor() {
75
+ this.stdout.write("\x1b[s");
76
+ }
77
+ restoreCursor() {
78
+ this.stdout.write("\x1b[u");
79
+ }
58
80
  };
59
81
  exports.ProcessService = ProcessService;
60
82
  exports.ProcessService = ProcessService = __decorate([
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wocker/core",
3
3
  "type": "commonjs",
4
- "version": "1.1.0-beta.7",
4
+ "version": "1.1.1-beta.0",
5
5
  "author": "Kris Papercut <krispcut@gmail.com>",
6
6
  "description": "Core of the Wocker",
7
7
  "license": "MIT",