interface FileHandle<T> {
    path: string;
    close(): void;
    modify(callback: ((data: T) => T)): Promise<[T, string]>;
    read(): Promise<T>;
    replace(content: T): Promise<string>;
    watch(callback: FileWatchCallback<T>, options?: {
        read?: boolean;
    }): FileWatchHandle;
}

Type Parameters

  • T

Properties

Methods

Properties

path: string

Methods

  • Returns void

  • Parameters

    • callback: ((data: T) => T)
        • (data: T): T
        • Parameters

          • data: T

          Returns T

    Returns Promise<[T, string]>

  • Returns Promise<T>

  • Parameters

    • content: T

    Returns Promise<string>