Skip to content

Commit 67c0661

Browse files
authored
Merge pull request #358 from jayalfredprufrock/main
Use type alias for inquirer module to avoid typescript error. Closes #357
2 parents 4433a20 + de57e4d commit 67c0661

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/node-plop/types/index.d.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import inquirer from "inquirer";
2+
3+
type Inquirer = typeof inquirer;
4+
25
// @types/globby doesn't export types for GlobOptions, so we have to work a little bit to extract them:
36
// GlobOptions is the second parameter of the sync function, which can be extracted with the Parameters<T> type
47
import { globbySync } from "globby";
5-
68
type GlobOptions = Parameters<typeof globbySync>[1];
79
import { HelperDelegate as HelperFunction } from "handlebars";
810

@@ -139,7 +141,7 @@ export type PromptQuestion =
139141
| inquirer.InputQuestion;
140142

141143
export type DynamicPromptsFunction = (
142-
inquirer: inquirer.Inquirer
144+
inquirer: Inquirer
143145
) => Promise<inquirer.Answers>;
144146
export type DynamicActionsFunction = (data?: inquirer.Answers) => ActionType[];
145147

0 commit comments

Comments
 (0)