@inquirer/core 12.0.0 → 12.0.2

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,4 +1,11 @@
1
- import { type Prompt, type Prettify } from '@inquirer/type';
2
- type ViewFunction<Value, Config> = (config: Prettify<Config>, done: (value: Value) => void) => string | [string, string | undefined];
3
- export declare function createPrompt<Value, Config>(view: ViewFunction<Value, Config>): Prompt<Value, Config>;
1
+ import { type Prompt } from '@inquirer/type';
2
+ type ViewFunction<Value, Config> = (config: Config, done: (value: Value) => void) => string | [string, string | undefined];
3
+ /**
4
+ * Expand the top-level keys of a type for better IDE display, without
5
+ * recursing into nested fields (so generic values stay compatible).
6
+ */
7
+ type ShallowPrettify<T> = {
8
+ [K in keyof T]: T[K];
9
+ } & {};
10
+ export declare function createPrompt<Value, Config>(view: ViewFunction<Value, Config>): Prompt<Value, ShallowPrettify<Config> & Config>;
4
11
  export {};
@@ -28,5 +28,6 @@ export function makeTheme(...themes) {
28
28
  getDefaultTheme(),
29
29
  ...themes.filter((theme) => theme != null),
30
30
  ];
31
+ // oxlint-disable-next-line typescript/no-unsafe-type-assertion
31
32
  return deepMerge(...themesToMerge);
32
33
  }
@@ -1,14 +1,13 @@
1
- import type { Prettify } from '@inquirer/type';
2
1
  export declare function usePagination<T>({ items, active, renderItem, pageSize, loop, }: {
3
2
  items: ReadonlyArray<T>;
4
3
  /** The index of the active item. */
5
4
  active: number;
6
5
  /** Renders an item as part of a page. */
7
- renderItem: (layout: Prettify<{
6
+ renderItem: (layout: {
8
7
  item: T;
9
8
  index: number;
10
9
  isActive: boolean;
11
- }>) => string;
10
+ }) => string;
12
11
  /** The size of the page. */
13
12
  pageSize: number;
14
13
  /** Allows creating an infinitely looping list. `true` if unspecified. */
@@ -160,7 +160,7 @@ type DefaultTheme = {
160
160
  key: (text: string) => string;
161
161
  };
162
162
  };
163
- export type Theme<Extension extends object = object> = Prettify<Extension & DefaultTheme>;
163
+ export type Theme<Extension extends object = object> = Extension & DefaultTheme;
164
164
  export declare const defaultTheme: DefaultTheme;
165
165
  export declare function getDefaultTheme(): DefaultTheme;
166
166
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inquirer/core",
3
- "version": "12.0.0",
3
+ "version": "12.0.2",
4
4
  "description": "Core Inquirer prompt API",
5
5
  "keywords": [
6
6
  "answer",
@@ -67,9 +67,9 @@
67
67
  "tsc": "tsc"
68
68
  },
69
69
  "dependencies": {
70
- "@inquirer/ansi": "^2.0.7",
71
- "@inquirer/figures": "^2.0.8",
72
- "@inquirer/type": "^4.0.7",
70
+ "@inquirer/ansi": "^2.0.8",
71
+ "@inquirer/figures": "^2.0.9",
72
+ "@inquirer/type": "4.1.1",
73
73
  "cli-width": "^4.1.0",
74
74
  "fast-wrap-ansi": "^0.2.0",
75
75
  "mute-stream": "^3.0.0",
@@ -94,5 +94,5 @@
94
94
  },
95
95
  "main": "./dist/index.js",
96
96
  "types": "./dist/index.d.ts",
97
- "gitHead": "999706755afbdcae271f62decbd9bcd05560905b"
97
+ "gitHead": "5748bd9966b5e175ddf5995ee4cdce6f60c4272e"
98
98
  }