Table Of Contents

Previous topic

std.client.Default

Next topic

ns.Environment

This Page

std.core

Constructor

class std.core()

Methods

bind(func, object)
:param function(this:Object|...[*]) func:
A function object to bind.
Arguments:
  • object (Object) – Instance of some class to become ‘this’.
Returns:

A new function that wraps func.apply()

Return type:

function(...[*])

pretty(obj, options)
Arguments:
  • obj
  • options

Converts an object to a string in a ‘pretty’ format, i.e. so it is human-readable, multiple lines, and handles indentation. If the object is not a tree (i.e. it has circular references in it), then the normal toString version will be returned. Generally this should only be used on small, tree-like objects.

RepeatingTimer(period, callback)
Arguments:
  • period (Number) – A number indicating the period (in seconds) to go between firing callback.
  • callback (function()) – A callback taking no args that should be fired every period seconds.
SimpleInput(type, message, cb, additional)
Arguments:
  • type (int) – what type of simple input going to provide (See std.core.SimpleInput.SELECT_LIST and std.core.SimpleInput.ENTER_TEXT as examples
  • message (string) – what message gets written at the top of the input.
  • cb (function) – Takes a single argument – the value of what was selected.
  • additional

    (optional)

    if ENTER_TEXT is selected, then this should be undefined.

    if SELECT_LIST is entered as type, then this should be an arrray of tuples. The first element of each tuple should contain the text that gets displayed to the user next to the option. The second element should contain a code that gets passed back to cb so that the scripter knows what was selected. Code must be text.

    if NO_INPUT is entered as type, then just display message without getting any response back.