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

@chijs/client

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chijs/client - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

11

lib/index.d.ts
import { ManagerOptions, Socket, SocketOptions } from 'socket.io-client';
import { RpcHub, IClientRpcFns, IServerClientRpcFns } from '@chijs/core';
export declare class ChiClient<M = IClientRpcFns> extends RpcHub<IServerClientRpcFns, M> {
private _socket;
import { RpcHub, IClientRpcFns, IServerClientRpcFns, RpcWrapped } from '@chijs/core';
export declare class ChiClient {
socket: Socket;
hub: RpcHub<IServerClientRpcFns, IClientRpcFns>;
service: RpcWrapped<IServerClientRpcFns, 'app:service:'>;
plugin: RpcWrapped<IServerClientRpcFns, 'app:plugin:'>;
misc: RpcWrapped<IServerClientRpcFns, 'app:misc:'>;
constructor(uri: string | Partial<ManagerOptions & SocketOptions>, opts?: Partial<ManagerOptions & SocketOptions>);
get socket(): Socket<import("@socket.io/component-emitter").DefaultEventsMap, import("@socket.io/component-emitter").DefaultEventsMap>;
}
import { io } from 'socket.io-client';
import { RpcHub } from '@chijs/core';
export class ChiClient extends RpcHub {
_socket;
import { RpcHub, createRpcWrapper } from '@chijs/core';
export class ChiClient {
socket;
hub;
service;
plugin;
misc;
constructor(uri, opts) {
const socket = io(uri, opts);
super((msg) => void socket.emit('rpc', msg));
socket.on('rpc', (msg) => this.handle(msg));
this._socket = socket;
this.socket = io(uri, opts);
this.hub = new RpcHub((msg) => void this.socket.emit('rpc', msg));
this.socket.on('rpc', (msg) => this.hub.handle(msg));
this.service = createRpcWrapper(this.hub, 'app:service:');
this.plugin = createRpcWrapper(this.hub, 'app:plugin:');
this.misc = createRpcWrapper(this.hub, 'app:misc:');
}
get socket() {
return this._socket;
}
}
//# sourceMappingURL=index.js.map
{
"name": "@chijs/client",
"version": "0.0.3",
"version": "0.0.4",
"main": "lib/index.js",

@@ -19,3 +19,3 @@ "license": "AGPL-3.0",

"dependencies": {
"@chijs/core": "^0.0.3",
"@chijs/core": "^0.0.4",
"socket.io-client": "^4.5.1"

@@ -26,3 +26,4 @@ },

"build": "node ../../scripts/build.mjs --package client",
"prepare": "node ../../scripts/build.mjs --package client --rebuild"
"prepare": "node ../../scripts/build.mjs --package client --rebuild",
"test": "mocha"
},

@@ -29,0 +30,0 @@ "files": [

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