Skip to content
CheshireCaat edited this page Feb 8, 2020 · 15 revisions

Default types

When calling functions and sending messages, you need to keep in mind what types the result may have. Since BAS uses JS as its primary language, some types may not be known in advance. Therefore, methods for sending messages and run functions by default work through dynamic.

The main thing you need to know in this case:

  • JavaScript objects will be represented as JObject type from Newtonsoft.Json.
  • JavaScript arrays will be represented as JArray type from Newtonsoft.Json.

Other types like strings, numbers, booleans will be converted to built-in .NET types. Thus, you can, for example, use type comparisons with the as and is keywords and implement your own processing of the results.

Generic types

Clone this wiki locally