Show:
Defined in: src/js/dsl/dsl.js:359
Module: proact-dsl

A set of predefined mapping operations to be used by the DSL.

Item Index

Methods

Methods

!

(
  • value
)
Boolean static

Toggles a boolean value. If the value is true it becomes false and vice versa.

Usage in a DSL expression:

   map(!)
 

Parameters:

Returns:

Boolean:

The opposite of value.

&.

(
  • methodName
)
Object static

Mapping operation for calling a method of an object.

Usage in a DSL expression:

   map(&.&go)
 
This will call the 'target.go' method and use its result.

Parameters:

  • methodName String

    The method name to call.

Returns:

Object:

The result of the method call.

-

(
  • n
)
Number final static

Mapping operation for changing the sign of a number to the oposite.

For example 4 becomes -4 and -5 becomes 5.

Usage in a DSL expression:

   map(-)
 

Parameters:

  • n Number

    The number which will have its sign inverted.

Returns:

Number:

The same number as n, but with opposite sign.

eventToVal

(
  • event
)
Object static

Mapping operation for turning value event in its value.

Usage in a DSL expression:

   map(eventToVal)
 

Parameters:

  • event Event

    The value event to get the new value from.

Returns:

Object:

The value.

int

(
  • str
)
Number static

Mapping operation for turning an string to a decimal Number - integer.

For example '4' becomes 4.

Usage in a DSL expression:

   map(int)
 

Parameters:

  • str String

    The string to convert to integer.

Returns:

Number:

The integer representation of str.

pop

() Event static

Mapping operation for turning value in an ProAct.Array pop event.

Usage in a DSL expression:

   map(pop)
 

Returns:

Event:

Pop event.

pow

(
  • n
)
Number static

Mapping operation for computing the square of a number.

For example 4 becomes 16.

Usage in a DSL expression:

   map(pow)
 

Parameters:

  • n Number

    The number to power.

Returns:

Number:

The square of n.

shift

() Event static

Mapping operation for turning value in an ProAct.Array shift event.

Usage in a DSL expression:

   map(shift)
 

Returns:

Event:

Shift event.

sqrt

(
  • n
)
Number static

Mapping operation for computing the square root of a number.

For example 4 becomes 2.

Usage in a DSL expression:

   map(sqrt)
 

Parameters:

  • n Number

    The number to compute the square root for.

Returns:

Number:

The square root of n.

time

(
  • value
)
Object static

Adds the current time to the object value, called upon If the value is not an object (for example it is a Number), it is returned as it is.

Usage in a DSL expression:

   map(time)
 

Parameters:

  • value Object

    The object to modify with time.

Returns:

Object:

The modified value.

true

(
  • value
)
Boolean static

Maps anything to the constant true.

Usage in a DSL expression:

   map(true)
 

Parameters:

  • value Object

    Arbitrary value.

Returns:

Boolean:

Just the true constant.