@inquirer/core 1.1.3 → 1.2.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.
@@ -6,6 +6,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.Separator = void 0;
7
7
  const chalk_1 = __importDefault(require("chalk"));
8
8
  const figures_1 = __importDefault(require("figures"));
9
+ /**
10
+ * Separator object
11
+ * Used to space/separate choices group
12
+ */
9
13
  class Separator {
10
14
  constructor(separator) {
11
15
  Object.defineProperty(this, "separator", {
@@ -24,5 +28,8 @@ class Separator {
24
28
  this.separator = separator;
25
29
  }
26
30
  }
31
+ static isSeparator(choice) {
32
+ return Boolean(choice && choice.type === 'separator');
33
+ }
27
34
  }
28
35
  exports.Separator = Separator;
@@ -10,6 +10,7 @@ export * from './lib/Separator.mjs';
10
10
  export type InquirerReadline = readline.ReadLine & {
11
11
  output: MuteStream;
12
12
  input: NodeJS.ReadableStream;
13
+ clearLine: (dir: 0 | 1 | -1) => void;
13
14
  };
14
15
  export type KeypressEvent = {
15
16
  name: string;
@@ -2,12 +2,9 @@
2
2
  * Separator object
3
3
  * Used to space/separate choices group
4
4
  */
5
- export type SeparatorType = {
6
- type: 'separator';
7
- separator: string;
8
- };
9
5
  export declare class Separator {
10
- separator: string;
6
+ readonly separator: string;
11
7
  readonly type = "separator";
12
8
  constructor(separator?: string);
9
+ static isSeparator(choice: undefined | Separator | Record<string, unknown>): choice is Separator;
13
10
  }
@@ -1,5 +1,9 @@
1
1
  import chalk from 'chalk';
2
2
  import figures from 'figures';
3
+ /**
4
+ * Separator object
5
+ * Used to space/separate choices group
6
+ */
3
7
  export class Separator {
4
8
  separator = chalk.dim(new Array(15).join(figures.line));
5
9
  type = 'separator';
@@ -8,4 +12,7 @@ export class Separator {
8
12
  this.separator = separator;
9
13
  }
10
14
  }
15
+ static isSeparator(choice) {
16
+ return Boolean(choice && choice.type === 'separator');
17
+ }
11
18
  }
@@ -10,6 +10,7 @@ export * from './lib/Separator.mjs';
10
10
  export type InquirerReadline = readline.ReadLine & {
11
11
  output: MuteStream;
12
12
  input: NodeJS.ReadableStream;
13
+ clearLine: (dir: 0 | 1 | -1) => void;
13
14
  };
14
15
  export type KeypressEvent = {
15
16
  name: string;
@@ -2,12 +2,9 @@
2
2
  * Separator object
3
3
  * Used to space/separate choices group
4
4
  */
5
- export type SeparatorType = {
6
- type: 'separator';
7
- separator: string;
8
- };
9
5
  export declare class Separator {
10
- separator: string;
6
+ readonly separator: string;
11
7
  readonly type = "separator";
12
8
  constructor(separator?: string);
9
+ static isSeparator(choice: undefined | Separator | Record<string, unknown>): choice is Separator;
13
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inquirer/core",
3
- "version": "1.1.3",
3
+ "version": "1.2.1",
4
4
  "engines": {
5
5
  "node": ">=14.18.0"
6
6
  },
@@ -94,5 +94,5 @@
94
94
  }
95
95
  }
96
96
  },
97
- "gitHead": "fdfa190cb12f2e28299878f433b0a9a15befc535"
97
+ "gitHead": "441c3e3e10ed7dc3dbadbf367dfb0eba4ae09854"
98
98
  }