diff options
Diffstat (limited to 'src/js/builtins.d.ts')
-rw-r--r-- | src/js/builtins.d.ts | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/js/builtins.d.ts b/src/js/builtins.d.ts index 70d76e5a0..ee7bd68cf 100644 --- a/src/js/builtins.d.ts +++ b/src/js/builtins.d.ts @@ -12,7 +12,9 @@ declare function $debug(...args: any[]): void; /** $assert is a preprocessor macro that only runs in debug mode. it throws an error if the first argument is falsy. * The source code passed to `check` is inlined in the message, but in addition you can pass additional messages. */ -declare function $assert(check: any, ...message: any[]): void; +declare function $assert(check: any, ...message: any[]): asserts check; + +declare const IS_BUN_DEVELOPMENT: boolean; /** Place this directly above a function declaration (like a decorator) to make it a getter. */ declare const $getter: never; @@ -26,6 +28,7 @@ declare var $visibility: "Public" | "Private"; declare var $nakedConstructor: never; /** Assign to this directly above a function declaration (like a decorator) to set intrinsic */ declare var $intrinsic: string; +/** Assign to this directly above a function declaration (like a decorator) to make it a constructor. */ declare var $constructor; /** Place this directly above a function declaration (like a decorator) to NOT include "use strict" */ declare var $sloppy; @@ -315,8 +318,6 @@ declare function $isPaused(): TODO; declare function $isWindows(): TODO; declare function $join(): TODO; declare function $kind(): TODO; -declare function $lazy(): TODO; -declare function $lazyLoad(): TODO; declare function $lazyStreamPrototypeMap(): TODO; declare function $loadModule(): TODO; declare function $localStreams(): TODO; @@ -371,7 +372,7 @@ declare function $releaseLock(): TODO; declare function $removeEventListener(): TODO; declare function $require(): TODO; declare function $requireESM(path: string): any; -declare const $requireMap: Map<string, NodeModule>; +declare const $requireMap: Map<string, CommonJSModuleRecord>; declare const $internalModuleRegistry: InternalFieldObject<any[]>; declare function $resolve(name: string, from: string): Promise<string>; declare function $resolveSync(name: string, from: string, isESM?: boolean): string; @@ -433,7 +434,14 @@ declare function $writer(): TODO; declare function $writing(): TODO; declare function $written(): TODO; -declare function $createCommonJSModule(id: string, exports: any, hasEvaluated: boolean): NodeModule; +declare function $createCommonJSModule( + id: string, + exports: any, + hasEvaluated: boolean, + parent: CommonJSModuleRecord, +): CommonJSModuleRecord; + +declare function $overridableRequire(this: CommonJSModuleRecord, id: string): any; // The following I cannot find any definitions of, but they are functional. declare function $toLength(length: number): number; |