]> git.r.bdr.sh - rbdr/api-notation.vim/commitdiff
Add new example syntax
authorRuben Beltran del Rio <redacted>
Wed, 4 Oct 2023 15:35:45 +0000 (17:35 +0200)
committerRuben Beltran del Rio <redacted>
Wed, 4 Oct 2023 15:35:45 +0000 (17:35 +0200)
example-syntax.api

index 8c5287055dd339c6ae8bcb0a84fc0cdd2388ed39..4ad79fa7c81b1c82fc3b77c80b7b8fdce7315d2d 100644 (file)
@@ -1,19 +1,20 @@
-HypotheticalModule <IModuleInterface>
-  +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>)
-
-
-// Comment
-EventHypotheticalClass
-  +>AnotherClass<+staticEventToListen(eventData <PredefinedObject>) // More Comments
-  <+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>)