In the directory
src/@types/yargs-interactive/index.d.ts
, I have created a typings file for https://github.com/nanovazquez/yargs-interactive. The contents of this file are as follows:
declare function yargsInteractive(): any;
declare namespace yargsInteractive {
interface OptionData {
type: string;
describe: string;
default?: string | number | boolean;
prompt?: string;
}
interface Option {
[key: string]: OptionData;
}
interface Interactive {
usage(usage: string): any;
interactive(options: Option[]): any;
then(callback: (result: any) => any): any;
}
}
export = yargsInteractive;
However, when attempting to import this typings file, I encounter a
Could not find a declaration file for module 'yargs-interactive'
error. Despite adding typeRoots
to my tsconfig.json file pointing to the src/@types
directory, the file is still not found. It does get recognized when located under node_modules/@types/yargs-interactive/index.d.ts
.
What could be causing this issue?