bun-types 1.0.10 → 1.0.11

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/types.d.ts +17 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bun-types",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "Type definitions for Bun, an incredibly fast JavaScript runtime",
5
5
  "types": "types.d.ts",
6
6
  "files": [
package/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Type definitions for bun 1.0.10
1
+ // Type definitions for bun 1.0.11
2
2
  // Project: https://github.com/oven-sh/bun
3
3
  // Definitions by: Jarred Sumner <https://github.com/Jarred-Sumner>
4
4
  // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -38800,6 +38800,22 @@ declare module "bun" {
38800
38800
  */
38801
38801
  const stdin: BunFile;
38802
38802
 
38803
+ type StringLike = string | { toString(): string };
38804
+
38805
+ interface semver {
38806
+ /**
38807
+ * Test if the version satisfies the range. Stringifies both arguments. Returns `true` or `false`.
38808
+ */
38809
+ satisfies(version: StringLike, range: StringLike): boolean;
38810
+
38811
+ /**
38812
+ * Returns 0 if the versions are equal, 1 if `v1` is greater, or -1 if `v2` is greater.
38813
+ * Throws an error if either version is invalid.
38814
+ */
38815
+ order(v1: StringLike, v2: StringLike): -1 | 0 | 1;
38816
+ }
38817
+ export const semver: semver;
38818
+
38803
38819
  interface unsafe {
38804
38820
  /**
38805
38821
  * Cast bytes to a `String` without copying. This is the fastest way to get a `String` from a `Uint8Array` or `ArrayBuffer`.