interface ModuleHost {
    binfmts?: { register(format: BinfmtSpec): () => void };
    commands?: {
        install(name: string, source: string): Promise<void>;
        remove(name: string): Promise<void>;
    };
    fstypes?: () => FsTypes;
    log: {
        error(message: string): void;
        info(message: string): void;
        warn(message: string): void;
    };
    syscalls?: {
        define(
            name: string,
            handler: (
                call: SyscallCall,
                ...args: (string | number)[],
            ) => number | void | Promise<number | void>,
        ): () => void;
        policy(
            policy: (
                call: { exe?: string; pid: number; syscall: string; uid: number },
            ) => boolean | void,
        ): () => void;
    };
    dmesg(line: string): void;
    evaluate(source: string): Promise<unknown>;
    keys(): Promise<TrustedKey[]>;
}
Hierarchy
Index
binfmts?: { register(format: BinfmtSpec): () => void }
commands?: {
    install(name: string, source: string): Promise<void>;
    remove(name: string): Promise<void>;
}
fstypes?: () => FsTypes

The registry mount -t reads (see ModuleContext.filesystem)

log: {
    error(message: string): void;
    info(message: string): void;
    warn(message: string): void;
}
syscalls?: {
    define(
        name: string,
        handler: (
            call: SyscallCall,
            ...args: (string | number)[],
        ) => number | void | Promise<number | void>,
    ): () => void;
    policy(
        policy: (
            call: { exe?: string; pid: number; syscall: string; uid: number },
        ) => boolean | void,
    ): () => void;
}

Adds a syscall (the handler gets its caller already described) and returns the function that takes it away; throws if the name is taken