/** * @file `uncurryThis` and the cluster of helpers built atop it. Mirrors * Node.js's internal/per_context/primordials.js. Every other primordials leaf * depends on `uncurryThis` to expose prototype-method primordials, so this * file must be import-safe before any of them. Smol fast paths * (`node:smol-util`) replace the JS forms when running on socket-btm's smol * Node binary; stock Node and other runtimes fall back to the standard * `bind.bind(call)` shape. **IMPORTANT**: do not destructure on `globalThis` * or `Reflect` here. tsgo has a bug that mis-transpiles destructured exports. * See: https://github.com/SocketDev/socket-packageurl-js/issues/3. */ export declare const uncurryThis: (fn: (this: T, ...args: A) => R) => (self: T, ...args: A) => R; export declare const applyBind: (fn: (this: T, ...args: A) => R) => (self: T, args: A) => R; export declare const applySafe: (fn: (this: T, ...args: A) => R) => (self: T, args: A) => R | undefined; export type BindCall = (fn: (this: T, ...args: [...P, ...A]) => R, thisArg: T, ...presetArgs: P) => (...newArgs: A) => R; export declare const bindCall: BindCall; export declare const weakRefSafe: (target: T) => WeakRef | undefined;