Skip to content

Commit

Permalink
lib: Fix cockpit.file().modify() annotation
Browse files Browse the repository at this point in the history
The callback can also return `null` to delete the file.
  • Loading branch information
martinpitt committed Aug 20, 2024
1 parent c50bf49 commit 79623a0
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 @@ -250,7 +250,7 @@ declare module 'cockpit' {
read(): Promise<T>;
replace(new_content: T | null, expected_tag?: FileTag): Promise<FileTag>;
watch(callback: FileWatchCallback<T>, options?: { read?: boolean }): FileWatchHandle;
modify(callback: (data: T) => T, initial_content?: string, initial_tag?: FileTag): Promise<[T, FileTag]>;
modify(callback: (data: T | null) => T | null, initial_content?: string, initial_tag?: FileTag): Promise<[T, FileTag]>;
close(): void;
path: string;
}
Expand Down

0 comments on commit 79623a0

Please sign in to comment.