hakojs
Version:
A secure, embeddable JavaScript engine that runs untrusted code inside WebAssembly sandboxes with fine-grained permissions and resource limits
42 lines • 1.49 kB
TypeScript
import { ErrorManager } from "../etc/errors";
import type { HakoExports } from "../etc/ffi";
import { Utils } from "../etc/utils";
import type { MemoryManager } from "../mem/memory";
import type { CallbackManager } from "./callback";
/**
* Central service container that holds and initializes all core PrimJS wrapper components.
*
* This class follows the dependency injection pattern, providing centralized
* access to shared services needed by the PrimJS wrapper.
*/
export declare class Container {
/**
* PrimJS WebAssembly exports object containing all exported functions.
*/
readonly exports: HakoExports;
/**
* Memory manager for handling WebAssembly memory operations.
*/
readonly memory: MemoryManager;
/**
* Error manager for handling PrimJS errors and exceptions.
*/
readonly error: ErrorManager;
/**
* Utility functions for common PrimJS operations.
*/
readonly utils: Utils;
/**
* Callback manager for handling bidirectional function calls between host and VM.
*/
readonly callbacks: CallbackManager;
/**
* Creates a new service container and initializes all dependencies.
*
* @param exports - PrimJS WebAssembly exports
* @param memory - Memory manager instance
* @param callbacks - Callback manager instance
*/
constructor(exports: HakoExports, memory: MemoryManager, callbacks: CallbackManager);
}
//# sourceMappingURL=container.d.ts.map