Skip to main content
Module

x/cav/client.ts

A server framework for Deno
Go to Latest
import * as cav from "https://deno.land/x/cav@0.0.8/client.ts";

Classes

An error class for describing exceptions during HTTP processing.

Functions

Constructs a new Client tied to a given base URL. The provided set of packers will be used everywhere that data is packed/unpacked when using this client, including web sockets.

Wraps a regular WebSocket with packing functionality and type support.

Interfaces

Client type representing an Rpc endpoint. Uses the Rpc type definition to determine what the expected arguments and response types are.

Initializer arguments for constructing HttpErrors.

Cav's WebSocket wrapper interface.

Arguments provided to a SocketHandler. There are four event types: "open", "close", "message", "error". Which properties are available depends on the event type.

Initializer options to use when upgrading a request into a web socket using the upgradeWebSocket function.

Type Aliases

A Proxied function that wraps fetch() with a tailored process for making requests to a Cav server. Each property access on the function itself returns a new Client that extends the URL of the original Client. The periods represent path dividers and the accessed properties are path segments, like this: client("http://localhost/base").nested["pa.th"]() will result in a request to "http://localhost/base/nested/pa.th".

Uses the RpcInit type imported from the server to determine what shape the arguments should be in when making requests to a given Rpc.

Handler type for the various socket event listeners on the SocketInit.