greybel-interpreter 1.2.7 → 1.2.8

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,14 +1,18 @@
1
+ export interface KeyEvent {
2
+ keyCode: number;
3
+ code: string;
4
+ }
1
5
  export declare abstract class OutputHandler {
2
6
  abstract print(message: string): void;
3
7
  abstract progress(timeout: number): Promise<void>;
4
8
  abstract waitForInput(isPassword: boolean): Promise<string>;
5
- abstract waitForKeyPress(): Promise<number>;
9
+ abstract waitForKeyPress(): Promise<KeyEvent>;
6
10
  abstract clear(): void;
7
11
  }
8
12
  export declare class DefaultOutputHandler extends OutputHandler {
9
13
  print(message: string): void;
10
14
  progress(timeout: number): Promise<void>;
11
15
  waitForInput(_isPassword: boolean): Promise<string>;
12
- waitForKeyPress(): Promise<number>;
16
+ waitForKeyPress(): Promise<KeyEvent>;
13
17
  clear(): void;
14
18
  }
@@ -39,7 +39,10 @@ var DefaultOutputHandler = /** @class */ (function (_super) {
39
39
  return Promise.resolve('test');
40
40
  };
41
41
  DefaultOutputHandler.prototype.waitForKeyPress = function () {
42
- return Promise.resolve(13);
42
+ return Promise.resolve({
43
+ keyCode: 13,
44
+ code: 'Enter'
45
+ });
43
46
  };
44
47
  DefaultOutputHandler.prototype.clear = function () {
45
48
  console.clear();
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { ContextForkOptions, ContextOptions, ContextState, ContextType, Debugger, FunctionState, LoopState, default as OperationContext, ProcessState, Scope } from './context';
2
2
  export { default as CPS, CPSContext } from './cps';
3
3
  export { DefaultErrorHandler, ErrorHandler } from './handler/error';
4
- export { DefaultOutputHandler, OutputHandler } from './handler/output';
4
+ export { DefaultOutputHandler, OutputHandler, KeyEvent } from './handler/output';
5
5
  export { DefaultResourceHandler, ResourceHandler } from './handler/resource';
6
6
  export { default as HandlerContainer } from './handler-container';
7
7
  export { default as Interpreter, InterpreterOptions } from './interpreter';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "greybel-interpreter",
3
- "version": "1.2.7",
3
+ "version": "1.2.8",
4
4
  "description": "Interpreter",
5
5
  "main": "dist/index",
6
6
  "typings": "dist/index",