CloseEventInit
interface
interface CloseEventInit extends EventInitConfiguration options for a WebSocket "close" event.
Example
// Creating a custom close event with specific parameters
const closeEventInit: CloseEventInit = {
code: 1000,
reason: "Normal closure",
wasClean: true,
};
const event = new CloseEvent("close", closeEventInit);
See also
Properties
code
code?: numberreason
reason?: stringwasClean
wasClean?: boolean