import type { ScriptingPlugin } from './plugin.ts'; import type { WasmoonEmscriptenModule, WasmoonLuaModule } from './runtime.ts'; import type { FengariModule } from './fengari-runtime.ts'; export type { ScriptingPlugin, WasmoonLuaModule, FengariModule }; /** Scripting limits. Every value must be a positive safe integer. */ export interface ScriptingOptions { /** Execution budget in milliseconds, checked during Lua instructions and between commands. Default 1,000. */ timeoutMs?: number; /** Maximum size of an individual script source in bytes. Default 256 KiB. */ maxScriptBytes?: number; /** Maximum number of cached script sources. Default 256. */ maxCachedScripts?: number; /** Maximum total bytes of cached script sources. Default 4 MiB. */ maxCacheBytes?: number; } /** Wasmoon scripting limits. */ export interface WasmoonScriptingOptions extends ScriptingOptions { /** Maximum Lua state allocations in bytes. Default 16 MiB. */ maxMemoryBytes?: number; } type RawStringExports = '_lua_pushlstring' | '_lua_tolstring'; /** * Wasmoon's published types omit the raw string exports the runner calls, so * they are optional here and checked at runtime. */ export type WasmoonLuaModuleInput = Omit & { module: Omit & Partial>; }; /** Create a single-server plugin from an initialized Wasmoon LuaModule. */ export declare function createWasmoonScripting(luaModule: WasmoonLuaModuleInput, options?: WasmoonScriptingOptions): ScriptingPlugin; /** Stable adapter for trusted scripts; Fengari has no per-state memory limit. */ export declare function createFengariScripting(fengari: FengariModule, options?: ScriptingOptions): ScriptingPlugin;