diff options
Diffstat (limited to 'src/js/private.d.ts')
-rw-r--r-- | src/js/private.d.ts | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/js/private.d.ts b/src/js/private.d.ts index 854d07c2e..80c22bd51 100644 --- a/src/js/private.d.ts +++ b/src/js/private.d.ts @@ -27,7 +27,7 @@ interface BunFSWatcher { */ unref(): void; } -type BunFS = Omit<typeof import("node:fs"), "watch"> & { +type BunFS = Omit<typeof import("node:fs") & typeof import("node:fs/promises"), "watch" | "cp" | "cpSync"> & { /** * Watch for changes on `filename`, where `filename` is either a file or a * directory. @@ -87,6 +87,18 @@ type BunFS = Omit<typeof import("node:fs"), "watch"> & { * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. */ watch(filename: string, listener?: BunWatchListener<string>): BunFSWatcher; + + // internal api is for fs.cp and fs.cpSync that is limited to a few options. + // there is a js implementation for options like `filter` in `src/js/internal/fs/cp*` + cpSync( + source: string, + dest: string, + recursive?: boolean, + errorOnExist?: boolean, + force?: boolean, + mode?: number, + ): void; + cp(source: string, dest: string, recursive?: boolean, errorOnExist?: boolean, force?: boolean, mode?: number): void; }; declare module "bun" { |