mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-08-28 11:54:07 +00:00
bots: generate code for TypeScript types module from Haskell tests (#6220)
* bots: generate code for TypeScript types module from Haskell tests * types for API events and command responses * code for chat command types * license, readme * fix array types * fix more types * add response type * add Connect command to docs/ts * update typescript client package to use auto-generated types
This commit is contained in:
@@ -26,6 +26,18 @@ isConst = \case
|
||||
Const _ -> True
|
||||
_ -> False
|
||||
|
||||
hasParams :: Expr -> Bool
|
||||
hasParams = \case
|
||||
Concat es -> any (hasParams) es
|
||||
Const _ -> False
|
||||
Param _ -> True
|
||||
Optional {} -> True
|
||||
Choice {} -> True
|
||||
Join {} -> True
|
||||
Json _ -> True
|
||||
OnOff _ -> True
|
||||
OnOffParam {} -> True
|
||||
|
||||
instance IsString Expr where fromString = Const
|
||||
|
||||
instance Semigroup Expr where
|
||||
|
||||
Reference in New Issue
Block a user