src/akari.ts: typescriptify