@inquirer/core 12.0.0 → 12.0.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.
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import { type Prompt
|
|
2
|
-
type ViewFunction<Value, Config> = (config:
|
|
3
|
-
|
|
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 {};
|
package/dist/lib/make-theme.js
CHANGED
|
@@ -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:
|
|
6
|
+
renderItem: (layout: {
|
|
8
7
|
item: T;
|
|
9
8
|
index: number;
|
|
10
9
|
isActive: boolean;
|
|
11
|
-
}
|
|
10
|
+
}) => string;
|
|
12
11
|
/** The size of the page. */
|
|
13
12
|
pageSize: number;
|
|
14
13
|
/** Allows creating an infinitely looping list. `true` if unspecified. */
|
package/dist/lib/theme.d.ts
CHANGED
|
@@ -160,7 +160,7 @@ type DefaultTheme = {
|
|
|
160
160
|
key: (text: string) => string;
|
|
161
161
|
};
|
|
162
162
|
};
|
|
163
|
-
export type Theme<Extension extends object = object> =
|
|
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.
|
|
3
|
+
"version": "12.0.1",
|
|
4
4
|
"description": "Core Inquirer prompt API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"answer",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"dependencies": {
|
|
70
70
|
"@inquirer/ansi": "^2.0.7",
|
|
71
71
|
"@inquirer/figures": "^2.0.8",
|
|
72
|
-
"@inquirer/type": "^4.0
|
|
72
|
+
"@inquirer/type": "^4.1.0",
|
|
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": "
|
|
97
|
+
"gitHead": "51ac389603405e8f9f315ce49416153d95c5fefe"
|
|
98
98
|
}
|