3 The following document attempts to define a legend for easy specification of APIs for components. Any suggestions to improve are welcome.
6 NameOfClass.WithPossibleNamespace
9 ~> listened events (socket)
10 +> listened events (class/module)
11 -> listened events (instance)
12 <~ dispatched events (socket)
13 <+ dispatched events(class/module)
14 <- dispatched events (instance)
24 Recommended order: class first, then sockets, then instance. Internally: Properties, events, methods.
26 // Anything after two forward slashes is a comment
29 Here's an example of usage
33 +staticProperty <String>
34 +anotherStaticProperty <Boolean>
35 ::toggleAnotherStaticProperty()
36 ::setStaticProperty(newValue <String>)
37 -instanceProperty <Number>
38 -anotherInstanceProperty <String>
39 #instanceMethodSync([optionalParameter]<Boolean>) => resultOfCall <String>
40 #instanceMethodAsync(someValue <Number>, [callback] <Function>) ->(error <String|null>, result <Number|null>)
43 Here's another example but with events.
46 EventHypotheticalClass
47 +>AnotherClass<+staticEventToListen(eventData <PredefinedObject>)
48 <+staticEventDispatched(someData <SomeData>)
49 ~>listenedSocketEvent(eventData <SomeObject>)
50 <~dispatchedSocketEvent(eventData <BlaBla>)
51 ->AnotherClass<-instanceEventToListen(eventData <Object>)
52 <-instanceEventDispatched(specificDataType <DefinedObject>)