4 * Kevin Gravier <kevin@mrkmg.com>
7 import { CreateFileError } from "./errors/CreateFileError";
8 import { LaunchEditorError } from "./errors/LaunchEditorError";
9 import { ReadFileError } from "./errors/ReadFileError";
10 import { RemoveFileError } from "./errors/RemoveFileError";
11 export interface IEditorParams {
15 export interface IFileOptions {
22 export declare type StringCallback = (err: Error, result: string) => void;
23 export declare type VoidCallback = () => void;
24 export { CreateFileError, LaunchEditorError, ReadFileError, RemoveFileError };
25 export declare function edit(text?: string, fileOptions?: IFileOptions): string;
26 export declare function editAsync(text: string, callback: StringCallback, fileOptions?: IFileOptions): void;
27 export declare class ExternalEditor {
28 private static splitStringBySpace;
31 editor: IEditorParams;
32 lastExitStatus: number;
34 readonly temp_file: string;
35 readonly last_exit_status: number;
36 constructor(text?: string, fileOptions?: IFileOptions);
38 runAsync(callback: StringCallback): void;
40 private determineEditor;
41 private createTemporaryFile;
42 private readTemporaryFile;
43 private removeTemporaryFile;
45 private launchEditorAsync;