import { type FfiBackend, type Pointer } from "./ffi.js";
type KoffiExternal = object & {
    __koffi_external__: true;
};
type KoffiFunction = ((...args: unknown[]) => unknown) & {
    async?: unknown;
};
type KoffiRegisteredCallback = KoffiExternal;
type KoffiTypeSpec = unknown;
type UnsafePointerOf = (value: ArrayBuffer) => Pointer;
type UnsafeArrayBufferAt = (pointer: Pointer, offset: number | undefined, length: number) => ArrayBuffer;
interface KoffiModule {
    address(pointer: KoffiExternal): bigint | number;
    extension: string;
    load(path: string): KoffiLib;
    opaque(name?: string): KoffiTypeSpec;
    pointer(nameOrType: string | KoffiTypeSpec, type?: KoffiTypeSpec): KoffiTypeSpec;
    proto(returns: KoffiTypeSpec, args: KoffiTypeSpec[]): KoffiTypeSpec;
    register(callback: (...args: any[]) => any, type: KoffiTypeSpec): KoffiRegisteredCallback;
    unregister(callback: KoffiRegisteredCallback): void;
    types: Record<string, KoffiTypeSpec>;
}
interface KoffiLib {
    func(name: string, returns: KoffiTypeSpec, args: KoffiTypeSpec[]): KoffiFunction;
    unload(): void;
}
interface Node22Modules {
    koffi: KoffiModule;
    unsafePointerOf: UnsafePointerOf;
    unsafeArrayBufferAt: UnsafeArrayBufferAt;
}
export declare function createNode22Backend(modules?: Node22Modules): FfiBackend;
export {};
