wilton.js  v202103141
 All Namespaces Functions
Functions
wiltoncall Namespace Reference

wilton/wiltoncall
Call native function. More...

Functions

String wiltoncall (String name, String|Object|Undefined data)

Detailed Description

This module allows to call native functions, that were added to "wiltoncall registry" using wiltoncall_register (C API) or wilton::support::register_wiltoncall (C++ API).

All interaction from wilton.js to the native code it done through this module.

Usage example:

// read file contents using "wiltoncall" directly
// the same can be done using "wilton/fs"
var contents = wiltoncall("fs_read_file", {
path: "path/to/file.txt"
});

Function Documentation

String wiltoncall::wiltoncall ( String  name,
String|Object|Undefined  data 
)
Parameters
nameString name that was used to register native function at wilton registry
dataString|Object|Undefined input data for native function
Returns
String output of the native function