@command-socket/browser-client
Advanced tools
Comparing version 0.4.0 to 0.4.2
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
56043
181
+ Added@command-socket/core@0.4.1(transitive)
- Removed@command-socket/core@0.4.3(transitive)
Updated@command-socket/core@0.4.1