-
Notifications
You must be signed in to change notification settings - Fork 48
Cheatsheet:Definition
Ulric Wilfred edited this page Feb 7, 2015
·
8 revisions
Rpd.channeltype(<id>, <Object | Function⇒Object>);
(all properties are optional, except name
or alias
, one of them is required)
-
name
:String
— inlet & outlet — full name -
alias
:String
— inlet & outlet — short alias for transfer purpose -
default
:Any
— inlet & outlet — default value -
readonly
:boolean
— inlet — is editable by user (true
by default) -
accept
:Function(Any)
⇒boolean
— inlet — accept or decline a value -
adapt
:Function(Any)
⇒Any
— inlet & outlet — adapt a value before passing -
show
:Function(Any)
⇒string
— inlet & outlet — show value to a user -
tune
:Function(KefirStream)
⇒KefirStream
— inlet — tune up updates stream
Rpd.nodetype(<id>, <Object | Function⇒Object>);
(all properties are optional)
-
name
:String
— full name -
width
:Float
— specify if the node should be wider or narrower than normal node (a relative value to normal size) -
inlets
:Object(alias: Object)
-
type
:<id>
— type of the channel -
default
:Any
— default value -
hidden
:boolean
— is hidden or not (false
by default) -
readonly
:boolean
— is editable by user (false
by default, but works only if channelreadonly
property also set tofalse
) -
cold
:boolean
— iftrue
, updates are not triggered with this inlet, but its value is stored (false
by default)
-
-
outlets
:Object(alias: Object)
-
type
:<id>
— type of the channel
-
-
tune
:Function(KefirStream)
⇒KefirStream
— tune up updates stream -
process
:Function(Object(alias: Any)[, Object(alias: Any)])
⇒Object(alias: Any)
— get inlets values and return outlet values; called on every inlet update, expect for "cold" ones -
handle
:Object(event-id: Function)
— subscribe to specific events
Rpd.nodedescription(<id>, String);
Describe a node type this way, optionally. It is a placeholder for future l10n.
Channel type descriptions are also planned in 2.0 or at some point
Rpd.channelrenderer(<id>, <render-type>, <Object | Function⇒Object>);
(all properties are optional)
-
show
:Function(DOMElement, Any[, Any])
— gets element, value and, in case of inlet, a value representation (aschannel.show
returned), may modify the value box, passed as the first argument; -
edit
:Function(DOMElement, Inlet, KefirStream)
⇒KefirStream
— gets value element to modify for editing and a stream of incoming values, should return a stream of outgoing values
Rpd.noderenderer(<id>, <render-type>, <Object | Function⇒Object>);
(all properties are optional)
-
first
:Function(DOMElement)
⇒Object(alias: Object)|None
— prepare node body for rendering, optionally return inlets subscriptions:-
default
:Function()
⇒Any
— if defined, called when inlet should be set to default value, should return it -
valueOut
:KefirStream
— if defined, inlet is subscribed to receive values from given stream
-
-
always
:Function(DOMElement, Object(alias: Any), Object(alias: Any))
— render node body using inlets and outlets values, called on every inlet update (including hidden ones)