Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data SomeCommand where
- SomeCommand :: Command cmd => cmd -> SomeCommand
- data CommandObj a = CommandObj {}
- data Promise a where
- data Subscription = Subscription {}
- data IncomingMessage = IncomingMessage {}
- type ClientApp b = Handle -> IO b
- runClient :: forall b. Config -> ClientApp b -> IO b
- dispatchCommandResponse :: Handle -> CommandId -> Maybe ProtocolError -> Maybe Value -> IO ()
- dispatchEvent :: Handle -> Maybe SessionId -> String -> Maybe Value -> IO ()
- subscribe :: forall a. Event a => Handle -> (a -> IO ()) -> IO Subscription
- subscribeForSession :: forall a. Event a => Handle -> SessionId -> (a -> IO ()) -> IO Subscription
- subscribe_ :: forall a. Event a => Handle -> Maybe SessionId -> (a -> IO ()) -> IO Subscription
- unsubscribe :: Handle -> Subscription -> IO ()
- readPromise :: Promise a -> IO a
- nextCommandId :: Handle -> IO CommandId
- sendCommandWait :: Command cmd => Handle -> cmd -> IO (CommandResponse cmd)
- sendCommandForSessionWait :: Command cmd => Handle -> SessionId -> cmd -> IO (CommandResponse cmd)
- sendCommandWait_ :: Command cmd => Handle -> Maybe SessionId -> cmd -> IO (CommandResponse cmd)
- sendCommand :: forall cmd. Command cmd => Handle -> cmd -> IO (Promise (CommandResponse cmd))
- sendCommandForSession :: forall cmd. Command cmd => Handle -> SessionId -> cmd -> IO (Promise (CommandResponse cmd))
- sendCommand_ :: forall cmd. Command cmd => Handle -> Maybe SessionId -> cmd -> IO (Promise (CommandResponse cmd))
- fromSomeCommand :: (forall cmd. Command cmd => cmd -> r) -> SomeCommand -> r
- module CDP.Endpoints
- module CDP.Internal.Utils
Documentation
data SomeCommand where Source #
SomeCommand :: Command cmd => cmd -> SomeCommand |
data CommandObj a Source #
Instances
Show a => Show (CommandObj a) Source # | |
Defined in CDP.Runtime showsPrec :: Int -> CommandObj a -> ShowS # show :: CommandObj a -> String # showList :: [CommandObj a] -> ShowS # | |
ToJSON a => ToJSON (CommandObj a) Source # | |
Defined in CDP.Runtime toJSON :: CommandObj a -> Value # toEncoding :: CommandObj a -> Encoding # toJSONList :: [CommandObj a] -> Value # toEncodingList :: [CommandObj a] -> Encoding # |
data Subscription Source #
data IncomingMessage Source #
A message from the browser. We don't know yet if this is a command response or an event
Instances
FromJSON IncomingMessage Source # | |
Defined in CDP.Runtime parseJSON :: Value -> Parser IncomingMessage # parseJSONList :: Value -> Parser [IncomingMessage] # |
runClient :: forall b. Config -> ClientApp b -> IO b Source #
Runs a client application.
By default, the connection is made to the browser. See the path
field in Config
.
The connection is closed once the IO action completes
dispatchCommandResponse :: Handle -> CommandId -> Maybe ProtocolError -> Maybe Value -> IO () Source #
subscribe :: forall a. Event a => Handle -> (a -> IO ()) -> IO Subscription Source #
Subscribes to an event
subscribeForSession :: forall a. Event a => Handle -> SessionId -> (a -> IO ()) -> IO Subscription Source #
Subscribes to an event for a given session
subscribe_ :: forall a. Event a => Handle -> Maybe SessionId -> (a -> IO ()) -> IO Subscription Source #
unsubscribe :: Handle -> Subscription -> IO () Source #
Unsubscribes to an event
readPromise :: Promise a -> IO a Source #
Resolves a promise to its value
sendCommandWait :: Command cmd => Handle -> cmd -> IO (CommandResponse cmd) Source #
Sends a command to the browser and waits until a response is received, for the timeout duration configured
sendCommandForSessionWait :: Command cmd => Handle -> SessionId -> cmd -> IO (CommandResponse cmd) Source #
Sends a command to the browser for a given session and waits until a response is received, for the timeout duration configured
sendCommandWait_ :: Command cmd => Handle -> Maybe SessionId -> cmd -> IO (CommandResponse cmd) Source #
sendCommand :: forall cmd. Command cmd => Handle -> cmd -> IO (Promise (CommandResponse cmd)) Source #
Sends a command to the browser
sendCommandForSession :: forall cmd. Command cmd => Handle -> SessionId -> cmd -> IO (Promise (CommandResponse cmd)) Source #
Sends a command to the browser for a given session
sendCommand_ :: forall cmd. Command cmd => Handle -> Maybe SessionId -> cmd -> IO (Promise (CommandResponse cmd)) Source #
fromSomeCommand :: (forall cmd. Command cmd => cmd -> r) -> SomeCommand -> r Source #
module CDP.Endpoints
module CDP.Internal.Utils