40 lines
797 B
Python
40 lines
797 B
Python
from typing import Any, Dict, Callable, Union
|
|
|
|
def wat2wasm(inp: str) -> bytes:
|
|
...
|
|
|
|
class Store:
|
|
...
|
|
|
|
class Function:
|
|
def __init__(self, store: Store, func: Callable[[Any], Any]) -> None:
|
|
...
|
|
|
|
class Module:
|
|
def __init__(self, store: Store, wasm: bytes) -> None:
|
|
...
|
|
|
|
class Uint8Array:
|
|
def __getitem__(self, index: Union[int, slice]) -> int:
|
|
...
|
|
|
|
def __setitem__(self, idx: int, value: int) -> None:
|
|
...
|
|
|
|
class Memory:
|
|
def uint8_view(self, offset: int = 0) -> Uint8Array:
|
|
...
|
|
|
|
class Exports:
|
|
...
|
|
|
|
class ImportObject:
|
|
def register(self, region: str, values: Dict[str, Function]) -> None:
|
|
...
|
|
|
|
class Instance:
|
|
exports: Exports
|
|
|
|
def __init__(self, module: Module, imports: ImportObject) -> None:
|
|
...
|