Skip to main content
Module

x/cav/socket.ts>socket

A server framework for Deno
Go to Latest
function socket
import { socket } from "https://deno.land/x/cav@0.2.3/socket.ts";

Constructs a new Socket request handler using the provided schema and setup function. The schema properties will be assigned to the returned socket endpoint function, with the setup argument available as the "setup" property.

Type Parameters

Schema extends SocketSchema | null
optional
Param extends ParamRecord = ParamRecord
optional
Ctx extends SocketSchema["ctx"] = null
optional
Query extends QueryRecord = QueryRecord
optional
Recv = unknown
optional
Send = unknown

Parameters

optional
schema: SocketSchema & Schema & { param?: Parser<Param> | null; ctx?: Ctx; query?: Parser<Query> | null; recv?: Parser<Recv> | null; send?: Send; } | null
optional
setup: (((x: SetupArg<Param, Ctx, Query, Recv, Send>) => Promise<void> | void) | null)