diff options
-rw-r--r-- | packages/bun-types/bun.d.ts | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/packages/bun-types/bun.d.ts b/packages/bun-types/bun.d.ts index 7c43ebd3a..3773d3ebb 100644 --- a/packages/bun-types/bun.d.ts +++ b/packages/bun-types/bun.d.ts @@ -620,8 +620,26 @@ declare module "bun" { * * @param begin - start offset in bytes * @param end - absolute offset in bytes (relative to 0) + * @param contentType - MIME type for the new FileBlob */ - slice(begin?: number, end?: number): FileBlob; + slice(begin?: number, end?: number, contentType?: string): FileBlob; + + /** + * Offset any operation on the file starting at `begin` + * + * Similar to [`TypedArray.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray). Does not copy the file, open the file, or modify the file. + * + * If `begin` > 0, {@link Bun.write()} will be slower on macOS + * + * @param begin - start offset in bytes + * @param contentType - MIME type for the new FileBlob + */ + slice(begin?: number, contentType?: string): FileBlob; + + /** + * @param contentType - MIME type for the new FileBlob + */ + slice(contentType?: string): FileBlob; /** * Incremental writer for files and pipes. |