diff options
author | 2023-03-07 22:34:28 -0800 | |
---|---|---|
committer | 2023-03-07 22:34:28 -0800 | |
commit | cb8af3a4e7b077f2a68bf94b4f68d348ab682725 (patch) | |
tree | dfbdd8ed4b0de4213f95e703996d6aa822e58e99 | |
parent | 5b0277b6b87f8b3e74b004524dc9338fc15999c5 (diff) | |
download | bun-cb8af3a4e7b077f2a68bf94b4f68d348ab682725.tar.gz bun-cb8af3a4e7b077f2a68bf94b4f68d348ab682725.tar.zst bun-cb8af3a4e7b077f2a68bf94b4f68d348ab682725.zip |
Fix types
-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. |