Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/evt/lib/types/index.ts>dom.CloseEvent

💧EventEmitter's typesafe replacement
Go to Latest
interface dom.CloseEvent
implements Event
import { type dom } from "https://deno.land/x/evt@v2.4.19/lib/types/index.ts";
const { CloseEvent } = dom;

A CloseEvent is sent to clients using WebSockets when the connection is closed. This is delivered to the listener indicated by the WebSocket object's onclose attribute.

Properties

readonly
code: number

Returns the WebSocket connection close code provided by the server.

readonly
reason: string

Returns the WebSocket connection close reason provided by the server.

readonly
wasClean: boolean

Returns true if the connection closed cleanly; false otherwise.