-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add documentation for typescript via JSDoc (#45)
* Start JSDoc * Rest of JS doc as things stand today * CI config * CI config * Tweaks per comments
- Loading branch information
Showing
14 changed files
with
2,411 additions
and
448 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"source": { | ||
"includePattern": ".+\\.ts(doc|x)?$", | ||
"excludePattern": ".+\\.(test|spec).ts" | ||
}, | ||
"template": "language-doc.hbs", | ||
"plugins": ["plugins/markdown", "node_modules/jsdoc-babel", "@godaddy/dmd"], | ||
"heading-depth": 3, | ||
"babel": { | ||
"extensions": ["ts", "tsx"], | ||
"ignore": ["**/*.(test|spec).ts"], | ||
"babelrc": false, | ||
"presets": [ | ||
["@babel/preset-env", { "targets": { "node": true } }], | ||
"@babel/preset-typescript" | ||
], | ||
"plugins": [] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<!-- This file is generated from the Handlebars template at `clients/typescript/doc/language-doc.hbs` | ||
If you are instead in `doc/language/js.md`, DO NOT EDIT THIS FILE DIRECTLY! | ||
--> | ||
|
||
# Typescript (JavaScript) Interface | ||
|
||
## Targetting WASM with TinyStan | ||
|
||
This interface is intended to be used to access models built | ||
with [Emscripten](https://emscripten.org/), which compiles C++ code to | ||
[WebAssembly](https://webassembly.org/). | ||
|
||
This requires some extra configuration compared to normal builds. | ||
Examples of the build (and usage) can be found in the following projects: | ||
|
||
- [Stan Web Demo](https://github.com/WardBrian/stan-web-demo/) ([Emscripten config](https://github.com/WardBrian/stan-web-demo/blob/main/build/local.mk)) | ||
- [Stan Playground](https://github.com/flatironinstitute/stan-playground) ([Emscripten config](https://github.com/flatironinstitute/stan-playground/blob/main/backend/local.mk)) | ||
|
||
Note that, among other things, a more recent version of TBB must be used, | ||
as WebAssembly is not supported in the version Stan currently vendors. | ||
|
||
## Installation | ||
|
||
The Typescript interface is [available on npm](https://www.npmjs.com/package/tinystan). | ||
To install it, run: | ||
```shell | ||
npm install tinystan --save | ||
``` | ||
or | ||
```shell | ||
yarn add tinystan | ||
``` | ||
|
||
<!-- hack to fix generated links | ||
add more items here if sphinx warns about "undefined label"s | ||
--> | ||
[.sample(p)]:#stanmodel-sample-p | ||
[.pathfinder(p)]:#stanmodel-pathfinder-p | ||
[.stanVersion()]:#stanmodel-stanversion | ||
[.load(createModule, printCallback)]:#stanmodel-load-createmodule-printcallback | ||
|
||
## API Reference | ||
{{>main}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.