greybel-interpreter 1.7.0 → 1.7.1
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.
package/dist/handler/output.d.ts
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { CancelablePromise } from 'cancelable-promise';
|
|
2
1
|
export interface KeyEvent {
|
|
3
2
|
keyCode: number;
|
|
4
3
|
code: string;
|
|
5
4
|
}
|
|
6
5
|
export declare abstract class OutputHandler {
|
|
7
6
|
abstract print(message: string, appendNewLine?: boolean): void;
|
|
8
|
-
abstract progress(timeout: number):
|
|
9
|
-
abstract waitForInput(isPassword: boolean):
|
|
10
|
-
abstract waitForKeyPress():
|
|
7
|
+
abstract progress(timeout: number): PromiseLike<void>;
|
|
8
|
+
abstract waitForInput(isPassword: boolean): PromiseLike<string>;
|
|
9
|
+
abstract waitForKeyPress(): PromiseLike<KeyEvent>;
|
|
11
10
|
abstract clear(): void;
|
|
12
11
|
}
|
|
13
12
|
export declare class DefaultOutputHandler extends OutputHandler {
|
|
14
13
|
print(message: string, appendNewLine?: boolean): void;
|
|
15
|
-
progress(timeout: number):
|
|
16
|
-
waitForInput(_isPassword: boolean):
|
|
17
|
-
waitForKeyPress():
|
|
14
|
+
progress(timeout: number): PromiseLike<void>;
|
|
15
|
+
waitForInput(_isPassword: boolean): PromiseLike<string>;
|
|
16
|
+
waitForKeyPress(): PromiseLike<KeyEvent>;
|
|
18
17
|
clear(): void;
|
|
19
18
|
}
|
package/dist/handler/output.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DefaultOutputHandler = exports.OutputHandler = void 0;
|
|
4
|
-
const cancelable_promise_1 = require("cancelable-promise");
|
|
5
4
|
class OutputHandler {
|
|
6
5
|
}
|
|
7
6
|
exports.OutputHandler = OutputHandler;
|
|
@@ -15,19 +14,15 @@ class DefaultOutputHandler extends OutputHandler {
|
|
|
15
14
|
}
|
|
16
15
|
}
|
|
17
16
|
progress(timeout) {
|
|
18
|
-
return new
|
|
19
|
-
|
|
20
|
-
onCancel(() => {
|
|
21
|
-
clearTimeout(timer);
|
|
22
|
-
resolve();
|
|
23
|
-
});
|
|
17
|
+
return new Promise((resolve, _reject) => {
|
|
18
|
+
setTimeout(resolve, timeout);
|
|
24
19
|
});
|
|
25
20
|
}
|
|
26
21
|
waitForInput(_isPassword) {
|
|
27
|
-
return
|
|
22
|
+
return Promise.resolve('test');
|
|
28
23
|
}
|
|
29
24
|
waitForKeyPress() {
|
|
30
|
-
return
|
|
25
|
+
return Promise.resolve({
|
|
31
26
|
keyCode: 13,
|
|
32
27
|
code: 'Enter'
|
|
33
28
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "greybel-interpreter",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.1",
|
|
4
4
|
"description": "Interpreter",
|
|
5
5
|
"main": "dist/index",
|
|
6
6
|
"typings": "dist/index",
|
|
@@ -48,7 +48,6 @@
|
|
|
48
48
|
"typescript": "^4.5.4"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"cancelable-promise": "^4.3.1",
|
|
52
51
|
"greybel-core": "^0.6.7",
|
|
53
52
|
"greyscript-core": "^0.6.2"
|
|
54
53
|
},
|