Skip to content

Commit 79623a0

Browse files
committed
lib: Fix cockpit.file().modify() annotation
The callback can also return `null` to delete the file.
1 parent c50bf49 commit 79623a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/lib/cockpit.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ declare module 'cockpit' {
250250
read(): Promise<T>;
251251
replace(new_content: T | null, expected_tag?: FileTag): Promise<FileTag>;
252252
watch(callback: FileWatchCallback<T>, options?: { read?: boolean }): FileWatchHandle;
253-
modify(callback: (data: T) => T, initial_content?: string, initial_tag?: FileTag): Promise<[T, FileTag]>;
253+
modify(callback: (data: T | null) => T | null, initial_content?: string, initial_tag?: FileTag): Promise<[T, FileTag]>;
254254
close(): void;
255255
path: string;
256256
}

0 commit comments

Comments
 (0)