"""Interop monomers — json real, rest stubs."""

import json as _json
from typing import Any

_STUB = "Extended monomer stub"


def json_encode(obj: Any) -> str:
    return _json.dumps(obj)


def json_decode(s: str) -> Any:
    return _json.loads(s)


def ffi_call(lib: str, fn: str, *args: Any) -> Any:
    raise NotImplementedError(_STUB)


def ffi_load(lib: str) -> int:
    raise NotImplementedError(_STUB)


def ffi_free(handle: int) -> None:
    raise NotImplementedError(_STUB)


def wasm_load(path: str) -> int:
    raise NotImplementedError(_STUB)


def wasm_call(module: int, fn: str, *args: Any) -> Any:
    raise NotImplementedError(_STUB)


def wasm_free(module: int) -> None:
    raise NotImplementedError(_STUB)
