@inquirer/type
Advanced tools
Comparing version 1.5.4 to 1.5.5
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.CancelablePromise = void 0; | ||
class CancelablePromise extends Promise { | ||
constructor() { | ||
super(...arguments); | ||
Object.defineProperty(this, "cancel", { | ||
enumerable: true, | ||
configurable: true, | ||
writable: true, | ||
value: () => { } | ||
}); | ||
} | ||
static withResolver() { | ||
let resolve; | ||
let reject; | ||
const promise = new CancelablePromise((res, rej) => { | ||
resolve = res; | ||
reject = rej; | ||
}); | ||
return { promise, resolve: resolve, reject: reject }; | ||
} | ||
} | ||
exports.CancelablePromise = CancelablePromise; |
import * as readline from 'node:readline'; | ||
import MuteStream from 'mute-stream'; | ||
export declare class CancelablePromise<T> extends Promise<T> { | ||
cancel: () => void; | ||
static withResolver<T>(): { | ||
promise: CancelablePromise<T>; | ||
resolve: (value: T) => void; | ||
reject: (error: unknown) => void; | ||
}; | ||
} | ||
export type InquirerReadline = readline.ReadLine & { | ||
@@ -14,5 +22,2 @@ output: MuteStream; | ||
}; | ||
export type Prompt<Value, Config> = (config: Config, context?: Context) => Promise<Value> & { | ||
/** @deprecated pass an AbortSignal in the context options instead. See {@link https://github.com/SBoudrias/Inquirer.js#canceling-prompt} */ | ||
cancel: () => void; | ||
}; | ||
export type Prompt<Value, Config> = (config: Config, context?: Context) => CancelablePromise<Value>; |
{ | ||
"name": "@inquirer/type", | ||
"version": "1.5.4", | ||
"version": "1.5.5", | ||
"description": "Inquirer core TS types", | ||
@@ -81,4 +81,3 @@ "main": "./dist/cjs/index.js", | ||
}, | ||
"sideEffects": false, | ||
"gitHead": "5fe03a4686d349d0d6cf281f86f12a4f7c992ad4" | ||
"sideEffects": false | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
154
16