Skip to content

Commit

Permalink
lib: type cockpit.file.read() correctly
Browse files Browse the repository at this point in the history
read() returns the content and the read tag.
  • Loading branch information
jelly committed Oct 21, 2024
1 parent 33a807b commit 4eb8d68
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/lib/cockpit.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ declare module 'cockpit' {
}

interface FileHandle<T> {
read(): Promise<T>;
read(callback: (data: T | null) => T, tag?: FileTag): Promise<T>;
replace(new_content: T | null, expected_tag?: FileTag): Promise<FileTag>;
watch(callback: FileWatchCallback<T>, options?: { read?: boolean }): FileWatchHandle;
modify(callback: (data: T | null) => T | null, initial_content?: string, initial_tag?: FileTag): Promise<[T, FileTag]>;
Expand Down

0 comments on commit 4eb8d68

Please sign in to comment.