]> git.r.bdr.sh - rbdr/api-notation.vim/blobdiff - example-syntax.api
Add new example syntax
[rbdr/api-notation.vim] / example-syntax.api
index 670be570e7e3fcb3484a6075fbb7042cbe92e787..4ad79fa7c81b1c82fc3b77c80b7b8fdce7315d2d 100644 (file)
@@ -1,17 +1,20 @@
-HypotheticalModule
-  +staticProperty <String>
-  +anotherStaticProperty <Boolean>
-  ::toggleAnotherStaticProperty()
-  ::setStaticProperty(newValue <String>)
-  -instanceProperty <Number>
-  -anotherInstanceProperty <String>
-  #instanceMethodSync([optionalParameter]<Boolean>) => resultOfCall <String>
-  #instanceMethodAsync(someValue <Number>, [callback] <Function>) ->(error <String|null>, result <Number|null>)
-
-EventHypotheticalClass
-  +>AnotherClass<+staticEventToListen(eventData <PredefinedObject>)
-  <+staticEventDispatched(someData <SomeData>)
-  ~>listenedSocketEvent(eventData <SomeObject>)
-  <~dispatchedSocketEvent(eventData <BlaBla>)
-  ->AnotherClass<-instanceEventToListen(eventData <Object>)
-  <-instanceEventDispatched(specificDataType <DefinedObject>)
+// This is an example of a definition.
+Forum.Models.Post
+  +glyphs <Array<String>>
+  -id <UUID>
+  -created_at <Date>
+  -parent_id <UUID>
+  -text <String>
+  -author <Author>
+  // Comments are also
+  // Allowed in the middle
+  ~>textUpdated(text <String>)
+  ->authorUpdated(author <Author>)
+  <~textWillUpdate(text <String>)
+  <-postWillRender(post <Forum.Models.Post>)
+  +>authorUpdated(author <Author>)
+  <+textWillUpdate(text <String>)
+  ::getAll(parent_id <UUID>) => Promise<Array<Forum.Models.Post>> #> NotFoundError,DisplayError
+  ::get(id <UUID>) => Promise<Forum.Models.Post>
+  #update(text <String>) => Promise<void>
+  #transform([transformer] <Function<T>(T) => boolean>)