mirror of
https://github.com/zhigang1992/replace-in-file.git
synced 2026-01-12 09:33:39 +08:00
Fix results TypeScript types (#86)
Types differ from the actual response, the result is an array for both sync and async methods https://github.com/adamreisnz/replace-in-file/blob/master/lib/replace-in-file.spec.js#L230-L240 https://github.com/adamreisnz/replace-in-file/blob/master/lib/replace-in-file.spec.js#L939-L948
This commit is contained in:
8
types/index.d.ts
vendored
8
types/index.d.ts
vendored
@@ -1,11 +1,11 @@
|
||||
|
||||
declare module 'replace-in-file' {
|
||||
function replaceInFile(config: ReplaceInFileConfig): Promise<ReplaceResults>;
|
||||
function replaceInFile(config: ReplaceInFileConfig, cb: (error: Error, results: ReplaceResults) => void): void;
|
||||
function replaceInFile(config: ReplaceInFileConfig): Promise<ReplaceResult[]>;
|
||||
function replaceInFile(config: ReplaceInFileConfig, cb: (error: Error, results: ReplaceResult[]) => void): void;
|
||||
export default replaceInFile;
|
||||
|
||||
namespace replaceInFile {
|
||||
export function sync(config: ReplaceInFileConfig): ReplaceResults;
|
||||
export function sync(config: ReplaceInFileConfig): ReplaceResult[];
|
||||
}
|
||||
|
||||
export interface ReplaceInFileConfig {
|
||||
@@ -19,7 +19,7 @@ declare module 'replace-in-file' {
|
||||
dry?:boolean
|
||||
}
|
||||
|
||||
export interface ReplaceResults {
|
||||
export interface ReplaceResult {
|
||||
file: string;
|
||||
hasChanged: boolean;
|
||||
numMatches?: number,
|
||||
|
||||
Reference in New Issue
Block a user