From 0c8e4e555efbdade85abc2c5bd401dab2e3e359e Mon Sep 17 00:00:00 2001 From: Adam Powers Date: Sun, 30 Aug 2020 12:09:42 -0700 Subject: [PATCH] complete API documentation --- sys/lib/npm-package/README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/lib/npm-package/README.md b/sys/lib/npm-package/README.md index 891237492..e71f3e5a1 100644 --- a/sys/lib/npm-package/README.md +++ b/sys/lib/npm-package/README.md @@ -10,7 +10,10 @@ npm install nethack ``` ## API -The main module returns a setup function: `startNethack(myCallback, moduleOptions)`. +The main module returns a setup function: `startNethack(uiCallback, moduleOptions)`. +* `uiCallback(name, ... args)` - Your callback function that will handle rendering NetHack on the screen of your choice. The `name` argument is one of the UI functions of the [NetHack Window Interface](https://github.com/NetHack/NetHack/blob/NetHack-3.7/doc/window.doc) and the `args` are corresponding to the window interface function that is being called. You are required to return the correct type of data for the function that is implemented. +* `moduleOptions` - An optional [emscripten Module object](https://emscripten.org/docs/api_reference/module.html) for configuring the WASM that will be run. + * `Module.arguments` - Of note is the [arguments property](https://emscripten.org/docs/api_reference/module.html#Module.arguments) which gets passed to NetHack as its [command line parameters](https://nethackwiki.com/wiki/Options). ## Example ``` js