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

@command-socket/browser-client

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@command-socket/browser-client - npm Package Compare versions

Comparing version 0.4.0 to 0.4.2

10

.d.ts/command-socket-browser-client.d.ts
import { CommandSocket, CommandSetStructure, CommandRegistry } from "@command-socket/core";
export declare class CommandSocketBrowserClient<LCS extends CommandSetStructure = any, RCS extends CommandSetStructure = any> extends CommandSocket<LCS, RCS> {
protected constructor(url: string, commandRegistry?: CommandRegistry<LCS>);
protected constructor(websocket: WebSocket, commandRegistry?: CommandRegistry<LCS>);
static create<LCS extends CommandSetStructure, RCS extends CommandSetStructure>(url: string, commandRegistry?: CommandRegistry<LCS>): Promise<CommandSocket<LCS, RCS>>;
static create<LCS extends CommandSetStructure, RCS extends CommandSetStructure>(websocket: WebSocket, commandRegistry?: CommandRegistry<LCS>): Promise<CommandSocket<LCS, RCS>>;
export declare class CommandSocketBrowserClient<LCS extends CommandSetStructure = any, RCS extends CommandSetStructure = any, M extends {} = {}> extends CommandSocket<LCS, RCS, M> {
protected constructor(url: string, commandRegistry?: CommandRegistry<LCS>, metadata?: Partial<M>);
protected constructor(websocket: WebSocket, commandRegistry?: CommandRegistry<LCS>, metadata?: Partial<M>);
static create<LCS extends CommandSetStructure, RCS extends CommandSetStructure, M extends {} = {}>(url: string, commandRegistry?: CommandRegistry<LCS>, metadata?: Partial<M>): Promise<CommandSocket<LCS, RCS, M>>;
static create<LCS extends CommandSetStructure, RCS extends CommandSetStructure, M extends {} = {}>(websocket: WebSocket, commandRegistry?: CommandRegistry<LCS>, metadata?: Partial<M>): Promise<CommandSocket<LCS, RCS, M>>;
}

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const core_1=require("@command-socket/core"),browser_websocket_1=require("./browser-websocket");class CommandSocketBrowserClient extends core_1.CommandSocket{constructor(e,r=new core_1.CommandRegistry){super(new browser_websocket_1.BrowserWebSocket(e),r)}static create(e,r=new core_1.CommandRegistry){return new Promise(o=>{let t=new CommandSocketBrowserClient(e,r);t.getEvents().OPEN.subscribe(()=>o(t))})}}exports.CommandSocketBrowserClient=CommandSocketBrowserClient;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const core_1=require("@command-socket/core"),browser_websocket_1=require("./browser-websocket");class CommandSocketBrowserClient extends core_1.CommandSocket{constructor(e,r=new core_1.CommandRegistry,o={}){super(new browser_websocket_1.BrowserWebSocket(e),r,o)}static create(e,r=new core_1.CommandRegistry,o={}){return new Promise(o=>{let t=new CommandSocketBrowserClient(e,r);t.getEvents().OPEN.subscribe(()=>o(t))})}}exports.CommandSocketBrowserClient=CommandSocketBrowserClient;
//# sourceMappingURL=command-socket-browser-client.js.map
{
"name": "@command-socket/browser-client",
"version": "0.4.0",
"version": "0.4.2",
"description": "An implementation of a CommandSocket client written for the browser.",

@@ -43,5 +43,5 @@ "publishConfig": {

"dependencies": {
"@command-socket/core": "^0.4.0",
"@command-socket/core": "0.4.1",
"promise-any-polyfill": "^0.1.2"
}
}

@@ -23,25 +23,30 @@ /*

LCS extends CommandSetStructure = any,
RCS extends CommandSetStructure = any> extends CommandSocket<LCS, RCS> {
RCS extends CommandSetStructure = any,
M extends {} = {}> extends CommandSocket<LCS, RCS, M> {
protected constructor(url: string, commandRegistry?: CommandRegistry<LCS>);
protected constructor(websocket: WebSocket, commandRegistry?: CommandRegistry<LCS>);
protected constructor(urlOrWebSocket: string | WebSocket,
commandRegistry: CommandRegistry<LCS> = new CommandRegistry<LCS>()) {
protected constructor(url: string, commandRegistry?: CommandRegistry<LCS>, metadata?: Partial<M>);
protected constructor(websocket: WebSocket, commandRegistry?: CommandRegistry<LCS>, metadata?: Partial<M>);
protected constructor(
urlOrWebSocket: string | WebSocket,
commandRegistry: CommandRegistry<LCS> = new CommandRegistry<LCS>(),
metadata: Partial<M> = {}) {
super(new BrowserWebSocket(urlOrWebSocket as any), commandRegistry);
super(new BrowserWebSocket(urlOrWebSocket as any), commandRegistry, metadata);
}
public static create<LCS extends CommandSetStructure, RCS extends CommandSetStructure>(
url: string, commandRegistry?: CommandRegistry<LCS>): Promise<CommandSocket<LCS, RCS>>;
public static create<LCS extends CommandSetStructure, RCS extends CommandSetStructure, M extends {} = {}>(
url: string, commandRegistry?: CommandRegistry<LCS>, metadata?: Partial<M>): Promise<CommandSocket<LCS, RCS, M>>;
public static create<LCS extends CommandSetStructure, RCS extends CommandSetStructure>(
websocket: WebSocket, commandRegistry?: CommandRegistry<LCS>): Promise<CommandSocket<LCS, RCS>>;
public static create<LCS extends CommandSetStructure, RCS extends CommandSetStructure, M extends {} = {}>(
websocket: WebSocket, commandRegistry?: CommandRegistry<LCS>, metadata?: Partial<M>): Promise<CommandSocket<LCS, RCS, M>>;
public static create<LCS extends CommandSetStructure, RCS extends CommandSetStructure>(urlOrWebSocket: string | WebSocket,
commandRegistry: CommandRegistry<LCS> = new CommandRegistry<LCS>()): Promise<CommandSocket<LCS, RCS>> {
public static create<LCS extends CommandSetStructure, RCS extends CommandSetStructure, M extends {} = {}>(
urlOrWebSocket: string | WebSocket,
commandRegistry: CommandRegistry<LCS> = new CommandRegistry<LCS>(),
metadata: Partial<M> = {}): Promise<CommandSocket<LCS, RCS, M>> {
return new Promise<CommandSocket<LCS, RCS>>((resolve: (value?: (PromiseLike<CommandSocket<LCS, RCS>> | CommandSocket<LCS, RCS>)) => void): void => {
return new Promise<CommandSocket<LCS, RCS, M>>((resolve: (value?: (PromiseLike<CommandSocket<LCS, RCS, M>> | CommandSocket<LCS, RCS, M>)) => void): void => {
let commandsocket: CommandSocket<LCS, RCS> = new CommandSocketBrowserClient(urlOrWebSocket as any, commandRegistry);
let commandsocket: CommandSocket<LCS, RCS, M> = new CommandSocketBrowserClient(urlOrWebSocket as any, commandRegistry);

@@ -48,0 +53,0 @@ commandsocket.getEvents().OPEN.subscribe((): void => resolve(commandsocket));

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