Yet another TypeScript wrapper for NodeCG
Bundle creation with TypeScript should be possible without depending to NodeCG during the development phase. As such, this package contains the NodeCG types in order to not download the whole project just to use TypeScript declaration files.
$ npm install nodecg-env
You can use the module with plain JavaScript.
const nodecgEnv = require('nodecg-env');
module.exports = nodecgEnv((nodecg) => {
// ...
});
The main benefit of this wrapper is to expose nodecg
with the correct type.
No need to include the whole main project for using with TypeScript.
import nodecgEnv from 'nodecg-env';
export = nodecgEnv((nodecg) => {
// The `nodecg` parameter has the `NodeCG` type.
});
You can also access the whole NodeCG types, just like that.
// Server-side types
import {NodeCG, Replicant} from 'nodecg-env';
// Browser-side types
import {NodeCG, Replicant} from 'nodecg-env/browser';
Alexandre Breteau - @0xSeldszar
MIT © Alexandre Breteau