bun-types 1.1.18-canary.20240706T140505 → 1.1.18-canary.20240707T140453

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/jsc.d.ts +21 -16
  2. package/package.json +1 -1
package/jsc.d.ts CHANGED
@@ -88,21 +88,7 @@ declare module "bun:jsc" {
88
88
  */
89
89
  function setTimeZone(timeZone: string): string;
90
90
 
91
- /**
92
- * Run JavaScriptCore's sampling profiler for a particular function
93
- *
94
- * This is pretty low-level.
95
- *
96
- * Things to know:
97
- * - LLint means "Low Level Interpreter", which is the interpreter that runs before any JIT compilation
98
- * - Baseline is the first JIT compilation tier. It's the least optimized, but the fastest to compile
99
- * - DFG means "Data Flow Graph", which is the second JIT compilation tier. It has some optimizations, but is slower to compile
100
- * - FTL means "Faster Than Light", which is the third JIT compilation tier. It has the most optimizations, but is the slowest to compile
101
- */
102
- function profile(
103
- callback: CallableFunction,
104
- sampleInterval?: number,
105
- ): {
91
+ interface SamplingProfile {
106
92
  /**
107
93
  * A formatted summary of the top functions
108
94
  *
@@ -193,7 +179,26 @@ declare module "bun:jsc" {
193
179
  * Stack traces of the top functions
194
180
  */
195
181
  stackTraces: string[];
196
- };
182
+ }
183
+
184
+ /**
185
+ * Run JavaScriptCore's sampling profiler for a particular function
186
+ *
187
+ * This is pretty low-level.
188
+ *
189
+ * Things to know:
190
+ * - LLint means "Low Level Interpreter", which is the interpreter that runs before any JIT compilation
191
+ * - Baseline is the first JIT compilation tier. It's the least optimized, but the fastest to compile
192
+ * - DFG means "Data Flow Graph", which is the second JIT compilation tier. It has some optimizations, but is slower to compile
193
+ * - FTL means "Faster Than Light", which is the third JIT compilation tier. It has the most optimizations, but is the slowest to compile
194
+ */
195
+ function profile<T extends (...args: any[]) => any>(
196
+ callback: T,
197
+ sampleInterval?: number,
198
+ ...args: Parameters<T>
199
+ ): ReturnType<T> extends Promise<infer U>
200
+ ? Promise<SamplingProfile>
201
+ : SamplingProfile;
197
202
 
198
203
  /**
199
204
  * This returns objects which native code has explicitly protected from being
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.1.18-canary.20240706T140505",
2
+ "version": "1.1.18-canary.20240707T140453",
3
3
  "name": "bun-types",
4
4
  "license": "MIT",
5
5
  "main": "",