From: Ruben Beltran del Rio Date: Wed, 4 Oct 2023 15:35:45 +0000 (+0200) Subject: Add new example syntax X-Git-Url: https://git.r.bdr.sh/rbdr/api-notation.vim/commitdiff_plain/c09911368b350418bc21e74054b13bb4f70a5b7e?hp=b6f0708fb9f009b7051db514423e9ebf86bc9af4 Add new example syntax --- diff --git a/example-syntax.api b/example-syntax.api index 8c52870..4ad79fa 100644 --- a/example-syntax.api +++ b/example-syntax.api @@ -1,19 +1,20 @@ -HypotheticalModule - +staticProperty - +anotherStaticProperty - ::toggleAnotherStaticProperty() - ::setStaticProperty(newValue ) - -instanceProperty - -anotherInstanceProperty - #instanceMethodSync([optionalParameter]) => resultOfCall - #instanceMethodAsync(someValue , [callback] ) ->(error , result ) - - -// Comment -EventHypotheticalClass - +>AnotherClass<+staticEventToListen(eventData ) // More Comments - <+staticEventDispatched(someData ) - ~>listenedSocketEvent(eventData ) - <~dispatchedSocketEvent(eventData ) - ->AnotherClass<-instanceEventToListen(eventData ) - <-instanceEventDispatched(specificDataType ) +// This is an example of a definition. +Forum.Models.Post + +glyphs > + -id + -created_at + -parent_id + -text + -author + // Comments are also + // Allowed in the middle + ~>textUpdated(text ) + ->authorUpdated(author ) + <~textWillUpdate(text ) + <-postWillRender(post ) + +>authorUpdated(author ) + <+textWillUpdate(text ) + ::getAll(parent_id ) => Promise> #> NotFoundError,DisplayError + ::get(id ) => Promise + #update(text ) => Promise + #transform([transformer] (T) => boolean>)