bun-types 1.2.9-canary.20250402T140633 → 1.2.9-canary.20250404T140622

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/s3.d.ts CHANGED
@@ -617,6 +617,106 @@ declare module "bun" {
617
617
  stat(): Promise<S3Stats>;
618
618
  }
619
619
 
620
+ interface S3ListObjectsOptions {
621
+ /** Limits the response to keys that begin with the specified prefix. */
622
+ prefix?: string;
623
+ /** ContinuationToken indicates to S3 that the list is being continued on this bucket with a token. ContinuationToken is obfuscated and is not a real key. You can use this ContinuationToken for pagination of the list results. */
624
+ continuationToken?: string;
625
+ /** A delimiter is a character that you use to group keys. */
626
+ delimiter?: string;
627
+ /** Sets the maximum number of keys returned in the response. By default, the action returns up to 1,000 key names. The response might contain fewer keys but will never contain more. */
628
+ maxKeys?: number;
629
+ /** StartAfter is where you want S3 to start listing from. S3 starts listing after this specified key. StartAfter can be any key in the bucket. */
630
+ startAfter?: string;
631
+ /** Encoding type used by S3 to encode the object keys in the response. Responses are encoded only in UTF-8. An object key can contain any Unicode character. However, the XML 1.0 parser can't parse certain characters, such as characters with an ASCII value from 0 to 10. For characters that aren't supported in XML 1.0, you can add this parameter to request that S3 encode the keys in the response. */
632
+ encodingType?: "url";
633
+ /** If you want to return the owner field with each key in the result, then set the FetchOwner field to true. */
634
+ fetchOwner?: boolean;
635
+ }
636
+
637
+ interface S3ListObjectsResponse {
638
+ /** All of the keys (up to 1,000) that share the same prefix are grouped together. When counting the total numbers of returns by this API operation, this group of keys is considered as one item.
639
+ *
640
+ * A response can contain CommonPrefixes only if you specify a delimiter.
641
+ *
642
+ * CommonPrefixes contains all (if there are any) keys between Prefix and the next occurrence of the string specified by a delimiter.
643
+ *
644
+ * CommonPrefixes lists keys that act like subdirectories in the directory specified by Prefix.
645
+ *
646
+ * For example, if the prefix is notes/ and the delimiter is a slash (/) as in notes/summer/july, the common prefix is notes/summer/. All of the keys that roll up into a common prefix count as a single return when calculating the number of returns. */
647
+ commonPrefixes?: { prefix: string }[];
648
+ /** Metadata about each object returned. */
649
+ contents?: {
650
+ /** The algorithm that was used to create a checksum of the object. */
651
+ checksumAlgorithm?: "CRC32" | "CRC32C" | "SHA1" | "SHA256" | "CRC64NVME";
652
+ /** The checksum type that is used to calculate the object’s checksum value. */
653
+ checksumType?: "COMPOSITE" | "FULL_OBJECT";
654
+ /**
655
+ * The entity tag is a hash of the object. The ETag reflects changes only to the contents of an object, not its metadata. The ETag may or may not be an MD5 digest of the object data. Whether or not it is depends on how the object was created and how it is encrypted as described below:
656
+ *
657
+ * - Objects created by the PUT Object, POST Object, or Copy operation, or through the AWS Management Console, and are encrypted by SSE-S3 or plaintext, have ETags that are an MD5 digest of their object data.
658
+ * - Objects created by the PUT Object, POST Object, or Copy operation, or through the AWS Management Console, and are encrypted by SSE-C or SSE-KMS, have ETags that are not an MD5 digest of their object data.
659
+ * - If an object is created by either the Multipart Upload or Part Copy operation, the ETag is not an MD5 digest, regardless of the method of encryption. If an object is larger than 16 MB, the AWS Management Console will upload or copy that object as a Multipart Upload, and therefore the ETag will not be an MD5 digest.
660
+ *
661
+ * MD5 is not supported by directory buckets.
662
+ */
663
+ eTag?: string;
664
+ /** The name that you assign to an object. You use the object key to retrieve the object. */
665
+ key: string;
666
+ /** Creation date of the object. */
667
+ lastModified?: string;
668
+ /** The owner of the object */
669
+ owner?: {
670
+ /** The ID of the owner. */
671
+ id?: string;
672
+ /** The display name of the owner. */
673
+ displayName?: string;
674
+ };
675
+ /** Specifies the restoration status of an object. Objects in certain storage classes must be restored before they can be retrieved. */
676
+ restoreStatus?: {
677
+ /** Specifies whether the object is currently being restored. */
678
+ isRestoreInProgress?: boolean;
679
+ /** Indicates when the restored copy will expire. This value is populated only if the object has already been restored. */
680
+ restoreExpiryDate?: string;
681
+ };
682
+ /** Size in bytes of the object */
683
+ size?: number;
684
+ /** The class of storage used to store the object. */
685
+ storageClass?:
686
+ | "STANDARD"
687
+ | "REDUCED_REDUNDANCY"
688
+ | "GLACIER"
689
+ | "STANDARD_IA"
690
+ | "ONEZONE_IA"
691
+ | "INTELLIGENT_TIERING"
692
+ | "DEEP_ARCHIVE"
693
+ | "OUTPOSTS"
694
+ | "GLACIER_IR"
695
+ | "SNOW"
696
+ | "EXPRESS_ONEZONE";
697
+ }[];
698
+ /** If ContinuationToken was sent with the request, it is included in the response. You can use the returned ContinuationToken for pagination of the list response. */
699
+ continuationToken?: string;
700
+ /** Causes keys that contain the same string between the prefix and the first occurrence of the delimiter to be rolled up into a single result element in the CommonPrefixes collection. These rolled-up keys are not returned elsewhere in the response. Each rolled-up result counts as only one return against the MaxKeys value. */
701
+ delimiter?: string;
702
+ /** Encoding type used by S3 to encode object key names in the XML response. */
703
+ encodingType?: "url";
704
+ /** Set to false if all of the results were returned. Set to true if more keys are available to return. If the number of results exceeds that specified by MaxKeys, all of the results might not be returned. */
705
+ isTruncated?: boolean;
706
+ /** KeyCount is the number of keys returned with this request. KeyCount will always be less than or equal to the MaxKeys field. For example, if you ask for 50 keys, your result will include 50 keys or fewer. */
707
+ keyCount?: number;
708
+ /** Sets the maximum number of keys returned in the response. By default, the action returns up to 1,000 key names. The response might contain fewer keys but will never contain more. */
709
+ maxKeys?: number;
710
+ /** The bucket name. */
711
+ name?: string;
712
+ /** NextContinuationToken is sent when isTruncated is true, which means there are more keys in the bucket that can be listed. The next list requests to S3 can be continued with this NextContinuationToken. NextContinuationToken is obfuscated and is not a real key. */
713
+ nextContinuationToken?: string;
714
+ /** Keys that begin with the indicated prefix. */
715
+ prefix?: string;
716
+ /** If StartAfter was sent with the request, it is included in the response. */
717
+ startAfter?: string;
718
+ }
719
+
620
720
  /**
621
721
  * A configured S3 bucket instance for managing files.
622
722
  * The instance is callable to create S3File instances and provides methods
@@ -818,6 +918,20 @@ declare module "bun" {
818
918
  * @param options The options to use for the S3 client.
819
919
  */
820
920
  stat(path: string, options?: S3Options): Promise<S3Stats>;
921
+
922
+ /** Returns some or all (up to 1,000) of the objects in a bucket with each request.
923
+ *
924
+ * You can use the request parameters as selection criteria to return a subset of the objects in a bucket.
925
+ */
926
+ list(
927
+ input?: S3ListObjectsOptions | null,
928
+ options?: Pick<S3Options, "accessKeyId" | "secretAccessKey" | "sessionToken" | "region" | "bucket" | "endpoint">,
929
+ ): Promise<S3ListObjectsResponse>;
930
+
931
+ static list(
932
+ input?: S3ListObjectsOptions | null,
933
+ options?: Pick<S3Options, "accessKeyId" | "secretAccessKey" | "sessionToken" | "region" | "bucket" | "endpoint">,
934
+ ): Promise<S3ListObjectsResponse>;
821
935
  }
822
936
 
823
937
  /**
package/sqlite.d.ts CHANGED
@@ -6,7 +6,7 @@
6
6
  * ```ts
7
7
  * import { Database } from 'bun:sqlite';
8
8
  *
9
- * var db = new Database('app.db');
9
+ * const db = new Database('app.db');
10
10
  * db.query('SELECT * FROM users WHERE name = ?').all('John');
11
11
  * // => [{ id: 1, name: 'John' }]
12
12
  * ```
@@ -24,42 +24,44 @@
24
24
  * | `null` | `NULL` |
25
25
  */
26
26
  declare module "bun:sqlite" {
27
+ /**
28
+ * A SQLite3 database
29
+ *
30
+ * @example
31
+ * ```ts
32
+ * const db = new Database("mydb.sqlite");
33
+ * db.run("CREATE TABLE foo (bar TEXT)");
34
+ * db.run("INSERT INTO foo VALUES (?)", ["baz"]);
35
+ * console.log(db.query("SELECT * FROM foo").all());
36
+ * ```
37
+ *
38
+ * @example
39
+ *
40
+ * Open an in-memory database
41
+ *
42
+ * ```ts
43
+ * const db = new Database(":memory:");
44
+ * db.run("CREATE TABLE foo (bar TEXT)");
45
+ * db.run("INSERT INTO foo VALUES (?)", ["hiiiiii"]);
46
+ * console.log(db.query("SELECT * FROM foo").all());
47
+ * ```
48
+ *
49
+ * @example
50
+ *
51
+ * Open read-only
52
+ *
53
+ * ```ts
54
+ * const db = new Database("mydb.sqlite", {readonly: true});
55
+ * ```
56
+ *
57
+ * @category Database
58
+ */
27
59
  export class Database implements Disposable {
28
60
  /**
29
61
  * Open or create a SQLite3 database
30
62
  *
31
63
  * @param filename The filename of the database to open. Pass an empty string (`""`) or `":memory:"` or undefined for an in-memory database.
32
64
  * @param options defaults to `{readwrite: true, create: true}`. If a number, then it's treated as `SQLITE_OPEN_*` constant flags.
33
- *
34
- * @example
35
- *
36
- * ```ts
37
- * const db = new Database("mydb.sqlite");
38
- * db.run("CREATE TABLE foo (bar TEXT)");
39
- * db.run("INSERT INTO foo VALUES (?)", ["baz"]);
40
- * console.log(db.query("SELECT * FROM foo").all());
41
- * ```
42
- *
43
- * @example
44
- *
45
- * Open an in-memory database
46
- *
47
- * ```ts
48
- * const db = new Database(":memory:");
49
- * db.run("CREATE TABLE foo (bar TEXT)");
50
- * db.run("INSERT INTO foo VALUES (?)", ["hiiiiii"]);
51
- * console.log(db.query("SELECT * FROM foo").all());
52
- * ```
53
- *
54
- * @example
55
- *
56
- * Open read-only
57
- *
58
- * ```ts
59
- * const db = new Database("mydb.sqlite", {readonly: true});
60
- * ```
61
- *
62
- * @category Database
63
65
  */
64
66
  constructor(
65
67
  filename?: string,