Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@satorijs/protocol

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@satorijs/protocol - npm Package Compare versions

Comparing version 1.3.0-alpha.0 to 1.3.0

44

lib/index.d.ts

@@ -224,1 +224,45 @@ import Element from '@satorijs/element';

}
export namespace WebSocket {
/** The connection is not yet open. */
const CONNECTING = 0;
/** The connection is open and ready to communicate. */
const OPEN = 1;
/** The connection is in the process of closing. */
const CLOSING = 2;
/** The connection is closed. */
const CLOSED = 3;
type ReadyState = typeof CONNECTING | typeof OPEN | typeof CLOSING | typeof CLOSED;
interface EventMap {
open: Event;
error: ErrorEvent;
message: MessageEvent;
close: CloseEvent;
}
interface EventListener {
(event: Event): void;
}
interface Event {
type: string;
target: WebSocket;
}
interface CloseEvent extends Event {
code: number;
reason: string;
}
interface MessageEvent extends Event {
data: string;
}
interface ErrorEvent extends Event {
message?: string;
}
}
export interface WebSocket {
readonly url?: string;
readonly protocol?: string;
readonly readyState?: number;
close(code?: number, reason?: string): void;
send(data: string): void;
dispatchEvent?(event: any): boolean;
addEventListener<K extends keyof WebSocket.EventMap>(type: K, listener: (event: WebSocket.EventMap[K]) => void): void;
removeEventListener<K extends keyof WebSocket.EventMap>(type: K, listener: (event: WebSocket.EventMap[K]) => void): void;
}

5

package.json
{
"name": "@satorijs/protocol",
"description": "Protocol types for Satori protocol",
"version": "1.3.0-alpha.0",
"version": "1.3.0",
"type": "module",

@@ -15,2 +15,3 @@ "main": "lib/index.cjs",

},
"./src/*": "./src/*",
"./package.json": "./package.json"

@@ -41,5 +42,5 @@ },

"dependencies": {
"@satorijs/element": "^3.1.4",
"@satorijs/element": "^3.1.6",
"cosmokit": "^1.5.2"
}
}

@@ -336,1 +336,58 @@ import Element from '@satorijs/element'

}
export namespace WebSocket {
/** The connection is not yet open. */
export const CONNECTING = 0
/** The connection is open and ready to communicate. */
export const OPEN = 1
/** The connection is in the process of closing. */
export const CLOSING = 2
/** The connection is closed. */
export const CLOSED = 3
export type ReadyState =
| typeof CONNECTING
| typeof OPEN
| typeof CLOSING
| typeof CLOSED
export interface EventMap {
open: Event
error: ErrorEvent
message: MessageEvent
close: CloseEvent
}
export interface EventListener {
(event: Event): void
}
export interface Event {
type: string
target: WebSocket
}
export interface CloseEvent extends Event {
code: number
reason: string
}
export interface MessageEvent extends Event {
data: string
}
export interface ErrorEvent extends Event {
message?: string
}
}
export interface WebSocket {
readonly url?: string
readonly protocol?: string
readonly readyState?: number
close(code?: number, reason?: string): void
send(data: string): void
dispatchEvent?(event: any): boolean
addEventListener<K extends keyof WebSocket.EventMap>(type: K, listener: (event: WebSocket.EventMap[K]) => void): void
removeEventListener<K extends keyof WebSocket.EventMap>(type: K, listener: (event: WebSocket.EventMap[K]) => void): void
}
lib/index.cjs

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc