aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2022-04-04 06:29:46 -0700
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2022-04-04 06:29:46 -0700
commit7fd12ca3ae2bf5bc98c45777af4e1e657fcd50f0 (patch)
treea691c52ada34cd72adc5d2292ed1bc6d6cb85263
parente84494b0e0b8829a9b7d40ee7b923ca1380c0284 (diff)
downloadbun-7fd12ca3ae2bf5bc98c45777af4e1e657fcd50f0.tar.gz
bun-7fd12ca3ae2bf5bc98c45777af4e1e657fcd50f0.tar.zst
bun-7fd12ca3ae2bf5bc98c45777af4e1e657fcd50f0.zip
Update bun.d.ts
-rw-r--r--types/bun/bun.d.ts19
1 files changed, 14 insertions, 5 deletions
diff --git a/types/bun/bun.d.ts b/types/bun/bun.d.ts
index aeb9f6307..1b98d9513 100644
--- a/types/bun/bun.d.ts
+++ b/types/bun/bun.d.ts
@@ -1335,7 +1335,7 @@ declare global {
* @returns A promise that resolves with the number of bytes written.
*/
// tslint:disable-next-line:unified-signatures
- function write(destinationPath: string, input: Response): Promise<number>;
+ function write(destinationPath: PathLike, input: Response): Promise<number>;
/**
*
@@ -1379,7 +1379,7 @@ declare global {
* @returns A promise that resolves with the number of bytes written.
*/
// tslint:disable-next-line:unified-signatures
- function write(destinationPath: string, input: FileBlob): Promise<number>;
+ function write(destinationPath: PathLike, input: FileBlob): Promise<number>;
/**
*
@@ -1393,7 +1393,7 @@ declare global {
*/
// tslint:disable-next-line:unified-signatures
function write(
- destination: FileBlob | string,
+ destination: FileBlob | PathLike,
input: Blob | TypedArray | string | BlobPart[]
): Promise<number>;
@@ -1631,8 +1631,17 @@ declare global {
*
*/
interface FileBlob extends Blob {
- /** Currently, "name" is not exposed because it may or may not exist */
- name: never;
+ /**
+ * Offset any operation on the file starting at `begin` and ending at `end`. `end` is relative to 0
+ *
+ * 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 end - absolute offset in bytes (relative to 0)
+ */
+ slice(begin?: number, end?: number): FileBlob;
}
/**