@types/inquirer-fuzzy-path
Advanced tools
Comparing version
@@ -1,7 +0,1 @@ | ||
// Type definitions for inquirer-fuzzy-path 2.3 | ||
// Project: https://github.com/adelsz/inquirer-fuzzy-path | ||
// Definitions by: 迷子 (Maiko Tan) <https://github.com/MaikoTan> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// TypeScript Version: 4.2 | ||
import { Answers, KeyUnion, QuestionCollection } from "inquirer"; | ||
@@ -8,0 +2,0 @@ import { AutocompleteQuestionOptions } from "inquirer-autocomplete-prompt"; |
{ | ||
"name": "@types/inquirer-fuzzy-path", | ||
"version": "2.3.7", | ||
"version": "2.3.8", | ||
"description": "TypeScript definitions for inquirer-fuzzy-path", | ||
@@ -10,4 +10,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/inquirer-fuzzy-path", | ||
"name": "迷子 (Maiko Tan)", | ||
"url": "https://github.com/MaikoTan", | ||
"githubUsername": "MaikoTan" | ||
"githubUsername": "MaikoTan", | ||
"url": "https://github.com/MaikoTan" | ||
} | ||
@@ -27,4 +27,4 @@ ], | ||
}, | ||
"typesPublisherContentHash": "cb74f31f6bd749b59513ebc3444519466b39b3fb0e5ecc9f051100ffffeb1906", | ||
"typesPublisherContentHash": "d4ecc6901a65dd80b0957e8a6a526ba64ad49139771c7ae64e787ba0d63c3ad2", | ||
"typeScriptVersion": "4.5" | ||
} |
@@ -9,9 +9,102 @@ # Installation | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/inquirer-fuzzy-path. | ||
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/inquirer-fuzzy-path/index.d.ts) | ||
````ts | ||
import { Answers, KeyUnion, QuestionCollection } from "inquirer"; | ||
import { AutocompleteQuestionOptions } from "inquirer-autocomplete-prompt"; | ||
import InquirerAutocomplete = require("inquirer-autocomplete-prompt"); | ||
import { Interface as ReadlineInterface } from "readline"; | ||
export = InquirerFuzzyPath; | ||
/** | ||
* Provides the functionality to create a new Inquirer plugin | ||
*/ | ||
declare class InquirerFuzzyPath<T extends Answers> extends InquirerAutocomplete<T> { | ||
/** | ||
* Create new InquirerFuzzyPath | ||
* | ||
* @param questions | ||
* The questions to prompt | ||
* @param rl | ||
* The readline interface | ||
* @param answers | ||
* The currently supplied answers | ||
*/ | ||
constructor(questions: QuestionCollection<T>, rl: ReadlineInterface, answers: Answers); | ||
/** | ||
* Curate list of choices. | ||
* | ||
* @param searchTerm | ||
* The term to search for | ||
*/ | ||
search(searchTerm: string): Promise<void>; | ||
/** | ||
* When user presses `enter` key | ||
* | ||
* @param line | ||
* The input on the line. | ||
*/ | ||
onSubmit(line: string): void; | ||
} | ||
/** | ||
* Provides inquirer prompt options for type `InquirerFuzzyPath`. | ||
*/ | ||
declare namespace InquirerFuzzyPath { | ||
/** | ||
* Provides options for a question of type `InquirerFuzzyPath`. | ||
* | ||
* @template T | ||
* The type of the answers. | ||
*/ | ||
interface FuzzyPathQuestionOptions<T extends Answers = Answers> | ||
extends Partial<Omit<AutocompleteQuestionOptions<T>, "type">> | ||
{ | ||
/** | ||
* The key to save the answer to the answers-hash. | ||
*/ | ||
type: "fuzzypath"; | ||
/** | ||
* The key to save the answer to the answers-hash. | ||
*/ | ||
name: KeyUnion<T>; | ||
/** | ||
* The root search directory, default to ".". | ||
*/ | ||
rootPath?: string | undefined; | ||
/** | ||
* A function to exclude some paths from the file-system scan. | ||
*/ | ||
excludePath?: ((path: string) => boolean) | undefined; | ||
/** | ||
* A function to exclude some paths from the final list. | ||
*/ | ||
excludeFilter?: ((path: string) => boolean) | undefined; | ||
/** | ||
* A string to specify the type of nodes to display, default to "any". | ||
*/ | ||
itemType?: "any" | "directory" | "file" | undefined; | ||
/** | ||
* An integer (>= 0) to limit the depth of sub-folders to scan, | ||
* undefined means infinite. | ||
*/ | ||
depthLimit?: number | undefined; | ||
} | ||
} | ||
```` | ||
### Additional Details | ||
* Last updated: Sun, 08 Oct 2023 23:35:10 GMT | ||
* Last updated: Wed, 18 Oct 2023 01:17:35 GMT | ||
* Dependencies: [@types/inquirer](https://npmjs.com/package/@types/inquirer), [@types/inquirer-autocomplete-prompt](https://npmjs.com/package/@types/inquirer-autocomplete-prompt) | ||
* Global values: none | ||
# Credits | ||
These definitions were written by [迷子 (Maiko Tan)](https://github.com/MaikoTan). |
7827
41.97%110
547.06%79
-5.95%