forked from oven-sh/bun-types
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jsc.d.ts
60 lines (58 loc) · 2.12 KB
/
jsc.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
declare module "bun:jsc" {
export function describe(value: any): string;
export function describeArray(args: any[]): string;
export function gcAndSweep(): void;
export function fullGC(): void;
export function edenGC(): void;
export function heapSize(): number;
export function heapStats(): {
heapSize: number;
heapCapacity: number;
extraMemorySize: number;
objectCount: number;
protectedObjectCount: number;
globalObjectCount: number;
protectedGlobalObjectCount: number;
objectTypeCounts: Record<string, number>;
protectedObjectTypeCounts: Record<string, number>;
};
export function memoryUsage(): {
current: number;
peak: number;
currentCommit: number;
peakCommit: number;
pageFaults: number;
};
export function getRandomSeed(): number;
export function setRandomSeed(value: number): void;
export function isRope(input: string): boolean;
export function callerSourceOrigin(): string;
export function noFTL(func: Function): Function;
export function noOSRExitFuzzing(func: Function): Function;
export function optimizeNextInvocation(func: Function): Function;
export function numberOfDFGCompiles(func: Function): number;
export function releaseWeakRefs(): void;
export function totalCompileTime(func: Function): number;
export function reoptimizationRetryCount(func: Function): number;
export function drainMicrotasks(): void;
/**
* This returns objects which native code has explicitly protected from being
* garbage collected
*
* By calling this function you create another reference to the object, which
* will further prevent it from being garbage collected
*
* This function is mostly a debugging tool for bun itself.
*
* Warning: not all objects returned are supposed to be observable from JavaScript
*/
export function getProtectedObjects(): any[];
/**
* Start a remote debugging socket server on the given port.
*
* This exposes JavaScriptCore's built-in debugging server.
*
* This is untested. May not be supported yet on macOS
*/
export function startRemoteDebugger(host?: string, port?: number): void;
}