diff --git a/node-jsfl-runner/node-jsfl-runner-tests.ts b/node-jsfl-runner/node-jsfl-runner-tests.ts new file mode 100644 index 000000000..f92f4bfde --- /dev/null +++ b/node-jsfl-runner/node-jsfl-runner-tests.ts @@ -0,0 +1,21 @@ +/// + +import * as jsfl from 'node-jsfl-runner'; + +let myJSFL: jsfl.JSFL = { + init: (param: string): void => { + + } +} + +jsfl.createJSFL(myJSFL, 'fileName.jsfl', ['Hello!'], (err: NodeJS.ErrnoException) => { + +}); + +jsfl.runJSFL('fileName.jsfl', (err: NodeJS.ErrnoException) => { + +}); + +jsfl.deleteJSFL('fileName.jsfl', (err: NodeJS.ErrnoException) => { + +}); \ No newline at end of file diff --git a/node-jsfl-runner/node-jsfl-runner.d.ts b/node-jsfl-runner/node-jsfl-runner.d.ts new file mode 100644 index 000000000..b3f0a8688 --- /dev/null +++ b/node-jsfl-runner/node-jsfl-runner.d.ts @@ -0,0 +1,35 @@ +// Type definitions for node-jsfl-runner +// Project: https://www.npmjs.com/package/node-jsfl-runner +// Definitions by: Michael Randolph +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +declare module "node-jsfl-runner" { + interface JSFL { + init: (...args: any[]) => void; + [index: string]: any; + } + + /** + * Creates a JSFL file from a JSFL object + * @param jsfl A valid JSFL object + * @param fileName Path to output JSFL file location + * @param initParams Parameters to pass to JSFL init function + * @param callback Callback + */ + function createJSFL(jsfl: JSFL, fileName: string, initParams: Array, callback: (err: NodeJS.ErrnoException) => void): void; + + /** + * Deletes a JSFL file + * @param fileName Path to JSFL file to delete + * @param callback Callback + */ + function deleteJSFL(fileName: string, callback: (err: NodeJS.ErrnoException) => void): void; + + /** + * Runs a JSFL file + * @param fileName Path to JSFL file to run + * @param callback Callback + */ + function runJSFL(fileName: string, callback: (err: NodeJS.ErrnoException) => void): void; +} \ No newline at end of file